From 669ba26a266c4e935a546587d92362fa7ca93814 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 25 Nov 2022 13:00:42 +0100 Subject: [PATCH 001/156] Allow the use of Foreach_enabled_attributes internal functor starting from a given dimension. --- .../Combinatorial_map/internal/Combinatorial_map_utility.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h index 542b5ab176a..340b0551c98 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h @@ -609,13 +609,13 @@ namespace CGAL struct Attribute_const_range { typedef CGAL::Void type; }; - // To iterate onto each enabled attributes - template + // To iterate onto each enabled attributes, starting from n-attributes (0 by default) + template struct Foreach_enabled_attributes { template static void run(Ts& ... t) - { Foreach_static_restricted::run(t...); } + { Foreach_static_restricted::run(t...); } }; // To iterate onto each enabled attributes, except j-attributes template From 45ee81d52266a3fd7a34c484456672ba75c81977 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 25 Nov 2022 13:01:43 +0100 Subject: [PATCH 002/156] add insert_cell_1_between_two_cells_2 method in genericmap concept --- .../Combinatorial_map/Concepts/GenericMap.h | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h index 8c1c3916212..31bcaf161d6 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h @@ -876,6 +876,7 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa \sa `insert_cell_0_in_cell_2` \sa `insert_cell_1_in_cell_2` +\sa `insert_cell_1_between_two_cells_2` \sa `insert_dangling_cell_1_in_cell_2` \sa `insert_cell_2_in_cell_3` \sa `remove_cell` @@ -896,6 +897,7 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa \sa `insert_cell_0_in_cell_2` \sa `insert_cell_1_in_cell_2` +\sa `insert_cell_1_between_two_cells_2` \sa `insert_dangling_cell_1_in_cell_2` \sa `insert_cell_2_in_cell_3` \sa `remove_cell` @@ -917,12 +919,40 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa \sa `is_insertable_cell_1_in_cell_2` \sa `insert_cell_0_in_cell_1` \sa `insert_cell_0_in_cell_2` +\sa `insert_cell_1_between_two_cells_2` \sa `insert_dangling_cell_1_in_cell_2` \sa `insert_cell_2_in_cell_3` \sa `remove_cell` */ Dart_descriptor insert_cell_1_in_cell_2(Dart_descriptor d1, Dart_descriptor d2); +/*! +Inserts a 1-cell between the 2-cell containing `d1` and the one containing `d2`. Returns `previous(d1)`, a descriptor on one dart belonging to the new 1-cell. +\pre `is_insertable_cell_1_between_two_cells_2(d1,d2)`. + +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, call \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink(a,a') is called for all enabled i-attributes, for i>=2, with a the original 2-attribute associated with `d` and a' the new 2-attribute created during the operation. If set, the dynamic onmerge function of i-attributes is also called on a and a'. + +\cgalAdvancedBegin +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. +\cgalAdvancedEnd + +\sa `is_insertable_cell_1_between_two_cells_2` +\sa `insert_cell_0_in_cell_1` +\sa `insert_cell_0_in_cell_2` +\sa `insert_cell_1_in_cell_2` +\sa `insert_dangling_cell_1_in_cell_2` +\sa `insert_cell_2_in_cell_3` +\sa `remove_cell` +*/ +Dart_descriptor insert_cell_1_between_two_cells_2(Dart_descriptor d1, Dart_descriptor d2); + +/*! Call `insert_cell_1_in_cell_2` if `is_insertable_cell_1_in_cell_2(d1, d2)`, otherwise call `insert_cell_1_between_two_cells_2`. +\sa `insert_cell_1_in_cell_2` +\sa `insert_cell_1_between_two_cells_2` +\sa `is_insertable_cell_1_in_cell_2` +*/ +Dart_descriptor insert_cell_1(Dart_descriptor d1, Dart_descriptor d2); + /*! Inserts a 2-cell along the path of 1-cells containing darts given by the range `[afirst,alast)`. Returns `opposite<2>(*afirst)`, a descriptor on one dart belonging to the new 2-cell. \pre `is_insertable_cell_2_in_cell_3(afirst,alast)`. @@ -939,6 +969,7 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa \sa `insert_cell_0_in_cell_1` \sa `insert_cell_0_in_cell_2` \sa `insert_cell_1_in_cell_2` +\sa `insert_cell_1_between_two_cells_2` \sa `insert_dangling_cell_1_in_cell_2` \sa `remove_cell` */ @@ -958,6 +989,7 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa \sa `insert_cell_0_in_cell_1` \sa `insert_cell_0_in_cell_2` \sa `insert_cell_1_in_cell_2` +\sa `insert_cell_1_between_two_cells_2` \sa `insert_cell_2_in_cell_3` \sa `remove_cell` @@ -976,6 +1008,17 @@ This is possible if `d1`\f$ \neq \f$ `d2` and `d1` can be reached from `d2` by u */ bool is_insertable_cell_1_in_cell_2(Dart_const_descriptor d1, Dart_const_descriptor d2); +/*! +Returns true iff it is possible to insert a 1-cell in the generic map between `d1` and `d2`. + +This is possible if `d1`\f$ \neq \f$ `d2` and `d1` can not be reached from `d2` by using some `previous` and `next` calls. +\pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 2, `d1`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink, and `d2`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink. + +\sa `insert_cell_1_between_two_cells_2` + +*/ +bool is_insertable_cell_1_between_two_cells_2(Dart_const_descriptor d1, Dart_const_descriptor d2); + /*! Returns true iff it is possible to insert a 2-cell in the generic map along the path of darts given by the range `[afirst,alast)`. The 2-cell can be inserted iff the ordered list of darts form a closed path of edges inside a same volume. \pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 3. @@ -1016,6 +1059,7 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa \sa `insert_cell_0_in_cell_1` \sa `insert_cell_0_in_cell_2` \sa `insert_cell_1_in_cell_2` +\sa `insert_cell_1_between_two_cells_2` \sa `insert_dangling_cell_1_in_cell_2` \sa `insert_cell_2_in_cell_3` */ From 01c05d8f1b2f1c772e5b62881239e31c05485813 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 25 Nov 2022 13:02:32 +0100 Subject: [PATCH 003/156] Add index method in cc with index, taking an index as parameter. --- Combinatorial_map/include/CGAL/Compact_container_with_index.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Combinatorial_map/include/CGAL/Compact_container_with_index.h b/Combinatorial_map/include/CGAL/Compact_container_with_index.h index 37d555793b6..c3ddb24005b 100644 --- a/Combinatorial_map/include/CGAL/Compact_container_with_index.h +++ b/Combinatorial_map/include/CGAL/Compact_container_with_index.h @@ -738,6 +738,9 @@ public: size_type index(const_iterator cit) const { return static_cast(cit); } + size_type index(Index idx) const + { return static_cast(idx); } + // Returns whether the iterator "cit" is in the range [begin(), end()]. // This function is mostly useful for purposes of efficient debugging at // higher levels. From bb263e009e859b9f6d2f11d24483dbef9bf17021 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 25 Nov 2022 13:06:50 +0100 Subject: [PATCH 004/156] add insert_cell_1_between_two_cells_2 method in CMap and GMap --- .../include/CGAL/Combinatorial_map.h | 90 +++++++++- .../include/CGAL/Generalized_map.h | 169 +++++++++++++----- 2 files changed, 205 insertions(+), 54 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index fa13fbe6d6c..f16a3779cd9 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -1639,11 +1639,14 @@ namespace CGAL { CGAL_static_assertion(i<=dimension); CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "set_attribute but i-attributes are disabled"); - for ( typename Dart_of_cell_range::iterator it(*this, dh); - it.cont(); ++it) + + for (typename Dart_of_cell_range::iterator it(*this, dh); it.cont(); ++it) { this->template set_dart_attribute(it, ah); } + if(ah!=null_descriptor) + // To ensure that the dart of this attribute is dh + { this->template set_dart_of_attribute(ah, dh); } } /// @return a Attributes_range (range through all the @@ -4410,7 +4413,8 @@ namespace CGAL { bool is_insertable_cell_1_in_cell_2(Dart_const_descriptor adart1, Dart_const_descriptor adart2) const { - if ( adart1==adart2 ) return false; + if (adart1==adart2 || adart1==null_descriptor) return false; + if (adart2==null_descriptor) return true; for ( CMap_dart_const_iterator_of_orbit it(*this,adart1); it.cont(); ++it ) { @@ -4427,15 +4431,81 @@ namespace CGAL { * same vertex than adart1. */ Dart_descriptor insert_cell_1_in_cell_2(Dart_descriptor adart1, - Dart_descriptor adart2, - bool update_attributes=true) + Dart_descriptor adart2, + bool update_attributes=true) { + CGAL_assertion(is_insertable_cell_1_in_cell_2(adart1, adart2)); if ( adart2==null_descriptor ) return insert_dangling_cell_1_in_cell_2(adart1, null_descriptor, update_attributes); + return generic_insert_cell_1(adart1, adart2, false, update_attributes); + } - CGAL_assertion(is_insertable_cell_1_in_cell_2(adart1, adart2)); + /** Test if an edge can be inserted between two different 2-cells + * between two given darts. + * @param adart1 a first dart. + * @param adart2 a second dart. + * @return true iff an edge can be inserted between adart1 and adart2. + */ + bool is_insertable_cell_1_between_two_cells_2(Dart_const_descriptor adart1, + Dart_const_descriptor adart2) const + { + if (adart1==adart2 || adart1==null_descriptor || adart2==null_descriptor) + { return false; } + for ( CMap_dart_const_iterator_of_orbit it(*this,adart1); + it.cont(); ++it ) + { + if ( it==adart2 ) return false; + } + return true; + } + /** Insert an edge between two different 2-cells, between two given darts. + * @param adart1 a first dart of the first facet (!=null_descriptor && !=null_dart_descriptor). + * @param adart2 a second dart of the second facet (!=null_descriptor && !=null_dart_descriptor). + * @param update_attributes a boolean to update the enabled attributes + * @return a dart of the new edge, and not incident to the + * same vertex than adart1. + */ + Dart_descriptor insert_cell_1_between_two_cells_2(Dart_descriptor adart1, + Dart_descriptor adart2, + bool update_attributes=true) + { + CGAL_assertion(is_insertable_cell_1_between_two_cells_2(adart1, adart2)); + return generic_insert_cell_1(adart1, adart2, true, update_attributes); + } + + /** Insert an edge between two given darts. If the two darts belong to the same facet, call + * insert_cell_1_in_cell_2, otherwise call insert_cell_1_between_two_cells_2. + * @param adart1 a first dart (!=null_descriptor && !=null_dart_descriptor). + * @param adart2 a second dart. + * @param update_attributes a boolean to update the enabled attributes + * @return a dart of the new edge, and not incident to the + * same vertex than adart1. + */ + Dart_descriptor insert_cell_1(Dart_descriptor adart1, + Dart_descriptor adart2, + bool update_attributes=true) + { + if(is_insertable_cell_1_in_cell_2(adart1, adart2)) + { return insert_cell_1_in_cell_2(adart1, adart2, update_attributes); } + return insert_cell_1_between_two_cells_2(adart1, adart2, update_attributes); + } + + /** Generic method to insert a 1-cell, either in a 2-cell (cf. insert_cell_1_in_cell_2) + * or between two different 2-cells (cf. insert_cell_1_between_two_cells_2). + * Indeed the code is the same, except for the group/degroup attribute. + * merge is true if adart1 and adart2 belongs to two different facets; in this case + * the two facets should be merged (they are now linked by the new edge); + * merge is false it adart1 and adart2 belongs to the same facet; in this case + * the facet is split in two. + * Internal method not supposed to be called by users. + */ + Dart_descriptor generic_insert_cell_1(Dart_descriptor adart1, + Dart_descriptor adart2, + bool merge, + bool update_attributes) + { size_type m1=get_new_mark(); CMap_dart_iterator_basic_of_involution it1(*this, adart1, m1); @@ -4509,7 +4579,13 @@ namespace CGAL { if (are_attributes_automatically_managed() && update_attributes) { - internal::Degroup_attribute_functor_run::run(*this, d1, d2); + if(merge) + { // Here we group all enabled attributes starting from 2 to dimension + Helper::template Foreach_enabled_attributes + , 2>::run(*this, adart1, adart2); + } + else // Here we degroup 2-attributes + { internal::Degroup_attribute_functor_run::run(*this, adart1, adart2); } } negate_mark(m1); diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index 6aa6b56045e..273d8b32bf2 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -1464,11 +1464,14 @@ namespace CGAL { CGAL_static_assertion(i<=dimension); CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "set_attribute but i-attributes are disabled"); - for ( typename Dart_of_cell_range::iterator it(*this, dh); - it.cont(); ++it) + for (typename Dart_of_cell_range::iterator it(*this, dh); + it.cont(); ++it) { this->template set_dart_attribute(it, ah); } + if(ah!=null_descriptor) + // To ensure that the dart of this attribute is dh + { this->template set_dart_of_attribute(ah, dh); } } /// @return a Attributes_range (range through all the @@ -3512,7 +3515,9 @@ namespace CGAL { bool is_insertable_cell_1_in_cell_2(Dart_const_descriptor adart1, Dart_const_descriptor adart2) { - if ( adart1==adart2 || adart1==this->template alpha<0>(adart2) ) + if (adart2==null_descriptor) return true; + if (adart1==adart2 || adart1==this->template alpha<0>(adart2) || + adart1==null_descriptor || this->template is_free<1>(adart2)) return false; for ( CGAL::GMap_dart_const_iterator_of_orbit it(*this,adart1); it.cont(); ++it ) @@ -3525,29 +3530,104 @@ namespace CGAL { /** Insert an edge in a 2-cell between two given darts. * @param adart1 a first dart of the facet (!=null_descriptor && !=null_dart_descriptor). * @param adart2 a second dart of the facet. If null_descriptor insert a dangling edge. + * @param update_attributes a boolean to update the enabled attributes * @return a dart of the new edge, and not incident to the * same vertex than adart1. */ Dart_descriptor insert_cell_1_in_cell_2(Dart_descriptor adart1, - Dart_descriptor adart2, - bool update_attributes=true, - typename Attribute_descriptor<0>::type - ah=null_descriptor) + Dart_descriptor adart2, + typename Attribute_descriptor<0>:: + type ah=null_descriptor, + bool update_attributes=true) { - if ( adart2!=null_descriptor) - { - CGAL_assertion(is_insertable_cell_1_in_cell_2(adart1, adart2)); - } + CGAL_assertion(is_insertable_cell_1_in_cell_2(adart1, adart2)); + return generic_insert_cell_1(adart1, adart2, false, update_attributes, ah); + } + /** Test if an edge can be inserted between two different 2-cells + * between two given darts. + * @param adart1 a first dart. + * @param adart2 a second dart. + * @return true iff an edge can be inserted between adart1 and adart2. + */ + bool is_insertable_cell_1_between_two_cells_2(Dart_const_descriptor adart1, + Dart_const_descriptor adart2) const + { + if (adart1==adart2 || adart1==null_descriptor || adart2==null_descriptor) + { return false; } + for ( CGAL::GMap_dart_const_iterator_of_orbit it(*this,adart1); + it.cont(); ++it ) + { + if ( it==adart2 ) return false; + } + for(unsigned int d=3; d<=dimension; ++d) + { if(is_free(adart1, d)!=is_free(adart2, d)) { return false; }} + + return true; + } + + /** Insert an edge between two different 2-cells, between two given darts. + * @param adart1 a first dart of the first facet (!=null_descriptor && !=null_dart_descriptor). + * @param adart2 a second dart of the second facet (!=null_descriptor && !=null_dart_descriptor). + * @param update_attributes a boolean to update the enabled attributes + * @return a dart of the new edge, and not incident to the + * same vertex than adart1. + */ + Dart_descriptor insert_cell_1_between_two_cells_2(Dart_descriptor adart1, + Dart_descriptor adart2, + bool update_attributes=true) + { + CGAL_assertion(is_insertable_cell_1_between_two_cells_2(adart1, adart2)); + return generic_insert_cell_1(adart1, adart2, true, update_attributes); + } + + /** Insert an edge between two given darts. If the two darts belong to the same facet, call + * insert_cell_1_in_cell_2, otherwise call insert_cell_1_between_two_cells_2. + * @param adart1 a first dart (!=null_descriptor && !=null_dart_descriptor). + * @param adart2 a second dart. + * @param update_attributes a boolean to update the enabled attributes + * @return a dart of the new edge, and not incident to the + * same vertex than adart1. + */ + Dart_descriptor insert_cell_1(Dart_descriptor adart1, + Dart_descriptor adart2, + bool update_attributes=true, + typename Attribute_descriptor<0>::type + ah=null_descriptor) + { + CGAL_assertion(adart1!=null_descriptor); + if(is_insertable_cell_1_in_cell_2(adart1, adart2)) + { return insert_cell_1_in_cell_2(adart1, adart2, update_attributes, ah); } + return insert_cell_1_between_two_cells_2(adart1, adart2, update_attributes); + } + + /** Generic method to insert a 1-cell, either in a 2-cell (cf. insert_cell_1_in_cell_2) + * or between two different 2-cells (cf. insert_cell_1_between_two_cells_2). + * Indeed the code is the same, except for the group/degroup attribute. + * merge is true if adart1 and adart2 belongs to two different facets; in this case + * the two facets should be merged (they are now linked by the new edge); + * merge is false it adart1 and adart2 belongs to the same facet; in this case + * the facet is split in two. + * Internal method not supposed to be called by users. + */ + Dart_descriptor generic_insert_cell_1(Dart_descriptor adart1, + Dart_descriptor adart2, + bool merge, + bool update_attributes=true, + typename Attribute_descriptor<0>::type + ah=null_descriptor) + { /* CGAL::GMap_dart_iterator_basic_of_involution will contain all * alpha_i except alpha_0, alpha_1 and alpha_2, i.e. this is * */ + Dart_descriptor dart2_a1=null_descriptor; + if(adart2!=null_descriptor) { dart2_a1=alpha<1>(adart2); } + size_type m1=get_new_mark(); CGAL::GMap_dart_iterator_basic_of_involution it1(*this, adart1, m1); - size_type m2=get_new_mark(); - CGAL::GMap_dart_iterator_basic_of_involution it2(*this, adart2, m2); + CGAL::GMap_dart_iterator_basic_of_involution it2(*this, dart2_a1, m2); Dart_descriptor d1=null_descriptor; Dart_descriptor d2=null_descriptor; @@ -3563,44 +3643,32 @@ namespace CGAL { d2 = create_dart(); mark(it1,treated); - if (!isfree1) - { - d3 = create_dart(); - d4 = create_dart(); - this->template basic_link_alpha<2>(d1, d3); - this->template basic_link_alpha<2>(d2, d4); - } + d3 = create_dart(); + d4 = create_dart(); + this->template basic_link_alpha<2>(d1, d3); + this->template basic_link_alpha<2>(d2, d4); - for ( unsigned int dim=3; dim<=dimension; ++dim) + for (unsigned int dim=3; dim<=dimension; ++dim) { if ( !is_free(it1, dim) && is_marked(alpha(it1, dim), treated) ) { basic_link_alpha(alpha(it1, dim, 1), d1, dim); - basic_link_alpha(alpha(d1, dim, 0), d2, dim); + basic_link_alpha(alpha(it1, dim, 1, 0), d2, dim); - if (!isfree1) - { - basic_link_alpha(alpha(it1, 1, dim, 1), d3, dim); - basic_link_alpha(alpha(d3, dim, 0), d4, dim); - } + basic_link_alpha(alpha(it1, dim, 1, 2), d3, dim); + basic_link_alpha(alpha(it1, dim, 1, 2, 0), d4, dim); } } if (!isfree1) - { - this->template link_alpha<1>(this->template alpha<1>(it1), d3); - if ( adart2!=null_descriptor ) - { - CGAL_assertion (it2.cont()); - this->template link_alpha<1>(this->template alpha<1>(it2), d4); - } - } - + { this->template link_alpha<1>(this->template alpha<1>(it1), d3); } this->template link_alpha<1>(it1, d1); - if ( adart2!=null_descriptor ) + + if (adart2!=null_descriptor) { CGAL_assertion (it2.cont()); + this->template link_alpha<1>(this->template alpha<1>(it2), d4); this->template link_alpha<1>(it2, d2); ++it2; } @@ -3610,25 +3678,31 @@ namespace CGAL { update_attributes && ah!=null_descriptor) { internal::Set_i_attribute_of_dart_functor::run(*this, d2, ah); - if (!isfree1) - { - internal::Set_i_attribute_of_dart_functor::run(*this, d4, ah); - } + internal::Set_i_attribute_of_dart_functor::run(*this, d4, ah); } } // We do the link_alpha<0> after the link_alpha<1> to update the // possible attributes of d2. this->template link_alpha<0>(d1, d2); - if (!isfree1) - { this->template link_alpha<0>(d3, d4); } + this->template link_alpha<0>(d3, d4); } if (are_attributes_automatically_managed() && update_attributes) { - if ( !this->template is_free<2>(d1) && d2!=null_descriptor ) - CGAL::internal::GMap_degroup_attribute_functor_run:: - run(*this, d1, this->template alpha<2>(d1)); + if(merge) + { // Here we group all enabled attributes starting from 2 to dimension + Helper::template Foreach_enabled_attributes + , 2>:: + run(*this, adart1, adart2); + } + else // Here we degroup 2-attributes + { + // TODO if ( !this->template is_free<2>(d1) && d2!=null_descriptor ) + if (adart2!=null_descriptor) + { CGAL::internal::GMap_degroup_attribute_functor_run:: + run(*this, adart1, adart2); } + } } negate_mark(m1); @@ -3673,7 +3747,8 @@ namespace CGAL { typename Attribute_descriptor<0>:: type ah=null_descriptor, bool update_attributes=true ) - { return insert_cell_1_in_cell_2(adart1, null_descriptor, update_attributes, ah); } + { return insert_cell_1_in_cell_2(adart1, null_descriptor, ah, + update_attributes); } /** Test if a 2-cell can be inserted onto a given 3-cell along * a path of edges. From 8d66f692e07f5d4610745d459a198d17e196f5c3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 25 Nov 2022 13:20:30 +0100 Subject: [PATCH 005/156] add a function in tests to create all possible attributes. --- .../Linear_cell_complex_2_test.h | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h index 55e93de1f2b..3b96f69ca76 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h @@ -45,6 +45,103 @@ void trace_display_msg(const char* msg) #endif } +template::type::Info> +struct SetInfoIfNonVoid +{ + static void run(Map& map, + typename Map::template Attribute_descriptor::type attr, + long long int nb) + { + map.template info_of_attribute(attr)= + typename Map::template Attribute_type::type::Info(nb); + } +}; +template +struct SetInfoIfNonVoid +{ + static void run(Map&, typename Map::template Attribute_descriptor::type, + long long int) + {} +}; + +template::type> +struct CreateAttributes +{ + static void run(Map& map) + { + long long int nb=0; + for(typename Map::Dart_range::iterator it=map.darts().begin(), + itend=map.darts().end(); it!=itend; ++it) + { + if ( map.template attribute(it)==map.null_descriptor ) + { + map.template set_attribute(it, map.template create_attribute()); + SetInfoIfNonVoid::run(map, map.template attribute(it), ++nb); + } + } + } +}; + +template +struct CreateAttributes +{ + static void run(Map& amap) + { + long long int nb=0; + for ( typename Map::template Attribute_range<0>::type::iterator + it=amap.template attributes<0>().begin(), + itend=amap.template attributes<0>().end(); it!=itend; ++it ) + SetInfoIfNonVoid::run(amap, it, ++nb); + } +}; + +template +struct CreateAttributes +{ + static void run(Map&) + {} +}; + +template +struct CreateAttributes +{ + static void run(Map&) + {} +}; + +template +struct InitDartInfo +{ + static void run(Map& map) + { + long long int nb=0; + for(typename Map::Dart_range::iterator it=map.darts().begin(), + itend=map.darts().end(); it!=itend; ++it) + { + nb=CGAL::get_default_random().get_int(0,20000); + map.info(it)=Info(nb); + } + } +}; + +template +struct InitDartInfo +{ + static void run(Map&) + {} +}; + +template +void create_attributes_2(Map& map) +{ + CreateAttributes::run(map); + CreateAttributes::run(map); + CreateAttributes::run(map); + InitDartInfo::run(map); +} + template struct Alpha1 From d381bfbd4486b6fb580eb1b56238606f96e8cfa0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 30 Nov 2022 10:35:16 +0100 Subject: [PATCH 006/156] Add a parameter to group functor to deal with the case where first dart will be deleted --- .../Combinatorial_map_group_functors.h | 42 ++++++++++++++----- .../internal/Generalized_map_group_functors.h | 23 +++++++--- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h index 88594075511..bda62d360f8 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h @@ -238,7 +238,8 @@ struct Group_nonvoid_attribute_functor_run { static void run(CMap& amap, typename CMap::Dart_descriptor adart1, - typename CMap::Dart_descriptor adart2) + typename CMap::Dart_descriptor adart2, + bool dart1_deleted=true) { CGAL_static_assertion( 1<=i && i<=CMap::dimension ); CGAL_static_assertion( i!=j ); @@ -251,8 +252,13 @@ struct Group_nonvoid_attribute_functor_run a2=amap.template attribute(adart2); // If the two attributes are equal, nothing to do. - if ( a1 == a2 ) return; - + if (a1==a2) + { + if(a1!=CMap::null_descriptor && dart1_deleted && + amap.template dart_of_attribute(a1)==adart1) + { amap.template set_dart_of_attribute(a1, adart2); } + return; + } typename CMap::Dart_descriptor toSet = amap.null_descriptor; // If the attribute associated to adart1 is nullptr, set it with @@ -268,6 +274,8 @@ struct Group_nonvoid_attribute_functor_run } } amap.template set_attribute(toSet, a1); + if(dart1_deleted && toSet==adart1) + { amap.template set_dart_of_attribute(a1, adart2); } } }; // Specialization for i=0 and 2<=j. We update 0-attributes for beta_j j>=2. @@ -277,7 +285,8 @@ struct Group_nonvoid_attribute_functor_run { static void run( CMap& amap, typename CMap::Dart_descriptor dh1, - typename CMap::Dart_descriptor dh2 ) + typename CMap::Dart_descriptor dh2, + bool dart1_deleted=true) { CGAL_static_assertion_msg ( CMap::Helper::template Dimension_index<0>::value>=0, @@ -306,6 +315,8 @@ struct Group_nonvoid_attribute_functor_run } } amap.template set_attribute<0>(toSet, a1); + if(dart1_deleted && toSet==dh1) + { amap.template set_dart_of_attribute<0>(a1, od); } } } // Second extremity @@ -338,7 +349,8 @@ struct Group_nonvoid_attribute_functor_run { static void run( CMap& amap, typename CMap::Dart_descriptor dh1, - typename CMap::Dart_descriptor dh2 ) + typename CMap::Dart_descriptor dh2, + bool dart1_deleted=true) { CGAL_static_assertion_msg ( CMap::Helper::template Dimension_index<0>::value>=0, @@ -364,6 +376,8 @@ struct Group_nonvoid_attribute_functor_run } } amap.template set_attribute<0>(toSet, a1); + if(dart1_deleted && toSet==dh1) + { amap.template set_dart_of_attribute<0>(a1, od); } } } } @@ -375,7 +389,8 @@ struct Group_nonvoid_attribute_functor_run { static void run( CMap& amap, typename CMap::Dart_descriptor dh1, - typename CMap::Dart_descriptor dh2 ) + typename CMap::Dart_descriptor dh2, + bool=true) { CGAL_static_assertion_msg ( CMap::Helper::template Dimension_index<0>::value>=0, @@ -411,7 +426,8 @@ struct Group_nonvoid_attribute_functor_run { static void run(CMap&, typename CMap::Dart_descriptor, - typename CMap::Dart_descriptor) + typename CMap::Dart_descriptor, + bool=true) {} }; // Specialization for i=1 and j=0. Do nothing as edges attributes are not @@ -421,7 +437,8 @@ struct Group_nonvoid_attribute_functor_run { static void run(CMap&, typename CMap::Dart_descriptor, - typename CMap::Dart_descriptor) + typename CMap::Dart_descriptor, + bool=true) {} }; //------------------------------------------------------------------------------ @@ -432,8 +449,10 @@ struct Group_attribute_functor_run { static void run( CMap& amap, typename CMap::Dart_descriptor d1, - typename CMap::Dart_descriptor d2) - { Group_nonvoid_attribute_functor_run::run(amap, d1, d2); } + typename CMap::Dart_descriptor d2, + bool dart1_deleted=true) + { Group_nonvoid_attribute_functor_run:: + run(amap, d1, d2, dart1_deleted); } }; // Specialization for void attributes. template @@ -441,7 +460,8 @@ struct Group_attribute_functor_run { static void run( CMap&, typename CMap::Dart_descriptor, - typename CMap::Dart_descriptor ) + typename CMap::Dart_descriptor, + bool=true) {} }; // ************************************************************************ diff --git a/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h b/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h index 950a723bf21..7514a5a0089 100644 --- a/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h +++ b/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h @@ -132,7 +132,8 @@ struct GMap_group_attribute_functor_run { static void run(GMap& amap, typename GMap::Dart_descriptor adart1, - typename GMap::Dart_descriptor adart2) + typename GMap::Dart_descriptor adart2, + bool dart1_deleted=true) { CGAL_static_assertion( i<=GMap::dimension ); CGAL_static_assertion( i!=j ); @@ -145,7 +146,13 @@ struct GMap_group_attribute_functor_run a2=amap.template attribute(adart2); // If the two attributes are equal, nothing to do. - if ( a1 == a2 ) return; + if ( a1 == a2 ) + { + if(a1!=GMap::null_descriptor && dart1_deleted && + amap.template dart_of_attribute(a1)==adart1) + { amap.template set_dart_of_attribute(a1, adart2); } + return; + } typename GMap::Dart_descriptor toSet = amap.null_descriptor; @@ -162,15 +169,18 @@ struct GMap_group_attribute_functor_run } } amap.template set_attribute(toSet, a1); + if(dart1_deleted && toSet==adart1) + { amap.template set_dart_of_attribute(a1, adart2); } } }; // Specialization for void attributes. template struct GMap_group_attribute_functor_run { - static void run( GMap&, - typename GMap::Dart_descriptor, - typename GMap::Dart_descriptor ) + static void run(GMap&, + typename GMap::Dart_descriptor, + typename GMap::Dart_descriptor, + bool=true) {} }; // Specialization for i=j. Do nothing as j is the dimension to not consider. @@ -179,7 +189,8 @@ struct GMap_group_attribute_functor_run { static void run(GMap&, typename GMap::Dart_descriptor, - typename GMap::Dart_descriptor) + typename GMap::Dart_descriptor, + bool=true) {} }; // ************************************************************************ From 96873950ee5eeb89a06e944c0b747ce14cbd0709 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 30 Nov 2022 10:36:04 +0100 Subject: [PATCH 007/156] Bug fix for remove and contrat operations for CMap and GMap --- .../include/CGAL/Combinatorial_map_operations.h | 10 ++++++---- .../include/CGAL/Generalized_map_operations.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h index 2ba09b32650..8d29ad53b6c 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h @@ -107,8 +107,10 @@ namespace CGAL { // We group the two (i+1)-cells incident if they exist. if ( dg1!=amap.null_descriptor ) + { CGAL::internal::Group_attribute_functor_run:: - run(amap, dg1, dg2); + run(amap, dg1, dg2, true); // true because dg1 will be removed + } } // During the operation, we store in modified_darts the darts modified @@ -353,7 +355,7 @@ namespace CGAL // We group the two edges incident if they exist. if ( dg1!=amap.null_descriptor ) CGAL::internal::Group_attribute_functor_run:: - run(amap, dg1, dg2); + run(amap, dg1, dg2, true); // true because dg1 will be removed } // During the operation, we store in modified_darts the darts modified @@ -523,7 +525,7 @@ namespace CGAL // We group the two (i-1)-cells incident if they exist. if ( dg1!=amap.null_descriptor ) CGAL::internal::Group_attribute_functor_run:: - run(amap, dg1, dg2); + run(amap, dg1, dg2, true); // true because dg1 will be removed } // During the operation, we store in modified_darts the darts modified @@ -677,7 +679,7 @@ namespace CGAL // We group the two vertices incident if they exist. if ( dg1!=amap.null_descriptor ) CGAL::internal::Group_attribute_functor_run:: - run(amap, dg1, dg2); + run(amap, dg1, dg2, true); // true because dg1 will be removed } // During the operation, we store in modified_darts the darts modified diff --git a/Generalized_map/include/CGAL/Generalized_map_operations.h b/Generalized_map/include/CGAL/Generalized_map_operations.h index 8366f3495df..abffe8d1651 100644 --- a/Generalized_map/include/CGAL/Generalized_map_operations.h +++ b/Generalized_map/include/CGAL/Generalized_map_operations.h @@ -102,7 +102,7 @@ namespace CGAL // We group the two (i+1)-cells incident if they exist. if ( dg1!=amap.null_descriptor ) CGAL::internal::GMap_group_attribute_functor_run:: - run(amap, dg1, dg2); + run(amap, dg1, dg2, true); // true because dg1 will be deleted } // During the operation, we store in modified_darts the darts modified @@ -320,7 +320,7 @@ namespace CGAL // We group the two (i-1)-cells incident if they exist. if ( dg1!=amap.null_descriptor ) CGAL::internal::GMap_group_attribute_functor_run:: - run(amap, dg1, dg2); + run(amap, dg1, dg2, true); // true because dg1 will be deleted } // During the operation, we store in modified_darts the darts modified From 8b114241ca644aac5dda96308f60256c56b5b6aa Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 30 Nov 2022 10:36:40 +0100 Subject: [PATCH 008/156] add one insertion test for cmap --- .../test/Combinatorial_map/Combinatorial_map_3_test.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h index 1abea6aef50..aecd73c271a 100644 --- a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h +++ b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h @@ -1012,6 +1012,17 @@ bool test3D() map.insert_cell_1_in_cell_2(d1, map.beta(d1,1,1)); map.display_characteristics(cout) << ", valid=" << map.is_valid() << endl; map.clear(); + + d1 = map.make_combinatorial_polygon(4); + d2 = map.make_combinatorial_polygon(4); + map.insert_cell_1_between_two_cells_2(d1, d2); + if(!map.is_valid()) + { + map.display_characteristics(cout) << ", valid=" << map.is_valid() << endl; + std::cout<<"ERROR after map.insert_cell_1_between_two_cells_2(d1, d2);"< Date: Wed, 30 Nov 2022 10:37:54 +0100 Subject: [PATCH 009/156] Bug fix in gmap tests, for the second dart given as parameter to the insert_cell_1_in_cell_2 method. --- .../test/Generalized_map/GMap_test_insertions.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Generalized_map/test/Generalized_map/GMap_test_insertions.h b/Generalized_map/test/Generalized_map/GMap_test_insertions.h index b239bad84c1..1a3f67aabc3 100644 --- a/Generalized_map/test/Generalized_map/GMap_test_insertions.h +++ b/Generalized_map/test/Generalized_map/GMap_test_insertions.h @@ -149,7 +149,7 @@ bool test_edge_insertion(GMAP& gmap) trace_test_begin(); d1 = gmap.make_combinatorial_polygon(4); - gmap.insert_cell_1_in_cell_2(d1, gmap.alpha(d1,0,1,0)); + gmap.insert_cell_1_in_cell_2(d1, gmap.alpha(d1,0,1)); if ( !check_number_of_cells_3(gmap, 4, 5, 2, 1, 1) ) return false; gmap.clear(); @@ -158,7 +158,7 @@ bool test_edge_insertion(GMAP& gmap) d1 = gmap.make_combinatorial_polygon(4); d2 = gmap.make_combinatorial_polygon(4); gmap.template sew<3>(d1, d2); - gmap.insert_cell_1_in_cell_2(d1, gmap.alpha(d1,0,1,0)); + gmap.insert_cell_1_in_cell_2(d1, gmap.alpha(d1,0,1)); if ( !check_number_of_cells_3(gmap, 4, 5, 2, 2, 1) ) return false; gmap.clear(); @@ -167,18 +167,11 @@ bool test_edge_insertion(GMAP& gmap) d1 = gmap.make_combinatorial_polygon(4); d2 = gmap.make_combinatorial_polygon(4); gmap.template sew<2>(d1, d2); - gmap.insert_cell_1_in_cell_2(d1, gmap.alpha(d1,0,1,0)); + gmap.insert_cell_1_in_cell_2(d1, gmap.alpha(d1,0,1)); if ( !check_number_of_cells_3(gmap, 6, 8, 3, 1, 1) ) return false; gmap.clear(); - trace_test_begin(); - d1 = gmap.create_dart(); - gmap.insert_dangling_cell_1_in_cell_2(d1); - if ( !check_number_of_cells_3(gmap, 2, 2, 1, 1, 1) ) - return false; - gmap.clear(); - trace_test_begin(); d1 = gmap.make_edge(); gmap.template sew<1>(d1, gmap.alpha(d1, 0)); From caf6d1b38b4e74a45b26794ac00751836988365c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 30 Nov 2022 11:06:42 +0100 Subject: [PATCH 010/156] update lcc test in 2D and 4d --- .../Linear_cell_complex_2_test.h | 14 -------------- .../Linear_cell_complex_4_test.h | 4 ++-- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h index 3b96f69ca76..b76bbf1d7e6 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h @@ -142,20 +142,6 @@ void create_attributes_2(Map& map) InitDartInfo::run(map); } -template -struct Alpha1 -{ - static typename LCC::Dart_descriptor run(LCC&, typename LCC::Dart_descriptor dh) - { return dh; } -}; -template -struct Alpha1 -{ - static typename LCC::Dart_descriptor run(LCC& lcc, typename LCC::Dart_descriptor dh) - { return lcc.template alpha<1>(dh); } -}; - // Test orientation specialized below only for CMap. For GMap return true. template struct Test_change_orientation_LCC_2 diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_4_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_4_test.h index 1606dbdaffa..edc8b0f6d40 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_4_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_4_test.h @@ -377,9 +377,9 @@ bool test_LCC_4() if ( !check_number_of_cells_4(lcc, 16, 28, 16, 4, 2, 1) ) return false; - lcc.insert_cell_1_in_cell_2(lcc.next(dh1), Alpha1::run(lcc, lcc.previous(dh1))); + lcc.insert_cell_1_in_cell_2(lcc.next(dh1), lcc.previous(dh1)); dh2=lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh1)))); - lcc.insert_cell_1_in_cell_2(dh2, Alpha1::run(lcc, lcc.next(lcc.next(dh2)))); + lcc.insert_cell_1_in_cell_2(dh2, lcc.next(lcc.next(dh2))); std::vector path; path.push_back(lcc.next(dh1)); From 7803086c66f927acc2cf058641b4c7fb7d6ce885 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 25 Apr 2023 11:38:13 +0200 Subject: [PATCH 011/156] Start to debug cmap/gmap insertion (nyf) --- .../include/CGAL/Combinatorial_map.h | 4 +- .../Combinatorial_map_group_functors.h | 41 +++++++++++++++++++ .../internal/Combinatorial_map_utility.h | 21 +++++----- .../CGAL/Combinatorial_map_operations.h | 6 +++ .../include/CGAL/Generalized_map_operations.h | 8 +++- 5 files changed, 67 insertions(+), 13 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index f16a3779cd9..b65e30614dd 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -4562,7 +4562,7 @@ namespace CGAL { } this->template basic_link_beta_for_involution<2>(d2, d1); - for ( unsigned int dim=3; dim<=dimension; ++dim) + for (unsigned int dim=3; dim<=dimension; ++dim) { if ( !is_free(it1, dim) && is_marked(beta(it1, dim), treated) ) @@ -4583,6 +4583,8 @@ namespace CGAL { { // Here we group all enabled attributes starting from 2 to dimension Helper::template Foreach_enabled_attributes , 2>::run(*this, adart1, adart2); + Helper::template Foreach_enabled_attributes + , 3>::run(*this, adart1, adart2); // TODO DEBUG } else // Here we degroup 2-attributes { internal::Degroup_attribute_functor_run::run(*this, adart1, adart2); } diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h index bda62d360f8..08dd26c00c7 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h @@ -42,6 +42,10 @@ * Test_split_attribute_functor to test if there is some i-attributes * that are split after an operation. Modified darts are given in a * std::deque. + * + * Set_dart_of_attribute_if_marked to set the dart of the i-attribute + * associated with a dart if the old dart is marked. Used in remove_cell + * functions. */ namespace CGAL { @@ -1033,6 +1037,43 @@ struct Test_split_attribute_functor } }; // ************************************************************************ +template::type> +struct Set_dart_of_attribute_if_marked +{ + static void run(CMap& amap, typename CMap::Dart_descriptor d1, + typename CMap::size_type amark) + { + if(amap.template attribute(d1)!=CMap::null_descriptor && + amap.template dart(d1)!=CMap::null_descriptor && + amap.is_marked(amap.template dart(d1), amark)) + { amap.template dart(d1)=d1; } + } +}; +// Specialization for void attributes. +template +struct Set_dart_of_attribute_if_marked +{ + static void run(CMap&, typename CMap::Dart_descriptor, + typename CMap::size_type) + {} +}; +// ************************************************************************ +template +struct Toto // TODO UPDATE +{ + template + static void run(CMap& amap, typename CMap::Dart_descriptor d1, + typename CMap::Dart_descriptor d2) + { + if(!amap.template is_free(d1) && !amap.template is_free(d2)) + { + Group_attribute_functor_run::run + (amap, amap.template beta(d1), amap.template beta(d2), false); + } + } +}; +// ************************************************************************ } // namespace internal } // namespace CGAL diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h index 340b0551c98..884c4f80b98 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h @@ -342,23 +342,24 @@ namespace CGAL //is called for case k only if the k'th type in the tuple //is different from Void. Note that to the converse of Foreach_static //Functor are called from n =0 to k - template + template struct Foreach_static_restricted; - template + template struct Foreach_static_restricted,n> + std::tuple,n, startn> { template static void run(T& ... t){ - Conditionnal_run::run(t...); + if(n>=startn) + { Conditionnal_run::run(t...); } Foreach_static_restricted - ,n+1>::run(t...); + , n+1, startn>::run(t...); } }; - template - struct Foreach_static_restricted,n>{ + template + struct Foreach_static_restricted,n, startn>{ template static void run(T& ... ){} }; @@ -609,13 +610,13 @@ namespace CGAL struct Attribute_const_range { typedef CGAL::Void type; }; - // To iterate onto each enabled attributes, starting from n-attributes (0 by default) - template + // To iterate onto each enabled attributes, starting from startn-attributes (0 by default) + template struct Foreach_enabled_attributes { template static void run(Ts& ... t) - { Foreach_static_restricted::run(t...); } + { Foreach_static_restricted::run(t...); } }; // To iterate onto each enabled attributes, except j-attributes template diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h index 8d29ad53b6c..9a2a3a94744 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h @@ -150,6 +150,9 @@ namespace CGAL if ( d1!=amap.null_dart_descriptor ) { + internal::Set_dart_of_attribute_if_marked:: + run(amap, d1, mark); + if ( d2!=amap.null_dart_descriptor && d1!=d2 ) { amap.template basic_link_beta(d1, d2); @@ -371,6 +374,9 @@ namespace CGAL { if ( !amap.template is_free<0>(*it) ) { + internal::Set_dart_of_attribute_if_marked:: + run(amap, amap.template beta<0>(*it), mark); + if ( !amap.template is_free<1>(*it) && amap.template beta<0>(*it)!=(*it) ) { diff --git a/Generalized_map/include/CGAL/Generalized_map_operations.h b/Generalized_map/include/CGAL/Generalized_map_operations.h index abffe8d1651..7ae5b70117f 100644 --- a/Generalized_map/include/CGAL/Generalized_map_operations.h +++ b/Generalized_map/include/CGAL/Generalized_map_operations.h @@ -91,8 +91,9 @@ namespace CGAL it.cont(); ++it ) { to_erase.push_back(it); - if ( !amap.template is_free(it) && dg1==amap.null_descriptor ) - { dg1=it; dg2=amap.template alpha(it); } + if (dg1==amap.null_descriptor && !amap.template is_free(it) && + !amap.template is_free(amap.template alpha(it))) + { dg1=it; dg2=amap.template alpha(it); } amap.mark(it, mark); ++res; } @@ -136,6 +137,9 @@ namespace CGAL modified_darts.push_back(d2); amap.mark(d2, mark_modified_darts); } + + internal::Set_dart_of_attribute_if_marked:: + run(amap, d1, mark); } } } From 79ac67c8ffa25e9d3e821cbfb2da9b09285c4069 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 25 Apr 2023 11:40:31 +0200 Subject: [PATCH 012/156] Create all attributes for LCC tests; add draw to debug (todo: remove later) --- .../test/Linear_cell_complex/CMakeLists.txt | 7 +- .../Linear_cell_complex_3_test.h | 108 +++++++++++++++++- 2 files changed, 108 insertions(+), 7 deletions(-) diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index 9adb636537f..0b7a094a29d 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Linear_cell_complex_Tests) -find_package(CGAL REQUIRED) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) set(hfiles Linear_cell_complex_2_test.h Linear_cell_complex_3_test.h Linear_cell_complex_3_test.h) @@ -26,6 +26,11 @@ target_compile_definitions(Linear_cell_complex_3_test_index PUBLIC USE_COMPACT_C target_link_libraries(Linear_cell_complex_3_test_index PUBLIC CGAL CGAL::Data) cgal_add_compilation_test(Linear_cell_complex_3_test_index) +if(CGAL_Qt5_FOUND) + target_link_libraries(Linear_cell_complex_3_test PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(Linear_cell_complex_3_test_index PUBLIC CGAL::CGAL_Basic_viewer) +endif() + add_executable(Linear_cell_complex_4_test_index Linear_cell_complex_4_test.cpp ${hfiles}) target_compile_definitions(Linear_cell_complex_4_test_index PUBLIC USE_COMPACT_CONTAINER_WITH_INDEX) target_link_libraries(Linear_cell_complex_4_test_index PUBLIC CGAL CGAL::Data) diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h index 7235848f2e8..d5811fbfff1 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h @@ -20,7 +20,7 @@ #include "Linear_cell_complex_2_test.h" #include #include - +#include template bool check_number_of_cells_3(LCC& lcc, unsigned int nbv, unsigned int nbe, unsigned int nbf, unsigned int nbvol, @@ -63,6 +63,13 @@ bool check_number_of_cells_3(LCC& lcc, unsigned int nbv, unsigned int nbe, return true; } +template +void create_attributes_3(Map& map) +{ + create_attributes_2(map); + CreateAttributes::run(map); +} + template typename LCC::Dart_descriptor make_loop(LCC& lcc, const typename LCC::Point& p1) { @@ -96,6 +103,7 @@ bool test_LCC_3() Dart_descriptor dh1=lcc.make_segment(Point(0,0,0),Point(1,0,0), true); Dart_descriptor dh2=lcc.make_segment(Point(2,0,0),Point(2,1,0), true); Dart_descriptor dh3=lcc.make_segment(Point(2,2,0),Point(3,1,0), true); + create_attributes_3(lcc); if ( !check_number_of_cells_3(lcc, 6, 3, 6, 3, 3) ) return false; @@ -210,6 +218,7 @@ bool test_LCC_3() if ( !check_number_of_cells_3(lcc, 11, 13, 8, 2, 2) ) return false; + // CGAL::draw(lcc); trace_test_begin(); lcc.template remove_cell<0>(dh9); if ( !check_number_of_cells_3(lcc, 10, 12, 8, 2, 2) ) @@ -320,6 +329,7 @@ bool test_LCC_3() dh1 = lcc.make_triangle(Point(5,5,3),Point(7,5,3),Point(6,6,3)); dh2 = lcc.make_triangle(Point(5,4,3),Point(7,4,3),Point(6,3,3)); lcc.template sew<3>(dh1, dh2); + create_attributes_3(lcc); dh2 = lcc.previous(dh1); dh3 = lcc.next(dh1); lcc.template contract_cell<1>(dh1); @@ -341,6 +351,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_triangle(Point(5,5,3),Point(7,5,3),Point(6,6,3)); dh2 = lcc.make_triangle(Point(5,4,3),Point(7,4,3),Point(6,3,3)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); dh2 = lcc.next(dh2); @@ -373,6 +384,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_triangle(Point(5,5,3),Point(7,5,3),Point(6,6,3)); dh2 = lcc.make_triangle(Point(5,4,3),Point(7,4,3),Point(6,3,3)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); dh2 = lcc.next(dh2); @@ -405,6 +417,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_triangle(Point(5,5,3),Point(7,5,3),Point(6,6,3)); dh2 = lcc.make_triangle(Point(5,4,3),Point(7,4,3),Point(6,3,3)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); dh3 = lcc.make_triangle(Point(5,5,4),Point(7,5,4),Point(6,6,4)); @@ -445,6 +458,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_triangle(Point(5,5,3),Point(7,5,3),Point(6,6,3)); dh2 = lcc.make_triangle(Point(5,4,3),Point(7,4,3),Point(6,3,3)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); dh3 = lcc.make_triangle(Point(5,5,4),Point(7,5,4),Point(6,6,4)); @@ -483,6 +497,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_tetrahedron(Point(9, 9, 0),Point(9, 0, 9), Point(0, 9, 9),Point(0, 0, 0)); + create_attributes_3(lcc); typename LCC::Vector v=CGAL::compute_normal_of_cell_0(lcc, dh1); if (v!=typename LCC::Vector(-9,-9,9)) { @@ -496,7 +511,7 @@ bool test_LCC_3() dh1 = lcc. make_hexahedron(Point(0,0,0),Point(1,0,0),Point(1,2,0),Point(0,2,0), Point(0,3,4),Point(0,0,4),Point(6,0,4),Point(6,3,4)); - + create_attributes_3(lcc); v=CGAL::compute_normal_of_cell_2(lcc, lcc.template opposite<2>(lcc.previous(dh1))); if (v!=typename LCC::Vector(0,0,1)) @@ -529,6 +544,7 @@ bool test_LCC_3() make_hexahedron(Point(0,3,0),Point(1,3,0),Point(1,4,0),Point(0,4,0), Point(0,4,1),Point(0,3,1),Point(1,3,1),Point(1,4,1)); dh2 = lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh2)))); + create_attributes_3(lcc); lcc.template sew<3>(dh1,dh2); lcc.template contract_cell<1>(lcc.previous(dh1)); @@ -560,12 +576,14 @@ bool test_LCC_3() trace_test_begin(); dh1 = make_loop(lcc, Point(0,0,0)); + create_attributes_3(lcc); lcc.template contract_cell<2>(dh1); if ( !check_number_of_cells_3(lcc, 0, 0, 0, 0, 0) ) return false; trace_test_begin(); dh1 = lcc.make_segment(Point(0,0,0),Point(1,0,0), true); + create_attributes_3(lcc); lcc.template sew<1>(lcc.template opposite<2>(dh1), lcc.other_orientation(lcc.template opposite<2>(dh1))); lcc.template contract_cell<2>(dh1); @@ -575,6 +593,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_segment(Point(0,0,0),Point(1,0,0),true); + create_attributes_3(lcc); lcc.template sew<1>(dh1, lcc.other_orientation(dh1)); lcc.template sew<1>(lcc.template opposite<2>(dh1), lcc.other_orientation(lcc.template opposite<2>(dh1))); @@ -586,6 +605,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = make_face_two_edges(lcc, Point(0,0,0), Point(1,0,0)); dh2 = make_face_two_edges(lcc, Point(0,0,1), Point(1,0,1)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); lcc.template contract_cell<2>(dh1); if ( !check_number_of_cells_3(lcc, 2, 2, 1, 1, 1) ) @@ -600,6 +620,7 @@ bool test_LCC_3() dh1 = lcc.make_triangle(Point(5,5,3),Point(7,5,3),Point(6,6,3)); dh2 = lcc.make_triangle(Point(5,4,3),Point(7,4,3),Point(6,3,3)); dh3 = lcc.make_triangle(Point(5,3,3),Point(7,3,3),Point(6,0,3)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); lcc.template sew<2>(lcc.next(dh2), dh3); @@ -615,6 +636,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.create_dart(Point(0,0,0)); + create_attributes_3(lcc); lcc.template sew<3>(dh1, lcc.create_dart(Point(1,0,0))); lcc.template contract_cell<2>(dh1); if ( !check_number_of_cells_3(lcc, 0, 0, 0, 0, 0) ) @@ -623,6 +645,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = make_loop(lcc, Point(0,0,0)); dh2 = make_loop(lcc, Point(0,0,1)); + create_attributes_3(lcc); lcc.template sew<3>(dh1, dh2); lcc.template contract_cell<2>(dh1); if ( !check_number_of_cells_3(lcc, 0, 0, 0, 0, 0) ) @@ -630,6 +653,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_segment(Point(0,0,0),Point(1,0,0), true); + create_attributes_3(lcc); lcc.template sew<3>(dh1, lcc.make_segment(Point(0,0,1),Point(1,0,1), true)); lcc.template sew<3>(lcc.template opposite<2>(dh1), lcc.template opposite<2>(lcc.template opposite<3>(dh1))); @@ -640,8 +664,10 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_segment(Point(0,0,0),Point(1,0,0), true); + create_attributes_3(lcc); lcc.template sew<1>(dh1, lcc.other_orientation(dh1)); dh2 = lcc.make_segment(Point(0,0,1),Point(1,0,1), true); + create_attributes_3(lcc); lcc.template sew<1>(dh2, lcc.other_orientation(dh2)); lcc.template sew<3>(dh1, dh2); lcc.template contract_cell<2>(dh1); @@ -651,10 +677,12 @@ bool test_LCC_3() trace_test_begin(); dh1 = lcc.make_segment(Point(0,0,0),Point(1,0,0), true); + create_attributes_3(lcc); lcc.template sew<1>(dh1, lcc.other_orientation(dh1)); lcc.template sew<1>(lcc.template opposite<2>(dh1), lcc.other_orientation(lcc.template opposite<2>(dh1))); dh2 = lcc.make_segment(Point(0,0,1),Point(1,0,1), true); + create_attributes_3(lcc); lcc.template sew<1>(dh2, lcc.other_orientation(dh2)); lcc.template sew<1>(lcc.template opposite<2>(dh2), lcc.other_orientation(lcc.template opposite<2>(dh2))); @@ -669,6 +697,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = make_face_two_edges(lcc, Point(0,0,0), Point(1,0,0)); dh2 = make_face_two_edges(lcc, Point(0,0,1), Point(1,0,1)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); lcc.template sew<3>(dh1, make_face_two_edges(lcc, Point(0,0,1), Point(1,0,1))); @@ -686,6 +715,7 @@ bool test_LCC_3() trace_test_begin(); dh1 = make_face_two_edges(lcc, Point(0,0,0), Point(1,0,0)); dh2 = make_face_two_edges(lcc, Point(0,0,1), Point(1,0,1)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); lcc.template sew<3>(dh1, make_face_two_edges(lcc, Point(0,0,1), Point(1,0,1))); @@ -706,6 +736,7 @@ bool test_LCC_3() dh1 = lcc.make_triangle(Point(5,5,3),Point(7,5,3),Point(6,6,3)); dh2 = lcc.make_triangle(Point(5,4,3),Point(7,4,3),Point(6,3,3)); dh3 = lcc.make_triangle(Point(5,3,3),Point(7,3,3),Point(6,0,3)); + create_attributes_3(lcc); lcc.template sew<2>(dh1, dh2); lcc.template sew<2>(lcc.next(dh2), dh3); lcc.template sew<3>(dh1, lcc.make_triangle(Point(5,5,4),Point(7,5,4), @@ -737,18 +768,21 @@ bool test_LCC_3() trace_test_begin(); dh1 = make_loop(lcc, Point(0,0,0)); + create_attributes_3(lcc); lcc.template contract_cell<3>(dh1); if ( !check_number_of_cells_3(lcc, 0, 0, 0, 0, 0) ) return false; trace_test_begin(); dh1 = lcc.make_segment(Point(0,0,0),Point(1,0,0)); + create_attributes_3(lcc); lcc.template contract_cell<3>(dh1); if ( !check_number_of_cells_3(lcc, 0, 0, 0, 0, 0) ) return false; trace_test_begin(); dh1 = lcc.make_segment(Point(0,0,0),Point(1,0,0), true); + create_attributes_3(lcc); lcc.template sew<1>(dh1, lcc.other_orientation(dh1)); lcc.template sew<1>(lcc.template opposite<2>(dh1), lcc.other_orientation(lcc.template opposite<2>(dh1))); @@ -764,6 +798,7 @@ bool test_LCC_3() dh2 = lcc. make_hexahedron(Point(0,3,0),Point(1,3,0),Point(1,4,0),Point(0,4,0), Point(0,4,1),Point(0,3,1),Point(1,3,1),Point(1,4,1)); + create_attributes_3(lcc); dh2 = lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh2)))); lcc.template sew<3>(dh1,dh2); @@ -813,6 +848,7 @@ bool test_LCC_3() dh3 = lcc. make_hexahedron(Point(0,6,0),Point(1,6,0),Point(1,7,0),Point(0,7,0), Point(0,7,1),Point(0,6,1),Point(1,6,1),Point(1,7,1)); + create_attributes_3(lcc); dh3 = lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh3)))); lcc.template sew<3>(dh2,dh3); dh2 = lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh2)))); @@ -861,6 +897,12 @@ bool test_LCC_3() Point(1,2,0),Point(0,2,0), Point(0,3,4),Point(0,0,4), Point(6,0,4),Point(6,3,4)); + + dh2=lcc.insert_cell_1_in_cell_2(lcc.next(dh1), lcc.previous(dh1)); + if ( !check_number_of_cells_3(lcc, 8, 13, 7, 1, 1) ) + return false; + lcc.template remove_cell<1>(dh2); + dh2 = lcc. make_hexahedron(Point(0,0,4),Point(1,0,4), Point(1,2,4),Point(0,2,4), @@ -871,16 +913,24 @@ bool test_LCC_3() Point(6,2,4),Point(5,2,4), Point(5,3,8),Point(5,0,8), Point(11,0,8),Point(11,3,8)); - lcc.template sew<3>(dh1,lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh2))))); - lcc.template sew<3>(lcc.template opposite<2>(lcc.next(dh1)), lcc.template opposite<2>(lcc.previous(dh3))); + create_attributes_3(lcc); + lcc.template sew<3>(dh1,lcc.template opposite<2> + (lcc.next(lcc.next(lcc.template opposite<2>(dh2))))); + lcc.template sew<3>(lcc.template opposite<2>(lcc.next(dh1)), + lcc.template opposite<2>(lcc.previous(dh3))); lcc.template close<3>(); if ( !check_number_of_cells_3(lcc, 16, 28, 16, 4, 1) ) return false; - lcc.insert_cell_1_in_cell_2(lcc.next(dh1), Alpha1::run(lcc, lcc.previous(dh1))); + lcc.insert_cell_1_in_cell_2(lcc.next(dh1), lcc.previous(dh1)); + if ( !check_number_of_cells_3(lcc, 16, 29, 17, 4, 1) ) + return false; + dh2=lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh1)))); - lcc.insert_cell_1_in_cell_2(dh2, Alpha1::run(lcc, lcc.next(lcc.next(dh2)))); + lcc.insert_cell_1_in_cell_2(dh2, lcc.next(lcc.next(dh2))); + if ( !check_number_of_cells_3(lcc, 16, 30, 18, 4, 1) ) + return false; std::vector path; path.push_back(lcc.next(dh1)); @@ -891,6 +941,52 @@ bool test_LCC_3() if ( !check_number_of_cells_3(lcc, 16, 30, 19, 5, 1) ) return false; + // Test insertion between two different 2-cells + trace_test_begin(); + lcc.clear(); + dh1 = lcc. + make_hexahedron(Point(0,0,0),Point(1,0,0), + Point(1,2,0),Point(0,2,0), + Point(0,3,4),Point(0,0,4), + Point(6,0,4),Point(6,3,4)); + dh2 = lcc. + make_hexahedron(Point(0,0,4),Point(1,0,4), + Point(1,2,4),Point(0,2,4), + Point(0,3,8),Point(0,0,8), + Point(6,0,8),Point(6,3,8)); + create_attributes_3(lcc); + lcc.template sew<3>(dh1,lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh2))))); + + lcc.insert_cell_1_between_two_cells_2(lcc.template opposite<2>(dh1), + lcc.template opposite<2>(lcc.next(dh1))); + if ( !check_number_of_cells_3(lcc, 12, 21, 10, 2, 1) ) + return false; + + trace_test_begin(); + lcc.clear(); + dh1=lcc.make_hexahedron(Point(0,0,0), Point(5,0,0), + Point(5,5,0), Point(0,5,0), + Point(0,5,4), Point(0,0,4), + Point(5,0,4), Point(5,5,4)); + dh2=lcc.make_hexahedron(Point(5,0,0), Point(10,0,0), + Point(10,5,0), Point(5,5,0), + Point(5,5,4), Point(5,0,4), + Point(10,0,4), Point(10,5,4)); + dh3=lcc.make_quadrangle(Point(5,2,2), Point(5,1,2), + Point(5,1,1), Point(5,2,1)); + create_attributes_3(lcc); + lcc.template sew<3>(lcc.template opposite<2>(lcc.next(lcc.next(dh1))), + lcc.other_orientation(lcc.template opposite<2>(dh2))); + lcc.template sew<3>(dh3, lcc.make_combinatorial_polygon(4)); + + // Create an hole in the face between the two cubes + lcc.insert_cell_1_between_two_cells_2(lcc.template opposite<2>(lcc.next(lcc.next(dh1))), + lcc.next(lcc.next(dh3))); + + CGAL::draw(lcc); // TODO remove + if (!check_number_of_cells_3(lcc, 16, 25, 11, 2, 1) ) + return false; + // Construction from Polyhedron_3 { trace_test_begin(); From 57f0b8908d198643a9b41cf379aa638cf77f7539 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 25 Apr 2023 14:47:33 +0200 Subject: [PATCH 013/156] bug fix in insert cell 1 between two 2 cells --- .../include/CGAL/Combinatorial_map.h | 6 +++- .../Combinatorial_map_group_functors.h | 34 +++++++++++-------- .../include/CGAL/Generalized_map.h | 7 ++++ .../Linear_cell_complex_3_test.h | 2 +- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index b65e30614dd..77af5bbc736 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -4583,8 +4583,12 @@ namespace CGAL { { // Here we group all enabled attributes starting from 2 to dimension Helper::template Foreach_enabled_attributes , 2>::run(*this, adart1, adart2); + // And we need to group also beta_i(adart1) and beta_i(adart2) for all + // enabled attributes starting from 3 dimension. Indeed when two i-cells + // are grouped for adart1 and adart2, this group also all beta_j two by two + // except for beta_i. Helper::template Foreach_enabled_attributes - , 3>::run(*this, adart1, adart2); // TODO DEBUG + , 3>::run(*this, adart1, adart2); } else // Here we degroup 2-attributes { internal::Degroup_attribute_functor_run::run(*this, adart1, adart2); } diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h index 08dd26c00c7..6fd93934b2c 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h @@ -36,6 +36,9 @@ * non nullptr, we overide all the i-attribute of the second i-cell to the * first i-attribute. * + * Group_neighboor_attribute to group the -attributes of beta_i(d1) and + * beta_i(d2) if they exist. + * * Degroup_attribute_functor_run to degroup one i-attributes in two * (except for j-adim). * @@ -488,6 +491,22 @@ struct Group_attribute_functor run(amap,adart1,adart2); } }; // ************************************************************************ +/// Group i-attribute of beta_i(d1) and beta_i(d2) if they exist. +template +struct Group_neighboor_attribute +{ + template + static void run(CMap& amap, typename CMap::Dart_descriptor d1, + typename CMap::Dart_descriptor d2) + { + if(!amap.template is_free(d1) && !amap.template is_free(d2)) + { + CGAL::internal::Group_attribute_functor_run::run + (amap, amap.template opposite(d1), amap.template opposite(d2), false); + } + } +}; +// ************************************************************************ // Functor used to degroup one i-attribute of one i-cell in two, except the // attribute of j. template {} }; // ************************************************************************ -template -struct Toto // TODO UPDATE -{ - template - static void run(CMap& amap, typename CMap::Dart_descriptor d1, - typename CMap::Dart_descriptor d2) - { - if(!amap.template is_free(d1) && !amap.template is_free(d2)) - { - Group_attribute_functor_run::run - (amap, amap.template beta(d1), amap.template beta(d2), false); - } - } -}; -// ************************************************************************ } // namespace internal } // namespace CGAL diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index 273d8b32bf2..d65292ed5a0 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -3695,6 +3695,13 @@ namespace CGAL { Helper::template Foreach_enabled_attributes , 2>:: run(*this, adart1, adart2); + // And we need to group also alpha_i(adart1) and alpha_i(adart2) for all + // enabled attributes starting from 3 dimension. Indeed when two i-cells + // are grouped for adart1 and adart2, this group also all alpha_j two by two + // except for alpha_i. + Helper::template Foreach_enabled_attributes + , 3>::run(*this, adart1, adart2); + } else // Here we degroup 2-attributes { diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h index d5811fbfff1..8b8d55ea375 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h @@ -974,10 +974,10 @@ bool test_LCC_3() Point(10,0,4), Point(10,5,4)); dh3=lcc.make_quadrangle(Point(5,2,2), Point(5,1,2), Point(5,1,1), Point(5,2,1)); - create_attributes_3(lcc); lcc.template sew<3>(lcc.template opposite<2>(lcc.next(lcc.next(dh1))), lcc.other_orientation(lcc.template opposite<2>(dh2))); lcc.template sew<3>(dh3, lcc.make_combinatorial_polygon(4)); + create_attributes_3(lcc); // Create an hole in the face between the two cubes lcc.insert_cell_1_between_two_cells_2(lcc.template opposite<2>(lcc.next(lcc.next(dh1))), From c9a683bf5488fdd8afa886a9237740e4ddbfa835 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 26 Apr 2023 10:17:58 +0200 Subject: [PATCH 014/156] Start to reintroduce last master modifications --- .../Combinatorial_map/Combinatorial_map.txt | 4 +- .../Concepts/CombinatorialMap.h | 2 +- .../Combinatorial_map/Concepts/GenericMap.h | 12 +-- .../map_3_dynamic_onmerge.cpp | 2 +- .../include/CGAL/Cell_attribute.h | 14 +-- .../include/CGAL/Cell_attribute_with_id.h | 6 +- .../include/CGAL/Combinatorial_map.h | 18 ++-- .../Combinatorial_map_copy_functors.h | 6 +- .../Combinatorial_map_group_functors.h | 11 ++- .../Combinatorial_map_internal_functors.h | 4 +- .../internal/Combinatorial_map_utility.h | 10 +- .../CGAL/Combinatorial_map_iterators_base.h | 2 +- .../CGAL/Combinatorial_map_save_load.h | 6 +- .../Combinatorial_map_storages_with_index.h | 9 ++ .../CGAL/Compact_container_with_index.h | 9 +- Combinatorial_map/include/CGAL/Dart.h | 2 +- .../include/CGAL/Info_for_cell_attribute.h | 4 +- .../test/Combinatorial_map/CMakeLists.txt | 8 ++ .../cmap_test_split_attribute.cpp | 92 +++++++++++++++++++ .../Generalized_map/Concepts/GeneralizedMap.h | 2 +- .../doc/Generalized_map/Generalized_map.txt | 4 +- .../gmap_3_dynamic_onmerge.cpp | 2 +- .../include/CGAL/Generalized_map.h | 51 ++++++---- .../internal/Generalized_map_group_functors.h | 9 +- .../Generalized_map_storages_with_index.h | 7 ++ .../test/Generalized_map/CMakeLists.txt | 20 ++-- .../gmap_test_split_attribute.cpp | 92 +++++++++++++++++++ .../cmake/FindCGAL.cmake | 2 +- .../surface_mesh/Surface_mesh.h | 2 +- .../surface_mesh/Vector.h | 2 +- .../Linear_cell_complex_3/CMakeLists.txt | 7 -- .../cmake/ACGCommon.cmake | 2 +- .../cmake/FindGoogleTest.cmake | 2 +- Linear_cell_complex/benchmark/README.TXT | 10 +- .../demo/Linear_cell_complex/CMakeLists.txt | 5 +- .../demo/Linear_cell_complex/MainWindow.cpp | 2 +- .../examples/Linear_cell_complex/README.txt | 2 +- .../test/Linear_cell_complex/CMakeLists.txt | 7 +- .../Linear_cell_complex_3_test.h | 3 - 39 files changed, 337 insertions(+), 117 deletions(-) create mode 100644 Combinatorial_map/test/Combinatorial_map/cmap_test_split_attribute.cpp create mode 100644 Generalized_map/test/Generalized_map/gmap_test_split_attribute.cpp diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 423f49aae1c..2e36037ea23 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -115,7 +115,7 @@ To answer this need, a combinatorial map allows to create attributes whic
  • an i-cell may have no associated i-attribute. -Since i-cells are not explicitely represented in combinatorial maps, the association between i-cells and i-attributes is transferred to darts: if attribute a is associated to i-cell c, all the darts belonging to c are associated to a. +Since i-cells are not explicitly represented in combinatorial maps, the association between i-cells and i-attributes is transferred to darts: if attribute a is associated to i-cell c, all the darts belonging to c are associated to a. We can see two examples of combinatorial maps having some attributes in \cgalFigureRef{fig_cmap_with_attribs}. In the first example (Left), a 2D combinatorial map has 1-attributes containing a float, for example corresponding to the length of the associated 1-cell, and 2-attributes containing a color in RGB format. In the second example (Right), a 3D combinatorial map has 2-attributes containing a color in RGB format. @@ -280,7 +280,7 @@ There are also two different classes of ranges containing one dart per i- The iterators of the \link GenericMap::Dart_range `Dart_range`\endlink are bidirectional iterators, while the iterators of the other four ranges are forward iterators. The value type of all these iterators is `Dart` thus all these iterators can be directly used as \link GenericMap::Dart_descriptor `Dart_descriptor`\endlink. -Additionally, there is a range over non void i-attributes: \link GenericMap::Attribute_range `Attribute_range::type`\endlink, having a bidirectional iterator with value type \link GenericMap::Attribute_type Attribute_type::type`\endlink. +Additionally, there is a range over non void i-attributes: \link GenericMap::Attribute_range `Attribute_range::type`\endlink, having a bidirectional iterator with value type \link GenericMap::Attribute_type `Attribute_type::type`\endlink. For each range, there is an associated const range, a model of the `ConstRange` concept. You can find some examples of ranges in Section \ref ssecexample3DCM "A 3D Combinatorial Map". diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h index 007d8b424c5..03f492d1b08 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h @@ -4,7 +4,7 @@ The concept `CombinatorialMap` defines a d-dimensional combinatorial map. -\cgalRefines `GenericMap` +\cgalRefines{GenericMap} \cgalHasModel \link CGAL::Combinatorial_map `CGAL::Combinatorial_map`\endlink diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h index 31bcaf161d6..790d378bd07 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h @@ -4,7 +4,7 @@ The concept `GenericMap` defines a d-dimensional generic map. This concept is defined only to factorize the common notions between \link CombinatorialMap `CombinatorialMap`\endlink and \link GeneralizedMap `GeneralizedMap`\endlink concepts. -\cgalRefines DefaultConstructible +\cgalRefines{DefaultConstructible} A generic map has a set of darts D, and functions \f$ f_0\f$,\f$ \ldots\f$,\f$ f_{d}\f$ that link these darts between them. @@ -450,28 +450,28 @@ template const Attribute_type::type::Info& info_of_attribute(typename Attribute_const_descriptor::type ah) const; /*! -A shorcut for \link GenericMap::info_of_attribute `info_of_attribute`\endlink`(`\link GenericMap::attribute `attribute`\endlink`(adart))`. +A shortcut for \link GenericMap::info_of_attribute `info_of_attribute`\endlink`(`\link GenericMap::attribute `attribute`\endlink`(adart))`. \pre \link GenericMap::attribute `attribute`\endlink`(adart)!=nullptr`. */ template typename Attribute_type::type::Info & info(Dart_descriptor adart); /*! -A shorcut for \link GenericMap::info_of_attribute(typename Attribute_const_descriptor::type)const `info_of_attribute`\endlink`(`\link GenericMap::attribute(Dart_const_descriptor)const `attribute`\endlink`(adart))` for const descriptor. +A shortcut for \link GenericMap::info_of_attribute(typename Attribute_const_descriptor::type)const `info_of_attribute`\endlink`(`\link GenericMap::attribute(Dart_const_descriptor)const `attribute`\endlink`(adart))` for const descriptor. \pre \link GenericMap::attribute(Dart_const_descriptor)const `attribute`\endlink`(adart)!=nullptr`. */ template const typename Attribute_type::type::Info & info(Dart_const_descriptor adart) const; /*! -A shorcut for \link GenericMap::dart_of_attribute `dart_of_attribute`\endlink`(`\link GenericMap::attribute `attribute`\endlink`(adart))`. +A shortcut for \link GenericMap::dart_of_attribute `dart_of_attribute`\endlink`(`\link GenericMap::attribute `attribute`\endlink`(adart))`. \pre `attribute(adart)!=nullptr`. */ template Dart_descriptor & dart(Dart_descriptor adart); /*! -A shorcut for \link GenericMap::dart_of_attribute(typename Attribute_const_descriptor::type)const `dart_of_attribute`\endlink`(`\link GenericMap::attribute(Dart_const_descriptor)const `attribute`\endlink`(adart))` for const descriptor. +A shortcut for \link GenericMap::dart_of_attribute(typename Attribute_const_descriptor::type)const `dart_of_attribute`\endlink`(`\link GenericMap::attribute(Dart_const_descriptor)const `attribute`\endlink`(adart))` for const descriptor. \pre `attribute(adart)!=nullptr`. */ template @@ -679,7 +679,7 @@ Returns the status of the management of the attributes of the generic map. (ca1.dart()).size(); CMap_3::size_type nb2=mmap.darts_of_cell<2>(ca2.dart()).size(); mmap.info<2>(ca1.dart())*=(double(nb1)/(nb1+nb2)); diff --git a/Combinatorial_map/include/CGAL/Cell_attribute.h b/Combinatorial_map/include/CGAL/Cell_attribute.h index 091fb5730a1..0c931f0e30d 100644 --- a/Combinatorial_map/include/CGAL/Cell_attribute.h +++ b/Combinatorial_map/include/CGAL/Cell_attribute.h @@ -176,11 +176,11 @@ struct Init_id; { return !operator==(other); } protected: - /// Contructor without parameter. + /// Constructor without parameter. Cell_attribute_without_info(): mrefcounting(0), m_for_cc(Refs::null_descriptor) {} - /// Copy contructor. + /// Copy constructor. Cell_attribute_without_info(const Cell_attribute_without_info& acell): mrefcounting(acell.mrefcounting) {} @@ -301,12 +301,12 @@ struct Init_id; { return !operator==(other); } protected: - /// Contructor without parameter. + /// Constructor without parameter. Cell_attribute_without_info() : mdart(Refs::null_descriptor), mrefcounting(0) {} - /// Copy contructor. + /// Copy constructor. Cell_attribute_without_info(const Cell_attribute_without_info& acell): mdart(acell.mdart), mrefcounting(acell.mrefcounting) @@ -398,7 +398,7 @@ struct Init_id; typedef void Info; protected: - /// Default contructor. + /// Default constructor. Cell_attribute() {} }; @@ -461,11 +461,11 @@ struct Init_id; { return !operator==(other); } protected: - /// Default contructor. + /// Default constructor. Cell_attribute() {} - /// Contructor with an info in parameter. + /// Constructor with an info in parameter. Cell_attribute(const Info_& ainfo) : Info_for_cell_attribute(ainfo) {} diff --git a/Combinatorial_map/include/CGAL/Cell_attribute_with_id.h b/Combinatorial_map/include/CGAL/Cell_attribute_with_id.h index 768e0b82aeb..7366d118928 100644 --- a/Combinatorial_map/include/CGAL/Cell_attribute_with_id.h +++ b/Combinatorial_map/include/CGAL/Cell_attribute_with_id.h @@ -42,11 +42,11 @@ namespace CGAL { friend class Concurrent_compact_container; protected: - /// Default contructor. + /// Default constructor. Cell_attribute_with_id() {} - /// Contructor with an info in parameter. + /// Constructor with an info in parameter. Cell_attribute_with_id(const Info_& ainfo) : Cell_attribute(ainfo) {} @@ -64,7 +64,7 @@ namespace CGAL { friend class Concurrent_compact_container; protected: - /// Default contructor. + /// Default constructor. Cell_attribute_with_id() {} }; diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index 77af5bbc736..ee80b2978c2 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -219,7 +219,7 @@ namespace CGAL { * @param dartinfoconverter functor to transform original information of darts into information of copies * @param pointconverter functor to transform points in original map into points of copies. * @param copy_perforated_darts true to copy also darts marked perforated (if any) - * @param mark_perforated_darts true to mark darts wich are copies of perforated darts (if any) + * @param mark_perforated_darts true to mark darts which are copies of perforated darts (if any) * @post *this is valid. */ template ::value> (mattribute_containers).emplace(args...); // Reinitialize the ref counting of the new attribute. This is normally - // not required except if create_attribute is used as "copy contructor". + // not required except if create_attribute is used as "copy constructor". this->template init_attribute_ref_counting(res); internal::Init_id::type>::run (this->template attributes(), res); @@ -1639,8 +1639,8 @@ namespace CGAL { CGAL_static_assertion(i<=dimension); CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "set_attribute but i-attributes are disabled"); - - for (typename Dart_of_cell_range::iterator it(*this, dh); it.cont(); ++it) + for (typename Dart_of_cell_range::iterator it(*this, dh); + it.cont(); ++it) { this->template set_dart_attribute(it, ah); } @@ -3543,7 +3543,7 @@ namespace CGAL { ::run(*this, map2, current, other); } - // We test if the injection is valid with its neighboors. + // We test if the injection is valid with its neighbors. // We go out as soon as it is not satisfied. for (i=0; match && i<=dimension; ++i) { @@ -3772,7 +3772,7 @@ namespace CGAL { /** Test if a face is a combinatorial polygon of length alg * (a cycle of alg darts beta1 links together). - * @param adart an intial dart + * @param adart an initial dart * @return true iff the face containing adart is a polygon of length alg. */ bool is_face_combinatorial_polygon(Dart_const_descriptor adart, @@ -3858,7 +3858,7 @@ namespace CGAL { } /** Test if a volume is a combinatorial tetrahedron. - * @param adart an intial dart + * @param adart an initial dart * @return true iff the volume containing adart is a combinatorial tetrahedron. */ bool is_volume_combinatorial_tetrahedron(Dart_const_descriptor d1) const @@ -3951,7 +3951,7 @@ namespace CGAL { } /** Test if a volume is a combinatorial hexahedron. - * @param adart an intial dart + * @param adart an initial dart * @return true iff the volume containing adart is a combinatorial hexahedron. */ bool is_volume_combinatorial_hexahedron(Dart_const_descriptor d1) const @@ -4145,7 +4145,7 @@ namespace CGAL { } /** Insert a vertex in the given 2-cell which is split in triangles, - * once for each inital edge of the facet. + * once for each initial edge of the facet. * @param adart a dart of the facet to triangulate. * @param update_attributes a boolean to update the enabled attributes * (deprecated, now we use are_attributes_automatically_managed()) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_copy_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_copy_functors.h index d3d11cbdfc7..5cbf7b7861a 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_copy_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_copy_functors.h @@ -41,7 +41,7 @@ namespace internal // **************************************************************************** // Map1 is the existing map, to convert into map2. // Functor called only when both i-attributes have non void info. -// General cases when both info are differents. +// General cases when both info are different. template< typename Map1, typename Map2, unsigned int i, typename Info1=typename Map1::template Attribute_type::type::Info, @@ -439,7 +439,7 @@ struct Default_converter_cmap_attributes }; // **************************************************************************** // Cast converter always copy attributes, doing a cast. This can work only -// if both types are convertible and this is user responsability +// if both types are convertible and this is user responsibility // to use it only in this case. template< typename Map1, typename Map2, unsigned int i> struct Cast_converter_cmap_attributes @@ -480,7 +480,7 @@ struct Default_converter_dart_info }; // **************************************************************************** // Cast converter of dart info. This can work only if both types are -// convertible and this is user responsability to use it only in this case. +// convertible and this is user responsibility to use it only in this case. template< typename Map1, typename Map2> struct Cast_converter_dart_info { diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h index 6fd93934b2c..d86c152c503 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h @@ -33,7 +33,7 @@ * Group_attribute_functor to group the -attributes of two * given i-cells (except for j-adim). If one i-attribute is nullptr, we set the * darts of its i-cell to the second attribute. If both i-attributes are - * non nullptr, we overide all the i-attribute of the second i-cell to the + * non nullptr, we override all the i-attribute of the second i-cell to the * first i-attribute. * * Group_neighboor_attribute to group the -attributes of beta_i(d1) and @@ -609,6 +609,15 @@ void test_split_attribute_functor_one_dart Attribute_descriptor_i a1 = amap.template attribute(adart); if ( found_attributes.is_defined(a1) ) { // Here the attribute was already present in the hash_map + + // We need to call reserve for the cc with index case. Indeed, if the vector + // is reallocated, the reference returned by get_attribute(a1) will be + // invalidated, and the copy will be wrong. Note that there is no overhead + // since the creation of the attribute need one allocation. + amap.template attributes().reserve(amap.template attributes().size()+1); + + // Now we are sure that the creation of a new attribute will not imply + // a realloc. Attribute_descriptor_i a2 = amap.template create_attribute(amap.template get_attribute(a1)); diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_internal_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_internal_functors.h index 5fe14f3217b..3e0b147942c 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_internal_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_internal_functors.h @@ -39,7 +39,7 @@ * valid (all its darts are linked to the same attribute, no other dart is * linked with this attribute). * - * internal::Count_cell_functor to count the nuber of i-cells. + * internal::Count_cell_functor to count the number of i-cells. * * internal::Count_bytes_one_attribute_functor to count the memory * occupied by i-attributes. @@ -66,7 +66,7 @@ * internal::Test_is_same_attribute_functor to test if two * i-attributes of two darts are isomorphic (ie they have the same info). * - * inernal::Test_is_same_attribute_point_functor to test if + * internal::Test_is_same_attribute_point_functor to test if * the point of two i-attributes are equal. * * internal::Reverse_orientation_of_map_functor to reverse the diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h index 884c4f80b98..4488da87fe1 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h @@ -533,7 +533,7 @@ namespace CGAL struct Attribute_type { typedef Void type; }; - // Helper class allowing to retreive the d-cell-descriptor attribute + // Helper class allowing to retrieve the d-cell-descriptor attribute template::type, typename WithIndex=typename CMap::Use_index> struct Attribute_descriptor @@ -550,7 +550,7 @@ namespace CGAL struct Attribute_descriptor { typedef typename CMap::Dart_index type; }; - // Helper class allowing to retreive the d-cell-const descriptor attribute + // Helper class allowing to retrieve the d-cell-const descriptor attribute template::type> struct Attribute_const_descriptor { @@ -562,7 +562,7 @@ namespace CGAL struct Attribute_const_descriptor { typedef CGAL::Void* type; }; - // Helper class allowing to retreive the d-cell-iterator attribute + // Helper class allowing to retrieve the d-cell-iterator attribute template::type> struct Attribute_iterator { @@ -574,7 +574,7 @@ namespace CGAL struct Attribute_iterator { typedef CGAL::Void* type; }; - // Helper class allowing to retreive the d-cell-const descriptor attribute + // Helper class allowing to retrieve the d-cell-const descriptor attribute template::type> struct Attribute_const_iterator { @@ -586,7 +586,7 @@ namespace CGAL struct Attribute_const_iterator { typedef CGAL::Void* type; }; - // Helper class allowing to retreive the d-cell-attribute range + // Helper class allowing to retrieve the d-cell-attribute range template::type> struct Attribute_range { diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h index eeb2c40b146..0b2c39bc720 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h @@ -28,7 +28,7 @@ namespace CGAL { * Basic classes that serve as tools for definition of iterators. There are 3 classes: * - CMap_dart_iterator is the basic generic class defining - * what is an interator on darts. + * what is an iterator on darts. * - CMap_extend_iterator to extend the given iterator by adding * the involution Bi. * - CMap_non_basic_iterator to transform the basic iterator Ite diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h b/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h index 31e8cff3946..e691fce122c 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h @@ -347,7 +347,7 @@ namespace CGAL { using boost::property_tree::ptree; ptree pt; - // update pt adding nodes containing attributes informations + // update pt adding nodes containing attributes information CMap::Helper::template Foreach_enabled_attributes >::run(const_cast(amap), pt, myDarts); @@ -371,7 +371,7 @@ namespace CGAL { tree.put("data", ""); /** First we save general information of the map (by default nothing, - the fuction can be specialized by users). */ + the function can be specialized by users). */ f(tree); // map dart => number @@ -818,7 +818,7 @@ namespace CGAL { read_xml(input, pt); /** First we load general information of the map (by default nothing, - the fuction can be specialized by users). */ + the function can be specialized by users). */ f(pt); // Then we load darts and attributes. diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h b/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h index aad7d643787..584442412c5 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h @@ -146,6 +146,8 @@ namespace CGAL { { return cit; } bool is_used(size_type i) const { return mmap.mdarts.is_used(i); } + bool owns(size_type i) const + { return mmap.mdarts.owns(i); } private: Self & mmap; }; @@ -286,6 +288,13 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); + // We need to do a reserve before the emplace in order to avoid a bug of + // invalid reference when the container is reallocated. + std::get::value> + (mattribute_containers).reserve + (std::get::value> + (mattribute_containers).size()+1); + typename Attribute_descriptor::type res= std::get::value> (mattribute_containers).emplace(get_attribute(ah)); diff --git a/Combinatorial_map/include/CGAL/Compact_container_with_index.h b/Combinatorial_map/include/CGAL/Compact_container_with_index.h index c3ddb24005b..d3d67c57a88 100644 --- a/Combinatorial_map/include/CGAL/Compact_container_with_index.h +++ b/Combinatorial_map/include/CGAL/Compact_container_with_index.h @@ -755,16 +755,21 @@ public: return false; } - bool owns_dereferencable(const_iterator cit) const + bool owns(size_type i) const + { return i=n) return; - capacity_=n; increase_size(); } diff --git a/Combinatorial_map/include/CGAL/Dart.h b/Combinatorial_map/include/CGAL/Dart.h index 761e9023249..3308def6103 100644 --- a/Combinatorial_map/include/CGAL/Dart.h +++ b/Combinatorial_map/include/CGAL/Dart.h @@ -241,7 +241,7 @@ namespace CGAL { } protected: - /// Neighboors for each dimension +1 (from 0 to dimension). + /// Neighbors for each dimension +1 (from 0 to dimension). Dart_descriptor mf[dimension+1]; /// Values of Boolean marks. diff --git a/Combinatorial_map/include/CGAL/Info_for_cell_attribute.h b/Combinatorial_map/include/CGAL/Info_for_cell_attribute.h index f45b23d76f8..ba13c664c21 100644 --- a/Combinatorial_map/include/CGAL/Info_for_cell_attribute.h +++ b/Combinatorial_map/include/CGAL/Info_for_cell_attribute.h @@ -19,10 +19,10 @@ namespace CGAL { class Info_for_cell_attribute { public: - /// Contructor without parameter. + /// Constructor without parameter. Info_for_cell_attribute()=default; // default => zero-initializing built-in types - /// Contructor with an info in parameter. + /// Constructor with an info in parameter. Info_for_cell_attribute(const Info& ainfo) : minfo(ainfo) {} diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index 94b110c4ac7..6357af2198d 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -24,9 +24,17 @@ target_compile_definitions(Combinatorial_map_copy_test_index PUBLIC USE_COMPACT_ target_link_libraries(Combinatorial_map_copy_test_index PUBLIC CGAL CGAL::Data) cgal_add_compilation_test(Combinatorial_map_copy_test_index) +create_single_source_cgal_program(cmap_test_split_attribute.cpp) + # Link with OpenMesh if possible find_package(OpenMesh QUIET) if(TARGET OpenMesh::OpenMesh) + message(STATUS "Found OpenMesh") + target_link_libraries(Combinatorial_map_copy_test PRIVATE OpenMesh::OpenMesh) + target_compile_definitions(Combinatorial_map_copy_test PRIVATE -DCGAL_USE_OPENMESH) target_link_libraries(Combinatorial_map_copy_test_index PRIVATE OpenMesh::OpenMesh) + target_compile_definitions(Combinatorial_map_copy_test_index PRIVATE -DCGAL_USE_OPENMESH) +else() + message(STATUS "NOTICE: Tests will not use OpenMesh.") endif() diff --git a/Combinatorial_map/test/Combinatorial_map/cmap_test_split_attribute.cpp b/Combinatorial_map/test/Combinatorial_map/cmap_test_split_attribute.cpp new file mode 100644 index 00000000000..49e8795eef7 --- /dev/null +++ b/Combinatorial_map/test/Combinatorial_map/cmap_test_split_attribute.cpp @@ -0,0 +1,92 @@ +#include +#include +#include +#include +#include +#include + +struct MyInfo +{ + MyInfo() :data(1) + {} + + MyInfo(int i) :data(i) + {} + + int data; +}; + +struct Myitem1 +{ + using Use_index=CGAL::Tag_true; // use indices + using Index_type=std::uint16_t; // 16 bits + template + struct Dart_wrapper + { + typedef CGAL::Cell_attribute attrib; + typedef std::tuple Attributes; + }; +}; + +struct Myitem2 +{ + template + struct Dart_wrapper + { + typedef CGAL::Cell_attribute attrib; + typedef std::tuple Attributes; + }; +}; + +using CMap1=CGAL::Combinatorial_map<3,Myitem1>; +using CMap2=CGAL::Combinatorial_map<3,Myitem2>; + +#define NB 1000 +template +bool test(const std::string& s) +{ + bool res=true; + CMap m; + // 1) create a face and one attribute. + typename CMap::Dart_descriptor dd=m.make_combinatorial_polygon(4); + m.template set_attribute<2>(dd, m.template create_attribute<2>(2)); + // 2) Split this face NB times => will create new 2-attributes for new faces + for(std::size_t i=0; i(newd)==CMap::null_descriptor) + { + std::cout<<"ERROR1: "<(newd)==CMap::null_descriptor"<(newd).data!=2) + { + std::cout<<"ERROR2: "<(newd).data<(newd); + if(m.template attribute<2>(newd)==CMap::null_descriptor) + { + std::cout<<"ERROR3: "<(newd)==CMap::null_descriptor"<(newd).data!=2) + { + std::cout<<"ERROR4: "<(newd).data<("CMap1") || !test("CMap2")) + { return EXIT_FAILURE; } + + return EXIT_SUCCESS; +} diff --git a/Generalized_map/doc/Generalized_map/Concepts/GeneralizedMap.h b/Generalized_map/doc/Generalized_map/Concepts/GeneralizedMap.h index 172e2481899..91c430a9d91 100644 --- a/Generalized_map/doc/Generalized_map/Concepts/GeneralizedMap.h +++ b/Generalized_map/doc/Generalized_map/Concepts/GeneralizedMap.h @@ -4,7 +4,7 @@ The concept `GeneralizedMap` defines a d-dimensional generalized map. -\cgalRefines `GenericMap` +\cgalRefines{GenericMap} \cgalHasModel \link CGAL::Generalized_map `CGAL::Generalized_map`\endlink diff --git a/Generalized_map/doc/Generalized_map/Generalized_map.txt b/Generalized_map/doc/Generalized_map/Generalized_map.txt index 0b08884f40a..491a8c9ed3d 100644 --- a/Generalized_map/doc/Generalized_map/Generalized_map.txt +++ b/Generalized_map/doc/Generalized_map/Generalized_map.txt @@ -117,7 +117,7 @@ To answer this need, a generalized map allows to create attributes which
  • an i-cell may have no associated i-attribute. -Since i-cells are not explicitely represented in generalized maps, the association between i-cells and i-attributes is transferred to darts: if attribute a is associated to i-cell c, all the darts belonging to c are associated to a. +Since i-cells are not explicitly represented in generalized maps, the association between i-cells and i-attributes is transferred to darts: if attribute a is associated to i-cell c, all the darts belonging to c are associated to a. We can see two examples of generalized maps having some attributes in \cgalFigureRef{fig_gmap_with_attribs}. In the first example (Left), a 2D generalized map has 1-attributes containing a float, for example corresponding to the length of the associated 1-cell, and 2-attributes containing a color in RGB format. In the second example (Right), a 3D generalized map has 2-attributes containing a color in RGB format. @@ -279,7 +279,7 @@ There are also two different classes of ranges containing one dart per i- The iterators of the \link GenericMap::Dart_range `Dart_range`\endlink are bidirectional iterators, while the iterators of the other four ranges are forward iterators. The value type of all these iterators is `Dart` thus all these iterators can be directly used as \link GenericMap::Dart_descriptor `Dart_descriptor`\endlink. -Additionally, there is a range over non void i-attributes: \link GenericMap::Attribute_range `Attribute_range::type`\endlink, having a bidirectional iterator with value type \link GenericMap::Attribute_type Attribute_type::type`\endlink. +Additionally, there is a range over non void i-attributes: \link GenericMap::Attribute_range `Attribute_range::type`\endlink, having a bidirectional iterator with value type \link GenericMap::Attribute_type `Attribute_type::type`\endlink. For each range, there is an associated const range, a model of the `ConstRange` concept. You can find some examples of ranges in Section \ref ssecexample3DGM "A 3D Generalized Map". diff --git a/Generalized_map/examples/Generalized_map/gmap_3_dynamic_onmerge.cpp b/Generalized_map/examples/Generalized_map/gmap_3_dynamic_onmerge.cpp index 48651e5ef92..4c8717af339 100644 --- a/Generalized_map/examples/Generalized_map/gmap_3_dynamic_onmerge.cpp +++ b/Generalized_map/examples/Generalized_map/gmap_3_dynamic_onmerge.cpp @@ -40,7 +40,7 @@ struct Split_functor // operator() automatically called after a split. void operator()(Face_attribute& ca1, Face_attribute& ca2) { - // We need to reinitalize the weight of the two faces + // We need to reinitialize the weight of the two faces GMap_3::size_type nb1=mmap.darts_of_cell<2>(ca1.dart()).size(); GMap_3::size_type nb2=mmap.darts_of_cell<2>(ca2.dart()).size(); mmap.info<2>(ca1.dart())*=(double(nb1)/(nb1+nb2)); diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index d65292ed5a0..4f4b29152fb 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -193,7 +193,7 @@ namespace CGAL { * @param dartinfoconverter functor to transform original information of darts into information of copies * @param pointconverter functor to transform points in original map into points of copies. * @param copy_perforated_darts true to copy also darts marked perforated (if any) - * @param mark_perforated_darts true to mark darts wich are copies of perforated darts (if any) + * @param mark_perforated_darts true to mark darts which are copies of perforated darts (if any) * @post *this is valid. */ template ::value> (mattribute_containers).emplace(args...); // Reinitialize the ref counting of the new attribute. This is normally - // not required except if create_attribute is used as "copy contructor". + // not required except if create_attribute is used as "copy constructor". this->template init_attribute_ref_counting(res); internal::Init_id::type>::run (this->template attributes(), res); @@ -2635,7 +2635,7 @@ namespace CGAL { ::run(*this, map2, current, other); } - // We test if the injection is valid with its neighboors. + // We test if the injection is valid with its neighbors. // We go out as soon as it is not satisfied. for (i = 0; match && i <= dimension; ++i) { @@ -3024,7 +3024,7 @@ namespace CGAL { /** Test if a face is a combinatorial polygon of length alg * (a cycle of alg edges alpha1 links together). - * @param adart an intial dart + * @param adart an initial dart * @return true iff the face containing adart is a polygon of length alg. */ bool is_face_combinatorial_polygon(Dart_const_descriptor adart, @@ -3118,7 +3118,7 @@ namespace CGAL { } /** Test if a volume is a combinatorial tetrahedron. - * @param adart an intial dart + * @param adart an initial dart * @return true iff the volume containing adart is a combinatorial tetrahedron. */ bool is_volume_combinatorial_tetrahedron(Dart_const_descriptor d1) const @@ -3195,7 +3195,7 @@ namespace CGAL { } /** Test if a volume is a combinatorial hexahedron. - * @param adart an intial dart + * @param adart an initial dart * @return true iff the volume containing adart is a combinatorial hexahedron. */ bool is_volume_combinatorial_hexahedron(Dart_const_descriptor d1) const @@ -3388,7 +3388,7 @@ namespace CGAL { } /** Insert a vertex in the given 2-cell which is split in triangles, - * once for each inital edge of the facet. + * once for each initial edge of the facet. * @param adart a dart of the facet to triangulate. * @return A dart incident to the new vertex. */ @@ -3643,10 +3643,13 @@ namespace CGAL { d2 = create_dart(); mark(it1,treated); + if (!isfree1) + { d3 = create_dart(); d4 = create_dart(); this->template basic_link_alpha<2>(d1, d3); this->template basic_link_alpha<2>(d2, d4); + } for (unsigned int dim=3; dim<=dimension; ++dim) { @@ -3654,21 +3657,30 @@ namespace CGAL { is_marked(alpha(it1, dim), treated) ) { basic_link_alpha(alpha(it1, dim, 1), d1, dim); - basic_link_alpha(alpha(it1, dim, 1, 0), d2, dim); + basic_link_alpha(alpha(d1, dim, 0), d2, dim); - basic_link_alpha(alpha(it1, dim, 1, 2), d3, dim); - basic_link_alpha(alpha(it1, dim, 1, 2, 0), d4, dim); + if (!isfree1) + { + basic_link_alpha(alpha(it1, 1, dim, 1), d3, dim); + basic_link_alpha(alpha(d3, dim, 0), d4, dim); + } } } if (!isfree1) - { this->template link_alpha<1>(this->template alpha<1>(it1), d3); } - this->template link_alpha<1>(it1, d1); + { + this->template link_alpha<1>(this->template alpha<1>(it1), d3); + if ( adart2!=null_descriptor ) + { + CGAL_assertion (it2.cont()); + this->template link_alpha<1>(this->template alpha<1>(it2), d4); + } + } + this->template link_alpha<1>(it1, d1); if (adart2!=null_descriptor) { CGAL_assertion (it2.cont()); - this->template link_alpha<1>(this->template alpha<1>(it2), d4); this->template link_alpha<1>(it2, d2); ++it2; } @@ -3678,14 +3690,18 @@ namespace CGAL { update_attributes && ah!=null_descriptor) { internal::Set_i_attribute_of_dart_functor::run(*this, d2, ah); - internal::Set_i_attribute_of_dart_functor::run(*this, d4, ah); + if (!isfree1) + { + internal::Set_i_attribute_of_dart_functor::run(*this, d4, ah); + } } } // We do the link_alpha<0> after the link_alpha<1> to update the // possible attributes of d2. this->template link_alpha<0>(d1, d2); - this->template link_alpha<0>(d3, d4); + if (!isfree1) + { this->template link_alpha<0>(d3, d4); } } if (are_attributes_automatically_managed() && update_attributes) @@ -3705,10 +3721,9 @@ namespace CGAL { } else // Here we degroup 2-attributes { - // TODO if ( !this->template is_free<2>(d1) && d2!=null_descriptor ) - if (adart2!=null_descriptor) + if (!this->template is_free<2>(d1) && d2!=null_descriptor) { CGAL::internal::GMap_degroup_attribute_functor_run:: - run(*this, adart1, adart2); } + run(*this, d1, this->template alpha<2>(d1)); } } } diff --git a/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h b/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h index 7514a5a0089..69179ad118c 100644 --- a/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h +++ b/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h @@ -34,7 +34,7 @@ * GMap_group_attribute_functor to group the -attributes of two * given i-cells (except for j-adim). If one i-attribute is nullptr, we set the * darts of its i-cell to the second attribute. If both i-attributes are - * non nullptr, we overide all the i-attribute of the second i-cell to the + * non nullptr, we override all the i-attribute of the second i-cell to the * first i-attribute. * * GMap_degroup_attribute_functor_run to degroup one i-attributes in two @@ -304,6 +304,13 @@ void GMap_test_split_attribute_functor_one_dart Attribute_descriptor_i a1 = amap.template attribute(adart); if ( found_attributes.is_defined(a1) ) { // Here the attribute was already present in the hash_map + + // We need to call reserve for the cc with index case. Indeed, if the vector + // is reallocated, the reference returned by get_attribute(a1) will be + // invalidated, and the copy will be wrong. Note that there is no overhead + // since the creation of the attribute need one allocation. + amap.template attributes().reserve(amap.template attributes().size()+1); + Attribute_descriptor_i a2 = amap.template create_attribute(amap.template get_attribute(a1)); diff --git a/Generalized_map/include/CGAL/Generalized_map_storages_with_index.h b/Generalized_map/include/CGAL/Generalized_map_storages_with_index.h index 80044bdc7d3..828004b8416 100644 --- a/Generalized_map/include/CGAL/Generalized_map_storages_with_index.h +++ b/Generalized_map/include/CGAL/Generalized_map_storages_with_index.h @@ -242,6 +242,13 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); + // We need to do a reserve before the emplace in order to avoid a bug of + // invalid reference when the container is reallocated. + std::get::value> + (mattribute_containers).reserve + (std::get::value> + (mattribute_containers).size()+1); + typename Attribute_descriptor::type res= std::get::value> (mattribute_containers).emplace(get_attribute(ah)); diff --git a/Generalized_map/test/Generalized_map/CMakeLists.txt b/Generalized_map/test/Generalized_map/CMakeLists.txt index d712bb061dc..e773e5c3218 100644 --- a/Generalized_map/test/Generalized_map/CMakeLists.txt +++ b/Generalized_map/test/Generalized_map/CMakeLists.txt @@ -7,20 +7,10 @@ project(Generalized_map_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -set(hfiles Generalized_map_2_test.h Generalized_map_3_test.h - Generalized_map_4_test.h GMap_test_insertions.h) +set(hfiles Generalized_map_2_test.h + Generalized_map_3_test.h + Generalized_map_4_test.h + GMap_test_insertions.h) create_single_source_cgal_program("Generalized_map_test.cpp" ${hfiles}) @@ -28,3 +18,5 @@ add_executable(Generalized_map_test_index Generalized_map_test.cpp ${hfiles}) target_compile_definitions(Generalized_map_test_index PUBLIC USE_COMPACT_CONTAINER_WITH_INDEX) target_link_libraries(Generalized_map_test_index PUBLIC CGAL CGAL::Data) cgal_add_compilation_test(Generalized_map_test_index) + +create_single_source_cgal_program("gmap_test_split_attribute.cpp") diff --git a/Generalized_map/test/Generalized_map/gmap_test_split_attribute.cpp b/Generalized_map/test/Generalized_map/gmap_test_split_attribute.cpp new file mode 100644 index 00000000000..6dd17ee0a84 --- /dev/null +++ b/Generalized_map/test/Generalized_map/gmap_test_split_attribute.cpp @@ -0,0 +1,92 @@ +#include +#include +#include +#include +#include +#include + +struct MyInfo +{ + MyInfo() :data(1) + {} + + MyInfo(int i) :data(i) + {} + + int data; +}; + +struct Myitem1 +{ + using Use_index=CGAL::Tag_true; // use indices + using Index_type=std::uint16_t; // 16 bits + template + struct Dart_wrapper + { + typedef CGAL::Cell_attribute attrib; + typedef std::tuple Attributes; + }; +}; + +struct Myitem2 +{ + template + struct Dart_wrapper + { + typedef CGAL::Cell_attribute attrib; + typedef std::tuple Attributes; + }; +}; + +using GMap1=CGAL::Generalized_map<3,Myitem1>; +using GMap2=CGAL::Generalized_map<3,Myitem2>; + +#define NB 1000 +template +bool test(const std::string& s) +{ + bool res=true; + GMap m; + // 1) create a face and one attribute. + typename GMap::Dart_descriptor dd=m.make_combinatorial_polygon(4); + m.template set_attribute<2>(dd, m.template create_attribute<2>(2)); + // 2) Split this face NB times => will create new 2-attributes for new faces + for(std::size_t i=0; i(dd)); + if(m.template attribute<2>(newd)==GMap::null_descriptor) + { + std::cout<<"ERROR1: "<(newd)==GMap::null_descriptor"<(newd).data!=2) + { + std::cout<<"ERROR2: "<(newd).data<(newd); + if(m.template attribute<2>(newd)==GMap::null_descriptor) + { + std::cout<<"ERROR3: "<(newd)==GMap::null_descriptor"<(newd).data!=2) + { + std::cout<<"ERROR4: "<(newd).data<("GMap1") || !test("GMap2")) + { return EXIT_FAILURE; } + + return EXIT_SUCCESS; +} diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindCGAL.cmake b/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindCGAL.cmake index 7dc0446bf45..a4b0902e60d 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindCGAL.cmake +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindCGAL.cmake @@ -10,7 +10,7 @@ # CGAL_USE_FILE - CMake file to use CGAL. # -# Construct consitent error messages for use below. +# Construct consistent error messages for use below. set(CGAL_DIR_DESCRIPTION "directory containing CGALConfig.cmake. This is either the binary directory where CGAL was configured or PREFIX/lib/CGAL for an installation.") set(CGAL_DIR_MESSAGE "CGAL not found. Set the CGAL_DIR cmake variable or environment variable to the ${CGAL_DIR_DESCRIPTION}") diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/Surface_mesh.h b/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/Surface_mesh.h index 889ee37db5d..f092321e4a9 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/Surface_mesh.h +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/Surface_mesh.h @@ -705,7 +705,7 @@ public: //---------------------------------------------------- circulator types { public: - /// default constructur + /// default constructor Halfedge_around_face_circulator(const Surface_mesh* m=NULL, Face f=Face()) : mesh_(m) { diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/Vector.h b/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/Vector.h index 8f9487c28cc..21aa768dbfb 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/Vector.h +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/Vector.h @@ -137,7 +137,7 @@ public: } - /// assign a scalar to all componenets + /// assign a scalar to all components Vector& operator=(const Scalar s) { for (int i=0; iset_dart_attribute<0>(scene.lcc->beta(d2,1),(scene.lcc)->create_vertex_attribute(scene.lcc->point(d1))); (scene.lcc)->set_dart_attribute<0>(scene.lcc->beta(d3,1),(scene.lcc)->create_vertex_attribute(scene.lcc->point(d2))); (scene.lcc)->set_dart_attribute<0>(scene.lcc->beta(d1,1),(scene.lcc)->create_vertex_attribute(scene.lcc->point(d3))); diff --git a/Linear_cell_complex/examples/Linear_cell_complex/README.txt b/Linear_cell_complex/examples/Linear_cell_complex/README.txt index 6326da0e665..e461312f2dd 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/README.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/README.txt @@ -5,7 +5,7 @@ Examples for Linear_cell_complex package: linear_cell_complex_3_with_colored_vertices.cpp linear_cell_complex_4.cpp - Three "basic" examples, detailled in the user manual. + Three "basic" examples, detailed in the user manual. * plane_graph_to_lcc_2.cpp diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index 0b7a094a29d..9adb636537f 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Linear_cell_complex_Tests) -find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) +find_package(CGAL REQUIRED) set(hfiles Linear_cell_complex_2_test.h Linear_cell_complex_3_test.h Linear_cell_complex_3_test.h) @@ -26,11 +26,6 @@ target_compile_definitions(Linear_cell_complex_3_test_index PUBLIC USE_COMPACT_C target_link_libraries(Linear_cell_complex_3_test_index PUBLIC CGAL CGAL::Data) cgal_add_compilation_test(Linear_cell_complex_3_test_index) -if(CGAL_Qt5_FOUND) - target_link_libraries(Linear_cell_complex_3_test PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(Linear_cell_complex_3_test_index PUBLIC CGAL::CGAL_Basic_viewer) -endif() - add_executable(Linear_cell_complex_4_test_index Linear_cell_complex_4_test.cpp ${hfiles}) target_compile_definitions(Linear_cell_complex_4_test_index PUBLIC USE_COMPACT_CONTAINER_WITH_INDEX) target_link_libraries(Linear_cell_complex_4_test_index PUBLIC CGAL CGAL::Data) diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h index 8b8d55ea375..1f696a41811 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h @@ -20,7 +20,6 @@ #include "Linear_cell_complex_2_test.h" #include #include -#include template bool check_number_of_cells_3(LCC& lcc, unsigned int nbv, unsigned int nbe, unsigned int nbf, unsigned int nbvol, @@ -218,7 +217,6 @@ bool test_LCC_3() if ( !check_number_of_cells_3(lcc, 11, 13, 8, 2, 2) ) return false; - // CGAL::draw(lcc); trace_test_begin(); lcc.template remove_cell<0>(dh9); if ( !check_number_of_cells_3(lcc, 10, 12, 8, 2, 2) ) @@ -983,7 +981,6 @@ bool test_LCC_3() lcc.insert_cell_1_between_two_cells_2(lcc.template opposite<2>(lcc.next(lcc.next(dh1))), lcc.next(lcc.next(dh3))); - CGAL::draw(lcc); // TODO remove if (!check_number_of_cells_3(lcc, 16, 25, 11, 2, 1) ) return false; From a94052388247059d6c6d5ab2f76d1663a43a1d71 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 15 May 2023 15:52:35 +0100 Subject: [PATCH 015/156] Mesh_3: Move doxygen into header file --- .../Polyhedral_mesh_domain_with_features_3.h | 105 ------------------ Mesh_3/doc/Mesh_3/Doxyfile.in | 1 + .../Polyhedral_mesh_domain_with_features_3.h | 104 ++++++++++++++--- 3 files changed, 92 insertions(+), 118 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Polyhedral_mesh_domain_with_features_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/doc/Mesh_3/CGAL/Polyhedral_mesh_domain_with_features_3.h deleted file mode 100644 index 8ee1140044c..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ /dev/null @@ -1,105 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -The class `Polyhedral_mesh_domain_with_features_3` implements a domain whose -boundary is a simplicial polyhedral surface. -This surface must be free of intersection. -It can either be closed, -included inside another polyhedral surface which is closed and free of intersection, -or open. In the latter case, the meshing process will only take care of the quality -of the 1D (features and boundaries) and 2D (surfaces) components of the mesh. - -It is a model of the concept `MeshDomainWithFeatures_3`. It also -provides a member function to automatically detect sharp features and boundaries from -the input polyhedral surface(s). - -\tparam IGT stands for a geometric traits class providing the types -and functors required to implement the intersection tests and intersection computations -for polyhedral boundary surfaces. This parameter has to be -instantiated with a model of the concept `IntersectionGeometricTraits_3`. - -\cgalModels `MeshDomainWithFeatures_3` - -\sa `CGAL::Mesh_domain_with_polyline_features_3` -\sa `CGAL::Polyhedral_mesh_domain_3` -\sa `CGAL::Mesh_polyhedron_3` -*/ -template< typename IGT > -class Polyhedral_mesh_domain_with_features_3 - : public CGAL::Mesh_domain_with_polyline_features_3< - CGAL::Polyhedral_mesh_domain_3< CGAL::Mesh_polyhedron_3::type, IGT> > - { -public: - -/// \name Types -/// @{ - -/*! -Numerical type. -*/ -typedef unspecified_type FT; - -/// @} - -/// \name Creation -/// @{ - -/*! -Constructs a `Polyhedral_mesh_domain_with_features_3` from a polyhedral surface of type `Polyhedron`. -The only requirement on type `Polyhedron` is that `CGAL::Mesh_polyhedron_3::%type` should -be constructible from `Polyhedron`. -No feature detection is done at this level. Note that a copy of `bounding_polyhedron` will be done. -The polyhedron `bounding_polyhedron` has to be closed and free of intersections. -Its interior of `bounding_polyhedron` will be meshed. -*/ -template -Polyhedral_mesh_domain_with_features_3(const Polyhedron& bounding_polyhedron); - - -/*! -Constructs a `Polyhedral_mesh_domain_with_features_3` from a polyhedral surface, and a bounding polyhedral surface. -`CGAL::Mesh_polyhedron_3::%type` should be constructible from `Polyhedron`. -The first polyhedron should be entirely included inside `bounding_polyhedron`, which has to be closed -and free of intersections. -Using this constructor allows to mesh a polyhedral surface which is not closed, or has holes. -The inside of `bounding_polyhedron` will be meshed. -*/ -template -Polyhedral_mesh_domain_with_features_3(const Polyhedron& polyhedron, - const Polyhedron& bounding_polyhedron); - -/*! -\deprecated Constructs a `Polyhedral_mesh_domain_with_features_3` from an off file. No feature -detection is done at this level. Users must read the file into a `Polyhedron_3` and call the -constructor above. -*/ -Polyhedral_mesh_domain_with_features_3(const std::string& filename); - -/// @} - -/// \name Operations -/// @{ - -/*! -Detects sharp features and boundaries of the internal bounding polyhedron (and the potential internal polyhedron) -and inserts them as features of the domain. `angle_bound` gives the maximum -angle (in degrees) between the two normal vectors of adjacent triangles. -For an edge of the polyhedron, if the angle between the two normal vectors of its -incident facets is bigger than the given bound, then the edge is considered as -a feature edge. -*/ -void detect_features(FT angle_bound=60); - - -/*! -Detects border edges of the bounding polyhedron and inserts them as features of the domain. -This function should be called alone only, and not before or after `detect_features()`. -*/ - void detect_borders(); - -/// @} - -}; /* end Polyhedral_mesh_domain_with_features_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index d3608c7b5a0..7e8105428e3 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -4,6 +4,7 @@ ALIASES += "cgalDescribePolylineType=A polyline is defined as a sequence of points, each pair of contiguous points defines a segment of the polyline. If the first and last points of the polyline are identical, the polyline is closed." INPUT += \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_mesh_domain_with_features_3.h \ ${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_3/generate_label_weights.h \ diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index acaf3455321..bb8eb5df378 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -57,11 +57,36 @@ namespace CGAL { -/** - * @class Polyhedral_mesh_domain_with_features_3 - * - * - */ +/*! +\ingroup PkgMesh3Domains + +The class `Polyhedral_mesh_domain_with_features_3` implements a domain whose +boundary is a simplicial polyhedral surface. +This surface must be free of intersection. +It can either be closed, +included inside another polyhedral surface which is closed and free of intersection, +or open. In the latter case, the meshing process will only take care of the quality +of the 1D (features and boundaries) and 2D (surfaces) components of the mesh. + +It is a model of the concept `MeshDomainWithFeatures_3`. It also +provides a member function to automatically detect sharp features and boundaries from +the input polyhedral surface(s). + +\tparam IGT stands for a geometric traits class providing the types +and functors required to implement the intersection tests and intersection computations +for polyhedral boundary surfaces. This parameter has to be +instantiated with a model of the concept +`IntersectionGeometricTraits_3`. + + +\tparam Polyhedron stands for the type of the input polyhedral surface(s), model of `FaceListGraph`. + +\cgalModels `MeshDomainWithFeatures_3` + +\sa `CGAL::Mesh_domain_with_polyline_features_3` +\sa `CGAL::Polyhedral_mesh_domain_3` +\sa `CGAL::Mesh_polyhedron_3` +*/ template < class IGT_, class Polyhedron_ = typename Mesh_polyhedron_3::type, class TriangleAccessor= CGAL::Default, @@ -114,27 +139,50 @@ public: typedef typename Base::R R; typedef typename Base::Point_3 Point_3; + + + /// \name Types + /// @{ + + /*! + Numerical type. + */ typedef typename Base::FT FT; + /// @} + typedef CGAL::Tag_true Has_features; typedef std::vector Bare_polyline; typedef Mesh_3::Polyline_with_context Polyline_with_context; - /// Constructors - Polyhedral_mesh_domain_with_features_3(const Polyhedron& p, + +/// \name Creation +/// @{ + + /*! + Constructs a `Polyhedral_mesh_domain_with_features_3` from a polyhedral surface. + No feature detection is done at this level. Note that a copy of `bounding_polyhedron` will be done. + The polyhedron `bounding_polyhedron` has to be closed and free of intersections. + Its interior of `bounding_polyhedron` will be meshed. + */ + Polyhedral_mesh_domain_with_features_3(const Polyhedron& bounding_polyhedron, CGAL::Random* p_rng = nullptr) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.resize(1); - stored_polyhedra[0] = p; + stored_polyhedra[0] = bounding_polyhedron; get(face_patch_id_t(), stored_polyhedra[0]); this->add_primitives(stored_polyhedra[0]); this->build(); } #ifndef CGAL_NO_DEPRECATED_CODE - + /*! + \deprecated Constructs a `Polyhedral_mesh_domain_with_features_3` from an off file. No feature + detection is done at this level. Users must read the file into a `Polyhedron` and call the + constructor above. + */ CGAL_DEPRECATED Polyhedral_mesh_domain_with_features_3(const std::string& filename, CGAL::Random* p_rng = nullptr) @@ -155,14 +203,21 @@ public: } #endif // not CGAL_NO_DEPRECATED_CODE - Polyhedral_mesh_domain_with_features_3(const Polyhedron& p, - const Polyhedron& bounding_p, + /*! + Constructs a `Polyhedral_mesh_domain_with_features_3` from a polyhedral surface, and a bounding polyhedral surface. + The first polyhedron should be entirely included inside `bounding_polyhedron`, which has to be closed + and free of intersections. + Using this constructor enables to mesh a polyhedral surface which is not closed, or has holes. + The inside of `bounding_polyhedron` will be meshed. + */ + Polyhedral_mesh_domain_with_features_3(const Polyhedron& polyhedron, + const Polyhedron& bounding_polyhedron, CGAL::Random* p_rng = nullptr) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.resize(2); - stored_polyhedra[0] = p; - stored_polyhedra[1] = bounding_p; + stored_polyhedra[0] = polyhedron; + stored_polyhedra[1] = bounding_polyhedron; get(face_patch_id_t(), stored_polyhedra[0]); get(face_patch_id_t(), stored_polyhedra[1]); this->add_primitives(stored_polyhedra[0]); @@ -219,18 +274,41 @@ public: /// Destructor ~Polyhedral_mesh_domain_with_features_3() {} +/// @} + /// Detect features void initialize_ts(Polyhedron& p); + void detect_features(FT angle_in_degree, std::vector& p); + +/// \name Operations +/// @{ + + /*! + Detects sharp features and boundaries of the internal bounding polyhedron (and the potential internal polyhedron) + and inserts them as features of the domain. `angle_bound` gives the maximum + angle (in degrees) between the two normal vectors of adjacent triangles. + For an edge of the polyhedron, if the angle between the two normal vectors of its + incident facets is bigger than the given bound, then the edge is considered as + a feature edge. + */ void detect_features(FT angle_in_degree = FT(60)) { detect_features(angle_in_degree, stored_polyhedra); } void detect_borders(std::vector& p); + + /*! + Detects border edges of the bounding polyhedron and inserts them as features of the domain. + This function should be called alone only, and not before or after `detect_features()`. + */ + void detect_borders() { detect_borders(stored_polyhedra); }; + /// @} + template void add_features(InputIterator first, InputIterator end) From 7171de7b03167ecede862be52f4744153c5498f3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 15 May 2023 21:59:09 +0100 Subject: [PATCH 016/156] Mesh_3: Move doxygen into header file --- Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h | 62 ---------------- Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h | 57 --------------- .../Mesh_3/CGAL/Polyhedral_mesh_domain_3.h | 60 ---------------- Mesh_3/doc/Mesh_3/Doxyfile.in | 2 + Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 65 ++++++++++++++++- Mesh_3/include/CGAL/Mesh_triangulation_3.h | 56 ++++++++++++++- .../include/CGAL/Polyhedral_mesh_domain_3.h | 72 +++++++++++++++---- .../Polyhedral_mesh_domain_with_features_3.h | 2 +- 8 files changed, 177 insertions(+), 199 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Polyhedral_mesh_domain_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h deleted file mode 100644 index 873a815075d..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h +++ /dev/null @@ -1,62 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3MeshClasses - -The class `Mesh_cell_criteria_3` is a model of `MeshCellCriteria_3`. It provides, -for the mesh tetrahedra, -a uniform shape criteria -and a sizing field which may be a uniform or variable field. - -\tparam Tr must be identical to the nested type -`Triangulation` of the instance used as model of -`MeshComplex_3InTriangulation_3`. - -\cgalModels `MeshCellCriteria_3` - -\sa `MeshCriteria_3` -\sa `CGAL::Mesh_criteria_3` -\sa `CGAL::make_mesh_3()` - -*/ -template< typename Tr > -class Mesh_cell_criteria_3 { -public: - -/// \name Types -/// @{ - -/*! -Numerical type -*/ -typedef Tr::FT FT; - -/// @} - -/// \name Creation -/// @{ - -/*! -Returns an object to serve as default criteria for cells. The argument -`radius_edge_bound` is the upper bound for the radius-edge ratio -of the tetrahedra. The argument `radius_bound` is a uniform upper bound -for the circumradii of the tetrahedra in the mesh. See -section \ref introsecparam for further details. -Note that if one parameter is set to 0, then its corresponding criteria is ignored. -*/ - Mesh_cell_criteria_3(const FT& radius_edge_bound, - const FT& radius_bound); - -/*! -Returns an object to serve as default criteria for facets. The type `SizingField` must -be a model of the concept `MeshDomainField_3`. The behavior and semantic of the arguments are the same -as above, except that the radius bound parameter is a functional instead of a constant. -*/ - template - Mesh_cell_criteria_3(const FT& radius_edge_bound, - const SizingField& radius_bound); - -/// @} - -}; /* end Mesh_cell_criteria_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h deleted file mode 100644 index cb8834e9040..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h +++ /dev/null @@ -1,57 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3MeshClasses - -The class `Mesh_triangulation_3` is a class template which provides the triangulation -type to be used for the 3D triangulation embedding the mesh. - -\tparam MD must be a model of `MeshDomain_3`. - -\tparam Gt must be a model of `MeshTriangulationTraits_3` or `Default` -and defaults to `Kernel_traits::%Kernel`. - -\tparam Concurrency_tag enables sequential versus parallel meshing and optimization algorithms. - Possible values are `Sequential_tag` (the default), `Parallel_tag`, - and `Parallel_if_available_tag`. - -\tparam Vertex_base must be a model of `MeshVertexBase_3` or `Default` -and defaults to `Mesh_vertex_base_3`. - -\tparam Cell_base must be a model of `MeshCellBase_3` or `Default` -and defaults to `Compact_mesh_cell_base_3`. - -\warning To improve the robustness of the meshing process, the input traits `Gt` - is wrapped with the traits class `Robust_weighted_circumcenter_filtered_traits_3`. - The class `Robust_weighted_circumcenter_filtered_traits_3` upgrades the functors - models of `Kernel::ConstructWeightedCircumcenter_3`, `Kernel::ComputeSquaredRadius_3`, - and `Kernel::ComputeSquaredRadiusSmallestOrthogonalSphere_3` that are - provided by `Gt` to use exact computations when the geometric configuration - is close to degenerate (e.g. almost coplanar points).
    - Users should therefore be aware that the traits class of the triangulation - will have type `Robust_weighted_circumcenter_filtered_traits_3`. - -\sa `make_mesh_3()` -\sa `Mesh_complex_3_in_triangulation_3` - -*/ -template< typename MD, typename Gt, - typename Concurrency_tag, - typename Vertex_base, - typename Cell_base > -struct Mesh_triangulation_3 { - -/// \name Types -/// @{ - -/*! -The triangulation type to be used for the 3D triangulation embedding the mesh. -This type is a wrapper around the type `CGAL::Regular_triangulation_3`, whose vertex -and cell base classes are respectively `Vertex_base` and `Cell_base`. -*/ -typedef unspecified_type type; - -/// @} - -}; /* end Mesh_triangulation_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Polyhedral_mesh_domain_3.h deleted file mode 100644 index a084e25bfcf..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Polyhedral_mesh_domain_3.h +++ /dev/null @@ -1,60 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -The class `Polyhedral_mesh_domain_3` implements -a domain defined by a simplicial polyhedral surface. - -The input polyhedral surface must be free of intersection. -It must include (at least) one closed connected component -that defines the boundary of the domain to be meshed. -Inside this bounding component, -the input polyhedral surface may contain -several other components (closed or not) -that will be represented in the final mesh. -This class is a model of the concept `MeshDomain_3`. - -\tparam Polyhedron stands for the type of the input polyhedral surface(s), -model of `FaceListGraph`. - -\tparam IGT stands for a geometric traits class -providing the types and functors required to implement -the intersection tests and intersection computations -for polyhedral boundary surfaces. This parameter has to be instantiated -with a model of the concept `IntersectionGeometricTraits_3`. - -\cgalModels `MeshDomain_3` - -\sa `IntersectionGeometricTraits_3` -\sa `CGAL::make_mesh_3()`. - -*/ -template< typename Polyhedron, typename IGT, typename TriangleAccessor > -class Polyhedral_mesh_domain_3 -{ -public: - -/// \name Creation -/// @{ - -/*! -Construction from a bounding polyhedral surface which must be closed, and free of intersections. -The inside of `bounding_polyhedron` will be meshed. -*/ -Polyhedral_mesh_domain_3(const Polyhedron& bounding_polyhedron); - -/*! -Construction from a polyhedral surface, and a bounding polyhedral surface,. -The first polyhedron must be entirely included inside `bounding_polyhedron`, which must be closed -and free of intersections. -Using this constructor allows to mesh a polyhedral surface which is not closed, or has holes. -The inside of `bounding_polyhedron` will be meshed. -*/ -Polyhedral_mesh_domain_3(const Polyhedron& polyhedron, - const Polyhedron& bounding_polyhedron); - -/// @} - -}; /* end Polyhedral_mesh_domain_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 7e8105428e3..fdbd34718f7 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -4,6 +4,8 @@ ALIASES += "cgalDescribePolylineType=A polyline is defined as a sequence of points, each pair of contiguous points defines a segment of the polyline. If the first and last points of the polyline are identical, the polyline is closed." INPUT += \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_triangulation_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_mesh_domain_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_mesh_domain_with_features_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_complex_mesh_domain_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \ diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index 06193693760..27b81bcb2ca 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -27,6 +27,28 @@ namespace CGAL { +/*! +\ingroup PkgMesh3MeshClasses + +The class `Mesh_cell_criteria_3` is a model of `MeshCellCriteria_3`. It provides, +for the mesh tetrahedra, +a uniform shape criteria +and a sizing field which may be a uniform or variable field. + +\tparam Tr must be identical to the nested type +`Triangulation` of the instance used as model of +`MeshComplex_3InTriangulation_3`. + +@todo What to do with `Visitor_`? + +\cgalModels `MeshCellCriteria_3` + +\sa `MeshCriteria_3` +\sa `CGAL::Mesh_criteria_3` +\sa `CGAL::make_mesh_3()` + +*/ + template > class Mesh_cell_criteria_3 @@ -47,10 +69,34 @@ private: public: - /** +#ifdef DOXYGEN_RUNNING +/// \name Types +/// @{ + +/*! +Numerical type +@todo: In the code this typedef is private +*/ +typedef Tr::FT FT; + +/// @} +#endif + + + /// \name Creation +/// @{ + + /*! * @brief Constructor - * @param radius_edge_bound the radius-edge bound - * @param radius_bound the radius bound (tet sizing) + + * @param radius_edge_bound is the upper bound for the radius-edge + * ratio of the tetrahedra. + * @param radius_bound is a uniform upper bound + for the circumradii of the tetrahedra in the + * mesh. + * + * See Section \ref introsecparam for further details. + * Note that if one parameter is set to 0, then its corresponding criteria is ignored. */ Mesh_cell_criteria_3(const FT& radius_edge_bound, const FT& radius_bound) @@ -64,6 +110,17 @@ public: // Nb: SFINAE to avoid wrong matches with built-in numerical types // as int. + + /*! + Returns an object to serve as default criteria for facets. + @tparam SizingField must be a model of the concept + `MeshDomainField_3`. + + The behavior and semantic of the arguments are the same + as above, except that the radius bound parameter is a functional + instead of a constant. + @todo hide the `enable_if_t` + */ template Mesh_cell_criteria_3(const FT& radius_edge_bound, const Sizing_field& radius_bound, @@ -78,6 +135,8 @@ public: init_radius_edge(radius_edge_bound); } + /// @} + /// Destructor ~Mesh_cell_criteria_3() { } diff --git a/Mesh_3/include/CGAL/Mesh_triangulation_3.h b/Mesh_3/include/CGAL/Mesh_triangulation_3.h index 8d8012806c7..72d133a36d5 100644 --- a/Mesh_3/include/CGAL/Mesh_triangulation_3.h +++ b/Mesh_3/include/CGAL/Mesh_triangulation_3.h @@ -122,8 +122,42 @@ public: } }; -// Struct Mesh_triangulation_3 -// + +/*! +\ingroup PkgMesh3MeshClasses + +The class `Mesh_triangulation_3` is a class template which provides the triangulation +type to be used for the 3D triangulation embedding the mesh. + +\tparam MD must be a model of `MeshDomain_3`. + +\tparam K_ must be a model of `MeshTriangulationTraits_3` or `Default` +and defaults to `Kernel_traits::%Kernel`. + +\tparam Concurrency_tag_ enables sequential versus parallel meshing and optimization algorithms. + Possible values are `Sequential_tag` (the default), `Parallel_tag`, + and `Parallel_if_available_tag`. + +\tparam Vertex_base__ must be a model of `MeshVertexBase_3` or `Default` +and defaults to `Mesh_vertex_base_3`. + +\tparam Cell_base_ must be a model of `MeshCellBase_3` or `Default` +and defaults to `Compact_mesh_cell_base_3`. + +\warning To improve the robustness of the meshing process, the input traits `K_` + is wrapped with the traits class `Robust_weighted_circumcenter_filtered_traits_3`. + The class `Robust_weighted_circumcenter_filtered_traits_3` upgrades the functors + models of `Kernel::ConstructWeightedCircumcenter_3`, `Kernel::ComputeSquaredRadius_3`, + and `Kernel::ComputeSquaredRadiusSmallestOrthogonalSphere_3` that are + provided by `K_` to use exact computations when the geometric configuration + is close to degenerate (e.g. almost coplanar points).
    + Users should therefore be aware that the traits class of the triangulation + will have type `Robust_weighted_circumcenter_filtered_traits_3`. + +\sa `make_mesh_3()` +\sa `Mesh_complex_3_in_triangulation_3` + +*/ template; public: + +#ifndef DOXYGEN_RUNNING using type = Triangulation; using Type = type; +#else + +/// \name Types +/// @{ + +/*! +The triangulation type to be used for the 3D triangulation embedding the mesh. +This type is a wrapper around the type `CGAL::Regular_triangulation_3`, whose vertex +and cell base classes are respectively `Vertex_base` and `Cell_base`. +*/ +typedef unspecified_type type; + +#endif + +/// @} + }; // end struct Mesh_triangulation_3 } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 2d9bf625f57..f944d1c7739 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -104,11 +104,39 @@ struct IGT_generator } // end namespace details } // end namespace Mesh_3 -/** - * @class Polyhedral_mesh_domain_3 - * - * - */ + +/*! +\ingroup PkgMesh3Domains + +The class `Polyhedral_mesh_domain_3` implements +a domain defined by a simplicial polyhedral surface. + +The input polyhedral surface must be free of intersection. +It must include (at least) one closed connected component +that defines the boundary of the domain to be meshed. +Inside this bounding component, +the input polyhedral surface may contain +several other components (closed or not) +that will be represented in the final mesh. +This class is a model of the concept `MeshDomain_3`. + +\tparam Polyhedron stands for the type of the input polyhedral surface(s), +model of `FaceListGraph`. + +\tparam IGT stands for a geometric traits class +providing the types and functors required to implement +the intersection tests and intersection computations +for polyhedral boundary surfaces. This parameter has to be instantiated +with a model of the concept `IntersectionGeometricTraits_3`. + +\cgalModels `MeshDomain_3` + +\sa `IntersectionGeometricTraits_3` +\sa `CGAL::make_mesh_3()`. + +*/ + + templateadd_primitives(p); - if(! is_triangle_mesh(p)) { + this->add_primitives(bounding_polyhedron); + if(! is_triangle_mesh(bounding_polyhedron)) { std::cerr << "Your input polyhedron must be triangulated!\n"; CGAL_error_msg("Your input polyhedron must be triangulated!"); } this->build(); } + /*! + Construction from a polyhedral surface, and a bounding polyhedral surface. + The first polyhedron must be entirely included inside `bounding_polyhedron`, which must be closed + and free of intersections. + Using this constructor allows to mesh a polyhedral surface which is not closed, or has holes. + The inside of `bounding_polyhedron` will be meshed. +*/ Polyhedral_mesh_domain_3(const Polyhedron& p, const Polyhedron& bounding_polyhedron, CGAL::Random* p_rng = nullptr) @@ -241,7 +281,8 @@ public: this->build(); } - /** + /*! + * @todo was not in doxygen * Constructor. * * Constructor from a sequence of polyhedral surfaces, and a bounding @@ -274,7 +315,8 @@ public: this->build(); } - /** + /*! + * @todo was not in doxygen * Constructor. * * Constructor from a sequence of polyhedral surfaces, without bounding @@ -309,6 +351,8 @@ public: void set_surface_only() { bounding_tree_ = 0; } +/// @} + /** * Constructs a set of \ccc{n} points on the surface, and output them to diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index bb8eb5df378..0d01d415922 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -222,7 +222,7 @@ public: get(face_patch_id_t(), stored_polyhedra[1]); this->add_primitives(stored_polyhedra[0]); this->add_primitives(stored_polyhedra[1]); - if(CGAL::is_empty(bounding_p)) { + if(CGAL::is_empty(bounding_polyhedron)) { this->set_surface_only(); } else { this->add_primitives_to_bounding_tree(stored_polyhedra[1]); From f1780e39ddb2bfa3857e410caf386f29ad071fa6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2023 09:32:15 +0100 Subject: [PATCH 017/156] Mesh_3: Move doxygen into header file --- .../Mesh_3/CGAL/Gray_image_mesh_domain_3.h | 80 ------------------- .../doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h | 80 ------------------- .../Implicit_to_labeling_function_wrapper.h | 66 --------------- .../Mesh_3/CGAL/Labeled_image_mesh_domain_3.h | 63 --------------- .../CGAL/Mesh_constant_domain_field_3.h | 73 ----------------- Mesh_3/doc/Mesh_3/CGAL/Mesh_edge_criteria_3.h | 53 ------------ .../doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h | 77 ------------------ Mesh_3/doc/Mesh_3/CGAL/Mesh_polyhedron_3.h | 34 -------- Mesh_3/doc/Mesh_3/CGAL/Triangle_accessor_3.h | 49 ------------ Mesh_3/doc/Mesh_3/Doxyfile.in | 10 +++ .../include/CGAL/Gray_image_mesh_domain_3.h | 73 +++++++++++++++-- Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 72 +++++++++++++++-- .../Implicit_to_labeling_function_wrapper.h | 59 +++++++++++++- .../CGAL/Labeled_image_mesh_domain_3.h | 63 +++++++++++++-- .../CGAL/Mesh_constant_domain_field_3.h | 70 +++++++++++++++- Mesh_3/include/CGAL/Mesh_edge_criteria_3.h | 53 ++++++++++-- Mesh_3/include/CGAL/Mesh_facet_criteria_3.h | 75 ++++++++++++++++- Mesh_3/include/CGAL/Mesh_polyhedron_3.h | 30 ++++++- Mesh_3/include/CGAL/Triangle_accessor_3.h | 35 ++++++++ 19 files changed, 506 insertions(+), 609 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Gray_image_mesh_domain_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Labeled_image_mesh_domain_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_constant_domain_field_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_edge_criteria_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_polyhedron_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Triangle_accessor_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/Gray_image_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Gray_image_mesh_domain_3.h deleted file mode 100644 index 02428df510e..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Gray_image_mesh_domain_3.h +++ /dev/null @@ -1,80 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -\deprecated The class template `Gray_image_mesh_domain_3` is deprecated -since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and -its static function -`Labeled_mesh_domain_3::create_gray_image_mesh_domain()`. - -The class `Gray_image_mesh_domain_3` implements 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. -This class is a model of the concept `MeshDomain_3`. -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. - -This class includes a member function that provides, by interpolation, -a gray level value at any query point. -An intersection between a segment and bounding -surfaces is detected when both segment endpoints are associated with gray level -values which are on both sides of the isovalue. -The intersection is then constructed by bisection. -The bisection stops when the query segment is shorter than a given error bound -`e`. This error bound is given by `e=d`\f$ \times\f$`bound` where `d` is the -length of the diagonal of the bounding box (in world coordinates) and -`bound` is the argument passed to the constructor of `Labeled_image_mesh_domain_3`. - - -\tparam Image is the type of the input image. -This parameter must be `CGAL::Image_3`. - -\tparam BGT is a geometric traits class which 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`. - -\tparam Image_word_type is the data type encoded in the `Image` -input file - - -\cgalModels `MeshDomain_3` - -\sa `BisectionGeometricTraits_3` -\sa `CGAL::make_mesh_3()`. - -*/ -template -class Gray_image_mesh_domain_3 -{ -public: - -/// \name Creation -/// @{ - -/*! -Construction from an image. -The object to be meshed is described by the voxels that have a gray-level -value higher than the input isovalue. -@param image the input image -@param iso_value the isovalue, inside `image`, - of the surface describing the boundary of the object to be meshed. -@param value_outside the value attached to voxels outside of the domain - to be meshed. It should be lower than `iso_value` -@param error_bound is relative to the size of the image. -*/ - Gray_image_mesh_domain_3( - const Image& image, - const Image_word_type iso_value, - const Image_word_type value_outside = 0., - const BGT::FT& error_bound = BGT::FT(1e-3)); - -/// @} - -}; /* end Labeled_image_mesh_domain_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h deleted file mode 100644 index e2595b9d6fb..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h +++ /dev/null @@ -1,80 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -\deprecated The class template `Implicit_mesh_domain_3` is deprecated -since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and -its static function -`Labeled_mesh_domain_3::create_implicit_mesh_domain()`. - -The class `Implicit_mesh_domain_3` implements 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. -This class is a model of the concept `MeshDomain_3`. - - -\tparam Function provides the definition of the function. -This parameter stands for a model of the concept -`ImplicitFunction` described in the -surface mesh generation package. -The number types `Function::FT` -and `BGT::FT` are required to match. - -\tparam BGT is a geometric traits which provides the basic operations to implement -intersection tests and computations -through a bisection method. This parameter must be instantiated -with a model of the concept `BisectionGeometricTraits_3`. - -The constructor of `Implicit_mesh_domain_3` -takes as argument a bounding sphere which is required -to circumscribe the surface and to have its center inside the -domain. -This domain constructs intersection points -between -the surface and segments/rays/lines by -bisection. It needs an -`error_bound` such that the bisection process is stopped -when the query segment is smaller than the error bound. -The `error_bound` passed as argument to the domain constructor -is a relative error bound expressed as a ratio to the bounding sphere radius. - -\cgalModels `MeshDomain_3` - -\sa `BisectionGeometricTraits_3` -\sa `CGAL::make_mesh_3()`. - -*/ -template< typename Function, typename BGT > -class Implicit_mesh_domain_3 -{ -public: - -/// \name Creation -/// @{ - -/*! -`f` is the object of type `Function` that represents the implicit -surface. - -`bounding_sphere` is a bounding sphere of the implicit surface. The -value of `f` at the sphere center `c` must be -negative: \f$ f(c)<0\f$. - -`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 `error_bound` by the -radius of `bounding_sphere`. -*/ - Implicit_mesh_domain_3(Function f, - const BGT::Sphere_3& bounding_sphere, - const BGT::FT& error_bound = FT(1e-3)); - -/// @} - -}; /* end Implicit_mesh_domain_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h deleted file mode 100644 index 9a5b38be16d..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h +++ /dev/null @@ -1,66 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -The class `Implicit_multi_domain_to_labeling_function_wrapper` is a helping class to get a function with integer values -labeling the components of a multi-domain. The multidomain is described through a set of functions {fi(p), i=1, ...n}. -Each component corresponds to a sign vector [s1, s2, ..., sn] where si is the sign of the function fi(p) at a point p of the component. -This wrapper class can be passed to `Labeled_mesh_domain_3` as first template parameter. - -\par Example -For example, the multidomain described by the three functions [f1,f2,f3] and the two sign vectors [-,-,+] and [+,-,+] - includes two components.
    -The first one matches the locus of points satisfying f1(p)<0 and f2(p)<0 and f3(p)>0.
    -The second one matches the locus of points satisfying f1(p)>0 and f2(p)<0 and f3(p)>0.
    - -\tparam Function provides the definition of the function. -This parameter stands for a model of the concept ImplicitFunction described in the surface mesh generation package. -The number types Function::FT and BGT::FT are required to match. - -\sa `Labeled_mesh_domain_3`. - -*/ -template -class Implicit_multi_domain_to_labeling_function_wrapper -{ -public: - /// \name Types - /// @{ - //! - typedef std::vector Function_vector; - //! - typedef typename Function::Point Point_3; - /// @} - - /// \name Creation - /// @{ - /*! - * \brief Construction from a vector of implicit functions. - * \param implicit_functions the vector of implicit functions. - * - * Position vectors are built automatically so that the union of components equals the union of the functions. - */ - Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& implicit_functions); - - /*! - * \brief Construction from a vector of implicit functions and a vector of vector of signs. - * \param implicit_functions the vector of implicit functions. - * \param position_vectors the vector of vector of signs. Each vector of positions describes a component. - * \sa `Sign` - */ - Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& implicit_functions, - const std::vector >& position_vectors); - - /*! - * \brief Construction from a vector of implicit functions and a vector of strings. - * \param implicit_functions the vector of implicit functions. - * \param position_strings the vector of strings. The strings contained in this vector must contain '+' or '-' only. Each string (vector of positions) describes a component. - */ - Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& implicit_functions, - const std::vector& position_strings); -/// @} - -}; /* end Implicit_multi_domain_to_labeling_function_wrapper */ - -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Labeled_image_mesh_domain_3.h deleted file mode 100644 index 9109b74f182..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Labeled_image_mesh_domain_3.h +++ /dev/null @@ -1,63 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -\deprecated The class template `Labeled_image_mesh_domain_3` is deprecated -since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and -its static function -`Labeled_mesh_domain_3::create_labeled_image_mesh_domain()`. - -The class `Labeled_image_mesh_domain_3` implements 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. This -class is a model of the concept `MeshDomain_3`. The domain to be discretized -is the union of voxels that have an non-default index (different from the -default constructed value of the type `Image::Type`). - -This class includes a member function that provides, by interpolation, 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 a given error bound -`e`. This error bound is given by `e=d`\f$ \times\f$`bound` where `d` is the -length of the diagonal of the bounding box (in world coordinates) and -`bound` is the argument passed to the constructor of `Labeled_image_mesh_domain_3`. - - -\tparam Image is the type of the input image. -This parameter must be `CGAL::Image_3`. - -\tparam BGT is a geometric traits class which 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`. - -\cgalModels `MeshDomain_3` - -An executable that uses `Labeled_image_mesh_domain_3` must be linked with -the CGAL_ImageIO library. - -\sa `BisectionGeometricTraits_3` -\sa `CGAL::make_mesh_3()`. - -*/ -template< typename Image, typename BGT > -class Labeled_image_mesh_domain_3 { -public: - -/// \name Creation -/// @{ - -/*! -Construction from an image. -The parameter `error_bound` is relative to the size of the image. -*/ - Labeled_Image_mesh_domain_3(const Image& image, - const BGT::FT& error_bound = FT(1e-3)); - -/// @} - -}; /* end Labeled_image_mesh_domain_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_constant_domain_field_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_constant_domain_field_3.h deleted file mode 100644 index b660a43e23b..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_constant_domain_field_3.h +++ /dev/null @@ -1,73 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -The class `Mesh_constant_domain_field_3` is a model of concept `MeshDomainField_3`. It provides -a constant field accessible using queries on 3D-points. - -The class `Mesh_constant_domain_field_3` can also be customized through `set_size()` operations to become -a piecewise constant field, i.e.\ a sizing field with a constant size on each subpart -of the domain. - -\tparam Gt is the geometric traits class. It must match the type `Triangulation::Geom_traits`, -where `Triangulation` is the nested type of the model of `MeshComplex_3InTriangulation_3` used -in the meshing process. - -\tparam Index is the type of index of the vertices of the triangulation. -It must match the type `%Index` of the model of `MeshDomain_3` used in the meshing process. - -\cgalModels `MeshDomainField_3` - -\sa `MeshDomainField_3` - -*/ -template< typename Gt, typename Index > -class Mesh_constant_domain_field_3 { -public: - -/// \name Types -/// @{ - -/*! -Numerical type. -*/ -typedef Gt::FT FT; - -/*! -Point type. -*/ -typedef Gt::Point_3 Point_3; - -/*! -Type of index of the vertices of the triangulation. -*/ -typedef Index Index; - -/// @} - -/// \name Creation -/// @{ - -/*! - -Builds a constant domain field with size `size`. -*/ -Mesh_constant_domain_field_3(FT size); - -/// @} - -/// \name Operations -/// @{ - -/*! - -Sets the size such as `operator()` will return size `size` -at any query point of dimension `dimension` and index `index`. -*/ -void set_size(FT size, int dimension, const Index& index); - -/// @} - -}; /* end Mesh_constant_domain_field_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_edge_criteria_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_edge_criteria_3.h deleted file mode 100644 index 3acbda1bd27..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_edge_criteria_3.h +++ /dev/null @@ -1,53 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3MeshClasses - -The function object class `Mesh_edge_criteria_3` is a model of `MeshEdgeCriteria_3`. It -provides a bound for the size criterion. - -\cgalModels `MeshEdgeCriteria_3` - -\sa `MeshCriteria_3` -\sa `CGAL::Mesh_criteria_3` -\sa `MeshDomainField_3` - -*/ -template< typename Tr > -class Mesh_edge_criteria_3 { -public: - -/// \name Types -/// @{ - -/*! -Numerical type. -*/ -typedef Tr::Geom_traits::FT FT; - -/// @} - -/// \name Creation -/// @{ - -/*! -Returns an object to serve as criteria for edges. -The argument `length_bound` is an upper bound -for the length of the edges which are used to discretize the curves. -Note that if one parameter is set to 0, then its corresponding criteria is ignored. -*/ -Mesh_edge_criteria_3(const FT& length_bound); - -/*! -Returns an object to serve as criteria for edges. The type `SizingField` -must be a model of concept `MeshDomainField_3`. The behavior and semantic of the argument are the same -as above, except that the length -parameter is a functional instead of a constant. -*/ -template -Mesh_edge_criteria_3(const SizingField& length_bound); - -/// @} - -}; /* end Mesh_edge_criteria_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h deleted file mode 100644 index ab5b440dc6f..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h +++ /dev/null @@ -1,77 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3MeshClasses - -The class `Mesh_facet_criteria_3` is a model of `MeshFacetCriteria_3`. -It provides a uniform bound for the shape criterion, -a uniform or variable sizing field -for the size criterion and/or -a uniform or variable distance field -for the approximation error criterion. - -\tparam Tr must be identical to the nested type -`Triangulation` of the instance used as model of -`MeshComplex_3InTriangulation_3`. - -\cgalModels `MeshFacetCriteria_3` - -\sa `CGAL::Mesh_facet_topology` -\sa `MeshCriteria_3` -\sa `MeshFacetCriteria_3` -\sa `CGAL::Mesh_criteria_3` -\sa `MeshDomainField_3` -\sa `CGAL::make_mesh_3()` - -*/ -template< typename Tr > -class Mesh_facet_criteria_3 { -public: - -/// \name Types -/// @{ - -/*! -Numerical type -*/ -typedef Tr::Geom_traits::FT FT; - -/// @} - -/// \name Creation -/// @{ - -/*! -Returns an object to serve as criteria for facets. -\param angle_bound is the lower bound for the angle in degrees of the -surface mesh facets. -\param radius_bound is a uniform upper bound -for the radius of the surface Delaunay balls. -\param distance_bound is an upper bound for the center-center distances -of the surface mesh facets. -\param topology is the set of topological constraints -which have to be verified by each surface facet. See -section \ref Mesh_3DelaunayRefinement for further details. -Note that if one parameter is set to 0, then its corresponding criteria is ignored. -*/ - Mesh_facet_criteria_3(const FT& angle_bound, - const FT& radius_bound, - const FT& distance_bound, - Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE); - -/*! -Returns an object to serve as criteria for facets. The types `SizingField` and -`DistanceField` must -be models of the concept `MeshDomainField_3`. The behavior and semantic of the arguments are the same -as above, except that the radius and distance bound parameters are functionals instead of constants. -*/ - template - Mesh_facet_criteria_3(const FT& angle_bound, - const SizingField& radius_bound, - const DistanceField& distance_bound, - Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE); - -/// @} - -}; /* end Mesh_facet_criteria_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_polyhedron_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_polyhedron_3.h deleted file mode 100644 index 4ec7e8481fa..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_polyhedron_3.h +++ /dev/null @@ -1,34 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -The class `Mesh_polyhedron_3` provides a customized `Polyhedron_3` type. This type uses -as `PolyhedronItems_3` a customized type which adds data to the Vertex, Face and -Halfedge class. Those data are required to use our sharp features -detection algorithm. - -\tparam IGT stands for the geometric traits associated -to the meshing process. It should be a model of the two concepts -`PolyhedronTraits_3` and `IntersectionGeometricTraits_3`. - -\sa `CGAL::Polyhedron_3` -\sa `CGAL::Polyhedral_mesh_domain_with_features_3` - -*/ -template< typename IGT > -struct Mesh_polyhedron_3 { - -/// \name Types -/// @{ - -/*! -`CGAL::Polyhedron_3` type with customized `PolyhedronItems_3` -designed to handle sharp feature detection. -*/ -typedef unspecified_type type; - -/// @} - -}; /* end Mesh_polyhedron_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Triangle_accessor_3.h b/Mesh_3/doc/Mesh_3/CGAL/Triangle_accessor_3.h deleted file mode 100644 index e72ee14e286..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Triangle_accessor_3.h +++ /dev/null @@ -1,49 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -The class `Triangle_accessor_3` is a model for the concept `TriangleAccessor_3`. It is -designed to serve as accessor for objects of type `Polyhedron_3`. - -\attention Actually, the class `Triangle_accessor_3` is a partial specialization of the class -template `template -Triangle_accessor_3`. One may give another partial -specialization of this class to handle one's own polyhedron data structure. - - -\tparam K is the geometric traits class. - -\cgalModels `TriangleAccessor_3` - -\sa `CGAL::Polyhedral_mesh_domain_3` - -*/ -template< CGAL::Polyhedron, typename K > -class Triangle_accessor_3 { -public: - -/// \name Types -/// @{ - -/*! -Triangle iterator. -*/ -typedef Polyhedron_3::Facet_const_iterator -Triangle_iterator; - -/*! -Triangle -handle. -*/ -typedef Polyhedron_3::Facet_const_handle Triangle_handle; - -/*! -Triangle type. -*/ -typedef K::Triangle_3 Triangle_3; - -/// @} - -}; /* end Triangle_accessor_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index fdbd34718f7..7d0a3aa1ccf 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -5,9 +5,14 @@ ALIASES += "cgalDescribePolylineType=A polyline is defined as a sequence of poin INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_triangulation_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_polyhedron_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_mesh_domain_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_mesh_domain_with_features_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_complex_mesh_domain_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Gray_image_mesh_domain_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Labeled_image_mesh_domain_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Implicit_mesh_domain_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Implicit_to_labeling_function_wrapper.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h \ @@ -17,7 +22,12 @@ INPUT += \ ${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/Triangle_accessor_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_criteria_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_constant_domain_field_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_cell_criteria_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_facet_criteria_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_edge_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 \ 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 99bc1e6b313..65cb1690f93 100644 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h @@ -26,11 +26,55 @@ namespace CGAL { -/** - * @class Gray_image_mesh_domain_3 - * - * - */ + +/*! +\ingroup PkgMesh3Domains + +\deprecated The class template `Gray_image_mesh_domain_3` is deprecated +since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and +its static function +`Labeled_mesh_domain_3::create_gray_image_mesh_domain()`. + +The class `Gray_image_mesh_domain_3` implements 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. +This class is a model of the concept `MeshDomain_3`. +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. + +This class includes a member function that provides, by interpolation, +a gray level value at any query point. +An intersection between a segment and bounding +surfaces is detected when both segment endpoints are associated with gray level +values which are on both sides of the isovalue. +The intersection is then constructed by bisection. +The bisection stops when the query segment is shorter than a given error bound +`e`. This error bound is given by `e=d`\f$ \times\f$`bound` where `d` is the +length of the diagonal of the bounding box (in world coordinates) and +`bound` is the argument passed to the constructor of `Labeled_image_mesh_domain_3`. + + +\tparam Image is the type of the input image. +This parameter must be `CGAL::Image_3`. + +\tparam BGT is a geometric traits class which 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`. + +\tparam Image_word_type is the data type encoded in the `Image` +input file + + +\cgalModels `MeshDomain_3` + +\sa `BisectionGeometricTraits_3` +\sa `CGAL::make_mesh_3()`. + +*/ + template > @@ -62,6 +101,25 @@ public: * @param bounding_sphere a bounding sphere of the domain * @param error_bound the error bound relative to the sphere radius */ + /// \name Creation + /// @{ + + /*! + @param f is the object of type `Function_` that represents the implicit + surface. + + @param bounding_sphere is a bounding sphere of the implicit surface. The + value of `f` at the sphere center `c` must be + negative: \f$ f(c)<0\f$. + + @param 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 `error_bound` by the + radius of `bounding_sphere`. + @todo Fix for `p_rng` + */ Implicit_mesh_domain_3(Function_ f, const Sphere_3& bounding_sphere, const FT& error_bound = FT(1e-6), @@ -69,6 +127,8 @@ public: : 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/Implicit_to_labeling_function_wrapper.h b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h index 59cd91281cc..48bd6d03cfe 100644 --- a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h @@ -142,6 +142,29 @@ private: }; // end class Implicit_to_labeling_function_wrapper + + /*! +\ingroup PkgMesh3Domains + +The class `Implicit_multi_domain_to_labeling_function_wrapper` is a helping class to get a function with integer values +labeling the components of a multi-domain. The multidomain is described through a set of functions {fi(p), i=1, ...n}. +Each component corresponds to a sign vector [s1, s2, ..., sn] where si is the sign of the function fi(p) at a point p of the component. +This wrapper class can be passed to `Labeled_mesh_domain_3` as first template parameter. + +\par Example +For example, the multidomain described by the three functions [f1,f2,f3] and the two sign vectors [-,-,+] and [+,-,+] + includes two components.
    +The first one matches the locus of points satisfying f1(p)<0 and f2(p)<0 and f3(p)>0.
    +The second one matches the locus of points satisfying f1(p)>0 and f2(p)<0 and f3(p)>0.
    + +\tparam ImplicitFunction provides the definition of the function. +This parameter stands for a model of the concept `ImplicitFunction` described in the surface mesh generation package. +The number types `ImplicitFunction::FT` and `BGT::FT` are required to match. + +\sa `Labeled_mesh_domain_3`. + +*/ + template class Implicit_multi_domain_to_labeling_function_wrapper { @@ -164,7 +187,18 @@ public: typedef int return_type; typedef ImplicitFunction Function; typedef typename Implicit_function_traits::Point Point_3; + + /// \name Types + /// @{ + //! typedef std::vector Function_vector; +#ifdef DOXYGEN_RUNNING + //! + /// @todo different from code + typedef typename Function::Point Point_3; +#endif + /// @} + private: std::vector funcs; @@ -172,6 +206,17 @@ private: std::vector bmasks; public: + + + /// \name Creation + /// @{ + + /*! + * \brief Construction from a vector of implicit functions and a vector of vector of signs. + * \param implicit_functions the vector of implicit functions. + * \param position_vectors the vector of vector of signs. Each vector of positions describes a component. + * \sa `Sign` + */ Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector >& vps) : funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false)) { @@ -200,7 +245,12 @@ public: } std::sort(bmasks.begin(), bmasks.end()); } - + /*! + * \brief Construction from a vector of implicit functions. + * \param implicit_functions the vector of implicit functions. + * + * Position vectors are built automatically so that the union of components equals the union of the functions. + */ Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf) : funcs(vf) { @@ -227,6 +277,11 @@ public: std::sort(bmasks.begin(), bmasks.end()); } + /*! + * \brief Construction from a vector of implicit functions and a vector of strings. + * \param implicit_functions the vector of implicit functions. + * \param position_strings the vector of strings. The strings contained in this vector must contain '+' or '-' only. Each string (vector of positions) describes a component. + */ Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector& vps) : funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false)) { @@ -256,6 +311,8 @@ public: std::sort(bmasks.begin(), bmasks.end()); } + /// @} + return_type operator() (const Point_3& p) const { Bmask bmask(funcs.size() * 2, false); 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 d9bd487410a..34491151faa 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -32,11 +32,52 @@ namespace CGAL { -/** - * @class Labeled_image_mesh_domain_3 - * - * - */ +/*! +\ingroup PkgMesh3Domains + +\deprecated The class template `Labeled_image_mesh_domain_3` is deprecated +since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and +its static function +`Labeled_mesh_domain_3::create_labeled_image_mesh_domain()`. + +The class `Labeled_image_mesh_domain_3` implements 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. This +class is a model of the concept `MeshDomain_3`. The domain to be discretized +is the union of voxels that have an non-default index (different from the +default constructed value of the type `Image::Type`). + +This class includes a member function that provides, by interpolation, 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 a given error bound +`e`. This error bound is given by `e=d`\f$ \times\f$`bound` where `d` is the +length of the diagonal of the bounding box (in world coordinates) and +`bound` is the argument passed to the constructor of `Labeled_image_mesh_domain_3`. + + +\tparam Image is the type of the input image. +This parameter must be `CGAL::Image_3`. + +\tparam BGT is a geometric traits class which 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`. + +\cgalModels `MeshDomain_3` + +An executable that uses `Labeled_image_mesh_domain_3` must be linked with +the CGAL_ImageIO library. + +@todo Document or comment the other parameters + +\sa `BisectionGeometricTraits_3` +\sa `CGAL::make_mesh_3()`. + +*/ + template Identity; - /// Constructor + + /// \name Creation + /// @{ + + /*! + Construction from an image. + The parameter `error_bound` is relative to the size of the image. + @todo Document or comment the other parameters + */ Labeled_image_mesh_domain_3(const Image& image, const FT& error_bound = FT(1e-3), Subdomain_index value_outside = 0, @@ -83,6 +132,8 @@ public: parameters::p_rng = p_rng) {} + /// @} + Labeled_image_mesh_domain_3(const Image& image, const FT error_bound, CGAL::Random* p_rng) 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 002117b14ae..2cc8550ce05 100644 --- a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h +++ b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h @@ -28,24 +28,73 @@ namespace CGAL { +/*! + \ingroup PkgMesh3Domains + + The class `Mesh_constant_domain_field_3` is a model of concept `MeshDomainField_3`. It provides + a constant field accessible using queries on 3D-points. + + The class `Mesh_constant_domain_field_3` can also be customized through `set_size()` operations to become + a piecewise constant field, i.e.\ a sizing field with a constant size on each subpart + of the domain. + + \tparam Gt is the geometric traits class. It must match the type `Triangulation::Geom_traits`, + where `Triangulation` is the nested type of the model of `MeshComplex_3InTriangulation_3` used + in the meshing process. + + \tparam Index_ is the type of index of the vertices of the triangulation. + It must match the type `%Index` of the model of `MeshDomain_3` used in the meshing process. + + \cgalModels `MeshDomainField_3` + + \sa `MeshDomainField_3` + +*/ + template class Mesh_constant_domain_field_3 { public: + /// \name Types + /// @{ + + /*! + Numerical type. + */ typedef typename Gt::FT FT; + + /*! + Point type. +@todo in the code `eval_if` for `Bare_point_type` + */ +#ifdef DOXYGEN_RUNNING +typedef Gt::Point_3 Point_3; +#else typedef typename boost::mpl::eval_if_c< internal::Has_nested_type_Bare_point::value, typename internal::Bare_point_type, boost::mpl::identity >::type Point_3; +#endif + /*! + Type of index of the vertices of the triangulation. + */ typedef Index_ Index; + /// @} + private: // Map to store field values typedef std::map,FT> Values; public: - /// Constructor + + /// \name Creation + /// @{ + + /*! + Builds a constant domain field with size `size`. + */ Mesh_constant_domain_field_3(const FT& d) : d_(d) {} /// Returns size @@ -57,11 +106,24 @@ public: return d_; } - /// Sets size at any point of dimension `dim` and index `index`. - void set_size(const FT& size, const int dim, const Index& index) + /// @} + + /// \name Operations + /// @{ + + /*! + + Sets the size such as `operator()` will return size `size` + at any query point of dimension `dimension` and index `index`. + + @todo docunment `operator()`? + */ + + void set_size(const FT& size, const int dimension, const Index& index) { - values_.insert(std::make_pair(std::make_pair(dim,index),size)); + values_.insert(std::make_pair(std::make_pair(dimension,index),size)); } + /// @} private: // default value diff --git a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h index d45ff426f9f..811d7690055 100644 --- a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h @@ -85,18 +85,52 @@ namespace internal { } // end namespace internal } // end namespace Mesh_3 + + /*! + \ingroup PkgMesh3MeshClasses + + The function object class `Mesh_edge_criteria_3` is a model of `MeshEdgeCriteria_3`. It + provides a bound for the size criterion. + + \cgalModels `MeshEdgeCriteria_3` + + \sa `MeshCriteria_3` + \sa `CGAL::Mesh_criteria_3` + \sa `MeshDomainField_3` + +*/ + template < typename Tr > class Mesh_edge_criteria_3 { typedef Mesh_edge_criteria_3 Self; public: + + /// \name Types + /// @{ + + /*! + Numerical type. + */ + typedef typename Tr::Geom_traits::FT FT; + + /// @} + typedef typename Tr::Vertex::Index Index; typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; typedef typename Tr::Bare_point Point_3; - /// Constructors + /// \name Creation + /// @{ + + /*! + Returns an object to serve as criteria for edges. + The argument `length_bound` is an upper bound + for the length of the edges which are used to discretize the curves. + Note that if one parameter is set to 0, then its corresponding criteria is ignored. + */ + Mesh_edge_criteria_3(const FT& value) : p_size_(new Mesh_3::internal::Sizing_field_container< Mesh_constant_domain_field_3 , @@ -107,14 +141,21 @@ public: // Nb: SFINAE to avoid wrong matches with built-in numerical types // as int. - template < typename Sizing_field > + + /*! + Returns an object to serve as criteria for edges. The type `SizingField` + must be a model of concept `MeshDomainField_3`. The behavior and semantic of the argument are the same + as above, except that the length + parameter is a functional instead of a constant. + */ + template < typename SizingField > Mesh_edge_criteria_3 ( - const Sizing_field& size, - std::enable_if_t::value>* = 0 + const SizingField& size, + std::enable_if_t::value>* = 0 ) { - p_size_ = new Mesh_3::internal::Sizing_field_container(size); diff --git a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h index 86972063b11..0e595d7a79b 100644 --- a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h @@ -27,6 +27,30 @@ namespace CGAL { +/*! + \ingroup PkgMesh3MeshClasses + + The class `Mesh_facet_criteria_3` is a model of `MeshFacetCriteria_3`. + It provides a uniform bound for the shape criterion, + a uniform or variable sizing field + for the size criterion and/or + a uniform or variable distance field + for the approximation error criterion. + + \tparam Tr must be identical to the nested type + `Triangulation` of the instance used as model of + `MeshComplex_3InTriangulation_3`. + + \cgalModels `MeshFacetCriteria_3` + + \sa `CGAL::Mesh_facet_topology` + \sa `MeshCriteria_3` + \sa `MeshFacetCriteria_3` + \sa `CGAL::Mesh_criteria_3` + \sa `MeshDomainField_3` + \sa `CGAL::make_mesh_3()` + +*/ template > class Mesh_facet_criteria_3 @@ -48,9 +72,36 @@ private: public: typedef CGAL::Tag_true Has_manifold_criterion; - /** - * @brief Constructor - */ +#ifdef DOXYGEN_RUNNING +/// \name Types +/// @{ + +/*! +Numerical type +@todo: In the code this typedef is private +*/ +typedef Tr::FT FT; + +/// @} +#endif + + + /// \name Creation + /// @{ + + /*! + Returns an object to serve as criteria for facets. + \param angle_bound is the lower bound for the angle in degrees of the + surface mesh facets. + \param radius_bound is a uniform upper bound + for the radius of the surface Delaunay balls. + \param distance_bound is an upper bound for the center-center distances + of the surface mesh facets. + \param topology is the set of topological constraints + which have to be verified by each surface facet. See + section \ref Mesh_3DelaunayRefinement for further details. + Note that if one parameter is set to 0, then its corresponding criteria is ignored. + */ template < typename Sizing_field, typename Sizing_field2 > Mesh_facet_criteria_3(const FT& angle_bound, const Sizing_field & radius_bound, @@ -69,6 +120,24 @@ public: init_topo(topology); } +#ifdef DOXYGEN_RUNNING + /*! + Returns an object to serve as criteria for facets. The types `SizingField` and + `DistanceField` must + be models of the concept `MeshDomainField_3`. The behavior and semantic of the arguments are the same + as above, except that the radius and distance bound parameters are + functionals instead of constants. + + @todo This one is only in the doc + */ + template + Mesh_facet_criteria_3(const FT& angle_bound, + const SizingField& radius_bound, + const DistanceField& distance_bound, + Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE); +#endif + /// @} + /// Destructor ~Mesh_facet_criteria_3() { } diff --git a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h index 4461e5ec478..f179ca9233d 100644 --- a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h +++ b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h @@ -209,12 +209,38 @@ public: } // end namespace Mesh_3 +/*! +\ingroup PkgMesh3Domains -template +The class `Mesh_polyhedron_3` provides a customized `Polyhedron_3` type. This type uses +as `PolyhedronItems_3` a customized type which adds data to the Vertex, Face and +Halfedge class. Those data are required to use the detection of sharp features. + +\tparam IGT stands for the geometric traits associated +to the meshing process. It must be a model of the two concepts +`PolyhedronTraits_3` and `IntersectionGeometricTraits_3`. + +\sa `CGAL::Polyhedron_3` +\sa `CGAL::Polyhedral_mesh_domain_with_features_3` + +*/ +template struct Mesh_polyhedron_3 { - typedef Polyhedron_3 > type; +#ifdef DOXYGEN_RUNNING + /// \name Types + /// @{ + + /*! + `CGAL::Polyhedron_3` type with customized `PolyhedronItems_3` + */ + typedef unspecified_type type; + + /// @} +#else + typedef Polyhedron_3 > type; typedef type Type; +#endif }; } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/Triangle_accessor_3.h b/Mesh_3/include/CGAL/Triangle_accessor_3.h index 03e8313e687..cba5e955c7d 100644 --- a/Mesh_3/include/CGAL/Triangle_accessor_3.h +++ b/Mesh_3/include/CGAL/Triangle_accessor_3.h @@ -34,6 +34,26 @@ class Triangle_accessor_3 { }; +/*! +\ingroup PkgMesh3Domains + +The class `Triangle_accessor_3` is a model for the concept `TriangleAccessor_3`. It is +designed to serve as accessor for objects of type `Polyhedron_3`. + +\attention Actually, the class `Triangle_accessor_3` is a partial specialization of the class +template `template +Triangle_accessor_3`. One may give another partial +specialization of this class to handle one's own polyhedron data structure. + +@todo Document the other partial specializations + +\tparam K is the geometric traits class. + +\cgalModels `TriangleAccessor_3` + +\sa `CGAL::Polyhedral_mesh_domain_3` + +*/ template < class K,class Items, template < class T, class I, class A> class T_HDS, @@ -42,10 +62,25 @@ class Triangle_accessor_3, K > { typedef Polyhedron_3 Polyhedron; public: + /// \name Types + /// @{ + /*! + Triangle type. + */ typedef typename K::Triangle_3 Triangle_3; + + /*! + Triangle iterator. + */ typedef typename Polyhedron::Facet_const_iterator Triangle_iterator; + + /*! + Triangle handle. + */ typedef typename Polyhedron::Facet_const_handle Triangle_handle; + /// @} + Triangle_accessor_3() { } Triangle_iterator triangles_begin(const Polyhedron& p) const From c97ce3ee5574c35b2df07296c96c39f473b5f40e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2023 10:30:03 +0100 Subject: [PATCH 018/156] Remove doc files --- Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h | 69 ---------------- .../doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h | 82 ------------------- 2 files changed, 151 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h deleted file mode 100644 index bdba19131c8..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_criteria_3.h +++ /dev/null @@ -1,69 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3MeshClasses - -The class `Mesh_cell_criteria_3` is a model of `MeshCellCriteria_3`. It provides, -for the mesh tetrahedra, -a uniform shape criteria -and a sizing field which may be a uniform or variable field. - -\tparam Tr must be identical to the nested type -`Triangulation` of the instance used as model of -`MeshComplex_3InTriangulation_3`. - -\cgalModels `MeshCellCriteria_3` - -\sa `MeshCriteria_3` -\sa `CGAL::Mesh_criteria_3` -\sa `CGAL::make_mesh_3()` - -*/ -template< typename Tr > -class Mesh_cell_criteria_3 { -public: - -/// \name Types -/// @{ - -/*! -Numerical type -*/ -typedef Tr::FT FT; - -/// @} - -/// \name Creation -/// @{ - -/*! -* Returns an object to serve as default criteria for cells. -* @param radius_edge_bound is the upper bound for the radius-edge ratio -* of the tetrahedra. -* @param radius_bound is a uniform upper bound -* for the circumradii of the tetrahedra in the mesh. See -* section \ref introsecparam for further details. -* @param min_radius_bound is a uniform lower bound for the -* circumradii of the tetrahedra in the mesh. -* Only cells with a circumradius larger than that -* bound will be refined. -* Note that if one parameter is set to 0, then its corresponding criteria is ignored. -*/ - Mesh_cell_criteria_3(const FT& radius_edge_bound, - const FT& radius_bound, - const FT& min_radius_bound = 0.); - -/*! -Returns an object to serve as default criteria for facets. The type `SizingField` must -be a model of the concept `MeshDomainField_3`. The behavior and semantic of the arguments are the same -as above, except that the radius bound parameter is a functional instead of a constant. -*/ - template - Mesh_cell_criteria_3(const FT& radius_edge_bound, - const SizingField& radius_bound, - const FT& min_radius_bound = 0.); - -/// @} - -}; /* end Mesh_cell_criteria_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h deleted file mode 100644 index bfbd79dfe39..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_facet_criteria_3.h +++ /dev/null @@ -1,82 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3MeshClasses - -The class `Mesh_facet_criteria_3` is a model of `MeshFacetCriteria_3`. -It provides a uniform bound for the shape criterion, -a uniform or variable sizing field -for the size criterion and/or -a uniform or variable distance field -for the approximation error criterion. - -\tparam Tr must be identical to the nested type -`Triangulation` of the instance used as model of -`MeshComplex_3InTriangulation_3`. - -\cgalModels `MeshFacetCriteria_3` - -\sa `CGAL::Mesh_facet_topology` -\sa `MeshCriteria_3` -\sa `MeshFacetCriteria_3` -\sa `CGAL::Mesh_criteria_3` -\sa `MeshDomainField_3` -\sa `CGAL::make_mesh_3()` - -*/ -template< typename Tr > -class Mesh_facet_criteria_3 { -public: - -/// \name Types -/// @{ - -/*! -Numerical type -*/ -typedef Tr::Geom_traits::FT FT; - -/// @} - -/// \name Creation -/// @{ - -/*! -Returns an object to serve as criteria for facets. -\param angle_bound is the lower bound for the angle in degrees of the -surface mesh facets. -\param radius_bound is a uniform upper bound -for the radius of the surface Delaunay balls. -\param distance_bound is an upper bound for the center-center distances -of the surface mesh facets. -\param topology is the set of topological constraints -which have to be verified by each surface facet. See -section \ref Mesh_3DelaunayRefinement for further details. -Note that if one parameter is set to 0, then its corresponding criteria is ignored. -\param min_radius_bound is a uniform lower bound for the radius of -the surface Delaunay balls. Only facets with a radius larger than that -bound will be refined. -*/ - Mesh_facet_criteria_3(const FT& angle_bound, - const FT& radius_bound, - const FT& distance_bound, - Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE, - const FT& min_radius_bound = 0.); - -/*! -Returns an object to serve as criteria for facets. The types `SizingField` and -`DistanceField` must -be models of the concept `MeshDomainField_3`. The behavior and semantic of the arguments are the same -as above, except that the radius and distance bound parameters are functionals instead of constants. -*/ - template - Mesh_facet_criteria_3(const FT& angle_bound, - const SizingField& radius_bound, - const DistanceField& distance_bound, - Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE, - const FT& min_radius_bound = 0.); - -/// @} - -}; /* end Mesh_facet_criteria_3 */ -} /* end namespace CGAL */ From cec7c3dccce46a1cb89bfd34df42bab0339bcbde Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2023 11:57:32 +0100 Subject: [PATCH 019/156] Fix some warnings --- .../Implicit_to_labeling_function_wrapper.h | 16 ++++++------- .../include/CGAL/Polyhedral_mesh_domain_3.h | 24 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h index 48bd6d03cfe..7ef8933b5a0 100644 --- a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h @@ -217,13 +217,13 @@ public: * \param position_vectors the vector of vector of signs. Each vector of positions describes a component. * \sa `Sign` */ - Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector >& vps) - : funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false)) + Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& implicit_functions, const std::vector >& position_vectors) + : funcs(implicit_functions), bmasks(position_vectors.size(), Bmask(funcs.size() * 2, false)) { CGAL_assertion(funcs.size() != 0); std::size_t mask_index = 0; - for (std::vector >::const_iterator mask_iter = vps.begin(), mask_end_iter = vps.end(); + for (std::vector >::const_iterator mask_iter = position_vectors.begin(), mask_end_iter = position_vectors.end(); mask_iter != mask_end_iter; ++mask_iter) { @@ -251,8 +251,8 @@ public: * * Position vectors are built automatically so that the union of components equals the union of the functions. */ - Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf) - : funcs(vf) + Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& implicit_functions) + : funcs(implicit_functions) { CGAL_assertion(funcs.size() != 0); @@ -282,13 +282,13 @@ public: * \param implicit_functions the vector of implicit functions. * \param position_strings the vector of strings. The strings contained in this vector must contain '+' or '-' only. Each string (vector of positions) describes a component. */ - Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector& vps) - : funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false)) + Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& implicit_functions, const std::vector& position_strings) + : funcs(implicit_functions), bmasks(position_strings.size(), Bmask(funcs.size() * 2, false)) { CGAL_assertion(funcs.size() != 0); std::size_t mask_index = 0; - for (std::vector::const_iterator mask_iter = vps.begin(), mask_end_iter = vps.end(); + for (std::vector::const_iterator mask_iter = position_strings.begin(), mask_end_iter = position_strings.end(); mask_iter != mask_end_iter; ++mask_iter) { diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index f944d1c7739..230863ee3de 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -355,9 +355,9 @@ public: /** - * 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}. + * 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 { @@ -386,9 +386,9 @@ public: /** - * 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. + * including `p`. It is set to the default value otherwise. */ struct Is_in_domain { @@ -411,12 +411,12 @@ public: typedef boost::mpl::vector Allowed_query_types; /** - * Returns true is the element \ccc{type} intersect properly any of the + * Returns true is 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 @@ -452,12 +452,12 @@ public: } /** - * 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 From 26369cb81b0e70453dfada9cb91998dc51880519 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2023 12:33:14 +0100 Subject: [PATCH 020/156] fixes --- .../CGAL/Mesh_constant_domain_field_3.h | 2 +- .../include/CGAL/Polyhedral_mesh_domain_3.h | 33 ++++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) 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 20de215efd5..fc5ea3f7538 100644 --- a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h +++ b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h @@ -115,7 +115,7 @@ public: */ void set_size(const FT& size, const int dim, const Index& index) { - values_.insert(std::make_pair(std::make_pair(dimension,index),size)); + values_.insert(std::make_pair(std::make_pair(dim,index),size)); } /// @} diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 230863ee3de..f1bf80dab4e 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -243,8 +243,11 @@ public: The inside of `bounding_polyhedron` will be meshed. */ - Polyhedral_mesh_domain_3(const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = nullptr) + Polyhedral_mesh_domain_3(const Polyhedron& bounding_polyhedron +#ifndef DOXYGEN_RUNNING + , CGAL::Random* p_rng = nullptr +#endif + ) : tree_() , bounding_tree_(&tree_) // the bounding tree is tree_ , p_rng_(p_rng) @@ -288,16 +291,19 @@ public: * Constructor from a sequence of polyhedral surfaces, and a bounding * polyhedral surface. * - * @param InputPolyhedraPtrIterator must an iterator of a sequence of - * pointers to polyhedra + * @tparam InputPolyhedraPtrIterator must an iterator of a sequence of + * pointers to polyhedra @todo fix what the type is * * @param bounding_polyhedron reference to the bounding surface */ template - Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin, - InputPolyhedraPtrIterator end, - const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = nullptr) + Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin + ,InputPolyhedraPtrIterator end + ,const Polyhedron& bounding_polyhedron +#ifndef DOXYGEN_RUNNING + ,CGAL::Random* p_rng = nullptr +#endif + ) : p_rng_(p_rng) , delete_rng_(false) { @@ -323,13 +329,16 @@ public: * surface. The domain will always answer false to "is_in_domain" * queries. * - * @param InputPolyhedraPtrIterator must an iterator of a sequence of + * @tparam InputPolyhedraPtrIterator must an iterator of a sequence of * pointers to polyhedra */ template - Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin, - InputPolyhedraPtrIterator end, - CGAL::Random* p_rng = nullptr) + Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin + , InputPolyhedraPtrIterator end +#ifndef DOXYGEN_RUNNING + , CGAL::Random* p_rng = nullptr +#endif + ) : p_rng_(p_rng) { if(begin != end) { From e9583a69d0654d139f0533cd4085c607ebbcbaff Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2023 12:38:50 +0100 Subject: [PATCH 021/156] fixes --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index f1bf80dab4e..66e7bf8f389 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -291,9 +291,11 @@ public: * Constructor from a sequence of polyhedral surfaces, and a bounding * polyhedral surface. * - * @tparam InputPolyhedraPtrIterator must an iterator of a sequence of - * pointers to polyhedra @todo fix what the type is + * @tparam InputPolyhedraPtrIterator must be a model of + * `ForwardIterator` and value type `Polyhedron*` * + * @param begin iterator for a sequence of pointers to polyhedra + * @param end iterator for a sequence of pointers to polyhedra * @param bounding_polyhedron reference to the bounding surface */ template From 90773e880618c96771b467876526ee1b435b5c47 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2023 12:41:17 +0100 Subject: [PATCH 022/156] fixes --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 66e7bf8f389..25005e5748b 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -328,11 +328,15 @@ public: * Constructor. * * Constructor from a sequence of polyhedral surfaces, without bounding - * surface. The domain will always answer false to "is_in_domain" + * surface. The domain will always answer `false` to `is_in_domain()` * queries. * - * @tparam InputPolyhedraPtrIterator must an iterator of a sequence of - * pointers to polyhedra + * @tparam InputPolyhedraPtrIterator must be a model of + * `ForwardIterator` and value type `Polyhedron*` + * + * @param begin iterator for a sequence of pointers to polyhedra + * @param end iterator for a sequence of pointers to polyhedra + * @param bounding_polyhedron reference to the bounding surface */ template Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin From fdcdd1a9eb0b82e725b53c4edb159f782fd8f49e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2023 12:50:07 +0100 Subject: [PATCH 023/156] fixes --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 25005e5748b..077dfcd3603 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -336,7 +336,6 @@ public: * * @param begin iterator for a sequence of pointers to polyhedra * @param end iterator for a sequence of pointers to polyhedra - * @param bounding_polyhedron reference to the bounding surface */ template Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin From b6531a76d19690a318d0e682d0b625bd7c6b32a6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2023 16:22:48 +0100 Subject: [PATCH 024/156] fixes --- Mesh_3/doc/Mesh_3/examples.txt | 3 +++ Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 11 ++++++----- Mesh_3/include/CGAL/Mesh_triangulation_3.h | 4 ++-- Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index ce8dbbb1b34..d9c2eb95d71 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -20,9 +20,12 @@ \example Mesh_3/mesh_optimization_example.cpp \example Mesh_3/mesh_optimization_lloyd_example.cpp \example Mesh_3/mesh_polyhedral_domain.cpp +\example Mesh_3/mesh_polyhedral_domain_sm.cpp \example Mesh_3/mesh_polyhedral_complex.cpp +\example Mesh_3/mesh_polyhedral_complex_sm.cpp \example Mesh_3/remesh_polyhedral_surface.cpp \example Mesh_3/mesh_polyhedral_domain_with_features.cpp +\example Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp \example Mesh_3/mesh_polyhedral_domain_with_features_sizing.cpp \example Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp \example Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index f782ea9ffef..7ef85ff8add 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -126,15 +126,16 @@ typedef Tr::FT FT; The behavior and semantic of the arguments are the same as above, except that the radius bound parameter is a functional instead of a constant. - @todo hide the `enable_if_t` */ template - Mesh_cell_criteria_3(const FT& radius_edge_bound, - const Sizing_field& radius_bound, - const FT& min_radius_bound = 0., - std::enable_if_t< + Mesh_cell_criteria_3(const FT& radius_edge_bound + ,const Sizing_field& radius_bound + ,const FT& min_radius_bound = 0. +#ifndef DOXYGEN_RUNNING + ,std::enable_if_t< Mesh_3::Is_mesh_domain_field_3::value >* = 0 +#endif ) { if (FT(0) != min_radius_bound) diff --git a/Mesh_3/include/CGAL/Mesh_triangulation_3.h b/Mesh_3/include/CGAL/Mesh_triangulation_3.h index 72d133a36d5..560d2983f41 100644 --- a/Mesh_3/include/CGAL/Mesh_triangulation_3.h +++ b/Mesh_3/include/CGAL/Mesh_triangulation_3.h @@ -206,9 +206,9 @@ and cell base classes are respectively `Vertex_base` and `Cell_base`. */ typedef unspecified_type type; -#endif + /// @} -/// @} +#endif }; // end struct Mesh_triangulation_3 } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 077dfcd3603..f1791c3d847 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -369,7 +369,7 @@ public: /** - * Constructs a set of `n points on the surface, and output them to + * 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`. */ From e1ac0e56e025e468cc2155161fe587027f308759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 17 May 2023 09:21:33 +0200 Subject: [PATCH 025/156] add new macro --- Documentation/doc/resources/1.8.13/BaseDoxyfile.in | 3 ++- Documentation/doc/resources/1.8.14/BaseDoxyfile.in | 3 ++- Documentation/doc/resources/1.8.20/BaseDoxyfile.in | 3 ++- Documentation/doc/resources/1.8.4/BaseDoxyfile.in | 3 ++- Documentation/doc/resources/1.9.3/BaseDoxyfile.in | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 69351ed254e..831c8ae9edf 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -2187,7 +2187,8 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_CLASS_1=NamedParameters1" \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ - CGAL_DEPRECATED + CGAL_DEPRECATED \ + CGAL_MSG_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 diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index 1a59e5d2d97..545860df0c4 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -2171,7 +2171,8 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_CLASS_1=NamedParameters1" \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ - CGAL_DEPRECATED + CGAL_DEPRECATED \ + CGAL_DEPRECATED_MSG # 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 diff --git a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in index bc0ca527ff2..b445780d98b 100644 --- a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in @@ -2255,7 +2255,8 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_CLASS_1=NamedParameters1" \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ - CGAL_DEPRECATED + CGAL_DEPRECATED \ + CGAL_DEPRECATED_MSG # 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 diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 70267fd649d..66cefaad4f2 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -1778,7 +1778,8 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_CLASS_1=NamedParameters1" \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ - CGAL_DEPRECATED + CGAL_DEPRECATED \ + CGAL_DEPRECATED_MSG # 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. diff --git a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in index 21d24dd6ecd..50fb0eddfe1 100644 --- a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in @@ -2267,7 +2267,8 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_CLASS_1=NamedParameters1" \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ - CGAL_DEPRECATED + CGAL_DEPRECATED \ + CGAL_DEPRECATED_MSG # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this From a78afb74bfe0295d83aaa311db31ab3fb56e541f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 17 May 2023 09:58:33 +0200 Subject: [PATCH 026/156] fix syntax --- Documentation/doc/resources/1.8.13/BaseDoxyfile.in | 2 +- Documentation/doc/resources/1.8.14/BaseDoxyfile.in | 2 +- Documentation/doc/resources/1.8.20/BaseDoxyfile.in | 2 +- Documentation/doc/resources/1.8.4/BaseDoxyfile.in | 2 +- Documentation/doc/resources/1.9.3/BaseDoxyfile.in | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 831c8ae9edf..caaa6b37982 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -2188,7 +2188,7 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED \ - CGAL_MSG_DEPRECATED + CGAL_DEPRECATED_MSG(name)= # 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 diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index 545860df0c4..e8f8336f112 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -2172,7 +2172,7 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED \ - CGAL_DEPRECATED_MSG + CGAL_DEPRECATED_MSG(name)= # 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 diff --git a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in index b445780d98b..822440929e0 100644 --- a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in @@ -2256,7 +2256,7 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED \ - CGAL_DEPRECATED_MSG + CGAL_DEPRECATED_MSG(name)= # 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 diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 66cefaad4f2..af6e905ef0f 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -1779,7 +1779,7 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED \ - CGAL_DEPRECATED_MSG + CGAL_DEPRECATED_MSG(name)= # 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. diff --git a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in index 50fb0eddfe1..6a80966eb82 100644 --- a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in @@ -2268,7 +2268,7 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED \ - CGAL_DEPRECATED_MSG + CGAL_DEPRECATED_MSG(name)= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this From 3ca05f491827ae5966f0e296090e83485174c92a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 17 May 2023 09:28:25 +0100 Subject: [PATCH 027/156] fixes --- Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h | 15 ++++++++------- Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 11 +++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) 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 65cb1690f93..44e555b9027 100644 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h @@ -115,14 +115,15 @@ public: @param value_outside the value attached to voxels outside of the domain to be meshed. It should be lower than `iso_value` @param error_bound is relative to the size of the image. - - @todo deal with p_rng */ - Gray_image_mesh_domain_3(const Image& image, - const Image_word_type iso_value, - const Image_word_type value_outside = 0., - const FT& error_bound = FT(1e-3), - CGAL::Random* p_rng = nullptr) + Gray_image_mesh_domain_3(const Image& image + ,const Image_word_type iso_value + ,const Image_word_type value_outside = 0. + ,const FT& error_bound = FT(1e-3) +#ifndef DOXYGEN_RUNNING + ,CGAL::Random* p_rng = nullptr +#endif + ) : Base(parameters::function = Wrapper(image, Transform(iso_value), Transform(iso_value)(value_outside)), diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 67b8ac251e1..47421dee532 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -120,10 +120,13 @@ public: radius of `bounding_sphere`. @todo Fix for `p_rng` */ - Implicit_mesh_domain_3(Function_ f, - const Sphere_3& bounding_sphere, - const FT& error_bound = FT(1e-6), - CGAL::Random* p_rng = nullptr) + Implicit_mesh_domain_3(Function_ f + ,const Sphere_3& bounding_sphere + ,const FT& error_bound = FT(1e-6) +#ifndef DOXYGEN_RUNNING + ,CGAL::Random* p_rng = nullptr +#endif + ) : 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) {} From a827d9ab676b760a22b198574cf3f42c787c1342 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 17 May 2023 11:11:25 +0100 Subject: [PATCH 028/156] fixes --- Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 47421dee532..59ad9706650 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -118,7 +118,6 @@ public: bisection is stopped when the length of the intersected segment is less than the product of `error_bound` by the radius of `bounding_sphere`. - @todo Fix for `p_rng` */ Implicit_mesh_domain_3(Function_ f ,const Sphere_3& bounding_sphere From bf79ecd8ad377cf4e32a2768740b6dde456a3991 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 17 May 2023 21:05:29 +0100 Subject: [PATCH 029/156] fixes --- Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h | 13 ++++++++----- Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) 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 34491151faa..9992d44a56f 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -120,11 +120,14 @@ public: The parameter `error_bound` is relative to the size of the image. @todo Document or comment the other parameters */ - Labeled_image_mesh_domain_3(const Image& image, - const FT& error_bound = FT(1e-3), - Subdomain_index value_outside = 0, - Null null = Null(), - CGAL::Random* p_rng = nullptr) + Labeled_image_mesh_domain_3(const Image& image + ,const FT& error_bound = FT(1e-3) + ,Subdomain_index value_outside = 0 + ,Null null = Null() +#ifndef DOXYGEN_RUNNING + ,CGAL::Random* p_rng = nullptr +#endif + ) : Base(parameters::function = Wrapper(image, Identity(), value_outside), parameters::bounding_object = compute_bounding_box(image), parameters::relative_error_bound = error_bound, diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index f1791c3d847..0e3937e4c7d 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -267,9 +267,12 @@ public: Using this constructor allows to mesh a polyhedral surface which is not closed, or has holes. The inside of `bounding_polyhedron` will be meshed. */ - Polyhedral_mesh_domain_3(const Polyhedron& p, - const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = nullptr) + Polyhedral_mesh_domain_3(const Polyhedron& p + ,const Polyhedron& bounding_polyhedron +#ifndef DOXYGEN_RUNNING + ,CGAL::Random* p_rng = nullptr +#endif + ) : tree_() , bounding_tree_(new AABB_tree_) , p_rng_(p_rng) @@ -425,8 +428,8 @@ public: typedef boost::mpl::vector Allowed_query_types; /** - * Returns true is the element `type` intersect properly any of the - * surface patches describing the either the domain boundary or some + * Returns `true` if the element `type` intersects properly any of the + * surface patches describing either the domain boundary or some * subdomain boundary. * `Type` is either `Segment_3`, `Ray_3` or `Line_3`. * Parameter index is set to the index of the intersected surface patch From 9f241c89c5471a1cd6d5fcdefba01aec4c351304 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 19 May 2023 18:42:56 +0100 Subject: [PATCH 030/156] rename template parameters --- .../Mesh_domain_with_polyline_features_3.h | 23 +++++++------- Mesh_3/include/CGAL/Mesh_triangulation_3.h | 30 +++++++++---------- .../include/CGAL/Polyhedral_mesh_domain_3.h | 4 ++- 3 files changed, 30 insertions(+), 27 deletions(-) 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 47b9bf495ad..9fa436fe842 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 @@ -523,7 +523,7 @@ features into any model of the `MeshDomain_3` concept. The 1-dimensional features are described as polylines whose endpoints are the added corners. -\tparam MeshDomain_3 is the type +\tparam MD is the type of the domain which should be extended. It has to be a model of the `MeshDomain_3` concept. @@ -536,16 +536,17 @@ It has to be a model of the `MeshDomain_3` concept. \sa `CGAL::Labeled_image_mesh_domain_3` */ -template < typename MeshDomain_3 > +template < typename MD > class Mesh_domain_with_polyline_features_3 - : public MeshDomain_3 + : public MD { - typedef Mesh_domain_with_polyline_features_3 Self; + typedef Mesh_domain_with_polyline_features_3 Self; + public: /// \name Types /// @{ - typedef typename MeshDomain_3::Surface_patch_index Surface_patch_index; - typedef typename MeshDomain_3::Subdomain_index Subdomain_index; + typedef typename MD::Surface_patch_index Surface_patch_index; + typedef typename MD::Subdomain_index Subdomain_index; typedef int Curve_index; typedef int Corner_index; @@ -553,14 +554,14 @@ public: typedef unspecified_type Index; #else typedef typename Mesh_3::internal::Index_generator_with_features< - typename MeshDomain_3::Subdomain_index, + typename MD::Subdomain_index, Surface_patch_index, Curve_index, Corner_index>::type Index; #endif typedef CGAL::Tag_true Has_features; - typedef typename MeshDomain_3::R::FT FT; + typedef typename MD::R::FT FT; /// @} #ifndef DOXYGEN_RUNNING @@ -569,9 +570,9 @@ public: typedef Curve_index Curve_segment_index; #endif - typedef typename MeshDomain_3::R Gt; + typedef typename MD::R Gt; typedef Gt R; - typedef typename MeshDomain_3::Point_3 Point_3; + typedef typename MD::Point_3 Point_3; #endif // DOXYGEN_RUNNING /// \name Creation @@ -581,7 +582,7 @@ public: template Mesh_domain_with_polyline_features_3(const T& ...o) - : MeshDomain_3(o...) + : MD(o...) , current_corner_index_(1) , current_curve_index_(1) , curves_aabb_tree_is_built(false) {} diff --git a/Mesh_3/include/CGAL/Mesh_triangulation_3.h b/Mesh_3/include/CGAL/Mesh_triangulation_3.h index 560d2983f41..ee7d53ab710 100644 --- a/Mesh_3/include/CGAL/Mesh_triangulation_3.h +++ b/Mesh_3/include/CGAL/Mesh_triangulation_3.h @@ -131,7 +131,7 @@ type to be used for the 3D triangulation embedding the mesh. \tparam MD must be a model of `MeshDomain_3`. -\tparam K_ must be a model of `MeshTriangulationTraits_3` or `Default` +\tparam Gt must be a model of `MeshTriangulationTraits_3` or `Default` and defaults to `Kernel_traits::%Kernel`. \tparam Concurrency_tag_ enables sequential versus parallel meshing and optimization algorithms. @@ -139,51 +139,51 @@ and defaults to `Kernel_traits::%Kernel`. and `Parallel_if_available_tag`. \tparam Vertex_base__ must be a model of `MeshVertexBase_3` or `Default` -and defaults to `Mesh_vertex_base_3`. +and defaults to `Mesh_vertex_base_3`. \tparam Cell_base_ must be a model of `MeshCellBase_3` or `Default` -and defaults to `Compact_mesh_cell_base_3`. +and defaults to `Compact_mesh_cell_base_3`. -\warning To improve the robustness of the meshing process, the input traits `K_` +\warning To improve the robustness of the meshing process, the input traits `Gt` is wrapped with the traits class `Robust_weighted_circumcenter_filtered_traits_3`. - The class `Robust_weighted_circumcenter_filtered_traits_3` upgrades the functors + The class `Robust_weighted_circumcenter_filtered_traits_3` upgrades the functors models of `Kernel::ConstructWeightedCircumcenter_3`, `Kernel::ComputeSquaredRadius_3`, and `Kernel::ComputeSquaredRadiusSmallestOrthogonalSphere_3` that are - provided by `K_` to use exact computations when the geometric configuration + provided by `Gt` to use exact computations when the geometric configuration is close to degenerate (e.g. almost coplanar points).
    Users should therefore be aware that the traits class of the triangulation - will have type `Robust_weighted_circumcenter_filtered_traits_3`. + will have type `Robust_weighted_circumcenter_filtered_traits_3`. \sa `make_mesh_3()` \sa `Mesh_complex_3_in_triangulation_3` */ template + class Gt = Default, + class ConcurrencyTag = Sequential_tag, + class VertexBase = Default, + class CellBase = Default> struct Mesh_triangulation_3 { private: - using K = typename Default::Lazy_get >::type; + using K = typename Default::Lazy_get >::type; using Geom_traits = typename details::Mesh_geom_traits_generator::type; using Indices_tuple = Mesh_3::internal::Indices_tuple_t; using Vertex_base = typename Default::Get< - Vertex_base_, + VertexBase, Mesh_vertex_generator_3 >::type; using Cell_base = typename Default::Get< - Cell_base_, + CellBase, Compact_mesh_cell_generator_3 >::type; using Concurrency_tag = - typename Default::Get::type; + typename Default::Get::type; struct Tds : public Triangulation_data_structure_3 {}; using Triangulation = diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 0e3937e4c7d..a07b9d106ff 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -129,6 +129,8 @@ the intersection tests and intersection computations for polyhedral boundary surfaces. This parameter has to be instantiated with a model of the concept `IntersectionGeometricTraits_3`. +@todo Document TriangleAccessor as it was template parameter. What about the two others? + \cgalModels `MeshDomain_3` \sa `IntersectionGeometricTraits_3` @@ -139,7 +141,7 @@ with a model of the concept `IntersectionGeometricTraits_3`. template class Polyhedral_mesh_domain_3 From b1137e9d83a98704f152e586d9decbad008702fc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 22 May 2023 12:19:44 +0100 Subject: [PATCH 031/156] various --- Mesh_3/doc/Mesh_3/Doxyfile.in | 5 ++ Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- Mesh_3/doc/Mesh_3/PackageDescription.txt | 1 - .../Implicit_to_labeling_function_wrapper.h | 1 - .../CGAL/Labeled_image_mesh_domain_3.h | 26 +++---- Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 35 +++++---- Mesh_3/include/CGAL/Mesh_facet_criteria_3.h | 76 ++++++++++--------- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 26 +++---- .../include/CGAL/Polyhedral_mesh_domain_3.h | 23 +++--- .../Polyhedral_mesh_domain_with_features_3.h | 40 ++++++---- 10 files changed, 124 insertions(+), 111 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index b228592fd95..b7f0fd99620 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -1,4 +1,9 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} +# custom options for this package + +EXTRACT_ALL = false +HIDE_UNDOC_CLASSES = true +WARN_IF_UNDOCUMENTED = false # macros to be used inside the code ALIASES += "cgalDescribePolylineType=A polyline is defined as a sequence of points, each pair of contiguous points defines a segment of the polyline. If the first and last points of the polyline are identical, the polyline is closed." diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index b7057a757a2..90afbe72b31 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -1428,6 +1428,6 @@ and Mariette Yvinec. It appeared first in the release 3.8 of \cgal. In 2013, Clément Jamin made the meshing and optimization algorithms parallel on multi-core shared-memory architectures. -\todo Add reference to paper or research report when it is available. + */ } /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 553358a202b..24a8d1786a3 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -41,7 +41,6 @@ /*! \addtogroup PkgMesh3Ref -\todo check generated documentation \cgalPkgDescriptionBegin{3D Mesh Generation,PkgMesh3} \cgalPkgPicture{Mesh_3/fig/multilabel_mesher_small.jpg} \cgalPkgSummaryBegin diff --git a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h index 7ef8933b5a0..cc4e8c96c9e 100644 --- a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h @@ -194,7 +194,6 @@ public: typedef std::vector Function_vector; #ifdef DOXYGEN_RUNNING //! - /// @todo different from code typedef typename Function::Point Point_3; #endif /// @} 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 9992d44a56f..da495b895a3 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -71,19 +71,20 @@ with a model of the concept `BisectionGeometricTraits_3`. An executable that uses `Labeled_image_mesh_domain_3` must be linked with the CGAL_ImageIO library. -@todo Document or comment the other parameters - \sa `BisectionGeometricTraits_3` \sa `CGAL::make_mesh_3()`. */ -template +template class CGAL_DEPRECATED_MSG ( "The class template `CGAL::Labeled_image_mesh_domain_3` is now deprecated. " @@ -117,14 +118,13 @@ public: /*! Construction from an image. - The parameter `error_bound` is relative to the size of the image. - @todo Document or comment the other parameters + @param error_bound is relative to the size of the image. */ Labeled_image_mesh_domain_3(const Image& image ,const FT& error_bound = FT(1e-3) +#ifndef DOXYGEN_RUNNING ,Subdomain_index value_outside = 0 ,Null null = Null() -#ifndef DOXYGEN_RUNNING ,CGAL::Random* p_rng = nullptr #endif ) @@ -146,13 +146,13 @@ public: parameters::p_rng = p_rng) {} - /// Destructor + // Destructor virtual ~Labeled_image_mesh_domain_3() {} using Base::bbox; private: - /// Returns a box enclosing image `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/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index 7ef85ff8add..2b8331a7b64 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -39,8 +39,6 @@ and a sizing field which may be a uniform or variable field. `Triangulation` of the instance used as model of `MeshComplex_3InTriangulation_3`. -@todo What to do with `Visitor_`? - \cgalModels `MeshCellCriteria_3` \sa `MeshCriteria_3` @@ -49,11 +47,22 @@ and a sizing field which may be a uniform or variable field. */ -template > +template +#endif + > class Mesh_cell_criteria_3 { public: + /// \name Types + /// @{ + + /*! + Numerical type + */ + typedef typename Tr::Geom_traits::FT FT; + typedef Visitor_ Visitor; typedef typename Visitor::Cell_quality Cell_quality; typedef typename Visitor::Is_cell_bad Is_cell_bad; @@ -67,22 +76,10 @@ private: typedef Mesh_cell_criteria_3 Self; + /// @} + public: -#ifdef DOXYGEN_RUNNING -/// \name Types -/// @{ - -/*! -Numerical type -@todo: In the code this typedef is private -*/ -typedef Tr::FT FT; - -/// @} -#endif - - /// \name Creation /// @{ @@ -162,10 +159,12 @@ typedef Tr::FT FT; return criteria_(tr, cell); } +#ifndef DOXYGEN_RUNNING void add(Abstract_criterion* criterion) { criteria_.add(criterion); } +#endif private: void init_radius_edge(const FT& radius_edge_bound) diff --git a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h index 7a14a3ea20b..d35f24e024f 100644 --- a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h @@ -51,11 +51,23 @@ namespace CGAL { \sa `CGAL::make_mesh_3()` */ -template > +template +#endif + > class Mesh_facet_criteria_3 { public: + + /// \name Types + /// @{ + + /*! + Numerical type + */ + typedef typename Tr::Geom_traits::FT FT; + typedef Visitor_ Visitor; typedef typename Visitor::Facet_quality Facet_quality; typedef typename Visitor::Is_facet_bad Is_facet_bad; @@ -65,31 +77,21 @@ private: typedef Mesh_3::Criteria Criteria; typedef typename Tr::Facet Facet; - typedef typename Tr::Geom_traits::FT FT; + typedef Mesh_facet_criteria_3 Self; public: typedef CGAL::Tag_true Has_manifold_criterion; -#ifdef DOXYGEN_RUNNING -/// \name Types -/// @{ - -/*! -Numerical type -@todo: In the code this typedef is private -*/ -typedef Tr::FT FT; - /// @} -#endif /// \name Creation /// @{ - /*! +#ifdef DOXYGEN_RUNNING + /*! Returns an object to serve as criteria for facets. \param angle_bound is the lower bound for the angle in degrees of the surface mesh facets. @@ -100,17 +102,32 @@ typedef Tr::FT FT; \param topology is the set of topological constraints which have to be verified by each surface facet. See section \ref Mesh_3DelaunayRefinement for further details. - Note that if one parameter is set to 0, then its corresponding - criteria is ignored. \param min_radius_bound is a uniform lower bound for the radius of the surface Delaunay balls. Only facets with a radius larger than that bound will be refined. -@todo Does the Note also apply to min_radius_bound? + @note If one parameter is set to 0, then its corresponding + criterion is ignored. */ - template < typename Sizing_field, typename Sizing_field2 > + Mesh_facet_criteria_3(const FT& angle_bound, + const FT& radius_bound, + const FT& distance_bound, + const Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE, + const FT& min_radius_bound = 0.); + +#endif + + + /*! + Returns an object to serve as criteria for facets. The types `SizingField` and + `DistanceField` must + be models of the concept `MeshDomainField_3`. The behavior and semantic of the arguments are the same + as above, except that the radius and distance bound parameters are + functionals instead of constants. + */ + template < typename Sizing_field, typename DistanceField > Mesh_facet_criteria_3(const FT& angle_bound, const Sizing_field & radius_bound, - const Sizing_field2& distance_bound, + const DistanceField& distance_bound, const Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE, const FT& min_radius_bound = 0.) { @@ -124,30 +141,15 @@ typedef Tr::FT FT; Mesh_3::Is_mesh_domain_field_3()); init_distance(distance_bound, - Mesh_3::Is_mesh_domain_field_3()); + Mesh_3::Is_mesh_domain_field_3()); init_topo(topology); } -#ifdef DOXYGEN_RUNNING - /*! - Returns an object to serve as criteria for facets. The types `SizingField` and - `DistanceField` must - be models of the concept `MeshDomainField_3`. The behavior and semantic of the arguments are the same - as above, except that the radius and distance bound parameters are - functionals instead of constants. - @todo This one is only in the doc - */ - template - Mesh_facet_criteria_3(const FT& angle_bound, - const SizingField& radius_bound, - const DistanceField& distance_bound, - Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE); -#endif /// @} -/// Destructor + // Destructor ~Mesh_facet_criteria_3() { } /** diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 17e69ff984c..ca0ed7f8fc3 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -85,7 +85,7 @@ surface, the sub-domain indices on both sides are known. \tparam Polyhedron stands for the type of the input polyhedral surface(s), model of `FaceListGraph`. -\tparam IGT_ stands for a geometric traits class +\tparam IGT stands for a geometric traits class providing the types and functors required to implement the intersection tests and intersection computations for polyhedral boundary surfaces. This parameter has to be instantiated @@ -96,16 +96,16 @@ with a model of the concept `IntersectionGeometricTraits_3`. \sa `IntersectionGeometricTraits_3` \sa `CGAL::make_mesh_3()`. \sa `CGAL::Mesh_domain_with_polyline_features_3` -\sa `CGAL::Polyhedral_mesh_domain_3` -\sa `CGAL::Mesh_polyhedron_3` +\sa `CGAL::Polyhedral_mesh_domain_3` +\sa `CGAL::Mesh_polyhedron_3` */ template < class IGT_, - class Polyhedron_ = typename Mesh_polyhedron_3::type, + class Polyhedron = typename Mesh_polyhedron_3::type, class TriangleAccessor=CGAL::Default > class Polyhedral_complex_mesh_domain_3 : public Mesh_domain_with_polyline_features_3< - Polyhedral_mesh_domain_3< Polyhedron_, + Polyhedral_mesh_domain_3< Polyhedron, IGT_, CGAL::Default, int, //Use_patch_id_tag @@ -113,14 +113,14 @@ class Polyhedral_complex_mesh_domain_3 { public: /// The base class - typedef Polyhedron_ Polyhedron; + typedef Polyhedron Polyhedron; typedef Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron, IGT_, CGAL::Default, int, Tag_true > > Base; /// @cond DEVELOPERS private: - typedef IGT_ IGT; + typedef Polyhedral_mesh_domain_3 BaseBase; typedef Polyhedral_complex_mesh_domain_3 Self; @@ -178,7 +178,7 @@ protected: boost::setS, // this avoids parallel edges boost::vecS, boost::undirectedS, - typename IGT::Point_3, + typename IGT_::Point_3, Set_of_indices> Featured_edges_copy_graph; /// @endcond @@ -378,7 +378,7 @@ public: typedef typename C3t3::Triangulation Tr; typedef typename Tr::Weighted_point Weighted_point; - typedef typename IGT::Sphere_3 Sphere_3; + typedef typename IGT_::Sphere_3 Sphere_3; typedef typename Polyhedron::Vertex_const_handle Vertex_const_handle; Tr& tr = c3t3.triangulation(); @@ -565,8 +565,8 @@ public: } // Shoot ray - typename IGT::Construct_ray_3 ray = IGT().construct_ray_3_object(); - typename IGT::Construct_vector_3 vector = IGT().construct_vector_3_object(); + typename IGT_::Construct_ray_3 ray = IGT_().construct_ray_3_object(); + typename IGT_::Construct_vector_3 vector = IGT_().construct_vector_3_object(); while(true) { Random_points_on_sphere_3 random_point(1.); @@ -598,7 +598,7 @@ public: Surface_patch_index face_id = r_domain_.make_surface_index(*opt); const std::pair& pair = r_domain_.incident_subdomains_indices(face_id); - const typename IGT::Triangle_3 triangle = + const typename IGT_::Triangle_3 triangle = BaseBase::template Primitive_type::datum(*opt); const Point_3& a = triangle[0]; const Point_3& b = triangle[1]; @@ -723,7 +723,7 @@ detect_features(FT angle_in_degree, G_copy g_copy; typedef typename boost::graph_traits::vertex_descriptor graph_vertex_descriptor; - typedef std::map P2vmap; // TODO: replace this map by and unordered_map P2vmap p2vmap; diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index a07b9d106ff..394ec07be02 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -129,7 +129,7 @@ the intersection tests and intersection computations for polyhedral boundary surfaces. This parameter has to be instantiated with a model of the concept `IntersectionGeometricTraits_3`. -@todo Document TriangleAccessor as it was template parameter. What about the two others? +@todo Comment TriangleAccessor as well as the others \cgalModels `MeshDomain_3` @@ -139,11 +139,14 @@ with a model of the concept `IntersectionGeometricTraits_3`. */ -template +template class Polyhedral_mesh_domain_3 { public: @@ -290,9 +293,6 @@ public: } /*! - * @todo was not in doxygen - * Constructor. - * * Constructor from a sequence of polyhedral surfaces, and a bounding * polyhedral surface. * @@ -329,9 +329,6 @@ public: } /*! - * @todo was not in doxygen - * Constructor. - * * Constructor from a sequence of polyhedral surfaces, without bounding * surface. The domain will always answer `false` to `is_in_domain()` * queries. @@ -360,7 +357,7 @@ public: bounding_tree_ = 0; } - /// Destructor + // Destructor ~Polyhedral_mesh_domain_3() { if(bounding_tree_ != 0 && bounding_tree_ != &tree_) { delete bounding_tree_; diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 0d01d415922..41fc06a2207 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -88,13 +88,13 @@ instantiated with a model of the concept \sa `CGAL::Mesh_polyhedron_3` */ template < class IGT_, - class Polyhedron_ = typename Mesh_polyhedron_3::type, + class Polyhedron = typename Mesh_polyhedron_3::type, class TriangleAccessor= CGAL::Default, class Patch_id=int, class Use_exact_intersection_construction_tag = Tag_true > class Polyhedral_mesh_domain_with_features_3 : public Mesh_domain_with_polyline_features_3< - Polyhedral_mesh_domain_3< Polyhedron_, + Polyhedral_mesh_domain_3< Polyhedron, IGT_, TriangleAccessor, Patch_id, @@ -102,7 +102,7 @@ class Polyhedral_mesh_domain_with_features_3 { typedef Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< - Polyhedron_, IGT_, TriangleAccessor, + Polyhedron, IGT_, TriangleAccessor, Patch_id, Use_exact_intersection_construction_tag > > Base; typedef boost::adjacency_list< @@ -112,7 +112,7 @@ class Polyhedral_mesh_domain_with_features_3 typename IGT_::Point_3, std::set > Featured_edges_copy_graph; public: - typedef Polyhedron_ Polyhedron; + typedef Polyhedron Polyhedron; typedef Polyhedron Polyhedron_type; // Index types @@ -166,8 +166,11 @@ public: The polyhedron `bounding_polyhedron` has to be closed and free of intersections. Its interior of `bounding_polyhedron` will be meshed. */ - Polyhedral_mesh_domain_with_features_3(const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = nullptr) + Polyhedral_mesh_domain_with_features_3(const Polyhedron& bounding_polyhedron +#ifndef DOXYGEN_RUNNING + ,CGAL::Random* p_rng = nullptr +#endif + ) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.resize(1); @@ -184,13 +187,17 @@ public: constructor above. */ CGAL_DEPRECATED - Polyhedral_mesh_domain_with_features_3(const std::string& filename, - CGAL::Random* p_rng = nullptr) + Polyhedral_mesh_domain_with_features_3(const std::string& filename +#ifndef DOXYGEN_RUNNING + ,CGAL::Random* p_rng = nullptr +#endif + ) : Base(p_rng) , borders_detected_(false) { load_from_file(filename.c_str()); } +#ifndef DOXYGEN_RUNNING // The following is needed, because otherwise, when a "const char*" is // passed, the constructors templates are a better match, than the // constructor with `std::string`. @@ -201,6 +208,7 @@ public: { load_from_file(filename); } +#endif #endif // not CGAL_NO_DEPRECATED_CODE /*! @@ -210,9 +218,12 @@ public: Using this constructor enables to mesh a polyhedral surface which is not closed, or has holes. The inside of `bounding_polyhedron` will be meshed. */ - Polyhedral_mesh_domain_with_features_3(const Polyhedron& polyhedron, - const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = nullptr) + Polyhedral_mesh_domain_with_features_3(const Polyhedron& polyhedron + ,const Polyhedron& bounding_polyhedron +#ifndef DOXYGEN_RUNNING + ,CGAL::Random* p_rng = nullptr +#endif + ) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.resize(2); @@ -287,15 +298,16 @@ public: /*! Detects sharp features and boundaries of the internal bounding polyhedron (and the potential internal polyhedron) - and inserts them as features of the domain. `angle_bound` gives the maximum + and inserts them as features of the domain. + @param angle_bound gives the maximum angle (in degrees) between the two normal vectors of adjacent triangles. For an edge of the polyhedron, if the angle between the two normal vectors of its incident facets is bigger than the given bound, then the edge is considered as a feature edge. */ - void detect_features(FT angle_in_degree = FT(60)) + void detect_features(FT angle_bound = FT(60)) { - detect_features(angle_in_degree, stored_polyhedra); + detect_features(angle_bound, stored_polyhedra); } void detect_borders(std::vector& p); From 1b4d4e0eb07edaf31eea75cac9c8bd72a9bb15e1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 22 May 2023 12:49:33 +0100 Subject: [PATCH 032/156] various --- Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h | 1 + 1 file changed, 1 insertion(+) 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 da495b895a3..952d4fc2187 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -118,6 +118,7 @@ public: /*! Construction from an image. + @param image the image @param error_bound is relative to the size of the image. */ Labeled_image_mesh_domain_3(const Image& image From 710219ed6d4be7d8d9742ce84b69e409a542fda0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 22 May 2023 13:12:46 +0100 Subject: [PATCH 033/156] various --- Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 1 - .../CGAL/Polyhedral_complex_mesh_domain_3.h | 11 +++++++--- .../include/CGAL/Polyhedral_mesh_domain_3.h | 11 +++++----- .../Polyhedral_mesh_domain_with_features_3.h | 21 ++++++++++++------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index 2b8331a7b64..09ccdd88357 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -72,7 +72,6 @@ private: typedef Mesh_3::Criteria Criteria; typedef typename Tr::Cell_handle Cell_handle; - typedef typename Tr::Geom_traits::FT FT; typedef Mesh_cell_criteria_3 Self; diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index ca0ed7f8fc3..98a766c9714 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -85,7 +85,7 @@ surface, the sub-domain indices on both sides are known. \tparam Polyhedron stands for the type of the input polyhedral surface(s), model of `FaceListGraph`. -\tparam IGT stands for a geometric traits class +\tparam IGT_ stands for a geometric traits class providing the types and functors required to implement the intersection tests and intersection computations for polyhedral boundary surfaces. This parameter has to be instantiated @@ -99,10 +99,15 @@ with a model of the concept `IntersectionGeometricTraits_3`. \sa `CGAL::Polyhedral_mesh_domain_3` \sa `CGAL::Mesh_polyhedron_3` */ +#ifdef DOXYGEN_RUNNING +template < class IGT, + class Polyhedron = typename Mesh_polyhedron_3::type, + class TriangleAccessor=CGAL::Default> +#else template < class IGT_, class Polyhedron = typename Mesh_polyhedron_3::type, - class TriangleAccessor=CGAL::Default - > + class TriangleAccessor=CGAL::Default> +#endif class Polyhedral_complex_mesh_domain_3 : public Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron, diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 394ec07be02..4dc89cf407e 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -129,8 +129,6 @@ the intersection tests and intersection computations for polyhedral boundary surfaces. This parameter has to be instantiated with a model of the concept `IntersectionGeometricTraits_3`. -@todo Comment TriangleAccessor as well as the others - \cgalModels `MeshDomain_3` \sa `IntersectionGeometricTraits_3` @@ -138,15 +136,16 @@ with a model of the concept `IntersectionGeometricTraits_3`. */ - +#ifdef DOXYGEN_RUNNING +template +#else template #endif - > class Polyhedral_mesh_domain_3 { public: diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 41fc06a2207..99c4123eead 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -87,14 +87,19 @@ instantiated with a model of the concept \sa `CGAL::Polyhedral_mesh_domain_3` \sa `CGAL::Mesh_polyhedron_3` */ -template < class IGT_, - class Polyhedron = typename Mesh_polyhedron_3::type, - class TriangleAccessor= CGAL::Default, - class Patch_id=int, - class Use_exact_intersection_construction_tag = Tag_true > +#ifdef DOXYGEN_RUNNING +template < class IGT + ,class Polyhedron = typename Mesh_polyhedron_3::type> +#else +template < class IGT_ + ,class Polyhedron_ = typename Mesh_polyhedron_3::type + ,class TriangleAccessor= CGAL::Default + ,class Patch_id=int + ,class Use_exact_intersection_construction_tag = Tag_true> +#endif class Polyhedral_mesh_domain_with_features_3 : public Mesh_domain_with_polyline_features_3< - Polyhedral_mesh_domain_3< Polyhedron, + Polyhedral_mesh_domain_3< Polyhedron_, IGT_, TriangleAccessor, Patch_id, @@ -102,7 +107,7 @@ class Polyhedral_mesh_domain_with_features_3 { typedef Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< - Polyhedron, IGT_, TriangleAccessor, + Polyhedron_, IGT_, TriangleAccessor, Patch_id, Use_exact_intersection_construction_tag > > Base; typedef boost::adjacency_list< @@ -112,7 +117,7 @@ class Polyhedral_mesh_domain_with_features_3 typename IGT_::Point_3, std::set > Featured_edges_copy_graph; public: - typedef Polyhedron Polyhedron; + typedef Polyhedron_ Polyhedron; typedef Polyhedron Polyhedron_type; // Index types From 585dc0f42458bd3b4e8225353de76af763dee2e0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 22 May 2023 13:36:24 +0100 Subject: [PATCH 034/156] various --- Mesh_3/doc/Mesh_3/Doxyfile.in | 1 + Mesh_3/doc/Mesh_3/PackageDescription.txt | 4 ++-- Mesh_3/doc/Mesh_3/dependencies | 2 +- Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h | 2 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 4 ++-- Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h | 4 ++-- Mesher_level/include/CGAL/Mesh_optimization_return_code.h | 5 ++++- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index b7f0fd99620..86ae0b5b5b4 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -9,6 +9,7 @@ WARN_IF_UNDOCUMENTED = false ALIASES += "cgalDescribePolylineType=A polyline is defined as a sequence of points, each pair of contiguous points defines a segment of the polyline. If the first and last points of the polyline are identical, the polyline is closed." INPUT += \ + ${CGAL_Mesher_level_INCLUDE_DIR}/CGAL/Mesh_optimization_return_code.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_triangulation_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_polyhedron_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_mesh_domain_3.h \ diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 24a8d1786a3..3e907c42686 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -85,7 +85,7 @@ related to the template parameters of some models of the main concepts: \cgalCRPSection{Classes} -- `CGAL::Mesh_triangulation_3` +- `CGAL::Mesh_triangulation_3` - `CGAL::Mesh_vertex_base_3` - `CGAL::Compact_mesh_cell_base_3` - `CGAL::Mesh_cell_base_3` @@ -102,7 +102,7 @@ and their associated classes: - `CGAL::Polyhedral_mesh_domain_3` - `CGAL::Polyhedral_mesh_domain_with_features_3` - `CGAL::Polyhedral_complex_mesh_domain_3` -- `CGAL::Mesh_domain_with_polyline_features_3` +- `CGAL::Mesh_domain_with_polyline_features_3` - `CGAL::Mesh_polyhedron_3` - `CGAL::Triangle_accessor_3,K>` - `CGAL::Implicit_multi_domain_to_labeling_function_wrapper` diff --git a/Mesh_3/doc/Mesh_3/dependencies b/Mesh_3/doc/Mesh_3/dependencies index be614f85b31..5f512007139 100644 --- a/Mesh_3/doc/Mesh_3/dependencies +++ b/Mesh_3/doc/Mesh_3/dependencies @@ -12,6 +12,6 @@ TDS_3 Polyhedron Miscellany Mesh_2 +Mesher_level Polygon_mesh_processing SMDS_3 - diff --git a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h index cc4e8c96c9e..8c1c880cb70 100644 --- a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h @@ -161,7 +161,7 @@ The second one matches the locus of points satisfying f1(p)>0 and f2(p)<0 and f3 This parameter stands for a model of the concept `ImplicitFunction` described in the surface mesh generation package. The number types `ImplicitFunction::FT` and `BGT::FT` are required to match. -\sa `Labeled_mesh_domain_3`. +\sa `CGAL::Labeled_mesh_domain_3`. */ diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 6e810c060c4..3782f9d46f4 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -340,8 +340,8 @@ The function type can be any model of the concept `Callable` compatible with the \cgalModels `MeshDomain_3` -\sa `Implicit_multi_domain_to_labeling_function_wrapper` -\sa `CGAL::make_mesh_3()`. +\sa `CGAL::Implicit_multi_domain_to_labeling_function_wrapper` +\sa `CGAL::make_mesh_3()` */ template` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::Mesh_domain_with_polyline_features_3` \sa `CGAL::Polyhedral_mesh_domain_3` \sa `CGAL::Mesh_polyhedron_3` */ diff --git a/Mesher_level/include/CGAL/Mesh_optimization_return_code.h b/Mesher_level/include/CGAL/Mesh_optimization_return_code.h index 4717055c530..3643395667c 100644 --- a/Mesher_level/include/CGAL/Mesh_optimization_return_code.h +++ b/Mesher_level/include/CGAL/Mesh_optimization_return_code.h @@ -18,7 +18,10 @@ #define CGAL_MESH_OPTIMIZATION_RETURN_CODE_H namespace CGAL { - + /*! + * \brief bla bla + @todo document correctly + */ enum Mesh_optimization_return_code { MESH_OPTIMIZATION_UNKNOWN_ERROR=-1, From 95f150a16ce6cc0bf8eea69470d3ed64b0351153 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 22 May 2023 16:51:33 +0100 Subject: [PATCH 035/156] various --- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 18 +++++++++++------- .../Polyhedral_mesh_domain_with_features_3.h | 6 +++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 8a284018e13..8550178efb4 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -101,24 +101,28 @@ with a model of the concept `IntersectionGeometricTraits_3`. */ #ifdef DOXYGEN_RUNNING template < class IGT, - class Polyhedron = typename Mesh_polyhedron_3::type, + class Polyhedron = typename Mesh_polyhedron_3::type, class TriangleAccessor=CGAL::Default> -#else -template < class IGT_, - class Polyhedron = typename Mesh_polyhedron_3::type, - class TriangleAccessor=CGAL::Default> -#endif class Polyhedral_complex_mesh_domain_3 : public Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron, + IGT> +#else +template < class IGT_, + class Polyhedron_ = typename Mesh_polyhedron_3::type, + class TriangleAccessor=CGAL::Default> +class Polyhedral_complex_mesh_domain_3 + : public Mesh_domain_with_polyline_features_3< + Polyhedral_mesh_domain_3< Polyhedron_, IGT_, CGAL::Default, int, //Use_patch_id_tag Tag_true > >//Use_exact_intersection_tag +#endif { public: /// The base class - typedef Polyhedron Polyhedron; + typedef Polyhedron_ Polyhedron; typedef Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron, IGT_, CGAL::Default, diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 99c4123eead..8361c3edd2b 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -90,13 +90,16 @@ instantiated with a model of the concept #ifdef DOXYGEN_RUNNING template < class IGT ,class Polyhedron = typename Mesh_polyhedron_3::type> +class Polyhedral_mesh_domain_with_features_3 + : public Mesh_domain_with_polyline_features_3< + Polyhedral_mesh_domain_3< Polyhedron, + IGT> > #else template < class IGT_ ,class Polyhedron_ = typename Mesh_polyhedron_3::type ,class TriangleAccessor= CGAL::Default ,class Patch_id=int ,class Use_exact_intersection_construction_tag = Tag_true> -#endif class Polyhedral_mesh_domain_with_features_3 : public Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron_, @@ -104,6 +107,7 @@ class Polyhedral_mesh_domain_with_features_3 TriangleAccessor, Patch_id, Use_exact_intersection_construction_tag > > +#endif { typedef Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< From 78ab4fab704560c0ae8806716d7917e94349423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 22 May 2023 18:24:06 +0200 Subject: [PATCH 036/156] add special cases for header only packages --- Documentation/doc/CMakeLists.txt | 9 +++++++++ Mesh_3/doc/Mesh_3/dependencies | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index bec8ffbb22f..13853e56735 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -402,6 +402,15 @@ else() endforeach() endif() +#special cases +foreach(pkg "Mesh_level") + if(CGAL_BRANCH_BUILD) + set(CGAL_${pkg}_INCLUDE_DIR "${CGAL_ROOT}/${pkg}/include") + else() + set(CGAL_${pkg}_INCLUDE_DIR "${CGAL_ROOT}/include") + endif() +endforeach() + option(CGAL_BUILD_THREE_DOC "Build the documentation of the Three package" OFF) if(NOT CGAL_BUILD_THREE_DOC) diff --git a/Mesh_3/doc/Mesh_3/dependencies b/Mesh_3/doc/Mesh_3/dependencies index 5f512007139..c8703db0782 100644 --- a/Mesh_3/doc/Mesh_3/dependencies +++ b/Mesh_3/doc/Mesh_3/dependencies @@ -12,6 +12,5 @@ TDS_3 Polyhedron Miscellany Mesh_2 -Mesher_level Polygon_mesh_processing SMDS_3 From 79ce772e71f56f7bfac7aba96a6c74d0cc2a7a58 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 22 May 2023 18:46:09 +0100 Subject: [PATCH 037/156] various --- Mesh_3/doc/Mesh_3/Concepts/MeshCriteria_3.h | 3 ++- Mesh_3/doc/Mesh_3/Concepts/MeshPolyline_3.h | 2 +- Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h | 10 +++++----- Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 17 +++++++---------- Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 2 +- .../include/CGAL/Mesh_constant_domain_field_3.h | 14 +++++++------- Mesh_3/include/CGAL/Mesh_edge_criteria_3.h | 2 +- Mesh_3/include/CGAL/Mesh_facet_criteria_3.h | 4 ++-- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 2 +- .../include/CGAL/Sizing_field_with_aabb_tree.h | 14 +++++++------- 10 files changed, 34 insertions(+), 36 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCriteria_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCriteria_3.h index ea4a1f33ea3..07cd4f12acd 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCriteria_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCriteria_3.h @@ -16,9 +16,10 @@ The concept `MeshCriteria_3` encapsulates these concepts. \sa `MeshFacetCriteria_3` \sa `MeshCellCriteria_3` +\sa `MeshCriteriaWithFeatures_3` \sa `CGAL::make_mesh_3()` \sa `CGAL::refine_mesh_3()` -\sa `MeshCriteriaWithFeatures_3` + */ diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshPolyline_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshPolyline_3.h index bfe6e4b8d98..b2a0fb4fa9c 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshPolyline_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshPolyline_3.h @@ -2,7 +2,7 @@ \ingroup PkgMesh3SecondaryConcepts \cgalConcept -The concept `MeshPolyline_3` implements a container of points designed to represent a polyline (i.e.\ a sequence of points). +The concept `MeshPolyline_3` implements a container of points designed to represent a polyline (i.e., a sequence of points). Types and functions provided in this concept are such as standard template library containers are natural models of this concept. diff --git a/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h b/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h index 03f9ff4880a..958e64ea360 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h @@ -19,19 +19,19 @@ public: /// @{ /*! -Triangle type. Must be a model of DefaultConstructible and -CopyConstructible. +Triangle type. Must be a model of `DefaultConstructible` and +`CopyConstructible`. */ typedef unspecified_type Triangle_3; /*! -Triangle iterator type. Must be a model of InputIterator. +Triangle iterator type. Must be a model of `InputIterator`. */ typedef unspecified_type Triangle_iterator; /*! -Handle to a `Triangle_3`. Must be -constructible from `Triangle_iterator`. It may be `Triangle_Iterator` itself. +%Handle to a `Triangle_3`. Must be +constructible from `Triangle_iterator`. It may be `Triangle_iterator` itself. */ typedef unspecified_type Triangle_handle; diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 59ad9706650..b8c1d72e0bd 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -75,9 +75,12 @@ is a relative error bound expressed as a ratio to the bounding sphere radius. \sa `CGAL::make_mesh_3()`. */ -template > +template +#endif + > class CGAL_DEPRECATED_MSG ( "The class template `CGAL::Implicit_mesh_domain_3` is now deprecated. " @@ -95,12 +98,6 @@ public: typedef typename Base::FT FT; typedef BGT Geom_traits; - /** - * Constructor - * @param f the function which negative values defines the domain - * @param bounding_sphere a bounding sphere of the domain - * @param error_bound the error bound relative to the sphere radius - */ /// \name Creation /// @{ @@ -131,7 +128,7 @@ public: /// @} - /// Destructor + // Destructor virtual ~Implicit_mesh_domain_3() {} using Base::bbox; diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index 09ccdd88357..eab9f794440 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -145,7 +145,7 @@ public: /// @} - /// Destructor + // Destructor ~Mesh_cell_criteria_3() { } /** 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 fc5ea3f7538..46b23a408c3 100644 --- a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h +++ b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h @@ -37,7 +37,7 @@ namespace CGAL { * a piecewise constant field, i.e. a sizing field with a constant size on each subpart * of the domain. * -* @tparam Gt is the geometric traits class. It must match the type `Triangulation::Geom_traits`, +* @tparam GT is the geometric traits class. It must match the type `Triangulation::Geom_traits`, * where `Triangulation` is the nested type of the model of `MeshComplex_3InTriangulation_3` used * in the meshing process. * @@ -46,7 +46,7 @@ namespace CGAL { * * @cgalModels `MeshDomainField_3` */ -template +template class Mesh_constant_domain_field_3 { public: @@ -56,19 +56,19 @@ public: /*! * Numerical type. */ - typedef typename Gt::FT FT; + typedef typename GT::FT FT; /*! * Point type. */ #ifdef DOXYGEN_RUNNING - typedef Gt::Point_3 Point_3; + typedef GT::Point_3 Point_3; #else typedef typename boost::mpl::eval_if_c< - internal::Has_nested_type_Bare_point::value, - typename internal::Bare_point_type, - boost::mpl::identity + internal::Has_nested_type_Bare_point::value, + typename internal::Bare_point_type, + boost::mpl::identity >::type Point_3; #endif diff --git a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h index a297dd42e0f..e7f3c4fa983 100644 --- a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h @@ -134,7 +134,7 @@ public: * break all the surface topology guarantees of the meshing algorithm. * It is not guaranteed to be exactly respected in the output mesh. * - * Note that if one parameter is set to 0, then its corresponding criterion is ignored. + * \note if one parameter is set to 0, then its corresponding criterion is ignored. */ Mesh_edge_criteria_3(const FT& length_bound, const FT& min_length_bound = 0) diff --git a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h index d35f24e024f..b35a7e78f95 100644 --- a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h @@ -43,11 +43,11 @@ namespace CGAL { \cgalModels `MeshFacetCriteria_3` - \sa `CGAL::Mesh_facet_topology` \sa `MeshCriteria_3` \sa `MeshFacetCriteria_3` - \sa `CGAL::Mesh_criteria_3` \sa `MeshDomainField_3` + \sa `CGAL::Mesh_facet_topology` + \sa `CGAL::Mesh_criteria_3` \sa `CGAL::make_mesh_3()` */ diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 8550178efb4..5f707903fbb 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -106,7 +106,7 @@ template < class IGT, class Polyhedral_complex_mesh_domain_3 : public Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron, - IGT> + IGT> > #else template < class IGT_, class Polyhedron_ = typename Mesh_polyhedron_3::type, diff --git a/Mesh_3/include/CGAL/Sizing_field_with_aabb_tree.h b/Mesh_3/include/CGAL/Sizing_field_with_aabb_tree.h index b3a0379c989..1104b45322e 100644 --- a/Mesh_3/include/CGAL/Sizing_field_with_aabb_tree.h +++ b/Mesh_3/include/CGAL/Sizing_field_with_aabb_tree.h @@ -52,7 +52,7 @@ namespace CGAL { * protecting ball will intersect a surface patch to which the * corresponding vertex does not belong. * -* @tparam GeomTraits is the geometric traits class. It must match the type `Triangulation::Geom_traits`, +* @tparam GT is the geometric traits class. It must match the type `Triangulation::Geom_traits`, * where `Triangulation` is the nested type of the model of `MeshComplex_3InTriangulation_3` used * in the meshing process. * @tparam MeshDomain is the type of the domain. It must be a model of `MeshDomainWithFeatures_3`, @@ -61,7 +61,7 @@ namespace CGAL { * @cgalModels `MeshDomainField_3` */ -template struct Sizing_field_with_aabb_tree { - using FT = typename GeomTraits::FT; - using Point_3 = typename GeomTraits::Point_3; + using FT = typename GT::FT; + using Point_3 = typename GT::Point_3; using Index = typename MeshDomain::Index; private: @@ -89,7 +89,7 @@ private: typedef std::vector Corners_incident_patches; typedef std::vector Curves_incident_patches; - typedef GeomTraits Kernel_; + typedef GT Kernel_; typedef CGAL::Delaunay_triangulation_3 Dt; using Input_facets_AABB_tree = typename CGAL::Default::Get< @@ -532,8 +532,8 @@ public: d_ptr->domain.curves_aabb_tree().traversal(p, curves_projection_traits); //Compute distance to the curve on which p lies - typedef typename GeomTraits::Segment_3 Segment_3; - typedef typename GeomTraits::Plane_3 Plane_3; + typedef typename GT::Segment_3 Segment_3; + typedef typename GT::Plane_3 Plane_3; const typename Input_curves_AABB_tree_::Point_and_primitive_id& ppid = d_ptr->domain.curves_aabb_tree().closest_point_and_primitive(p); From c4d6c232181458655b3f7f83e112d7f2beb2fb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 23 May 2023 08:43:52 +0200 Subject: [PATCH 038/156] add macro --- Documentation/doc/resources/1.9.6/BaseDoxyfile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/doc/resources/1.9.6/BaseDoxyfile.in b/Documentation/doc/resources/1.9.6/BaseDoxyfile.in index 5e86cb89cc1..6759b86cc65 100644 --- a/Documentation/doc/resources/1.9.6/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.9.6/BaseDoxyfile.in @@ -655,7 +655,9 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_CLASS_1=NamedParameters1" \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ - CGAL_DEPRECATED + CGAL_DEPRECATED \ + CGAL_DEPRECATED_MSG(name)= + #--------------------------------------------------------------------------- # Configuration options related to external references From 0c29013c3d45cb49505127e1f69503bacbc7f087 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 23 May 2023 09:58:41 +0100 Subject: [PATCH 039/156] Polish --- .../doc/Mesh_3/Concepts/MeshCellCriteria_3.h | 2 +- .../Concepts/MeshDomainWithFeatures_3.h | 6 ++--- Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h | 2 +- .../doc/Mesh_3/Concepts/MeshEdgeCriteria_3.h | 2 +- .../doc/Mesh_3/Concepts/TriangleAccessor_3.h | 5 ++-- Mesh_3/include/CGAL/Triangle_accessor_3.h | 27 ++++++++++--------- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCellCriteria_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCellCriteria_3.h index d3b0b83f0a6..242c25189b5 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCellCriteria_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCellCriteria_3.h @@ -26,7 +26,7 @@ public: /// @{ /*! -Handle type for the cells of the +%Handle type for the cells of the triangulation. Must match the `Cell_handle` type in the triangulation type used by the mesh generation function. */ diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h index 18e97b9a275..8e91075c581 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h @@ -17,7 +17,7 @@ between two ordered points on the same curve. \cgalRefines{MeshDomain_3} -\cgalHasModel `CGAL::Mesh_domain_with_polyline_features_3` +\cgalHasModel `CGAL::Mesh_domain_with_polyline_features_3` \cgalHasModel `CGAL::Polyhedral_mesh_domain_with_features_3` \sa `MeshDomain_3` @@ -47,7 +47,7 @@ Point type. typedef unspecified_type Point_3; /*! -Type of indices for curves (i.e. \f$ 1\f$-dimensional features) +Type of indices for curves (i.e., \f$ 1\f$-dimensional features) of the input domain. Must be a model of CopyConstructible, Assignable, DefaultConstructible and LessThanComparable. The default constructed value must be the value of an edge which @@ -56,7 +56,7 @@ does not approximate a 1-dimensional feature of the input domain. typedef unspecified_type Curve_index; /*! -Type of indices for corners (i.e.\f$ 0\f$--dimensional features) +Type of indices for corners (i.e., \f$ 0\f$--dimensional features) of the input domain. Must be a model of CopyConstructible, Assignable, DefaultConstructible and LessThanComparable. diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h index 240f9b0f1fb..929790c0d46 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h @@ -29,7 +29,7 @@ A segment, ray or line is said to intersect properly the domain boundary if it includes points which are strictly inside and strictly outside the domain (resp. the subdomain). -\cgalHasModel `CGAL::Polyhedral_mesh_domain_3` +\cgalHasModel `CGAL::Polyhedral_mesh_domain_3` \cgalHasModel `CGAL::Labeled_mesh_domain_3` \sa `MeshVertexBase_3` diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshEdgeCriteria_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshEdgeCriteria_3.h index 4c044751069..50b9374fa98 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshEdgeCriteria_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshEdgeCriteria_3.h @@ -46,7 +46,7 @@ typedef unspecified_type FT; /*! -Returns the value of the sizing field (i.e.\ the maximum edge length) at point `p`. +Returns the value of the sizing field (i.e., the maximum edge length) at point `p`. */ FT sizing_field(const Point_3& p); diff --git a/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h b/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h index 958e64ea360..5df33f35db1 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h @@ -5,9 +5,8 @@ The concept `TriangleAccessor_3` represents an accessor to a triangulated polyhedral surface, intersection free and without boundaries. -\cgalHasModel `CGAL::Triangle_accessor_3,K>` +\cgalHasModel `CGAL::Triangle_accessor_3` -\sa `CGAL::Polyhedral_mesh_domain_3` \sa `CGAL::make_mesh_3()` */ @@ -36,7 +35,7 @@ constructible from `Triangle_iterator`. It may be `Triangle_iterator` itself. typedef unspecified_type Triangle_handle; /*! -Polyhedron type. +Polyhedron type which must be a model of `FaceGraph`. */ typedef unspecified_type Polyhedron; diff --git a/Mesh_3/include/CGAL/Triangle_accessor_3.h b/Mesh_3/include/CGAL/Triangle_accessor_3.h index cba5e955c7d..578833fd494 100644 --- a/Mesh_3/include/CGAL/Triangle_accessor_3.h +++ b/Mesh_3/include/CGAL/Triangle_accessor_3.h @@ -37,23 +37,26 @@ class Triangle_accessor_3 { /*! \ingroup PkgMesh3Domains -The class `Triangle_accessor_3` is a model for the concept `TriangleAccessor_3`. It is -designed to serve as accessor for objects of type `Polyhedron_3`. +The class `Triangle_accessor_3` is a model for the concept +`TriangleAccessor_3`. It is no longer used in the 3D Mesh +Generation package, and it is only kept for backward compatibility. -\attention Actually, the class `Triangle_accessor_3` is a partial specialization of the class -template `template -Triangle_accessor_3`. One may give another partial -specialization of this class to handle one's own polyhedron data structure. - -@todo Document the other partial specializations +\attention Actually, the class generic class template of +`Triangle_accessor_3` must not be used. Partial specializations +are provided for `CGAL::Polyhedron` and `CGAL::Graph_with_descriptor_with_graph>`. +\tparam Polyhdron must be model of FaceGraph \tparam K is the geometric traits class. \cgalModels `TriangleAccessor_3` - -\sa `CGAL::Polyhedral_mesh_domain_3` - */ + +#ifdef DOXYGEN_RUNNING +template +class Triangle_accessor_3 +{}; + +#else template < class K,class Items, template < class T, class I, class A> class T_HDS, @@ -142,7 +145,7 @@ public: return Triangle_3(a,b,c); } }; - +#endif } // end namespace CGAL From bc45a0019425a03d5e31cbf993204ed95603e71e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 25 May 2023 12:08:01 +0200 Subject: [PATCH 040/156] Undocument TriangleAccessor_3 and CGAL::Triangle_accessor_3 as they are unused --- .../doc/Mesh_3/Concepts/TriangleAccessor_3.h | 65 ------------------- Mesh_3/doc/Mesh_3/Doxyfile.in | 1 - Mesh_3/doc/Mesh_3/PackageDescription.txt | 1 - Mesh_3/include/CGAL/Triangle_accessor_3.h | 25 ------- 4 files changed, 92 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h diff --git a/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h b/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h deleted file mode 100644 index 5df33f35db1..00000000000 --- a/Mesh_3/doc/Mesh_3/Concepts/TriangleAccessor_3.h +++ /dev/null @@ -1,65 +0,0 @@ -/*! -\ingroup PkgMesh3SecondaryConcepts -\cgalConcept - -The concept `TriangleAccessor_3` represents an accessor to a triangulated polyhedral -surface, intersection free and without boundaries. - -\cgalHasModel `CGAL::Triangle_accessor_3` - -\sa `CGAL::make_mesh_3()` - -*/ - -class TriangleAccessor_3 { -public: - -/// \name Types -/// @{ - -/*! -Triangle type. Must be a model of `DefaultConstructible` and -`CopyConstructible`. -*/ -typedef unspecified_type Triangle_3; - -/*! -Triangle iterator type. Must be a model of `InputIterator`. -*/ -typedef unspecified_type Triangle_iterator; - -/*! -%Handle to a `Triangle_3`. Must be -constructible from `Triangle_iterator`. It may be `Triangle_iterator` itself. -*/ -typedef unspecified_type Triangle_handle; - -/*! -Polyhedron type which must be a model of `FaceGraph`. -*/ -typedef unspecified_type Polyhedron; - -/// @} - -/// \name Operations -/// @{ - -/*! -Returns a `Triangle_iterator` to visit the triangles of polyhedron `p`. -*/ -Triangle_iterator triangles_begin(Polyhedron p); - -/*! -Returns the past-the-end iterator for the above iterator. -*/ -Triangle_iterator triangles_end(Polyhedron p); - -/*! -Returns a `Triangle_3` -object from handle `h`. -*/ -Triangle_3 triangle(Triangle_handle h); - -/// @} - -}; /* end TriangleAccessor_3 */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 86ae0b5b5b4..741c77a18f5 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -30,7 +30,6 @@ INPUT += \ ${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/Triangle_accessor_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_criteria_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_constant_domain_field_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_cell_criteria_3.h \ diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 3e907c42686..c3b82d6b25b 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -104,7 +104,6 @@ and their associated classes: - `CGAL::Polyhedral_complex_mesh_domain_3` - `CGAL::Mesh_domain_with_polyline_features_3` - `CGAL::Mesh_polyhedron_3` -- `CGAL::Triangle_accessor_3,K>` - `CGAL::Implicit_multi_domain_to_labeling_function_wrapper` - `CGAL::Implicit_mesh_domain_3` (deprecated) - `CGAL::Labeled_image_mesh_domain_3` (deprecated) diff --git a/Mesh_3/include/CGAL/Triangle_accessor_3.h b/Mesh_3/include/CGAL/Triangle_accessor_3.h index 578833fd494..03c091ccdb4 100644 --- a/Mesh_3/include/CGAL/Triangle_accessor_3.h +++ b/Mesh_3/include/CGAL/Triangle_accessor_3.h @@ -33,30 +33,6 @@ class Triangle_accessor_3 { typedef typename Polyhedron::Error_bad_match Error_bad_match; }; - -/*! -\ingroup PkgMesh3Domains - -The class `Triangle_accessor_3` is a model for the concept -`TriangleAccessor_3`. It is no longer used in the 3D Mesh -Generation package, and it is only kept for backward compatibility. - -\attention Actually, the class generic class template of -`Triangle_accessor_3` must not be used. Partial specializations -are provided for `CGAL::Polyhedron` and `CGAL::Graph_with_descriptor_with_graph>`. - -\tparam Polyhdron must be model of FaceGraph -\tparam K is the geometric traits class. - -\cgalModels `TriangleAccessor_3` -*/ - -#ifdef DOXYGEN_RUNNING -template -class Triangle_accessor_3 -{}; - -#else template < class K,class Items, template < class T, class I, class A> class T_HDS, @@ -145,7 +121,6 @@ public: return Triangle_3(a,b,c); } }; -#endif } // end namespace CGAL From 13f804402789dfa8e97df003cdef069f5d998caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 25 May 2023 14:56:16 +0200 Subject: [PATCH 041/156] Remove more (needless) doc appearances of TriangleAccessor --- Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h | 2 +- Mesh_3/doc/Mesh_3/PackageDescription.txt | 3 +-- Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h | 2 +- Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h | 5 ++--- Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h index a1b35060f85..7583cc6957e 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h @@ -12,7 +12,7 @@ and construction of intersections between segments and triangles. \cgalHasModel All models of the `Kernel` concept. \sa `BisectionGeometricTraits_3` -\sa `CGAL::Polyhedral_mesh_domain_3` +\sa `CGAL::Polyhedral_mesh_domain_3` */ class IntersectionGeometricTraits_3 { diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index c3b82d6b25b..a2480bc71ac 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -81,7 +81,6 @@ related to the template parameters of some models of the main concepts: - `MeshVertexBase_3` - `MeshDomainField_3` - `MeshPolyline_3` -- `TriangleAccessor_3` \cgalCRPSection{Classes} @@ -99,7 +98,7 @@ The following classes are models of domain concepts and their associated classes: - `CGAL::Labeled_mesh_domain_3` -- `CGAL::Polyhedral_mesh_domain_3` +- `CGAL::Polyhedral_mesh_domain_3` - `CGAL::Polyhedral_mesh_domain_with_features_3` - `CGAL::Polyhedral_complex_mesh_domain_3` - `CGAL::Mesh_domain_with_polyline_features_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 9fa436fe842..a4f81ce1812 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 @@ -532,7 +532,7 @@ It has to be a model of the `MeshDomain_3` concept. \sa `MeshDomain_3` \sa `MeshPolyline_3` \sa `CGAL::Implicit_mesh_domain_3` -\sa `CGAL::Polyhedral_mesh_domain_3` +\sa `CGAL::Polyhedral_mesh_domain_3` \sa `CGAL::Labeled_image_mesh_domain_3` */ diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 5f707903fbb..68687f526be 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -96,13 +96,12 @@ with a model of the concept `IntersectionGeometricTraits_3`. \sa `IntersectionGeometricTraits_3` \sa `CGAL::make_mesh_3()` \sa `CGAL::Mesh_domain_with_polyline_features_3` -\sa `CGAL::Polyhedral_mesh_domain_3` +\sa `CGAL::Polyhedral_mesh_domain_3` \sa `CGAL::Mesh_polyhedron_3` */ #ifdef DOXYGEN_RUNNING template < class IGT, - class Polyhedron = typename Mesh_polyhedron_3::type, - class TriangleAccessor=CGAL::Default> + class Polyhedron = typename Mesh_polyhedron_3::type> class Polyhedral_complex_mesh_domain_3 : public Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron, diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 8361c3edd2b..7c07b8a5ef2 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -84,7 +84,7 @@ instantiated with a model of the concept \cgalModels `MeshDomainWithFeatures_3` \sa `CGAL::Mesh_domain_with_polyline_features_3` -\sa `CGAL::Polyhedral_mesh_domain_3` +\sa `CGAL::Polyhedral_mesh_domain_3` \sa `CGAL::Mesh_polyhedron_3` */ #ifdef DOXYGEN_RUNNING From c3873374ceb18111f776a7e4ba983d61ed0fc38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 25 May 2023 14:56:46 +0200 Subject: [PATCH 042/156] Carry the template parameter (as it should be if it were actually in use) It is in fact CGAL::Default and unused everywhere, but it's clearer this way. --- Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 68687f526be..56fabd99813 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -114,7 +114,7 @@ class Polyhedral_complex_mesh_domain_3 : public Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron_, IGT_, - CGAL::Default, + TriangleAccessor, int, //Use_patch_id_tag Tag_true > >//Use_exact_intersection_tag #endif @@ -124,7 +124,7 @@ public: typedef Polyhedron_ Polyhedron; typedef Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< - Polyhedron, IGT_, CGAL::Default, + Polyhedron, IGT_, TriangleAccessor, int, Tag_true > > Base; /// @cond DEVELOPERS private: From 6d3d60c6e27b1cab5939fdb50694007bfa5491fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 25 May 2023 15:19:13 +0200 Subject: [PATCH 043/156] Do not document Mesh_3 classes' members that are not explicitely documented --- Mesh_3/doc/Mesh_3/Doxyfile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 741c77a18f5..70e7712b574 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -3,6 +3,7 @@ EXTRACT_ALL = false HIDE_UNDOC_CLASSES = true +HIDE_UNDOC_MEMBERS = true WARN_IF_UNDOCUMENTED = false # macros to be used inside the code From abad43a63db368aec51a5a0ec6b1fe918c082596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 25 May 2023 15:19:36 +0200 Subject: [PATCH 044/156] Add missing doc dependency --- Mesh_3/doc/Mesh_3/dependencies | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_3/doc/Mesh_3/dependencies b/Mesh_3/doc/Mesh_3/dependencies index c8703db0782..3219d3896f4 100644 --- a/Mesh_3/doc/Mesh_3/dependencies +++ b/Mesh_3/doc/Mesh_3/dependencies @@ -10,6 +10,7 @@ Triangulation_3 Periodic_3_triangulation_3 TDS_3 Polyhedron +Surface_mesh Miscellany Mesh_2 Polygon_mesh_processing From 525338eec262979fd676da4a53a120f18166239e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 26 May 2023 12:52:35 +0200 Subject: [PATCH 045/156] Haronize Gt/GT/etc. --- Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h | 4 +- .../doc/Mesh_3/Concepts/MeshDomainField_3.h | 2 +- Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h | 2 +- Mesh_3/doc/Mesh_3/PackageDescription.txt | 10 +-- Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h | 72 ++++++++--------- .../Mesh_3/Cell_criteria_visitor_with_balls.h | 8 +- .../CGAL/Mesh_3/Detect_features_in_image.h | 6 +- .../Facet_criteria_visitor_with_balls.h | 12 +-- Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h | 48 ++++++------ .../CGAL/Mesh_3/Mesh_global_optimizer.h | 50 ++++++------ .../include/CGAL/Mesh_3/Mesh_sizing_field.h | 16 ++-- Mesh_3/include/CGAL/Mesh_3/Odt_move.h | 28 +++---- .../CGAL/Mesh_3/Protect_edges_sizing_field.h | 36 ++++----- Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h | 26 +++---- Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h | 14 ++-- Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h | 14 ++-- Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h | 24 +++--- .../CGAL/Mesh_3/Triangle_accessor_primitive.h | 16 ++-- .../CGAL/Mesh_3/Triangulation_helpers.h | 32 ++++---- .../CGAL/Mesh_3/Triangulation_sizing_field.h | 22 +++--- .../CGAL/Mesh_3/Uniform_sizing_field.h | 4 +- ...tialize_triangulation_from_labeled_image.h | 12 +-- .../CGAL/Mesh_3/mesh_standard_cell_criteria.h | 14 ++-- .../Mesh_3/mesh_standard_facet_criteria.h | 44 +++++------ Mesh_3/include/CGAL/Mesh_3/sliver_criteria.h | 8 +- .../include/CGAL/Mesh_3/vertex_perturbation.h | 78 +++++++++---------- .../Mesh_domain_with_polyline_features_3.h | 10 +-- Mesh_3/include/CGAL/Mesh_edge_criteria_3.h | 6 +- Mesh_3/include/CGAL/Mesh_triangulation_3.h | 16 ++-- .../include/CGAL/Polyhedral_mesh_domain_3.h | 16 ++-- Mesh_3/test/Mesh_3/test_criteria.cpp | 4 +- Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp | 4 +- .../test/Mesh_3/test_meshing_polyhedron.cpp | 6 +- .../test_meshing_polyhedron_with_features.cpp | 6 +- Mesh_3/test/Mesh_3/test_min_size_criteria.cpp | 6 +- 35 files changed, 337 insertions(+), 339 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h index 028d9e70d9f..68138d36775 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h @@ -43,8 +43,8 @@ each cell (see below). \cgalRefines{SimplicialMeshCellBase_3,RegularTriangulationCellBaseWithWeightedCircumcenter_3,CopyConstructible} -\cgalHasModel `CGAL::Compact_mesh_cell_base_3` -\cgalHasModel `CGAL::Mesh_cell_base_3` +\cgalHasModel `CGAL::Compact_mesh_cell_base_3` +\cgalHasModel `CGAL::Mesh_cell_base_3` \sa `CGAL::make_mesh_3()` \sa `MeshDomain_3` diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomainField_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomainField_3.h index 644a3a46046..c90469bf835 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomainField_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomainField_3.h @@ -5,7 +5,7 @@ The concept `MeshDomainField_3` describes a scalar field which could be queried at any point of the space. -\cgalHasModel `CGAL::Mesh_constant_domain_field_3` +\cgalHasModel `CGAL::Mesh_constant_domain_field_3` \sa `MeshDomain_3` \sa `MeshDomainWithFeatures_3` diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h index 4739741b01c..a80d9c5b28f 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h @@ -22,7 +22,7 @@ each cell (see below). \cgalRefines{SimplicialMeshVertexBase_3,RegularTriangulationVertexBase_3,SurfaceMeshVertexBase_3} -\cgalHasModel `CGAL::Mesh_vertex_base_3` +\cgalHasModel `CGAL::Mesh_vertex_base_3` \sa `CGAL::make_mesh_3()` \sa `CGAL::refine_mesh_3()` diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index a2480bc71ac..bad6b7e691e 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -84,15 +84,15 @@ related to the template parameters of some models of the main concepts: \cgalCRPSection{Classes} -- `CGAL::Mesh_triangulation_3` -- `CGAL::Mesh_vertex_base_3` -- `CGAL::Compact_mesh_cell_base_3` -- `CGAL::Mesh_cell_base_3` +- `CGAL::Mesh_triangulation_3` +- `CGAL::Mesh_vertex_base_3` +- `CGAL::Compact_mesh_cell_base_3` +- `CGAL::Mesh_cell_base_3` - `CGAL::Mesh_criteria_3` - `CGAL::Mesh_cell_criteria_3` - `CGAL::Mesh_facet_criteria_3` - `CGAL::Mesh_edge_criteria_3` -- `CGAL::Mesh_constant_domain_field_3` +- `CGAL::Mesh_constant_domain_field_3` The following classes are models of domain concepts and their associated classes: diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index 6a15d8cce50..a7826a3d56b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -378,10 +378,10 @@ template class C3T3_helpers_base { protected: - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Gt::FT FT; + typedef typename GT::FT FT; typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Cell_handle Cell_handle; typedef typename Tr::Facet Facet; @@ -450,7 +450,7 @@ template class C3T3_helpers_base { protected: - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; typedef typename Tr::Vertex_handle Vertex_handle; @@ -625,14 +625,14 @@ class C3T3_helpers typedef typename Base::Lock_data_structure Lock_data_structure; typedef typename C3T3::Triangulation Tr; typedef Tr Triangulation; - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; - typedef typename Gt::FT FT; + typedef typename GT::FT FT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Gt::Vector_3 Vector_3; - typedef typename Gt::Plane_3 Plane_3; - typedef typename Gt::Tetrahedron_3 Tetrahedron; + typedef typename GT::Vector_3 Vector_3; + typedef typename GT::Plane_3 Plane_3; + typedef typename GT::Tetrahedron_3 Tetrahedron; typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Facet Facet; @@ -1118,17 +1118,17 @@ private: const bool update_c3t3, const bool update_surface_center) const { - typedef typename C3T3::Triangulation::Geom_traits Gt; - typedef typename Gt::Segment_3 Segment_3; - typedef typename Gt::Ray_3 Ray_3; - typedef typename Gt::Line_3 Line_3; + typedef typename C3T3::Triangulation::Geom_traits GT; + typedef typename GT::Segment_3 Segment_3; + typedef typename GT::Ray_3 Ray_3; + typedef typename GT::Line_3 Line_3; // Nothing to do for infinite facets if ( c3t3_.triangulation().is_infinite(facet) ) return Surface_patch(); // Functors - typename Gt::Is_degenerate_3 is_degenerate = + typename GT::Is_degenerate_3 is_degenerate = c3t3_.triangulation().geom_traits().is_degenerate_3_object(); // Get dual of facet @@ -2476,7 +2476,7 @@ update_mesh_no_topo_change(const Vertex_handle& old_vertex, << " " << new_position << ")" << std::endl; #endif - typename Gt::Construct_opposite_vector_3 cov = tr_.geom_traits().construct_opposite_vector_3_object(); + typename GT::Construct_opposite_vector_3 cov = tr_.geom_traits().construct_opposite_vector_3_object(); //backup metadata std::set cells_backup; @@ -2685,7 +2685,7 @@ C3T3_helpers:: rebuild_restricted_delaunay(OutdatedCells& outdated_cells, Moving_vertices_set& moving_vertices) { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); typename OutdatedCells::iterator first_cell = outdated_cells.begin(); typename OutdatedCells::iterator last_cell = outdated_cells.end(); @@ -2815,9 +2815,9 @@ rebuild_restricted_delaunay(ForwardIterator first_cell, ForwardIterator last_cell, Moving_vertices_set& moving_vertices) { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Construct_vector_3 vector = tr_.geom_traits().construct_vector_3_object(); - typename Gt::Equal_3 equal = tr_.geom_traits().equal_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_vector_3 vector = tr_.geom_traits().construct_vector_3_object(); + typename GT::Equal_3 equal = tr_.geom_traits().equal_3_object(); Update_c3t3 updater(domain_,c3t3_); @@ -2953,9 +2953,9 @@ move_point(const Vertex_handle& old_vertex, << " " << move << ")\n"; #endif - typename Gt::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Construct_weighted_point_3 cwp = tr_.geom_traits().construct_weighted_point_3_object(); + typename GT::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_weighted_point_3 cwp = tr_.geom_traits().construct_weighted_point_3_object(); Cell_vector incident_cells_; incident_cells_.reserve(64); @@ -3004,9 +3004,9 @@ move_point(const Vertex_handle& old_vertex, << " " << move << ")\n"; #endif - typename Gt::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Construct_weighted_point_3 cwp = tr_.geom_traits().construct_weighted_point_3_object(); + typename GT::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_weighted_point_3 cwp = tr_.geom_traits().construct_weighted_point_3_object(); Cell_vector incident_cells_; incident_cells_.reserve(64); @@ -3068,9 +3068,9 @@ move_point(const Vertex_handle& old_vertex, } //======= /Get incident cells ========== - typename Gt::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Construct_weighted_point_3 cwp = tr_.geom_traits().construct_weighted_point_3_object(); + typename GT::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_weighted_point_3 cwp = tr_.geom_traits().construct_weighted_point_3_object(); const Weighted_point& position = tr_.point(old_vertex); const Weighted_point& new_position = cwp(translate(cp(position), move)); @@ -3372,14 +3372,14 @@ project_on_surface_aux(const Bare_point& p, const Bare_point& ref_point, const Vector_3& projection_vector) const { - typedef typename Gt::Segment_3 Segment_3; + typedef typename GT::Segment_3 Segment_3; // Build a segment directed as projection_direction, - typename Gt::Compute_squared_distance_3 sq_distance = tr_.geom_traits().compute_squared_distance_3_object(); - typename Gt::Compute_squared_length_3 sq_length = tr_.geom_traits().compute_squared_length_3_object(); - typename Gt::Construct_scaled_vector_3 scale = tr_.geom_traits().construct_scaled_vector_3_object(); - typename Gt::Is_degenerate_3 is_degenerate = tr_.geom_traits().is_degenerate_3_object(); - typename Gt::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); + typename GT::Compute_squared_distance_3 sq_distance = tr_.geom_traits().compute_squared_distance_3_object(); + typename GT::Compute_squared_length_3 sq_length = tr_.geom_traits().compute_squared_length_3_object(); + typename GT::Construct_scaled_vector_3 scale = tr_.geom_traits().construct_scaled_vector_3_object(); + typename GT::Is_degenerate_3 is_degenerate = tr_.geom_traits().is_degenerate_3_object(); + typename GT::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); typename MD::Construct_intersection construct_intersection = domain_.construct_intersection_object(); @@ -3432,7 +3432,7 @@ get_least_square_surface_plane(const Vertex_handle& v, Surface_patch_index patch_index) const { typedef typename C3T3::Triangulation::Triangle Triangle; - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); // Get incident facets Facet_vector facets; @@ -3521,8 +3521,8 @@ project_on_surface_if_possible(const Vertex_handle& v, { // return domain_.project_on_surface(p); - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Equal_3 equal = tr_.geom_traits().equal_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Equal_3 equal = tr_.geom_traits().equal_3_object(); // Get plane std::pair, Bare_point> pl_rp diff --git a/Mesh_3/include/CGAL/Mesh_3/Cell_criteria_visitor_with_balls.h b/Mesh_3/include/CGAL/Mesh_3/Cell_criteria_visitor_with_balls.h index 4e9393a01e5..3e6824d27ea 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Cell_criteria_visitor_with_balls.h +++ b/Mesh_3/include/CGAL/Mesh_3/Cell_criteria_visitor_with_balls.h @@ -45,8 +45,8 @@ public: typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; int nb_weighted_points; std::vector points; @@ -59,9 +59,9 @@ public: Cell_criteria_visitor_with_balls(const Tr& tr, const Cell_handle& ch) : Base(tr, ch) { - typename Gt::Compare_weighted_squared_radius_3 compare_sq_radius = + typename GT::Compare_weighted_squared_radius_3 compare_sq_radius = tr.geom_traits().compare_weighted_squared_radius_3_object(); - typename Gt::Squared_radius_orthogonal_sphere sq_radius_ortho_sphere = + typename GT::Squared_radius_orthogonal_sphere sq_radius_ortho_sphere = tr.geom_traits().compute_squared_radius_smallest_orthogonal_sphere_3_object(); const Weighted_point& p = tr.point(ch, 0); diff --git a/Mesh_3/include/CGAL/Mesh_3/Detect_features_in_image.h b/Mesh_3/include/CGAL/Mesh_3/Detect_features_in_image.h index 8efaf67f799..5df9393ce5d 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Detect_features_in_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Detect_features_in_image.h @@ -57,9 +57,9 @@ std::vector> detect_features_in_image_with_know_word_type(const CGAL::Image_3& image, CGAL::Image_3& weights) { - using Gt = typename CGAL::Kernel_traits

    ::Kernel; + using GT = typename CGAL::Kernel_traits

    ::Kernel; using Point_3 = P; - using Vector_3 = typename Gt::Vector_3; + using Vector_3 = typename GT::Vector_3; using Polyline_type = std::vector; using Polylines = std::vector; @@ -86,7 +86,7 @@ detect_features_in_image_with_know_word_type(const CGAL::Image_3& image, using CGAL::IMAGEIO::static_evaluate; - using Del = CGAL::Delaunay_triangulation_3; + using Del = CGAL::Delaunay_triangulation_3; using Cell_handle = typename Del::Cell_handle; using Vertex_handle = typename Del::Vertex_handle; Del triangulation; diff --git a/Mesh_3/include/CGAL/Mesh_3/Facet_criteria_visitor_with_balls.h b/Mesh_3/include/CGAL/Mesh_3/Facet_criteria_visitor_with_balls.h index ec638dd29ef..0db721cd9d9 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Facet_criteria_visitor_with_balls.h +++ b/Mesh_3/include/CGAL/Mesh_3/Facet_criteria_visitor_with_balls.h @@ -50,8 +50,8 @@ public: typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; int wp_nb_; double radius_ortho_shpere; @@ -68,13 +68,13 @@ public: , radius_ortho_shpere(0.) , ratio(0.) { - typename Gt::Compare_weighted_squared_radius_3 compare_sq_radius = + typename GT::Compare_weighted_squared_radius_3 compare_sq_radius = tr.geom_traits().compare_weighted_squared_radius_3_object(); - typename Gt::Compute_weight_3 cw = + typename GT::Compute_weight_3 cw = tr.geom_traits().compute_weight_3_object(); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Squared_radius_orthogonal_sphere sq_radius_ortho_sphere = + typename GT::Squared_radius_orthogonal_sphere sq_radius_ortho_sphere = tr.geom_traits().compute_squared_radius_smallest_orthogonal_sphere_3_object(); Weighted_point wp1 = tr.point(fh.first, (fh.second+1)&3); diff --git a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h index f709f4b4f1a..74dbb09b2ca 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h +++ b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h @@ -44,7 +44,7 @@ template Facet_vector; typedef typename std::vector Cell_vector; - typedef typename Gt::FT FT; - typedef typename Gt::Point_2 Point_2; - typedef typename Gt::Vector_3 Vector_3; - typedef typename Gt::Tetrahedron_3 Tetrahedron_3; - typedef typename Gt::Plane_3 Plane_3; - typedef typename Gt::Aff_transformation_3 Aff_transformation_3; + typedef typename GT::FT FT; + typedef typename GT::Point_2 Point_2; + typedef typename GT::Vector_3 Vector_3; + typedef typename GT::Tetrahedron_3 Tetrahedron_3; + typedef typename GT::Plane_3 Plane_3; + typedef typename GT::Aff_transformation_3 Aff_transformation_3; public: typedef SizingField Sizing_field; @@ -261,7 +261,7 @@ private: { const Tr& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); Facet_vector incident_facets; incident_facets.reserve(64); @@ -306,8 +306,8 @@ private: const C3T3& c3t3, const Sizing_field& sizing_field) const { - typename Gt::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); - typename Gt::Construct_vector_3 vector = c3t3.triangulation().geom_traits().construct_vector_3_object(); + typename GT::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); + typename GT::Construct_vector_3 vector = c3t3.triangulation().geom_traits().construct_vector_3_object(); const Weighted_point position = c3t3.triangulation().point(v); const Bare_point& p = cp(position); @@ -329,8 +329,8 @@ private: const C3T3& c3t3, const Sizing_field& sizing_field) const { - typename Gt::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); - typename Gt::Construct_vector_3 vector = c3t3.triangulation().geom_traits().construct_vector_3_object(); + typename GT::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); + typename GT::Construct_vector_3 vector = c3t3.triangulation().geom_traits().construct_vector_3_object(); const Weighted_point& position = c3t3.triangulation().point(v); const Bare_point& p = cp(position); @@ -409,10 +409,10 @@ private: { CGAL_precondition(std::distance(first,last) >= 3); - typename Gt::Compute_area_3 area = c3t3.triangulation().geom_traits().compute_area_3_object(); - typename Gt::Construct_centroid_3 centroid = c3t3.triangulation().geom_traits().construct_centroid_3_object(); - typename Gt::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); - typename Gt::Construct_vector_3 vector = c3t3.triangulation().geom_traits().construct_vector_3_object(); + typename GT::Compute_area_3 area = c3t3.triangulation().geom_traits().compute_area_3_object(); + typename GT::Construct_centroid_3 centroid = c3t3.triangulation().geom_traits().construct_centroid_3_object(); + typename GT::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); + typename GT::Construct_vector_3 vector = c3t3.triangulation().geom_traits().construct_vector_3_object(); // Vertex current position const Weighted_point& vertex_weighted_position = c3t3.triangulation().point(v); @@ -460,8 +460,8 @@ private: const Bare_point& reference_point, const C3T3& c3t3) const { - typename Gt::Construct_base_vector_3 base = c3t3.triangulation().geom_traits().construct_base_vector_3_object(); - typename Gt::Construct_orthogonal_vector_3 orthogonal_vector = c3t3.triangulation().geom_traits().construct_orthogonal_vector_3_object(); + typename GT::Construct_base_vector_3 base = c3t3.triangulation().geom_traits().construct_base_vector_3_object(); + typename GT::Construct_orthogonal_vector_3 orthogonal_vector = c3t3.triangulation().geom_traits().construct_orthogonal_vector_3_object(); Vector_3 u = base(plane, 1); u = u / CGAL::sqrt(u*u); @@ -542,12 +542,12 @@ private: const Tr& tr = c3t3.triangulation(); - typename Gt::Construct_centroid_3 centroid = tr.geom_traits().construct_centroid_3_object(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Construct_tetrahedron_3 tetrahedron = tr.geom_traits().construct_tetrahedron_3_object(); - typename Gt::Construct_translated_point_3 translate = tr.geom_traits().construct_translated_point_3_object(); - typename Gt::Construct_vector_3 vector = tr.geom_traits().construct_vector_3_object(); - typename Gt::Compute_volume_3 volume = tr.geom_traits().compute_volume_3_object(); + typename GT::Construct_centroid_3 centroid = tr.geom_traits().construct_centroid_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Construct_tetrahedron_3 tetrahedron = tr.geom_traits().construct_tetrahedron_3_object(); + typename GT::Construct_translated_point_3 translate = tr.geom_traits().construct_translated_point_3_object(); + typename GT::Construct_vector_3 vector = tr.geom_traits().construct_vector_3_object(); + typename GT::Compute_volume_3 volume = tr.geom_traits().compute_volume_3_object(); Cell_circulator current_cell = tr.incident_cells(edge); Cell_circulator done = current_cell; 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 7b83d8b05bc..0014ff0e5e0 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h @@ -68,9 +68,9 @@ template class Mesh_global_optimizer_base { protected: - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename Tr::Lock_data_structure Lock_data_structure; // The sizing field info is stored inside the move vector because it is computed @@ -127,9 +127,9 @@ class Mesh_global_optimizer_base { protected: - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename Tr::Lock_data_structure Lock_data_structure; typedef tbb::concurrent_vector > Moves_vector; @@ -240,7 +240,7 @@ class Mesh_global_optimizer using Base::increment_frozen_points; typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; @@ -249,8 +249,8 @@ class Mesh_global_optimizer typedef typename Tr::Edge Edge; typedef typename Tr::Vertex Vertex; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename std::vector Cell_vector; typedef typename std::vector Vertex_vector; @@ -380,7 +380,7 @@ private: Moves_vector_ & m_moves; bool m_do_freeze; Vertex_conc_vector & m_vertices_not_moving_any_more; - const Gt & m_gt; + const GT & m_gt; public: // Constructor @@ -389,7 +389,7 @@ private: Moves_vector_ &moves, bool do_freeze, Vertex_conc_vector &vertices_not_moving_any_more, - const Gt >) + const GT >) : m_mgo(mgo), m_sizing_field(sizing_field), m_moves(moves), @@ -411,8 +411,8 @@ private: // operator() void operator()(const Vertex_handle& oldv) const { - typename Gt::Construct_point_3 cp = m_gt.construct_point_3_object(); - typename Gt::Construct_translated_point_3 translate = m_gt.construct_translated_point_3_object(); + typename GT::Construct_point_3 cp = m_gt.construct_point_3_object(); + typename GT::Construct_translated_point_3 translate = m_gt.construct_translated_point_3_object(); Vector_3 move = m_mgo.compute_move(oldv); if ( CGAL::NULL_VECTOR != move ) @@ -451,13 +451,13 @@ private: class Compute_sizing_field_value { MGO & m_mgo; - const Gt & m_gt; + const GT & m_gt; Local_list_ & m_local_lists; public: // Constructor Compute_sizing_field_value(MGO &mgo, - const Gt >, + const GT >, Local_list_ &local_lists) : m_mgo(mgo), m_gt(gt), @@ -474,7 +474,7 @@ private: // operator() void operator()(Vertex& v) const { - typename Gt::Construct_point_3 cp = m_gt.construct_point_3_object(); + typename GT::Construct_point_3 cp = m_gt.construct_point_3_object(); Vertex_handle vh = Tr::Triangulation_data_structure::Vertex_range::s_iterator_to(v); @@ -827,8 +827,8 @@ compute_moves(Moving_vertices_set& moving_vertices) else #endif // CGAL_LINKED_WITH_TBB { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); // Get move for each moving vertex typename Moving_vertices_set::iterator vit = moving_vertices.begin(); @@ -879,10 +879,10 @@ typename Mesh_global_optimizer::Vector_3 Mesh_global_optimizer:: compute_move(const Vertex_handle& v) { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Compute_squared_length_3 sq_length = tr_.geom_traits().compute_squared_length_3_object(); - typename Gt::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); - typename Gt::Construct_vector_3 vector = tr_.geom_traits().construct_vector_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Compute_squared_length_3 sq_length = tr_.geom_traits().compute_squared_length_3_object(); + typename GT::Construct_translated_point_3 translate = tr_.geom_traits().construct_translated_point_3_object(); + typename GT::Construct_vector_3 vector = tr_.geom_traits().construct_vector_3_object(); Cell_vector incident_cells; incident_cells.reserve(64); @@ -1061,7 +1061,7 @@ fill_sizing_field() else #endif //CGAL_LINKED_WITH_TBB { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); // Fill map with local size for(typename Tr::Finite_vertices_iterator vit = tr_.finite_vertices_begin(); @@ -1195,8 +1195,8 @@ typename Mesh_global_optimizer::FT Mesh_global_optimizer:: sq_circumradius_length(const Cell_handle& cell, const Vertex_handle& v) const { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Compute_squared_distance_3 sq_distance = tr_.geom_traits().compute_squared_distance_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Compute_squared_distance_3 sq_distance = tr_.geom_traits().compute_squared_distance_3_object(); const Bare_point circumcenter = tr_.dual(cell); const Weighted_point& position = tr_.point(cell, cell->index(v)); 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 e1d52d202f2..03e3262ef6b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h @@ -88,10 +88,10 @@ class Mesh_sizing_field typename Tr::Concurrency_tag> { // Types - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Gt::FT FT; + typedef typename GT::FT FT; typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Cell_handle Cell_handle; @@ -169,7 +169,7 @@ fill(const std::map& value_map) { typedef typename Tr::Finite_vertices_iterator Fvi; - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); for ( Fvi vit = tr_.finite_vertices_begin(); vit != tr_.finite_vertices_end(); ++ vit ) { @@ -196,7 +196,7 @@ typename Mesh_sizing_field::FT Mesh_sizing_field:: operator()(const Bare_point& p, const Cell_handle& c) const { - typename Gt::Construct_weighted_point_3 cwp = tr_.geom_traits().construct_weighted_point_3_object(); + typename GT::Construct_weighted_point_3 cwp = tr_.geom_traits().construct_weighted_point_3_object(); #ifdef CGAL_MESH_3_SIZING_FIELD_INEXACT_LOCATE //use the inexact locate (much faster than locate) to get a hint @@ -239,8 +239,8 @@ typename Mesh_sizing_field::FT Mesh_sizing_field:: interpolate_on_cell_vertices(const Bare_point& p, const Cell_handle& cell) const { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); - typename Gt::Compute_volume_3 volume = tr_.geom_traits().compute_volume_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Compute_volume_3 volume = tr_.geom_traits().compute_volume_3_object(); // Interpolate value using tet vertices values const FT& va = cell->vertex(0)->meshing_info(); @@ -275,9 +275,9 @@ typename Mesh_sizing_field::FT Mesh_sizing_field:: interpolate_on_facet_vertices(const Bare_point& p, const Cell_handle& cell) const { - typename Gt::Compute_area_3 area = tr_.geom_traits().compute_area_3_object(); + typename GT::Compute_area_3 area = tr_.geom_traits().compute_area_3_object(); - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); // Find infinite vertex and put it in k0 int k0 = 0; int k1 = 1; diff --git a/Mesh_3/include/CGAL/Mesh_3/Odt_move.h b/Mesh_3/include/CGAL/Mesh_3/Odt_move.h index a2cbcc78cc5..4ec48adaf2e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Odt_move.h +++ b/Mesh_3/include/CGAL/Mesh_3/Odt_move.h @@ -34,7 +34,7 @@ template Facet_vector; typedef typename std::vector Cell_vector; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; public: typedef SizingField Sizing_field; @@ -66,8 +66,8 @@ public: // Compute move const Tr& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Construct_vector_3 vector = tr.geom_traits().construct_vector_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Construct_vector_3 vector = tr.geom_traits().construct_vector_3_object(); Vector_3 move = CGAL::NULL_VECTOR; FT sum_volume(0); @@ -117,8 +117,8 @@ private: const Tr& tr, const Sizing_field& sizing_field) const { - typename Gt::Construct_centroid_3 centroid = tr.geom_traits().construct_centroid_3_object(); - typename Gt::Compute_volume_3 volume = tr.geom_traits().compute_volume_3_object(); + typename GT::Construct_centroid_3 centroid = tr.geom_traits().construct_centroid_3_object(); + typename GT::Compute_volume_3 volume = tr.geom_traits().compute_volume_3_object(); Bare_point c = centroid(tr.tetrahedron(cell)); FT s = sizing_field(c, std::make_pair(cell, true)); @@ -195,8 +195,8 @@ private: // const Tr& tr, // const Sizing_field& sizing_field) const // { -// typename Gt::Compute_area_3 area = tr.geom_traits().compute_area_3_object(); -// typename Gt::Construct_centroid_3 centroid = tr.geom_traits().construct_centroid_3_object(); +// typename GT::Compute_area_3 area = tr.geom_traits().compute_area_3_object(); +// typename GT::Construct_centroid_3 centroid = tr.geom_traits().construct_centroid_3_object(); // // Bare_point c = centroid(tr.triangle(facet)); // FT s = sizing_field(c, facet.first->vertex(0)); @@ -211,9 +211,9 @@ private: // const Tr& tr, // const Sizing_field& sizing_field) const // { -// typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); -// typename Gt::Construct_midpoint_3 midpoint = tr.geom_traits().construct_midpoint_3_object(); -// typename Gt::Compute_squared_distance_3 sq_distance = tr.geom_traits().compute_squared_distance_3_object(); +// typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); +// typename GT::Construct_midpoint_3 midpoint = tr.geom_traits().construct_midpoint_3_object(); +// typename GT::Compute_squared_distance_3 sq_distance = tr.geom_traits().compute_squared_distance_3_object(); // // const Weighted_point& wp1 = tr.point(cell, vertex_index_1); // const Weighted_point& wp2 = tr.point(cell, vertex_index_2); @@ -251,8 +251,8 @@ private: // // Vector_3 normal_outside(const Facet& f, const C3T3& c3t3) const // { -// typename Gt::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); -// typename Gt::Construct_normal_3 normal = c3t3.triangulation().geom_traits().construct_normal_3_object(); +// typename GT::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); +// typename GT::Construct_normal_3 normal = c3t3.triangulation().geom_traits().construct_normal_3_object(); // // const Cell_handle& cell = f.first; // const int& i = f.second; 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 3bd65976493..197b71916fe 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 @@ -118,8 +118,8 @@ public: typedef typename Tr::Weighted_point Weighted_point; typedef typename Weighted_point::Weight Weight; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; typedef typename C3T3::Cell_handle Cell_handle; typedef typename C3T3::Vertex_handle Vertex_handle; @@ -394,7 +394,7 @@ private: /// Returns the radius of the ball of vertex `v`. FT get_radius(const Vertex_handle& v) const { - typename Gt::Compute_weight_3 cw = + typename GT::Compute_weight_3 cw = c3t3_.triangulation().geom_traits().compute_weight_3_object(); const Weighted_point& v_wp = c3t3_.triangulation().point(v); @@ -643,7 +643,7 @@ insert_point(const Bare_point& p, const Weight& w, int dim, const Index& index, // Insert point CGAL_assertion_code(size_type nb_vertices_before = c3t3_.triangulation().number_of_vertices()); - typename Gt::Construct_weighted_point_3 cwp = + typename GT::Construct_weighted_point_3 cwp = c3t3_.triangulation().geom_traits().construct_weighted_point_3_object(); const Weighted_point wp = cwp(p,w*weight_modifier); @@ -712,13 +712,13 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, #endif const Tr& tr = c3t3_.triangulation(); - typename Gt::Compute_squared_distance_3 sq_distance = + typename GT::Compute_squared_distance_3 sq_distance = tr.geom_traits().compute_squared_distance_3_object(); - typename Gt::Compare_weighted_squared_radius_3 cwsr = + typename GT::Compare_weighted_squared_radius_3 cwsr = tr.geom_traits().compare_weighted_squared_radius_3_object(); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Construct_weighted_point_3 cwp = + typename GT::Construct_weighted_point_3 cwp = tr.geom_traits().construct_weighted_point_3_object(); bool add_handle_to_unchecked = false; // add or not the new vertex to the set 'unchecked_vertices' @@ -972,7 +972,7 @@ insert_balls_on_edges() } else { - typename Gt::Construct_weighted_point_3 cwp = + typename GT::Construct_weighted_point_3 cwp = c3t3_.triangulation().geom_traits().construct_weighted_point_3_object(); // Even if the curve is a cycle, it can intersect other curves at @@ -1026,7 +1026,7 @@ typename Protect_edges_sizing_field::Vertex_handle Protect_edges_sizing_field:: get_vertex_corner_from_point(const Bare_point& p, const Index&) const { - typename Gt::Construct_weighted_point_3 cwp = + typename GT::Construct_weighted_point_3 cwp = c3t3_.triangulation().geom_traits().construct_weighted_point_3_object(); // Get vertex_handle associated to corner (dim=0) point @@ -1470,13 +1470,13 @@ bool Protect_edges_sizing_field:: do_balls_intersect(const Vertex_handle& va, const Vertex_handle& vb) const { - typename Gt::Construct_sphere_3 sphere = + typename GT::Construct_sphere_3 sphere = c3t3_.triangulation().geom_traits().construct_sphere_3_object(); - typename Gt::Do_intersect_3 do_intersect = + typename GT::Do_intersect_3 do_intersect = c3t3_.triangulation().geom_traits().do_intersect_3_object(); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = c3t3_.triangulation().geom_traits().construct_point_3_object(); - typename Gt::Compute_weight_3 cw = + typename GT::Compute_weight_3 cw = c3t3_.triangulation().geom_traits().compute_weight_3_object(); const Weighted_point& wa = c3t3_.triangulation().point(va); @@ -1516,7 +1516,7 @@ change_ball_size(const Vertex_handle& v, const FT squared_size, const bool speci } // Store point data - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = c3t3_.triangulation().geom_traits().construct_point_3_object(); Index index = c3t3_.index(v); @@ -1535,7 +1535,7 @@ change_ball_size(const Vertex_handle& v, const FT squared_size, const bool speci // Change v size c3t3_.triangulation().remove(v); - CGAL_assertion_code(typename Gt::Construct_weighted_point_3 cwp = + CGAL_assertion_code(typename GT::Construct_weighted_point_3 cwp = c3t3_.triangulation().geom_traits().construct_weighted_point_3_object();) CGAL_assertion_code(const Weighted_point wp = cwp(p,w);) CGAL_assertion_code(Tr& tr = c3t3_.triangulation()); @@ -1724,9 +1724,9 @@ is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2, using CGAL::Mesh_3::internal::min_intersection_factor; CGAL_precondition(c3t3_.curve_index(v1,v2) == curve_index); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = c3t3_.triangulation().geom_traits().construct_point_3_object(); - typename Gt::Compute_weight_3 cw = + typename GT::Compute_weight_3 cw = c3t3_.triangulation().geom_traits().compute_weight_3_object(); // Get sizes 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 ded63f9b139..06f3d16139b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -244,10 +244,10 @@ class Refine_facets_3_base typedef typename Tr::Cell_handle Cell_handle; typedef typename Triangulation_mesher_level_traits_3::Zone Zone; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::Segment_3 Segment_3; - typedef typename Gt::Ray_3 Ray_3; - typedef typename Gt::Line_3 Line_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::Segment_3 Segment_3; + typedef typename GT::Ray_3 Ray_3; + typedef typename GT::Line_3 Line_3; public: Refine_facets_3_base(Tr& tr, Complex3InTriangulation3& c3t3, @@ -892,8 +892,8 @@ private: typedef typename Tr::Cell_handle Cell_handle; typedef typename MeshDomain::Surface_patch_index Surface_patch_index; typedef typename MeshDomain::Index Index; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::Ray_3 Ray_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::Ray_3 Ray_3; private: // Disabled copy constructor @@ -1628,11 +1628,11 @@ compute_facet_properties(const Facet& facet, typedef typename MD::Intersection Intersection; // Functor - typename Gt::Is_degenerate_3 is_degenerate = + typename GT::Is_degenerate_3 is_degenerate = r_tr_.geom_traits().is_degenerate_3_object(); - typename Gt::Compare_xyz_3 compare_xyz = + typename GT::Compare_xyz_3 compare_xyz = r_tr_.geom_traits().compare_xyz_3_object(); - typename Gt::Construct_segment_3 construct_segment = + typename GT::Construct_segment_3 construct_segment = r_tr_.geom_traits().construct_segment_3_object(); #ifndef CGAL_MESH_3_NO_LONGER_CALLS_DO_INTERSECT_3 typename MD::Do_intersect_surface do_intersect_surface = @@ -1752,13 +1752,13 @@ Refine_facets_3_base:: is_encroached_facet_refinable(Facet& facet) const { typedef typename Tr::Weighted_point Weighted_point; - typedef typename Gt::FT FT; + typedef typename GT::FT FT; - typename Gt::Compute_squared_radius_smallest_orthogonal_sphere_3 sq_radius = + typename GT::Compute_squared_radius_smallest_orthogonal_sphere_3 sq_radius = r_tr_.geom_traits().compute_squared_radius_smallest_orthogonal_sphere_3_object(); - typename Gt::Compute_weight_3 cw = + typename GT::Compute_weight_3 cw = r_tr_.geom_traits().compute_weight_3_object(); - typename Gt::Compare_weighted_squared_radius_3 compare = + typename GT::Compare_weighted_squared_radius_3 compare = r_tr_.geom_traits().compare_weighted_squared_radius_3_object(); const Cell_handle& c = facet.first; diff --git a/Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h b/Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h index 9fe82752715..ac261599db8 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h @@ -31,12 +31,12 @@ namespace CGAL { namespace Mesh_3 { -template +template class Sizing_grid_node { public: - typedef typename Gt::Point_3 Point; - typedef typename Gt::FT FT; + typedef typename GT::Point_3 Point; + typedef typename GT::FT FT; FT m_init_size; FT m_size; @@ -108,14 +108,14 @@ template class Sizing_grid { public: - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; typedef typename Tr::Weighted_point Weighted_point; typedef typename Tr::Bare_point Bare_point; - typedef typename Gt::Vector_3 Vector; - typedef Sizing_grid_node Node; + typedef typename GT::Vector_3 Vector; + typedef Sizing_grid_node Node; typedef typename std::pair Constraint; private: diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index 87a0416f7b3..875ea698378 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -317,8 +317,8 @@ class Sliver_perturber_base { protected: typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; typedef typename std::vector Bad_vertices_vector; typedef typename Tr::Lock_data_structure Lock_data_structure; @@ -345,8 +345,8 @@ class Sliver_perturber_base { protected: typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; typedef typename tbb::concurrent_vector Bad_vertices_vector; typedef typename Tr::Lock_data_structure Lock_data_structure; @@ -437,7 +437,7 @@ class Sliver_perturber typename C3T3::Triangulation, Concurrency_tag> Base; typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Cell_handle Cell_handle; typedef typename Base::Vertex_handle Vertex_handle; @@ -450,7 +450,7 @@ class Sliver_perturber typedef typename std::vector Vertex_vector; typedef typename Base::Bad_vertices_vector Bad_vertices_vector; - typedef typename Gt::FT FT; + typedef typename GT::FT FT; // Helper typedef class C3T3_helpers C3T3_helpers; @@ -1261,7 +1261,7 @@ perturb_vertex( PVertex pv , bool *could_lock_zone ) const { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); #ifdef CGAL_CONCURRENT_MESH_3_PROFILING static Profile_branch_counter_3 bcounter( diff --git a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h index 03eb91e812b..cbe8056b23a 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h +++ b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h @@ -107,8 +107,8 @@ protected: typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Cell_handle Cell_handle; typedef std::vector Cell_vector; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; typedef typename std::vector Bad_vertices_vector; typedef typename Tr::Lock_data_structure Lock_data_structure; @@ -197,8 +197,8 @@ protected: typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Cell_handle Cell_handle; typedef std::vector Cell_vector; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; typedef typename tbb::concurrent_vector Bad_vertices_vector; typedef typename Tr::Lock_data_structure Lock_data_structure; @@ -353,9 +353,9 @@ private: // Types typedef typename Base::Queue_value_type Queue_value_type; typedef typename Base::Cell_vector Cell_vector; - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Base::FT FT; - typedef typename Gt::Tetrahedron_3 Tetrahedron_3; + typedef typename GT::Tetrahedron_3 Tetrahedron_3; typedef typename C3T3::Cells_in_complex_iterator Cell_iterator; typedef std::vector Facet_vector; @@ -1045,14 +1045,14 @@ pump_vertex(const Vertex_handle& pumped_vertex, if (could_lock_zone && *could_lock_zone == false) return false; - typename Gt::Compare_weighted_squared_radius_3 compare_sq_radius = + typename GT::Compare_weighted_squared_radius_3 compare_sq_radius = tr_.geom_traits().compare_weighted_squared_radius_3_object(); // If best_weight <= pumped_vertex weight, nothing to do const Weighted_point& pumped_vertex_wp = tr_.point(pumped_vertex); if ( compare_sq_radius(pumped_vertex_wp, - best_weight) == CGAL::LARGER ) // best_weight > v's weight { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); const Weighted_point& pwp = tr_.point(pumped_vertex); Weighted_point wp(cp(pwp), best_weight); @@ -1115,8 +1115,8 @@ expand_prestar(const Cell_handle& cell_to_add, Pre_star& pre_star, Sliver_values& criterion_values) const { - typename Gt::Compute_weight_3 cw = tr_.geom_traits().compute_weight_3_object(); - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Compute_weight_3 cw = tr_.geom_traits().compute_weight_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); // Delete first facet of pre_star Facet start_facet = pre_star.front()->second; @@ -1332,13 +1332,13 @@ get_best_weight(const Vertex_handle& v, bool *could_lock_zone) const } // end while(... can pump...) #ifdef CGAL_MESH_3_DEBUG_SLIVERS_EXUDER - typename Gt::Compare_weighted_squared_radius_3 compare_sq_radius = + typename GT::Compare_weighted_squared_radius_3 compare_sq_radius = tr_.geom_traits().compare_weighted_squared_radius_3_object(); const Weighted_point& vwp = tr_.point(v); if ( compare_sq_radius(vwp, - best_weight) == CGAL::LARGER ) // best_weight > v's weight { - typename Gt::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr_.geom_traits().construct_point_3_object(); const Weighted_point& wpv = tr_.point(v); Weighted_point wp(cp(wpv), best_weight); check_pre_star(pre_star_copy, wp, v); diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangle_accessor_primitive.h b/Mesh_3/include/CGAL/Mesh_3/Triangle_accessor_primitive.h index a3436fbdb91..a5a13232909 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangle_accessor_primitive.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangle_accessor_primitive.h @@ -24,13 +24,13 @@ namespace CGAL { namespace Mesh_3 { -template +template class Triangle_accessor_primitive { public: typedef typename TriangleAccessor::Triangle_handle Id; - typedef typename Gt::Triangle_3 Datum; - typedef typename Gt::Point_3 Point; + typedef typename GT::Triangle_3 Datum; + typedef typename GT::Point_3 Point; Triangle_accessor_primitive(const Id& h) : handle_(h) {} @@ -55,15 +55,15 @@ private: Id handle_; }; -//template -//class Triangle_accessor_primitive,Gt>, Gt> +//template +//class Triangle_accessor_primitive,GT>, GT> //{ -// typedef class Triangle_accessor,Gt> Triangle_accessor; +// typedef class Triangle_accessor,GT> Triangle_accessor; // //public: // typedef typename Triangle_accessor::Triangle_iterator Id; -// typedef typename Gt::Triangle_3 Datum; -// typedef typename Gt::Point_3 Point; +// typedef typename GT::Triangle_3 Datum; +// typedef typename GT::Point_3 Point; // // Triangle_accessor_primitive(const Id& h) // : handle_(h) {} diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h index 7de442b25fb..644cdc5399f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h @@ -43,17 +43,17 @@ namespace Mesh_3 { template class Triangulation_helpers { - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; // If `Tr` is not a triangulation that has defined Bare_point, // use Point_3 as defined in the traits class. typedef typename boost::mpl::eval_if_c< CGAL::internal::Has_nested_type_Bare_point::value, typename CGAL::internal::Bare_point_type, - boost::mpl::identity + boost::mpl::identity >::type Bare_point; // 'Point' is either a bare point or a weighted point, depending on the triangulation. @@ -190,7 +190,7 @@ no_topological_change(Tr& tr, if(std::is_same::value) return false; - typename Gt::Construct_opposite_vector_3 cov = + typename GT::Construct_opposite_vector_3 cov = tr.geom_traits().construct_opposite_vector_3_object(); bool np = true; @@ -382,7 +382,7 @@ inside_protecting_balls(const Tr& tr, const Vertex_handle v, const Bare_point& p) const { - typename Gt::Compare_weighted_squared_radius_3 cwsr = + typename GT::Compare_weighted_squared_radius_3 cwsr = tr.geom_traits().compare_weighted_squared_radius_3_object(); Vertex_handle nv = tr.nearest_power_vertex(p, v->cell()); @@ -416,8 +416,8 @@ get_sq_distance_to_closest_vertex(const Tr& tr, // There is no need to use tr.min_squared_distance() here because we are computing // distances between 'v' and a neighbor within their common cell, which means // that even if we are using a periodic triangulation, the distance is correctly computed. - typename Gt::Compute_squared_distance_3 csqd = tr.geom_traits().compute_squared_distance_3_object(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Compute_squared_distance_3 csqd = tr.geom_traits().compute_squared_distance_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); Vertex_container treated_vertices; FT min_sq_dist = std::numeric_limits::infinity(); @@ -477,8 +477,8 @@ get_sq_distance_to_closest_vertex(const Tr& tr, // There is no need to use tr.min_squared_distance() here because we are computing // distances between 'v' and a neighbor within their common cell, which means // that even if we are using a periodic triangulation, the distance is correctly computed. - typename Gt::Compute_squared_distance_3 csqd = tr.geom_traits().compute_squared_distance_3_object(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Compute_squared_distance_3 csqd = tr.geom_traits().compute_squared_distance_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); Vertex_container treated_vertices; FT min_sq_dist = std::numeric_limits::infinity(); @@ -524,9 +524,9 @@ Triangulation_helpers:: well_oriented(const Tr& tr, const Cell_vector& cells_tos) const { - typedef typename Tr::Geom_traits Gt; - typename Gt::Orientation_3 orientation = tr.geom_traits().orientation_3_object(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typedef typename Tr::Geom_traits GT; + typename GT::Orientation_3 orientation = tr.geom_traits().orientation_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); typename Cell_vector::const_iterator it = cells_tos.begin(); for( ; it != cells_tos.end() ; ++it) @@ -570,9 +570,9 @@ well_oriented(const Tr& tr, const Cell_vector& cells_tos, const Point_getter& pg) const { - typedef typename Tr::Geom_traits Gt; - typename Gt::Orientation_3 orientation = tr.geom_traits().orientation_3_object(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typedef typename Tr::Geom_traits GT; + typename GT::Orientation_3 orientation = tr.geom_traits().orientation_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); typename Cell_vector::const_iterator it = cells_tos.begin(); for( ; it != cells_tos.end() ; ++it) 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 547365f9a1e..aa607e7b088 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h @@ -43,18 +43,18 @@ template class Triangulation_sizing_field { // Types - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Gt::FT FT; + typedef typename GT::FT FT; - typedef Triangulation_vertex_base_with_info_3 Vbb; - typedef Regular_triangulation_vertex_base_3 Vb; - typedef Triangulation_cell_base_3 Cbb; + typedef Triangulation_vertex_base_with_info_3 Vbb; + typedef Regular_triangulation_vertex_base_3 Vb; + typedef Triangulation_cell_base_3 Cbb; typedef Regular_triangulation_cell_base_3< - Gt, Cbb, Discard_hidden_points> Cb; + GT, Cbb, Discard_hidden_points> Cb; typedef Triangulation_data_structure_3 Tds; - typedef Regular_triangulation_3 Compact_triangulation; + typedef Regular_triangulation_3 Compact_triangulation; typedef Compact_triangulation Ctr; typedef typename Tr::Vertex_handle Vertex_handle; @@ -181,8 +181,8 @@ typename Triangulation_sizing_field::FT Triangulation_sizing_field:: interpolate_on_cell_vertices(const Weighted_point& p, const CCell_handle& cell) const { - typename Gt::Construct_point_3 cp = ctr_.geom_traits().construct_point_3_object(); - typename Gt::Compute_volume_3 volume = ctr_.geom_traits().compute_volume_3_object(); + typename GT::Construct_point_3 cp = ctr_.geom_traits().construct_point_3_object(); + typename GT::Compute_volume_3 volume = ctr_.geom_traits().compute_volume_3_object(); // Interpolate value using tet vertices values const FT& va = cell->vertex(0)->info(); @@ -217,8 +217,8 @@ typename Triangulation_sizing_field::FT Triangulation_sizing_field:: interpolate_on_facet_vertices(const Weighted_point& p, const CCell_handle& cell) const { - typename Gt::Construct_point_3 cp = ctr_.geom_traits().construct_point_3_object(); - typename Gt::Compute_area_3 area = ctr_.geom_traits().compute_area_3_object(); + typename GT::Construct_point_3 cp = ctr_.geom_traits().construct_point_3_object(); + typename GT::Compute_area_3 area = ctr_.geom_traits().compute_area_3_object(); // Find infinite vertex and put it in k0 int k0 = 0; diff --git a/Mesh_3/include/CGAL/Mesh_3/Uniform_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Uniform_sizing_field.h index 273ba6b6f37..3e552737ee6 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Uniform_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Uniform_sizing_field.h @@ -27,9 +27,9 @@ namespace Mesh_3 { template class Uniform_sizing_field { - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Gt::FT FT; + typedef typename GT::FT FT; public: // Vertices of mesh triangulation do not need to be updated 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 d2dfef196e0..edfef11f039 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 @@ -96,25 +96,25 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, TransformOperator transform = CGAL::Identity()) { typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; typedef typename Tr::Weighted_point Weighted_point; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Segment Segment_3; typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Cell_handle Cell_handle; - typedef typename Gt::Vector_3 Vector_3; + typedef typename GT::Vector_3 Vector_3; typedef MeshDomain Mesh_domain; Tr& tr = c3t3.triangulation(); - typename Gt::Compare_weighted_squared_radius_3 cwsr = + typename GT::Compare_weighted_squared_radius_3 cwsr = tr.geom_traits().compare_weighted_squared_radius_3_object(); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Construct_weighted_point_3 cwp = + typename GT::Construct_weighted_point_3 cwp = tr.geom_traits().construct_weighted_point_3_object(); if(protect_features) { diff --git a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_cell_criteria.h b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_cell_criteria.h index 5fed977c7ef..c5a148d78fa 100644 --- a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_cell_criteria.h +++ b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_cell_criteria.h @@ -395,8 +395,8 @@ class Cell_criteria_visitor_with_features typedef Criterion_visitor Base; typedef Cell_criteria_visitor_with_features Self; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; typedef typename Tr::Weighted_point Weighted_point; @@ -414,11 +414,11 @@ public: , ratio_(0) , size_ratio_(0.5*0.5*4.) { - typename Gt::Compare_weighted_squared_radius_3 compare = + typename GT::Compare_weighted_squared_radius_3 compare = tr.geom_traits().compare_weighted_squared_radius_3_object(); - typename Gt::Compute_weight_3 cw = + typename GT::Compute_weight_3 cw = tr.geom_traits().compute_weight_3_object(); - typename Gt::Compute_squared_radius_smallest_orthogonal_sphere_3 sq_radius = + typename GT::Compute_squared_radius_smallest_orthogonal_sphere_3 sq_radius = tr.geom_traits().compute_squared_radius_smallest_orthogonal_sphere_3_object(); int k1 = 0; @@ -560,8 +560,8 @@ class Cell_criterion_visitor_with_radius_lower_bound typedef Cell_criteria_visitor_with_features Base; typedef Cell_criterion_visitor_with_radius_lower_bound Self; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; public: typedef typename Base::Quality Cell_quality; diff --git a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h index ed57357bda9..4e42d381005 100644 --- a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h +++ b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h @@ -102,14 +102,14 @@ protected: CGAL_assertion (f.first->is_facet_on_surface(f.second)); CGAL_assertion (B_ != 0); - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Gt::Compute_squared_area_3 Area; - typedef typename Gt::Compute_squared_distance_3 Distance; - typedef typename Gt::Construct_point_3 Construct_point_3; - typedef typename Gt::Construct_triangle_3 Construct_triangle_3; + typedef typename GT::Compute_squared_area_3 Area; + typedef typename GT::Compute_squared_distance_3 Distance; + typedef typename GT::Construct_point_3 Construct_point_3; + typedef typename GT::Construct_triangle_3 Construct_triangle_3; Area area = tr.geom_traits().compute_squared_area_3_object(); Distance distance = tr.geom_traits().compute_squared_distance_3_object(); @@ -127,7 +127,7 @@ protected: const FT d12 = distance(p1,p2); const FT d13 = distance(p1,p3); const FT d23 = distance(p2,p3); - const FT min_d123 = details::min_3(d12,d13,d23); + const FT min_d123 = details::min_3(d12,d13,d23); const FT aspect_ratio = 4 * triangle_area * min_d123 / (d12*d13*d23); @@ -193,11 +193,11 @@ protected: CGAL_assertion(f.first->is_facet_on_surface(f.second)); CGAL_assertion (B_ != 0); - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Weighted_point Weighted_point; typedef typename Tr::Bare_point Bare_point; - typename Gt::Construct_weighted_circumcenter_3 weighted_circumcenter = + typename GT::Construct_weighted_circumcenter_3 weighted_circumcenter = tr.geom_traits().construct_weighted_circumcenter_3_object(); const Weighted_point& p1 = tr.point(f.first, (f.second+1)&3); @@ -264,11 +264,11 @@ protected: { CGAL_assertion (f.first->is_facet_on_surface(f.second)); - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Weighted_point Weighted_point; typedef typename Tr::Bare_point Bare_point; - typename Gt::Construct_weighted_circumcenter_3 weighted_circumcenter = + typename GT::Construct_weighted_circumcenter_3 weighted_circumcenter = tr.geom_traits().construct_weighted_circumcenter_3_object(); const Weighted_point& p1 = tr.point(f.first, (f.second+1)&3); @@ -346,11 +346,11 @@ protected: { CGAL_assertion (f.first->is_facet_on_surface(f.second)); - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); const Weighted_point& wp1 = tr.point(f.first, (f.second+1)&3); const Bare_point& p1 = cp(wp1); @@ -426,11 +426,11 @@ protected: CGAL_assertion (f.first->is_facet_on_surface(f.second)); CGAL_assertion (B_ != 0); - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); const Weighted_point& wp1 = tr.point(f.first, (f.second+1)&3); const Bare_point p1 = cp(wp1); @@ -653,8 +653,8 @@ class Facet_criterion_visitor_with_features typedef Mesh_3::Criterion_visitor Base; typedef Facet_criterion_visitor_with_features Self; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; public: typedef typename Base::Quality Facet_quality; @@ -672,15 +672,15 @@ public: , angle_ratio_(0.5*0.5*4.) , size_ratio_(0.4*0.4*4.) { - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Weighted_point Weighted_point; typedef typename Tr::Cell_handle Cell_handle; - typename Gt::Compute_squared_radius_smallest_orthogonal_sphere_3 sq_radius = + typename GT::Compute_squared_radius_smallest_orthogonal_sphere_3 sq_radius = tr.geom_traits().compute_squared_radius_smallest_orthogonal_sphere_3_object(); - typename Gt::Compute_weight_3 cw = + typename GT::Compute_weight_3 cw = tr.geom_traits().compute_weight_3_object(); - typename Gt::Compare_weighted_squared_radius_3 compare = + typename GT::Compare_weighted_squared_radius_3 compare = tr.geom_traits().compare_weighted_squared_radius_3_object(); const Cell_handle& c = fh.first; @@ -817,8 +817,8 @@ class Facet_criterion_visitor_with_radius_lower_bound typedef Facet_criterion_visitor_with_features Base; typedef Facet_criterion_visitor_with_radius_lower_bound Self; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; public: typedef typename Base::Quality Facet_quality; diff --git a/Mesh_3/include/CGAL/Mesh_3/sliver_criteria.h b/Mesh_3/include/CGAL/Mesh_3/sliver_criteria.h index 335bd89291c..6ecabd1aa90 100644 --- a/Mesh_3/include/CGAL/Mesh_3/sliver_criteria.h +++ b/Mesh_3/include/CGAL/Mesh_3/sliver_criteria.h @@ -36,9 +36,9 @@ template Base; typedef typename Base::Tetrahedron_3 Tetrahedron_3; typedef typename Base::Cell_vector Cell_vector; - typedef typename Base::Gt Gt; + typedef typename Base::GT GT; public: typedef typename Base::Cell_handle Cell_handle; @@ -163,7 +163,7 @@ class Radius_ratio_criterion { protected: typedef Sliver_criterion Base; - typedef typename Base::Gt Gt; + typedef typename Base::GT GT; typedef typename Base::Tetrahedron_3 Tetrahedron_3; typedef typename Base::Cell_vector Cell_vector; typedef Radius_ratio_criterion RR_criterion; diff --git a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h index 1b1e53c9305..d33523015da 100644 --- a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h +++ b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h @@ -115,13 +115,13 @@ typename Tr::Geom_traits::FT edge_sq_length(const typename Tr::Edge& e, const Tr& tr) { - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Compute_squared_distance_3 sq_distance = + typename GT::Compute_squared_distance_3 sq_distance = tr.geom_traits().compute_squared_distance_3_object(); const Weighted_point& wp = tr.point(e.first, e.second); @@ -390,9 +390,9 @@ protected: typedef typename Base::Cell_handle Cell_handle; typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; @@ -447,15 +447,15 @@ protected: const Tr& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Construct_weighted_point_3 cwp = + typename GT::Construct_weighted_point_3 cwp = tr.geom_traits().construct_weighted_point_3_object(); - typename Gt::Compute_squared_length_3 sq_length = + typename GT::Compute_squared_length_3 sq_length = tr.geom_traits().compute_squared_length_3_object(); - typename Gt::Construct_translated_point_3 translate = + typename GT::Construct_translated_point_3 translate = tr.geom_traits().construct_translated_point_3_object(); - typename Gt::Construct_vector_3 vector = + typename GT::Construct_vector_3 vector = tr.geom_traits().construct_vector_3_object(); // create a helper @@ -548,9 +548,9 @@ protected: typedef typename Base::Vertex_handle Vertex_handle; typedef typename Base::Cell_handle Cell_handle; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; @@ -650,9 +650,9 @@ private: { const Triangulation& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); - typename Gt::Construct_translated_point_3 translate = + typename GT::Construct_translated_point_3 translate = c3t3.triangulation().geom_traits().construct_translated_point_3_object(); unsigned int index = cell->index(v); @@ -724,9 +724,9 @@ protected: typedef typename Base::Cell_handle Cell_handle; typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; @@ -827,7 +827,7 @@ private: CGAL_precondition(cell->has_vertex(v)); const typename C3T3::Triangulation& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); const int i = cell->index(v); @@ -875,9 +875,9 @@ protected: typedef typename Base::Cell_handle Cell_handle; typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; @@ -979,9 +979,9 @@ private: CGAL_assertion(cell->has_vertex(v)); const typename C3T3::Triangulation& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Compute_squared_distance_3 sq_distance = + typename GT::Compute_squared_distance_3 sq_distance = tr.geom_traits().compute_squared_distance_3_object(); const int i = cell->index(v); @@ -1041,9 +1041,9 @@ private: { const typename C3T3::Triangulation& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Compute_approximate_dihedral_angle_3 approx_dihedral_angle = + typename GT::Compute_approximate_dihedral_angle_3 approx_dihedral_angle = tr.geom_traits().compute_approximate_dihedral_angle_3_object(); const Weighted_point& wp1 = tr.point(cell, k1); @@ -1069,7 +1069,7 @@ private: { const typename C3T3::Triangulation& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); int k1 = (i+1)&3; int k2 = (i+2)&3; @@ -1108,9 +1108,9 @@ protected: typedef typename Base::Cell_handle Cell_handle; typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename Tr::Bare_point Bare_point; @@ -1171,7 +1171,7 @@ protected: Vector_3 random_vector_fixed_size(const C3T3& c3t3, const FT& vector_sq_size) const { - typename Gt::Compute_squared_length_3 sq_length = + typename GT::Compute_squared_length_3 sq_length = c3t3.triangulation().geom_traits().compute_squared_length_3_object(); Vector_3 rnd_vector(random_ft(),random_ft(),random_ft()); @@ -1236,9 +1236,9 @@ protected: typedef typename Base::Cell_handle Cell_handle; typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Vector_3 Vector_3; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; @@ -1313,13 +1313,13 @@ private: { typedef Triangulation_helpers Th; - typename Gt::Construct_point_3 cp = + typename GT::Construct_point_3 cp = c3t3.triangulation().geom_traits().construct_point_3_object(); - typename Gt::Construct_weighted_point_3 cwp = + typename GT::Construct_weighted_point_3 cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); - typename Gt::Construct_translated_point_3 translate = + typename GT::Construct_translated_point_3 translate = c3t3.triangulation().geom_traits().construct_translated_point_3_object(); - typename Gt::Construct_vector_3 vector = + typename GT::Construct_vector_3 vector = c3t3.triangulation().geom_traits().construct_vector_3_object(); modified_vertices.clear(); 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 a4f81ce1812..4014f13835c 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 @@ -452,7 +452,7 @@ public: }; // end class Polyline -template +template struct Mesh_domain_segment_of_curve_primitive{ typedef typename std::iterator_traits::value_type Map_value_type; typedef typename Map_value_type::first_type Curve_id; @@ -464,7 +464,7 @@ struct Mesh_domain_segment_of_curve_primitive{ typedef typename std::iterator_traits< typename Polyline::const_iterator>::value_type Point; - typedef typename Gt::Segment_3 Datum; + typedef typename GT::Segment_3 Datum; Id id_; @@ -844,17 +844,17 @@ private: private: typedef std::map Corners; - typedef Mesh_3::internal::Polyline Polyline; + typedef Mesh_3::internal::Polyline Polyline; typedef std::map Edges; typedef std::map Edges_incidences; typedef std::map > Corners_tmp_incidences; typedef std::map Corners_incidences; typedef Mesh_3::internal::Mesh_domain_segment_of_curve_primitive< - Gt, + GT, typename Edges::const_iterator> Curves_primitives; - typedef CGAL::AABB_traits AABB_curves_traits; Corners corners_; diff --git a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h index e7f3c4fa983..cbaf1add111 100644 --- a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h @@ -97,15 +97,13 @@ provides a bound for the size criterion. \sa `MeshCriteria_3` \sa `CGAL::Mesh_criteria_3` \sa `MeshDomainField_3` - */ - template < typename Tr > class Mesh_edge_criteria_3 { private: typedef Mesh_edge_criteria_3 Self; - typedef typename Tr::Geom_traits Gt; + typedef typename Tr::Geom_traits GT; public: @@ -140,7 +138,7 @@ public: const FT& min_length_bound = 0) : p_size_(new Mesh_3::internal::Sizing_field_container< - Mesh_constant_domain_field_3 , + Mesh_constant_domain_field_3 , FT, Point_3, Index>(length_bound)) diff --git a/Mesh_3/include/CGAL/Mesh_triangulation_3.h b/Mesh_3/include/CGAL/Mesh_triangulation_3.h index ee7d53ab710..3f3ca673523 100644 --- a/Mesh_3/include/CGAL/Mesh_triangulation_3.h +++ b/Mesh_3/include/CGAL/Mesh_triangulation_3.h @@ -131,7 +131,7 @@ type to be used for the 3D triangulation embedding the mesh. \tparam MD must be a model of `MeshDomain_3`. -\tparam Gt must be a model of `MeshTriangulationTraits_3` or `Default` +\tparam GT must be a model of `MeshTriangulationTraits_3` or `Default` and defaults to `Kernel_traits::%Kernel`. \tparam Concurrency_tag_ enables sequential versus parallel meshing and optimization algorithms. @@ -144,29 +144,29 @@ and defaults to `Mesh_vertex_base_3`. \tparam Cell_base_ must be a model of `MeshCellBase_3` or `Default` and defaults to `Compact_mesh_cell_base_3`. -\warning To improve the robustness of the meshing process, the input traits `Gt` +\warning To improve the robustness of the meshing process, the input traits `GT` is wrapped with the traits class `Robust_weighted_circumcenter_filtered_traits_3`. - The class `Robust_weighted_circumcenter_filtered_traits_3` upgrades the functors + The class `Robust_weighted_circumcenter_filtered_traits_3` upgrades the functors models of `Kernel::ConstructWeightedCircumcenter_3`, `Kernel::ComputeSquaredRadius_3`, and `Kernel::ComputeSquaredRadiusSmallestOrthogonalSphere_3` that are - provided by `Gt` to use exact computations when the geometric configuration - is close to degenerate (e.g. almost coplanar points).
    + provided by `GT` to use exact computations when the geometric configuration + is close to degenerate (e.g. almost coplanar points).

    Users should therefore be aware that the traits class of the triangulation - will have type `Robust_weighted_circumcenter_filtered_traits_3`. + will have type `Robust_weighted_circumcenter_filtered_traits_3`. \sa `make_mesh_3()` \sa `Mesh_complex_3_in_triangulation_3` */ template struct Mesh_triangulation_3 { private: - using K = typename Default::Lazy_get >::type; + using K = typename Default::Lazy_get >::type; using Geom_traits = typename details::Mesh_geom_traits_generator::type; diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 4dc89cf407e..6d50190ac98 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -79,25 +79,25 @@ max_length(const Bbox_3& b) // ----------------------------------- // Geometric traits generator // ----------------------------------- -template < typename Gt, +template < typename GT, typename Use_exact_intersection_construction_tag > struct IGT_generator {}; -template < typename Gt > -struct IGT_generator +template < typename GT > +struct IGT_generator { #ifdef CGAL_MESH_3_NEW_ROBUST_INTERSECTION_TRAITS - typedef CGAL::Mesh_3::Robust_intersection_traits_3_new type; + typedef CGAL::Mesh_3::Robust_intersection_traits_3_new type; #else // NOT CGAL_MESH_3_NEW_ROBUST_INTERSECTION_TRAITS - typedef CGAL::Mesh_3::Robust_intersection_traits_3 type; + typedef CGAL::Mesh_3::Robust_intersection_traits_3 type; #endif // NOT CGAL_MESH_3_NEW_ROBUST_INTERSECTION_TRAITS typedef type Type; }; -template < typename Gt > -struct IGT_generator +template < typename GT > +struct IGT_generator { - typedef Gt type; + typedef GT type; typedef type Type; }; diff --git a/Mesh_3/test/Mesh_3/test_criteria.cpp b/Mesh_3/test/Mesh_3/test_criteria.cpp index 317fcb5f3e9..a10460ceee2 100644 --- a/Mesh_3/test/Mesh_3/test_criteria.cpp +++ b/Mesh_3/test/Mesh_3/test_criteria.cpp @@ -49,8 +49,8 @@ struct Tester typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; C3t3 c3t3_; // Cells & facets diff --git a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp index fe31c62f6a4..f0371d3a96d 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp @@ -24,7 +24,7 @@ typedef CGAL::Parallel_if_available_tag Concurrency_tag; typedef CGAL::Mesh_triangulation_3::type Tr; -typedef Tr::Geom_traits Gt; +typedef Tr::Geom_traits GT; typedef CGAL::Mesh_complex_3_in_triangulation_3(domain, criteria, no_perturb(), no_exude()); - Gt::Construct_weighted_circumcenter_3 w_circumcenter = + GT::Construct_weighted_circumcenter_3 w_circumcenter = c3t3.triangulation().geom_traits().construct_weighted_circumcenter_3_object(); int return_code = 0; diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp index 9a0c5677168..c44966f9cce 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp @@ -31,9 +31,9 @@ struct Polyhedron_tester : public Tester { void polyhedron() const { - typedef K Gt; - typedef CGAL::Polyhedron_3 Polyhedron; - typedef CGAL::Polyhedral_mesh_domain_3 Mesh_domain; + typedef K GT; + typedef CGAL::Polyhedron_3 Polyhedron; + typedef CGAL::Polyhedral_mesh_domain_3 Mesh_domain; CGAL_static_assertion((std::is_same< typename Mesh_domain::Surface_patch_index, diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp index 5cfdd17ca79..ad3c190e056 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp @@ -75,9 +75,9 @@ struct Polyhedron_with_features_tester : public Tester } void operator()() const { - typedef CGAL::Mesh_3::Robust_intersection_traits_3 Gt; - typedef typename CGAL::Mesh_polyhedron_3::type Polyhedron; - typedef CGAL::Polyhedral_mesh_domain_with_features_3 GT; + typedef typename CGAL::Mesh_polyhedron_3::type Polyhedron; + typedef CGAL::Polyhedral_mesh_domain_with_features_3 Mesh_domain; diff --git a/Mesh_3/test/Mesh_3/test_min_size_criteria.cpp b/Mesh_3/test/Mesh_3/test_min_size_criteria.cpp index 427030c4c70..d42bef33f80 100644 --- a/Mesh_3/test/Mesh_3/test_min_size_criteria.cpp +++ b/Mesh_3/test/Mesh_3/test_min_size_criteria.cpp @@ -37,7 +37,7 @@ public: Concurrency_tag>::type; using C3t3 = CGAL::Mesh_complex_3_in_triangulation_3; - using Gt = typename Tr::Geom_traits; + using GT = typename Tr::Geom_traits; using FT = typename Tr::Geom_traits::FT; using Bare_point = typename Tr::Bare_point; @@ -79,8 +79,8 @@ public: CGAL::parameters::no_perturb()); const Tr& tr = c3t3.triangulation(); - typename Gt::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); - typename Gt::Compute_squared_radius_3 sq_radius = tr.geom_traits().compute_squared_radius_3_object(); + typename GT::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); + typename GT::Compute_squared_radius_3 sq_radius = tr.geom_traits().compute_squared_radius_3_object(); double max_sq_facet_radius = 0.; double max_sq_cell_radius = 0.; From 97097f1f040472b2fa8b02d778ecb22b55109d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 26 May 2023 13:19:19 +0200 Subject: [PATCH 046/156] misc fixes --- Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h | 2 +- .../include/CGAL/Gray_image_mesh_domain_3.h | 8 +- .../Implicit_to_labeling_function_wrapper.h | 42 +++--- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 29 ++-- Mesh_3/include/CGAL/Mesh_cell_base_3.h | 23 +-- Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 6 +- .../Mesh_domain_with_polyline_features_3.h | 138 +++++++++-------- Mesh_3/include/CGAL/Mesh_edge_criteria_3.h | 12 +- Mesh_3/include/CGAL/Mesh_facet_criteria_3.h | 10 +- Mesh_3/include/CGAL/Mesh_polyhedron_3.h | 18 ++- Mesh_3/include/CGAL/Mesh_triangulation_3.h | 41 +++-- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 87 ++++++----- .../include/CGAL/Polyhedral_mesh_domain_3.h | 64 ++++---- .../Polyhedral_mesh_domain_with_features_3.h | 141 ++++++++++-------- Mesh_3/include/CGAL/Triangle_accessor_3.h | 19 +-- 15 files changed, 321 insertions(+), 319 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h index 68138d36775..f1b619635db 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h @@ -41,7 +41,7 @@ and `is_facet_visited(1)` in parallel must be safe) Moreover, the parallel algorithms require an erase counter in each cell (see below). -\cgalRefines{SimplicialMeshCellBase_3,RegularTriangulationCellBaseWithWeightedCircumcenter_3,CopyConstructible} +\cgalRefines{SimplicialMeshCellBase_3,RegularTriangulationCellBaseWithWeightedCircumcenter_3} \cgalHasModel `CGAL::Compact_mesh_cell_base_3` \cgalHasModel `CGAL::Mesh_cell_base_3` 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 44e555b9027..cb5f6cc262f 100644 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h @@ -67,7 +67,6 @@ with a model of the concept `BisectionGeometricTraits_3`. \tparam Image_word_type is the data type encoded in the `Image` input file - \cgalModels `MeshDomain_3` \sa `BisectionGeometricTraits_3` @@ -149,13 +148,12 @@ public: CGAL_assertion(transform(value_outside) == 0); } - /// Destructor + // Destructor virtual ~Gray_image_mesh_domain_3() {} -}; // end class Gray_image_mesh_domain_3 +}; -} // end namespace CGAL +} // namespace CGAL #include - #endif // CGAL_GRAY_IMAGE_MESH_DOMAIN_3_H diff --git a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h index 8c1c880cb70..c57f4e4d3b3 100644 --- a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h @@ -157,15 +157,17 @@ For example, the multidomain described by the three functions [f1,f2,f3] and the The first one matches the locus of points satisfying f1(p)<0 and f2(p)<0 and f3(p)>0.
    The second one matches the locus of points satisfying f1(p)>0 and f2(p)<0 and f3(p)>0.
    -\tparam ImplicitFunction provides the definition of the function. +\tparam Function provides the definition of the function. This parameter stands for a model of the concept `ImplicitFunction` described in the surface mesh generation package. -The number types `ImplicitFunction::FT` and `BGT::FT` are required to match. +The number types `Function::FT` and `BGT::FT` are required to match. \sa `CGAL::Labeled_mesh_domain_3`. - */ - +#ifdef DOXYGEN_RUNNING +template +#else template +#endif class Implicit_multi_domain_to_labeling_function_wrapper { template @@ -184,20 +186,20 @@ class Implicit_multi_domain_to_labeling_function_wrapper }; public: - typedef int return_type; - typedef ImplicitFunction Function; - typedef typename Implicit_function_traits::Point Point_3; - /// \name Types /// @{ - //! - typedef std::vector Function_vector; -#ifdef DOXYGEN_RUNNING - //! - typedef typename Function::Point Point_3; -#endif - /// @} +#ifdef DOXYGEN_RUNNING + typedef typename Function::Point Point_3; +#else + typedef ImplicitFunction Function; + typedef typename Implicit_function_traits::Point Point_3; + typedef int return_type; +#endif + + typedef std::vector Function_vector; + + /// @} private: std::vector funcs; @@ -205,15 +207,15 @@ private: std::vector bmasks; public: - - /// \name Creation /// @{ /*! * \brief Construction from a vector of implicit functions and a vector of vector of signs. + * * \param implicit_functions the vector of implicit functions. * \param position_vectors the vector of vector of signs. Each vector of positions describes a component. + * * \sa `Sign` */ Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& implicit_functions, const std::vector >& position_vectors) @@ -246,6 +248,7 @@ public: } /*! * \brief Construction from a vector of implicit functions. + * \param implicit_functions the vector of implicit functions. * * Position vectors are built automatically so that the union of components equals the union of the functions. @@ -278,6 +281,7 @@ public: /*! * \brief Construction from a vector of implicit functions and a vector of strings. + * * \param implicit_functions the vector of implicit functions. * \param position_strings the vector of strings. The strings contained in this vector must contain '+' or '-' only. Each string (vector of positions) describes a component. */ @@ -337,9 +341,7 @@ public: } }; -} // end namespace CGAL - - +} // end namespace CGAL #if defined(BOOST_MSVC) # pragma warning(pop) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 3782f9d46f4..b273da9af2e 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -336,7 +336,9 @@ Let `p` be a Point. `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`. +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` @@ -350,9 +352,9 @@ template > class Labeled_mesh_domain_3 #ifndef DOXYGEN_RUNNING -: protected details::Labeled_mesh_domain_3_impl + : protected details::Labeled_mesh_domain_3_impl #endif { public: @@ -381,7 +383,7 @@ public: /// The number type (a field type) of the geometric traits class typedef typename Geom_traits::FT FT; ///@} -#else +#else // DOXYGEN_RUNNING typedef boost::optional Subdomain; // Type of indexes for cells of the input complex @@ -428,7 +430,7 @@ public: typedef typename BGT::FT FT; typedef BGT Geom_traits; using Impl_details::construct_pair_functor; -#endif +#endif // DOXYGEN_RUNNING /// \name Creation /// @{ @@ -451,16 +453,19 @@ public: * \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) + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , typename std::enable_if>::type* = nullptr +#endif // DOXYGEN_RUNNING + ) :Impl_details(function, bounding_object, parameters::choose_parameter(parameters::get_parameter(np, internal_np::error_bound), FT(1e-3)), @@ -496,7 +501,7 @@ public: template #if !defined(BOOST_MSVC) CGAL_DEPRECATED -#endif +#endif // BOOST_MSVC Labeled_mesh_domain_3(const Function& function, const Bounding_object& bounding_object, double error_bound, @@ -505,8 +510,8 @@ public: bounding_object, parameters::relative_error_bound(error_bound)) {} -#endif -#endif +#endif // CGAL_NO_DEPRECATED_CODE +#endif // DOXYGEN_RUNNING /// \name Creation of domains from 3D images /// @{ diff --git a/Mesh_3/include/CGAL/Mesh_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_cell_base_3.h index 787124c3ec7..14f18f4a09b 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_base_3.h @@ -125,15 +125,14 @@ of the concept `RegularTriangulationCellBaseWithWeightedCircumcenter_3` and defa \sa `CGAL::Compact_mesh_cell_base_3` */ -template< class GT, - class MD, - class Cb= CGAL::Regular_triangulation_cell_base_with_weighted_circumcenter_3< - GT, CGAL::Regular_triangulation_cell_base_3 > > +template > > class Mesh_cell_base_3 -: public Mesh_3::Mesh_surface_cell_base_3 #ifndef DOXYGEN_RUNNING -, public Mesh_cell_base_3_base< - typename Mesh_3::Mesh_surface_cell_base_3::Tds::Concurrency_tag> + : public Mesh_3::Mesh_surface_cell_base_3, + public Mesh_cell_base_3_base::Tds::Concurrency_tag> #endif { typedef typename GT::FT FT; @@ -163,7 +162,6 @@ public: typedef Mesh_cell_base_3 Other; }; - // Constructors Mesh_cell_base_3() : Base() , subdomain_index_() @@ -225,6 +223,9 @@ public: bool is_cache_valid() const { return sliver_cache_validity_; } void reset_cache_validity() const { sliver_cache_validity_ = false; } + /// \name I/O + ///@{ + static std::string io_signature() { @@ -233,6 +234,8 @@ public: + Get_io_signature()(); } + /// @} + #ifdef CGAL_INTRUSIVE_LIST public: Cell_handle next_intrusive() const { return next_intrusive_; } @@ -248,8 +251,9 @@ public: } #endif // CGAL_INTRUSIVE_LIST - /// For the determinism of Compact_container iterators + /// \name Determinism ///@{ + typedef Tag_true Has_timestamp; std::size_t time_stamp() const { @@ -258,6 +262,7 @@ public: void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } + ///@} private: diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index eab9f794440..b13a9955521 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -44,9 +44,7 @@ and a sizing field which may be a uniform or variable field. \sa `MeshCriteria_3` \sa `CGAL::Mesh_criteria_3` \sa `CGAL::make_mesh_3()` - */ - template @@ -63,6 +61,8 @@ public: */ typedef typename Tr::Geom_traits::FT FT; + /// @} + typedef Visitor_ Visitor; typedef typename Visitor::Cell_quality Cell_quality; typedef typename Visitor::Is_cell_bad Is_cell_bad; @@ -75,8 +75,6 @@ private: typedef Mesh_cell_criteria_3 Self; - /// @} - public: /// \name Creation 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 4014f13835c..a8cfa8a2610 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 @@ -62,7 +62,7 @@ public: Polyline() {} ~Polyline() {} - /// Add a point at the end of the polyline + /// adds a point at the end of the polyline void add_point(const Point_3& p) { if( points_.empty() || p != end_point() ) { @@ -70,27 +70,27 @@ public: } } - /// Returns the starting point of the polyline + /// returns the starting point of the polyline const Point_3& start_point() const { CGAL_assertion( ! points_.empty() ); return points_.front(); } - /// Returns the ending point of the polyline + /// returns the ending point of the polyline const Point_3& end_point() const { CGAL_assertion( ! points_.empty() ); return points_.back(); } - /// Returns `true` if the polyline is not degenerated + /// returns `true` if the polyline is not degenerated bool is_valid() const { return points_.size() > 1; } - /// Returns `true` if polyline is a loop + /// returns `true` if polyline is a loop bool is_loop() const { return start_point() == end_point(); @@ -201,7 +201,7 @@ public: } - /// Returns the angle at the first point. + /// returns the angle at the first point. /// \pre The polyline must be a loop. Angle angle_at_first_point() const { CGAL_precondition(is_loop()); @@ -211,7 +211,7 @@ public: return angle(prev, first, next_p); } - /// Returns the length of the polyline + /// returns the length of the polyline FT length() const { //TODO: cache result @@ -227,7 +227,7 @@ public: return result; } - /// Returns signed geodesic distance between `p` and `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 `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 @@ -332,7 +332,7 @@ private: return (points_.end() - 2); } - /// Returns an iterator on the starting point of the segment of the + /// returns an iterator on the starting point of the segment of the /// polyline which contains p /// if end_point_first is true, then --end is returned instead of begin /// if p is the starting point of a loop. @@ -523,28 +523,25 @@ features into any model of the `MeshDomain_3` concept. The 1-dimensional features are described as polylines whose endpoints are the added corners. -\tparam MD is the type -of the domain which should be extended. -It has to be a model of the `MeshDomain_3` concept. +\tparam MD is the type of the domain which is extended. It has to be a model of the `MeshDomain_3` concept. \cgalModels `MeshDomainWithFeatures_3` -\sa `MeshDomain_3` \sa `MeshPolyline_3` \sa `CGAL::Implicit_mesh_domain_3` \sa `CGAL::Polyhedral_mesh_domain_3` \sa `CGAL::Labeled_image_mesh_domain_3` - */ template < typename MD > class Mesh_domain_with_polyline_features_3 : public MD { - typedef Mesh_domain_with_polyline_features_3 Self; + typedef Mesh_domain_with_polyline_features_3 Self; public: -/// \name Types -/// @{ + /// \name Types + /// @{ + typedef typename MD::Surface_patch_index Surface_patch_index; typedef typename MD::Subdomain_index Subdomain_index; typedef int Curve_index; @@ -562,24 +559,21 @@ public: typedef CGAL::Tag_true Has_features; typedef typename MD::R::FT FT; -/// @} -#ifndef DOXYGEN_RUNNING + /// @} #ifndef CGAL_NO_DEPRECATED_CODE - typedef Curve_index Curve_segment_index; + typedef Curve_index Curve_segment_index; #endif - typedef typename MD::R Gt; - typedef Gt R; - typedef typename MD::Point_3 Point_3; -#endif // DOXYGEN_RUNNING + typedef typename MD::R GT; + typedef GT R; + typedef typename MD::Point_3 Point_3; -/// \name Creation -/// Constructors. Forwards the arguments to the constructor -/// of the base class. -/// @{ + /// \name Creation + /// @{ + // forwards the arguments to the constructor of the base class. template Mesh_domain_with_polyline_features_3(const T& ...o) : MD(o...) @@ -589,15 +583,14 @@ public: Mesh_domain_with_polyline_features_3(const Mesh_domain_with_polyline_features_3&) = default; -/// @} + /// @} -/// \name Operations -/// @{ - - /// @cond DEVELOPERS + /// \name Operations /// @{ - /// Add a 0-dimensional feature in the domain. + /// @cond DEVELOPERS + + /// adds a 0-dimensional feature in the domain. Corner_index add_corner(const Point_3& p); /// Overload where the last parameter `out` is not `CGAL::Emptyset_iterator()`. @@ -607,8 +600,9 @@ public: IndicesOutputIterator out /*= CGAL::Emptyset_iterator()*/); /*! - Add 0-dimensional features in the domain. The value type of `InputIterator` must - be `Point_3`. + adds 0-dimensional features in the domain. + + The value type of `InputIterator` must be `Point_3`. */ template void @@ -641,11 +635,13 @@ public: add_features_with_context(InputIterator first, InputIterator end, IndicesOutputIterator out /*= CGAL::Emptyset_iterator()*/); - /// @} - /// \endcond + + /// @endcond + /*! - Add 1-dimensional features in the domain. `InputIterator` value type must - be a model of the concept `MeshPolyline_3`. + adds 1-dimensional features in the domain. + + The value type of `InputIterator` must be a model of the concept `MeshPolyline_3`. */ template void @@ -653,16 +649,17 @@ public: { add_features(first, end, CGAL::Emptyset_iterator()); } /// @cond DEVELOPERS - /// Undocumented function, kept for backward-compatibility with existing - /// code + + /// Undocumented function, kept for backward-compatibility with existing code template void add_features_with_context(InputIterator first, InputIterator end) { add_features_with_context(first, end, CGAL::Emptyset_iterator()); } + /// @endcond /*! - Add 1-dimensional features (curves) from the range `[first, end)` in the domain with their incidences + adds 1-dimensional features (curves) from the range `[first, end)` in the domain with their incidences with 2-dimensional features (patches) of the domain. \tparam InputIterator input iterator over curves @@ -695,57 +692,57 @@ public: incident_patches_indices_pmap, CGAL::Emptyset_iterator()); } -/// @} -/// \name Implementation of the concept MeshDomainWithFeatures_3 -/// The following methods implement the requirement of the concept -/// `MeshDomainWithFeatures_3`. -/// @{ + /// @} - /// Implements `MeshDomainWithFeatures_3::get_corners()`. - /// OutputIterator value type is std::pair + /// \name Implementation of the concept MeshDomainWithFeatures_3 + /// The following methods implement the requirement of the concept + /// `MeshDomainWithFeatures_3`. + /// @{ + + /// implements `MeshDomainWithFeatures_3::get_corners()`. + /// OutputIterator is std::pair template OutputIterator get_corners(OutputIterator out) const; - /// Implements `MeshDomainWithFeatures_3::get_curves()`. + /// implements `MeshDomainWithFeatures_3::get_curves()`. /// OutputIterator value type is std::tuple, std::pair > template OutputIterator get_curves(OutputIterator out) const; - /// Implements `MeshDomainWithFeatures_3::curve_segment_length()`. + /// implements `MeshDomainWithFeatures_3::curve_segment_length()`. FT curve_segment_length(const Point_3& p, const Point_3 q, const Curve_index& curve_index, CGAL::Orientation orientation) const; - /// Implements `MeshDomainWithFeatures_3::curve_length()`. + /// implements `MeshDomainWithFeatures_3::curve_length()`. FT curve_length(const Curve_index& curve_index) const; - /// Implements `MeshDomainWithFeatures_3::construct_point_on_curve()`. + /// implements `MeshDomainWithFeatures_3::construct_point_on_curve()`. Point_3 construct_point_on_curve(const Point_3& starting_point, const Curve_index& curve_index, FT distance) const; - /// Implements `MeshDomainWithFeatures_3::distance_sign_along_loop()`. + /// implements `MeshDomainWithFeatures_3::distance_sign_along_loop()`. CGAL::Sign distance_sign_along_loop(const Point_3& p, const Point_3& q, const Point_3& r, const Curve_index& index) const; - /// Implements `MeshDomainWithFeatures_3::distance_sign()`. + /// implements `MeshDomainWithFeatures_3::distance_sign()`. CGAL::Sign distance_sign(const Point_3& p, const Point_3& q, const Curve_index& index) const; - /// Implements `MeshDomainWithFeatures_3::is_loop()`. + /// implements `MeshDomainWithFeatures_3::is_loop()`. bool is_loop(const Curve_index& index) const; - /// Implements `MeshDomainWithFeatures_3::is_curve_segment_covered()`. + /// implements `MeshDomainWithFeatures_3::is_curve_segment_covered()`. bool is_curve_segment_covered(const Curve_index& index, CGAL::Orientation orientation, const Point_3& c1, const Point_3& c2, const FT sq_r1, const FT sq_r2) const; - /** * Returns the index to be stored in a vertex lying on the surface identified * by `index`. @@ -760,11 +757,11 @@ public: Index index_from_subdomain_index(const Subdomain_index& index) const { return Index(index); } - /// Returns an `Index` from a `Curve_index` + /// returns an `Index` from a `Curve_index` Index index_from_curve_index(const Curve_index& index) const { return Index(index); } - /// Returns an `Index` from a `Corner_index` + /// returns an `Index` from a `Corner_index` Index index_from_corner_index(const Corner_index& index) const { return Index(index); } @@ -782,11 +779,11 @@ public: Subdomain_index subdomain_index(const Index& index) const { return boost::get(index); } - /// Returns a `Curve_index` from an `Index` + /// returns a `Curve_index` from an `Index` Curve_index curve_index(const Index& index) const { return boost::get(index); } - /// Returns a `Corner_index` from an `Index` + /// returns a `Corner_index` from an `Index` Corner_index corner_index(const Index& index) const { return boost::get(index); } @@ -832,12 +829,12 @@ public: Curve_index insert_edge(InputIterator first, InputIterator end); /// @endcond -/// @} + /// @} private: void compute_corners_incidences(); - /// Returns Index associated to p (p must be the coordinates of a corner + /// returns Index associated to p (p must be the coordinates of a corner /// point) Index point_corner_index(const Point_3& p) const; @@ -918,9 +915,11 @@ public: timer.stop(); std::cerr << " done (" << timer.time() * 1000 << " ms)" << std::endl; #endif - } // end build_curves_aabb_tree() + } // build_curves_aabb_tree() + /// @endcond -}; // end class Mesh_domain_with_polyline_features_3 + +}; // class Mesh_domain_with_polyline_features_3 @@ -1548,9 +1547,6 @@ is_curve_segment_covered(const Curve_index& index, c1, c2, sq_r1, sq_r2); } - - } //namespace CGAL - #endif // CGAL_MESH_DOMAIN_WITH_POLYLINE_FEATURES_3_H diff --git a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h index cbaf1add111..ca001d12072 100644 --- a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h @@ -122,7 +122,8 @@ public: /// \name Creation /// @{ /*! - * Returns an object to serve as criteria for edges. + * returns an object to serve as criteria for edges. + * * \param length_bound is an upper bound * for the length of the edges which are used to discretize the curves. * \param min_length_bound is a desired lower bound @@ -132,7 +133,7 @@ public: * break all the surface topology guarantees of the meshing algorithm. * It is not guaranteed to be exactly respected in the output mesh. * - * \note if one parameter is set to 0, then its corresponding criterion is ignored. + * \note If one parameter is set to 0, then its corresponding criterion is ignored. */ Mesh_edge_criteria_3(const FT& length_bound, const FT& min_length_bound = 0) @@ -149,13 +150,12 @@ public: // as int. /*! - * @tparam SizingField a model of `MeshDomainField_3` - * - * Returns an object to serve as criteria for edges. + * returns an object to serve as criteria for edges. * The behavior and semantic of the argument are the same * as above, except that the `length_bound` * parameter is a functional instead of a constant. - + * + * @tparam SizingField a model of `MeshDomainField_3` */ template < typename SizingField > Mesh_edge_criteria_3 diff --git a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h index b35a7e78f95..30adfbd26f4 100644 --- a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h @@ -68,6 +68,8 @@ public: */ typedef typename Tr::Geom_traits::FT FT; + /// @} + typedef Visitor_ Visitor; typedef typename Visitor::Facet_quality Facet_quality; typedef typename Visitor::Is_facet_bad Is_facet_bad; @@ -84,15 +86,13 @@ private: public: typedef CGAL::Tag_true Has_manifold_criterion; -/// @} - - /// \name Creation /// @{ #ifdef DOXYGEN_RUNNING /*! - Returns an object to serve as criteria for facets. + returns an object to serve as criteria for facets. + \param angle_bound is the lower bound for the angle in degrees of the surface mesh facets. \param radius_bound is a uniform upper bound @@ -105,6 +105,7 @@ public: \param min_radius_bound is a uniform lower bound for the radius of the surface Delaunay balls. Only facets with a radius larger than that bound will be refined. + @note If one parameter is set to 0, then its corresponding criterion is ignored. */ @@ -154,6 +155,7 @@ public: /** * @brief returns whether the facet `facet` is bad or not. + * * @param tr the triangulation within which `facet` lives * @param facet the facet */ diff --git a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h index f179ca9233d..8e053945d60 100644 --- a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h +++ b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h @@ -214,34 +214,40 @@ public: The class `Mesh_polyhedron_3` provides a customized `Polyhedron_3` type. This type uses as `PolyhedronItems_3` a customized type which adds data to the Vertex, Face and -Halfedge class. Those data are required to use the detection of sharp features. +Halfedge classes. Those data are required to use the detection of sharp features. \tparam IGT stands for the geometric traits associated to the meshing process. It must be a model of the two concepts `PolyhedronTraits_3` and `IntersectionGeometricTraits_3`. -\sa `CGAL::Polyhedron_3` +\sa `CGAL::Polyhedron_3` \sa `CGAL::Polyhedral_mesh_domain_with_features_3` */ -template +#ifdef DOXYGEN_RUNNING +template struct Mesh_polyhedron_3 { -#ifdef DOXYGEN_RUNNING /// \name Types /// @{ /*! - `CGAL::Polyhedron_3` type with customized `PolyhedronItems_3` + `CGAL::Polyhedron_3` type with customized `PolyhedronItems_3` designed to handle sharp feature detection. */ typedef unspecified_type type; /// @} +}; #else +template +struct Mesh_polyhedron_3 +{ typedef Polyhedron_3 > type; typedef type Type; -#endif }; +#endif + } // end namespace CGAL #endif // CGAL_MESH_POLYHEDRON_3_H diff --git a/Mesh_3/include/CGAL/Mesh_triangulation_3.h b/Mesh_3/include/CGAL/Mesh_triangulation_3.h index 3f3ca673523..3aca8774843 100644 --- a/Mesh_3/include/CGAL/Mesh_triangulation_3.h +++ b/Mesh_3/include/CGAL/Mesh_triangulation_3.h @@ -134,15 +134,15 @@ type to be used for the 3D triangulation embedding the mesh. \tparam GT must be a model of `MeshTriangulationTraits_3` or `Default` and defaults to `Kernel_traits::%Kernel`. -\tparam Concurrency_tag_ enables sequential versus parallel meshing and optimization algorithms. - Possible values are `Sequential_tag` (the default), `Parallel_tag`, - and `Parallel_if_available_tag`. +\tparam ConcurrencyTag enables sequential versus parallel meshing and optimization algorithms. + Possible values are `Sequential_tag` (the default), `Parallel_tag`, + and `Parallel_if_available_tag`. -\tparam Vertex_base__ must be a model of `MeshVertexBase_3` or `Default` -and defaults to `Mesh_vertex_base_3`. +\tparam VertexBase must be a model of `MeshVertexBase_3` or `Default` +and defaults to `Mesh_vertex_base_3`. -\tparam Cell_base_ must be a model of `MeshCellBase_3` or `Default` -and defaults to `Compact_mesh_cell_base_3`. +\tparam CellBase must be a model of `MeshCellBase_3` or `Default` +and defaults to `Compact_mesh_cell_base_3`. \warning To improve the robustness of the meshing process, the input traits `GT` is wrapped with the traits class `Robust_weighted_circumcenter_filtered_traits_3`. @@ -162,7 +162,7 @@ template + class CellBase = Default> struct Mesh_triangulation_3 { private: @@ -190,28 +190,25 @@ private: Mesh_3_regular_triangulation_3_wrapper; public: - #ifndef DOXYGEN_RUNNING using type = Triangulation; using Type = type; #else + /// \name Types + /// @{ -/// \name Types -/// @{ - -/*! -The triangulation type to be used for the 3D triangulation embedding the mesh. -This type is a wrapper around the type `CGAL::Regular_triangulation_3`, whose vertex -and cell base classes are respectively `Vertex_base` and `Cell_base`. -*/ -typedef unspecified_type type; + /*! + The triangulation type to be used for the 3D triangulation embedding the mesh. + This type is a wrapper around the type `CGAL::Regular_triangulation_3`, whose vertex + and cell base classes are respectively `VertexBase` and `CellBase`. + */ + typedef unspecified_type type; /// @} +#endif // DOXYGEN_RUNNING +}; -#endif - -}; // end struct Mesh_triangulation_3 -} // end namespace CGAL +} // end namespace CGAL #include diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 56fabd99813..987acca1567 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -85,7 +85,7 @@ surface, the sub-domain indices on both sides are known. \tparam Polyhedron stands for the type of the input polyhedral surface(s), model of `FaceListGraph`. -\tparam IGT_ stands for a geometric traits class +\tparam IGT stands for a geometric traits class providing the types and functors required to implement the intersection tests and intersection computations for polyhedral boundary surfaces. This parameter has to be instantiated @@ -93,7 +93,6 @@ with a model of the concept `IntersectionGeometricTraits_3`. \cgalModels `MeshDomainWithFeatures_3` -\sa `IntersectionGeometricTraits_3` \sa `CGAL::make_mesh_3()` \sa `CGAL::Mesh_domain_with_polyline_features_3` \sa `CGAL::Polyhedral_mesh_domain_3` @@ -104,53 +103,47 @@ template < class IGT, class Polyhedron = typename Mesh_polyhedron_3::type> class Polyhedral_complex_mesh_domain_3 : public Mesh_domain_with_polyline_features_3< - Polyhedral_mesh_domain_3< Polyhedron, - IGT> > + Polyhedral_mesh_domain_3 > #else template < class IGT_, class Polyhedron_ = typename Mesh_polyhedron_3::type, - class TriangleAccessor=CGAL::Default> + class TriangleAccessor = CGAL::Default> class Polyhedral_complex_mesh_domain_3 : public Mesh_domain_with_polyline_features_3< Polyhedral_mesh_domain_3< Polyhedron_, IGT_, TriangleAccessor, - int, //Use_patch_id_tag - Tag_true > >//Use_exact_intersection_tag + int, // Use_patch_id_tag + Tag_true > >// Use_exact_intersection_tag #endif { public: - /// The base class + // The base class typedef Polyhedron_ Polyhedron; typedef Mesh_domain_with_polyline_features_3< - Polyhedral_mesh_domain_3< - Polyhedron, IGT_, TriangleAccessor, - int, Tag_true > > Base; - /// @cond DEVELOPERS -private: + Polyhedral_mesh_domain_3< + Polyhedron, IGT_, TriangleAccessor, int, Tag_true > > Base; +private: + /// @cond DEVELOPERS typedef Polyhedral_mesh_domain_3 BaseBase; typedef Polyhedral_complex_mesh_domain_3 Self; /// @endcond public: - /*! - Numerical type. - */ + // Numerical type typedef typename Base::FT FT; - /// The polyhedron type + // The polyhedron type typedef Polyhedron Polyhedron_type; - /// \name Index types - /// @{ - /// The types are `int` or types compatible with `int`. + // The types are `int` or types compatible with `int`. typedef typename Base::Corner_index Corner_index; typedef typename Base::Curve_index Curve_index; typedef typename Base::Surface_patch_index Surface_patch_index; typedef typename Base::Subdomain_index Subdomain_index; - /// @} /// @cond DEVELOPERS typedef typename Base::Ray_3 Ray_3; @@ -162,6 +155,7 @@ public: typedef typename Base::AABB_primitive AABB_primitive; typedef typename Base::AABB_primitive_id AABB_primitive_id; typedef typename Base::Surface_patch_index Patch_id; + // Backward compatibility #ifndef CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX typedef Surface_patch_index Surface_index; @@ -192,9 +186,12 @@ protected: /// @endcond public: - /// Constructor - /*! Constructs a domain defined by a set of polyhedral surfaces, - describing a polyhedral complex. + /// \name Creation + /// @{ + + /*! + constructs a domain defined by a set of polyhedral surfaces, describing a polyhedral complex. + @param begin first iterator on the input polyhedral surfaces @param end past the end iterator on the input polyhedral surfaces @param indices_begin first iterator on the pairs of subdomain indices @@ -214,15 +211,14 @@ public: */ template - Polyhedral_complex_mesh_domain_3 - ( InputPolyhedraIterator begin, - InputPolyhedraIterator end, - InputPairOfSubdomainIndicesIterator indices_begin, - InputPairOfSubdomainIndicesIterator indices_end + Polyhedral_complex_mesh_domain_3(InputPolyhedraIterator begin, + InputPolyhedraIterator end, + InputPairOfSubdomainIndicesIterator indices_begin, + InputPairOfSubdomainIndicesIterator indices_end #ifndef DOXYGEN_RUNNING - , CGAL::Random* p_rng = nullptr + , CGAL::Random* p_rng = nullptr #endif - ) + ) : Base(p_rng) , patch_indices(indices_begin, indices_end) , borders_detected_(false) @@ -254,7 +250,10 @@ public: this->build(); } + /// @} + /// @cond DEVELOPERS + Polyhedral_complex_mesh_domain_3 ( CGAL::Random* p_rng = nullptr @@ -266,17 +265,15 @@ public: const std::vector& polyhedra() const { return stored_polyhedra; } - /// @endcond - /// @cond DEVELOPERS /*! * construct_initial_points_object() is one of the very first functions called - * when make_mesh_3 starts + * when make_mesh_3 starts. * BEFORE make_mesh_3 starts, we have to make sure that (at least) the borders have * been detected, and the polyhedral complex internal data structures initialized * So, this function is overloaded to make sure they are (checking that - * borders_detected_ is false is enough) - * Then, call the base class function + * borders_detected_ is false is enough). + * Then, call the base class function. */ typename BaseBase::Construct_initial_points construct_initial_points_object() const { @@ -289,9 +286,13 @@ public: void detect_features(FT angle_in_degree, std::vector& p, const bool dont_protect);//if true, features will not be protected + + void detect_borders(std::vector& p, const bool dont_protect); + /// @endcond + /*! - Detects sharp features and boundaries of the polyhedral components of the complex + detects sharp features and boundaries of the polyhedral components of the complex (including potential internal polyhedra), and inserts them as features of the domain. `angle_bound` gives the maximum angle (in degrees) between the two normal vectors of adjacent triangles. @@ -303,13 +304,10 @@ public: detect_features(angle_bound, stored_polyhedra, false/*do protect*/); } - /// @cond DEVELOPERS - void detect_borders(std::vector& p, const bool dont_protect); - /// @endcond /*! - Detects border edges of the polyhedral components of the complex, + detects border edges of the polyhedral components of the complex, and inserts them as features of the domain. - This function should be called alone only, and not before or after `detect_features()`. + This function should only be called alone, and not before or after `detect_features()`. */ void detect_borders() { detect_borders(stored_polyhedra, false/*do protect*/); @@ -373,11 +371,10 @@ public: this->boundary_polyhedra_ids.push_back(poly_id); } } - /// @endcond - /// @cond DEVELOPERS template - void add_vertices_to_c3t3_on_patch_without_feature_edges(C3t3& c3t3) const { + void add_vertices_to_c3t3_on_patch_without_feature_edges(C3t3& c3t3) const + { #ifdef CGAL_MESH_3_VERBOSE std::cout << "add_vertices_to_c3t3_on_patch_without_feature_edges..."; std::cout.flush(); diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 6d50190ac98..2abd37c3d77 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -133,19 +133,17 @@ with a model of the concept `IntersectionGeometricTraits_3`. \sa `IntersectionGeometricTraits_3` \sa `CGAL::make_mesh_3()`. - */ - #ifdef DOXYGEN_RUNNING template -#else -template -#endif +#else // DOXYGEN_RUNNING +template +#endif // DOXYGEN_RUNNING class Polyhedral_mesh_domain_3 { public: @@ -155,7 +153,7 @@ public: typedef Patch_id_ Patch_id; - /// Geometric object types + // Geometric object types typedef typename IGT::Point_3 Point_3; typedef typename IGT::Segment_3 Segment_3; typedef typename IGT::Ray_3 Ray_3; @@ -166,25 +164,25 @@ public: //------------------------------------------------------- // Index Types //------------------------------------------------------- - /// Type of indexes for cells of the input complex + // Type of indexes for cells of the input complex typedef int Subdomain_index; typedef boost::optional Subdomain; - /// Type of indexes for surface patch of the input complex + // Type of indexes for surface patch of the input complex typedef typename boost::property_map >::type Face_patch_id_pmap; typedef typename boost::property_traits< Face_patch_id_pmap>::value_type 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 Mesh_3::internal::Index_generator< Subdomain_index, Surface_patch_index>::type Index; typedef std::tuple Intersection; - typedef typename IGT::FT FT; // Kernel_traits compatibility @@ -229,8 +227,6 @@ public: typedef typename AABB_traits::Bounding_box Bounding_box; public: - - /// Default constructor Polyhedral_mesh_domain_3(CGAL::Random* p_rng = nullptr) : tree_() , bounding_tree_(&tree_) @@ -238,15 +234,13 @@ public: { } - -/// \name Creation -/// @{ + /// \name Creation + /// @{ /*! Construction from a bounding polyhedral surface which must be closed, and free of intersections. The inside of `bounding_polyhedron` will be meshed. */ - Polyhedral_mesh_domain_3(const Polyhedron& bounding_polyhedron #ifndef DOXYGEN_RUNNING , CGAL::Random* p_rng = nullptr @@ -270,11 +264,11 @@ public: and free of intersections. Using this constructor allows to mesh a polyhedral surface which is not closed, or has holes. The inside of `bounding_polyhedron` will be meshed. -*/ - Polyhedral_mesh_domain_3(const Polyhedron& p - ,const Polyhedron& bounding_polyhedron + */ + Polyhedral_mesh_domain_3(const Polyhedron& p, + const Polyhedron& bounding_polyhedron #ifndef DOXYGEN_RUNNING - ,CGAL::Random* p_rng = nullptr + , CGAL::Random* p_rng = nullptr #endif ) : tree_() @@ -300,14 +294,14 @@ public: * * @param begin iterator for a sequence of pointers to polyhedra * @param end iterator for a sequence of pointers to polyhedra - * @param bounding_polyhedron reference to the bounding surface + * @param bounding_polyhedron the bounding surface */ template - Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin - ,InputPolyhedraPtrIterator end - ,const Polyhedron& bounding_polyhedron + Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin, + InputPolyhedraPtrIterator end, + const Polyhedron& bounding_polyhedron #ifndef DOXYGEN_RUNNING - ,CGAL::Random* p_rng = nullptr + , CGAL::Random* p_rng = nullptr #endif ) : p_rng_(p_rng) @@ -328,7 +322,7 @@ public: } /*! - * Constructor from a sequence of polyhedral surfaces, without bounding + * Constructor from a sequence of polyhedral surfaces, without a bounding * surface. The domain will always answer `false` to `is_in_domain()` * queries. * @@ -356,6 +350,8 @@ public: bounding_tree_ = 0; } + /// @} + // Destructor ~Polyhedral_mesh_domain_3() { if(bounding_tree_ != 0 && bounding_tree_ != &tree_) { @@ -366,11 +362,9 @@ public: void set_surface_only() { bounding_tree_ = 0; } -/// @} - /** - * Constructs a set of `n` points on the surface, and output them to + * 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`. */ @@ -422,7 +416,7 @@ public: return tree_.closest_point(p); } - /// Allowed query types + // Allowed query types typedef boost::mpl::vector Allowed_query_types; /** diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 7c07b8a5ef2..38c2b9570f1 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -62,14 +62,14 @@ namespace CGAL { The class `Polyhedral_mesh_domain_with_features_3` implements a domain whose boundary is a simplicial polyhedral surface. -This surface must be free of intersection. -It can either be closed, + +This surface must be free of intersection. It can either be closed, included inside another polyhedral surface which is closed and free of intersection, or open. In the latter case, the meshing process will only take care of the quality of the 1D (features and boundaries) and 2D (surfaces) components of the mesh. -It is a model of the concept `MeshDomainWithFeatures_3`. It also -provides a member function to automatically detect sharp features and boundaries from +It is a model of the concept `MeshDomainWithFeatures_3`. It also provides +a member function to automatically detect sharp features and boundaries from the input polyhedral surface(s). \tparam IGT stands for a geometric traits class providing the types @@ -78,7 +78,6 @@ for polyhedral boundary surfaces. This parameter has to be instantiated with a model of the concept `IntersectionGeometricTraits_3`. - \tparam Polyhedron stands for the type of the input polyhedral surface(s), model of `FaceListGraph`. \cgalModels `MeshDomainWithFeatures_3` @@ -88,25 +87,25 @@ instantiated with a model of the concept \sa `CGAL::Mesh_polyhedron_3` */ #ifdef DOXYGEN_RUNNING -template < class IGT - ,class Polyhedron = typename Mesh_polyhedron_3::type> +template ::type> class Polyhedral_mesh_domain_with_features_3 : public Mesh_domain_with_polyline_features_3< - Polyhedral_mesh_domain_3< Polyhedron, - IGT> > + Polyhedral_mesh_domain_3 > #else -template < class IGT_ - ,class Polyhedron_ = typename Mesh_polyhedron_3::type - ,class TriangleAccessor= CGAL::Default - ,class Patch_id=int - ,class Use_exact_intersection_construction_tag = Tag_true> +template ::type, + class TriangleAccessor = CGAL::Default, + class Patch_id = int, + class Use_exact_intersection_construction_tag = Tag_true> class Polyhedral_mesh_domain_with_features_3 : public Mesh_domain_with_polyline_features_3< - Polyhedral_mesh_domain_3< Polyhedron_, - IGT_, - TriangleAccessor, - Patch_id, - Use_exact_intersection_construction_tag > > + Polyhedral_mesh_domain_3 > #endif { typedef Mesh_domain_with_polyline_features_3< @@ -131,8 +130,9 @@ public: typedef typename Base::Surface_patch_index Surface_patch_index; typedef typename Base::Subdomain_index Subdomain_index; + // Backward-compatibility #ifndef CGAL_NO_DEPRECATED_CODE - typedef Curve_index Curve_segment_index; ///< Backward-compatibility + typedef Curve_index Curve_segment_index; #endif typedef typename boost::property_map Bare_polyline; typedef Mesh_3::Polyline_with_context Polyline_with_context; -/// \name Creation -/// @{ + /// \name Creation + /// @{ /*! - Constructs a `Polyhedral_mesh_domain_with_features_3` from a polyhedral surface. + Constructor from a polyhedral surface. No feature detection is done at this level. Note that a copy of `bounding_polyhedron` will be done. The polyhedron `bounding_polyhedron` has to be closed and free of intersections. Its interior of `bounding_polyhedron` will be meshed. */ Polyhedral_mesh_domain_with_features_3(const Polyhedron& bounding_polyhedron #ifndef DOXYGEN_RUNNING - ,CGAL::Random* p_rng = nullptr + , CGAL::Random* p_rng = nullptr #endif ) : Base(p_rng) , borders_detected_(false) @@ -191,14 +182,13 @@ public: #ifndef CGAL_NO_DEPRECATED_CODE /*! - \deprecated Constructs a `Polyhedral_mesh_domain_with_features_3` from an off file. No feature - detection is done at this level. Users must read the file into a `Polyhedron` and call the - constructor above. + \deprecated Constructor from an OFF file. No feature detection is done at this level. + Users must read the file into a `Polyhedron` and call the constructor above. */ CGAL_DEPRECATED Polyhedral_mesh_domain_with_features_3(const std::string& filename #ifndef DOXYGEN_RUNNING - ,CGAL::Random* p_rng = nullptr + , CGAL::Random* p_rng = nullptr #endif ) : Base(p_rng) , borders_detected_(false) @@ -217,20 +207,20 @@ public: { load_from_file(filename); } -#endif +#endif // DOXYGEN_RUNNING #endif // not CGAL_NO_DEPRECATED_CODE /*! - Constructs a `Polyhedral_mesh_domain_with_features_3` from a polyhedral surface, and a bounding polyhedral surface. + Constructor from a polyhedral surface, and a bounding polyhedral surface. The first polyhedron should be entirely included inside `bounding_polyhedron`, which has to be closed and free of intersections. Using this constructor enables to mesh a polyhedral surface which is not closed, or has holes. The inside of `bounding_polyhedron` will be meshed. */ - Polyhedral_mesh_domain_with_features_3(const Polyhedron& polyhedron - ,const Polyhedron& bounding_polyhedron + Polyhedral_mesh_domain_with_features_3(const Polyhedron& polyhedron, + const Polyhedron& bounding_polyhedron #ifndef DOXYGEN_RUNNING - ,CGAL::Random* p_rng = nullptr + , CGAL::Random* p_rng = nullptr #endif ) : Base(p_rng) , borders_detected_(false) @@ -249,10 +239,24 @@ public: } } + /*! + * Constructor from a sequence of polyhedral surfaces, without a bounding + * surface. The domain will always answer `false` to `is_in_domain()` + * queries. + * + * @tparam InputPolyhedraPtrIterator must be a model of + * `ForwardIterator` and value type `Polyhedron*` + * + * @param begin iterator for a sequence of pointers to polyhedra + * @param end iterator for a sequence of pointers to polyhedra + */ template Polyhedral_mesh_domain_with_features_3(InputPolyhedraPtrIterator begin, - InputPolyhedraPtrIterator end, - CGAL::Random* p_rng = nullptr) + InputPolyhedraPtrIterator end +#ifndef DOXYGEN_RUNNING + , CGAL::Random* p_rng = nullptr +#endif + ) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.reserve(std::distance(begin, end)); @@ -265,11 +269,25 @@ public: this->build(); } + /*! + * Constructor from a sequence of polyhedral surfaces, and a bounding + * polyhedral surface. + * + * @tparam InputPolyhedraPtrIterator must be a model of + * `ForwardIterator` and value type `Polyhedron*` + * + * @param begin iterator for a sequence of pointers to polyhedra + * @param end iterator for a sequence of pointers to polyhedra + * @param bounding_polyhedron the bounding surface + */ template Polyhedral_mesh_domain_with_features_3(InputPolyhedraPtrIterator begin, InputPolyhedraPtrIterator end, - const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = nullptr) + const Polyhedron& bounding_polyhedron +#ifndef DOXYGEN_RUNNING + , CGAL::Random* p_rng = nullptr +#endif + ) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.reserve(std::distance(begin, end)+1); @@ -291,26 +309,27 @@ public: this->build(); } - /// Destructor + /// @} + + // Destructor ~Polyhedral_mesh_domain_with_features_3() {} -/// @} - - /// Detect features + // Detect features void initialize_ts(Polyhedron& p); + void detect_borders(std::vector& p); void detect_features(FT angle_in_degree, std::vector& p); -/// \name Operations -/// @{ + /// \name Operations + /// @{ /*! - Detects sharp features and boundaries of the internal bounding polyhedron (and the potential internal polyhedron) - and inserts them as features of the domain. - @param angle_bound gives the maximum - angle (in degrees) between the two normal vectors of adjacent triangles. - For an edge of the polyhedron, if the angle between the two normal vectors of its + detects sharp features and boundaries of the internal bounding polyhedron (and the potential + internal polyhedra) and inserts them as features of the domain. + + @param angle_bound gives the maximum angle (in degrees) between the two normal vectors of adjacent triangles. + For an edge of a polyhedron, if the angle between the two normal vectors of its incident facets is bigger than the given bound, then the edge is considered as a feature edge. */ @@ -319,13 +338,11 @@ public: detect_features(angle_bound, stored_polyhedra); } - void detect_borders(std::vector& p); - /*! - Detects border edges of the bounding polyhedron and inserts them as features of the domain. - This function should be called alone only, and not before or after `detect_features()`. - */ + detects border edges of the bounding polyhedron and inserts them as features of the domain. + This function should only be called alone, and not before or after `detect_features()`. + */ void detect_borders() { detect_borders(stored_polyhedra); }; /// @} diff --git a/Mesh_3/include/CGAL/Triangle_accessor_3.h b/Mesh_3/include/CGAL/Triangle_accessor_3.h index 03c091ccdb4..4e336aea354 100644 --- a/Mesh_3/include/CGAL/Triangle_accessor_3.h +++ b/Mesh_3/include/CGAL/Triangle_accessor_3.h @@ -19,7 +19,6 @@ #include - #include #include #include @@ -40,26 +39,14 @@ template < class K,class Items, class Triangle_accessor_3, K > { typedef Polyhedron_3 Polyhedron; + public: - /// \name Types - /// @{ - /*! - Triangle type. - */ typedef typename K::Triangle_3 Triangle_3; - /*! - Triangle iterator. - */ typedef typename Polyhedron::Facet_const_iterator Triangle_iterator; - /*! - Triangle handle. - */ typedef typename Polyhedron::Facet_const_handle Triangle_handle; - /// @} - Triangle_accessor_3() { } Triangle_iterator triangles_begin(const Polyhedron& p) const @@ -82,8 +69,7 @@ public: } }; - - template +template class Triangle_accessor_3 >, K > { typedef Graph_with_descriptor_with_graph > Polyhedron; @@ -124,5 +110,4 @@ public: } // end namespace CGAL - #endif // POLYHEDRON_TRIANGLE_ACCESSOR_H From b3fe07a51d8673fd7dcac79433510cd1f453956b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 26 May 2023 13:36:15 +0200 Subject: [PATCH 047/156] Remove deprecated labeled mesh domains --- Mesh_3/benchmark/Mesh_3/StdAfx.h | 2 +- Mesh_3/benchmark/Mesh_3/concurrency.cpp | 17 +- Mesh_3/doc/Mesh_3/Doxyfile.in | 3 - Mesh_3/doc/Mesh_3/PackageDescription.txt | 3 - .../include/CGAL/Gray_image_mesh_domain_3.h | 159 ---------------- Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 148 --------------- .../CGAL/Labeled_image_mesh_domain_3.h | 174 ------------------ .../Mesh_domain_with_polyline_features_3.h | 2 - .../test_meshing_3D_gray_image_deprecated.cpp | 103 ----------- .../test_meshing_3D_image_deprecated.cpp | 73 -------- ...t_meshing_implicit_function_deprecated.cpp | 102 ---------- 11 files changed, 11 insertions(+), 775 deletions(-) delete mode 100644 Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h delete mode 100644 Mesh_3/include/CGAL/Implicit_mesh_domain_3.h delete mode 100644 Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h delete mode 100644 Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp delete mode 100644 Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp delete mode 100644 Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index a07ee4b3f16..6cb2d1e0c6c 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -201,7 +201,7 @@ #include #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 006c917b990..153f235d2b8 100644 --- a/Mesh_3/benchmark/Mesh_3/concurrency.cpp +++ b/Mesh_3/benchmark/Mesh_3/concurrency.cpp @@ -236,11 +236,10 @@ protected: #include #include +#include #include #include -#include #include -#include #include #include @@ -579,7 +578,7 @@ bool make_mesh_3D_images(const std::string &input_filename, // Domain typedef Kernel K; - typedef CGAL::Labeled_image_mesh_domain_3 Mesh_domain; + typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; // Triangulation #ifdef CGAL_CONCURRENT_MESH_3 @@ -600,7 +599,7 @@ bool make_mesh_3D_images(const std::string &input_filename, image.read(input_filename.c_str()); // Create domain - Mesh_domain domain(image); + Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); std::cerr << "done." << std::endl; Mesh_parameters params; @@ -686,10 +685,10 @@ bool make_mesh_implicit(double facet_approx, { // Domain #ifdef CGAL_MESH_3_IMPLICIT_WITH_FEATURES - typedef CGAL::Implicit_mesh_domain_3 Implicit_domain; + typedef CGAL::Labeled_mesh_domain_3 Implicit_domain; typedef CGAL::Mesh_domain_with_polyline_features_3 Mesh_domain; #else - typedef CGAL::Implicit_mesh_domain_3 Mesh_domain; + typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; #endif // Triangulation @@ -708,7 +707,11 @@ bool make_mesh_implicit(double facet_approx, // Create domain Sphere bounding_sphere(CGAL::ORIGIN, 10.0 * 10.0); - Mesh_domain domain(func, bounding_sphere/*, 1e-7*/); + + namespace p = CGAL::parameters; + Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain(p::function = func, + p::bounding_object = bounding_sphere + /*, p::relative_error_bound = 1e-7*/); #ifdef CGAL_MESH_3_IMPLICIT_WITH_FEATURES // Add 12 feature creases diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 70e7712b574..18c58c248e6 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -16,9 +16,6 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_mesh_domain_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_mesh_domain_with_features_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_complex_mesh_domain_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Gray_image_mesh_domain_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Labeled_image_mesh_domain_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Implicit_mesh_domain_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Implicit_to_labeling_function_wrapper.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \ diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index bad6b7e691e..63141c257e0 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -104,9 +104,6 @@ and their associated classes: - `CGAL::Mesh_domain_with_polyline_features_3` - `CGAL::Mesh_polyhedron_3` - `CGAL::Implicit_multi_domain_to_labeling_function_wrapper` -- `CGAL::Implicit_mesh_domain_3` (deprecated) -- `CGAL::Labeled_image_mesh_domain_3` (deprecated) -- `CGAL::Gray_image_mesh_domain_3` (deprecated) The following functors are available for feature detection: diff --git a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h deleted file mode 100644 index cb5f6cc262f..00000000000 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) 2009 INRIA Sophia-Antipolis (France). -// Copyright (c) 2012 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) : Stephane Tayeb, Laurent Rineau -// - -#ifndef CGAL_GRAY_IMAGE_MESH_DOMAIN_3_H -#define CGAL_GRAY_IMAGE_MESH_DOMAIN_3_H - -#include - -#include - -#include -#include -#include -#include - -namespace CGAL { - - -/*! -\ingroup PkgMesh3Domains - -\deprecated The class template `Gray_image_mesh_domain_3` is deprecated -since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and -its static function -`Labeled_mesh_domain_3::create_gray_image_mesh_domain()`. - -The class `Gray_image_mesh_domain_3` implements 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. -This class is a model of the concept `MeshDomain_3`. -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. - -This class includes a member function that provides, by interpolation, -a gray level value at any query point. -An intersection between a segment and bounding -surfaces is detected when both segment endpoints are associated with gray level -values which are on both sides of the isovalue. -The intersection is then constructed by bisection. -The bisection stops when the query segment is shorter than a given error bound -`e`. This error bound is given by `e=d`\f$ \times\f$`bound` where `d` is the -length of the diagonal of the bounding box (in world coordinates) and -`bound` is the argument passed to the constructor of `Labeled_image_mesh_domain_3`. - - -\tparam Image is the type of the input image. -This parameter must be `CGAL::Image_3`. - -\tparam BGT is a geometric traits class which 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`. - -\tparam Image_word_type is the data type encoded in the `Image` -input file - -\cgalModels `MeshDomain_3` - -\sa `BisectionGeometricTraits_3` -\sa `CGAL::make_mesh_3()`. - -*/ - -template, - typename Subdomain_index = int> -class -CGAL_DEPRECATED_MSG -( "The class template `CGAL::Gray_image_mesh_domain_3` is now deprecated. " - "Use the static member function template " - "`Labeled_mesh_domain_3::create_gray_image_mesh_domain` instead.") -Gray_image_mesh_domain_3 - : public Labeled_mesh_domain_3 -{ -public: - typedef Image_word_type_ Image_word_type; - typedef Mesh_3::Image_to_labeled_function_wrapper Wrapper; - - typedef Labeled_mesh_domain_3 Base; - - typedef typename Base::Sphere_3 Sphere_3; - typedef typename Base::FT FT; - typedef BGT Geom_traits; - typedef CGAL::Bbox_3 Bbox_3; - - /// \name Creation - /// @{ - - /*! - Construction from an image. - The object to be meshed is described by the voxels that have a gray-level - value higher than the input isovalue. - @param image the input image - @param iso_value the isovalue, inside `image`, - of the surface describing the boundary of the object to be meshed. - @param value_outside the value attached to voxels outside of the domain - to be meshed. It should be lower than `iso_value` - @param error_bound is relative to the size of the image. - */ - Gray_image_mesh_domain_3(const Image& image - ,const Image_word_type iso_value - ,const Image_word_type value_outside = 0. - ,const FT& error_bound = FT(1e-3) -#ifndef DOXYGEN_RUNNING - ,CGAL::Random* p_rng = nullptr -#endif - ) - : Base(parameters::function = Wrapper(image, - Transform(iso_value), - Transform(iso_value)(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(iso_value)(value_outside) == 0); - } - - /// @} - - Gray_image_mesh_domain_3(const Image& image, - const Transform& transform, - const Image_word_type value_outside = 0., - const FT& error_bound = FT(1e-3), - CGAL::Random* p_rng = nullptr) - : 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); - } - - // Destructor - virtual ~Gray_image_mesh_domain_3() {} -}; - -} // namespace CGAL - -#include - -#endif // CGAL_GRAY_IMAGE_MESH_DOMAIN_3_H diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h deleted file mode 100644 index b8c1d72e0bd..00000000000 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ /dev/null @@ -1,148 +0,0 @@ -// 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 -// -// -// Author(s) : Stéphane Tayeb -// -//****************************************************************************** -// File Description : -// class Implicit_mesh_domain_3. See class description. -//****************************************************************************** - -#ifndef CGAL_IMPLICIT_MESH_DOMAIN_3_H -#define CGAL_IMPLICIT_MESH_DOMAIN_3_H - -#include - -#include - -#include -#include -#include -#include - -namespace CGAL { - - -/*! -\ingroup PkgMesh3Domains - -\deprecated The class template `Implicit_mesh_domain_3` is deprecated -since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and -its static function -`Labeled_mesh_domain_3::create_implicit_mesh_domain()`. - -The class `Implicit_mesh_domain_3` implements 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. -This class is a model of the concept `MeshDomain_3`. - - -\tparam Function_ provides the definition of the function. -This parameter stands for a model of the concept -`ImplicitFunction` described in the -surface mesh generation package. -The number types `Function::FT` -and `BGT::FT` are required to match. - -\tparam BGT is a geometric traits which provides the basic operations to implement -intersection tests and computations -through a bisection method. This parameter must be instantiated -with a model of the concept `BisectionGeometricTraits_3`. - -The constructor of `Implicit_mesh_domain_3` -takes as argument a bounding sphere which is required -to circumscribe the surface and to have its center inside the -domain. -This domain constructs intersection points between -the surface and segments/rays/lines by bisection. It needs an -`error_bound` such that the bisection process is stopped -when the query segment is smaller than the error bound. -The `error_bound` passed as argument to the domain constructor -is a relative error bound expressed as a ratio to the bounding sphere radius. - -\cgalModels `MeshDomain_3` - -\sa `BisectionGeometricTraits_3` -\sa `CGAL::make_mesh_3()`. - -*/ -template -#endif - > -class -CGAL_DEPRECATED_MSG -( "The class template `CGAL::Implicit_mesh_domain_3` is now deprecated. " - "Use the static member function template " - "`Labeled_mesh_domain_3::create_implicit_image_mesh_domain` instead.") -Implicit_mesh_domain_3 - : public Labeled_mesh_domain_3 -{ -public: - /// Base type - typedef Labeled_mesh_domain_3 Base; - - /// Public types - typedef typename Base::Sphere_3 Sphere_3; - typedef typename Base::FT FT; - typedef BGT Geom_traits; - - /// \name Creation - /// @{ - - /*! - @param f is the object of type `Function_` that represents the implicit - surface. - - @param bounding_sphere is a bounding sphere of the implicit surface. The - value of `f` at the sphere center `c` must be - negative: \f$ f(c)<0\f$. - - @param 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 `error_bound` by the - radius of `bounding_sphere`. - */ - Implicit_mesh_domain_3(Function_ f - ,const Sphere_3& bounding_sphere - ,const FT& error_bound = FT(1e-6) -#ifndef DOXYGEN_RUNNING - ,CGAL::Random* p_rng = nullptr -#endif - ) - : 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() {} - - using Base::bbox; -private: - // Disabled copy constructor & assignment operator - typedef Implicit_mesh_domain_3 Self; - Implicit_mesh_domain_3(const Self& src); - Self& operator=(const Self& src); - -}; // end class Implicit_mesh_domain_3 - - -} // end namespace CGAL - -#include - -#endif // CGAL_IMPLICIT_MESH_DOMAIN_3_H diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h deleted file mode 100644 index 952d4fc2187..00000000000 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ /dev/null @@ -1,174 +0,0 @@ -// 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 -// -// -// Author(s) : Stephane Tayeb -// -//****************************************************************************** -// File Description : -// -// -//****************************************************************************** - -#ifndef CGAL_LABELED_IMAGE_MESH_DOMAIN_3_H -#define CGAL_LABELED_IMAGE_MESH_DOMAIN_3_H - -#include - -#include - -#include -#include -#include -#include -#include -#include - -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -\deprecated The class template `Labeled_image_mesh_domain_3` is deprecated -since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and -its static function -`Labeled_mesh_domain_3::create_labeled_image_mesh_domain()`. - -The class `Labeled_image_mesh_domain_3` implements 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. This -class is a model of the concept `MeshDomain_3`. The domain to be discretized -is the union of voxels that have an non-default index (different from the -default constructed value of the type `Image::Type`). - -This class includes a member function that provides, by interpolation, 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 a given error bound -`e`. This error bound is given by `e=d`\f$ \times\f$`bound` where `d` is the -length of the diagonal of the bounding box (in world coordinates) and -`bound` is the argument passed to the constructor of `Labeled_image_mesh_domain_3`. - - -\tparam Image is the type of the input image. -This parameter must be `CGAL::Image_3`. - -\tparam BGT is a geometric traits class which 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`. - -\cgalModels `MeshDomain_3` - -An executable that uses `Labeled_image_mesh_domain_3` must be linked with -the CGAL_ImageIO library. - -\sa `BisectionGeometricTraits_3` -\sa `CGAL::make_mesh_3()`. - -*/ - -template -class -CGAL_DEPRECATED_MSG -( "The class template `CGAL::Labeled_image_mesh_domain_3` is now deprecated. " - "Use the static member function template " - "`Labeled_mesh_domain_3::create_labeled_image_mesh_domain` instead.") -Labeled_image_mesh_domain_3 - : public Labeled_mesh_domain_3 -{ -public: - typedef Image_word_type_ Image_word_type; - typedef typename Default::Get - - >::type Wrapper; - typedef typename Default::Get::type Null; - - typedef Labeled_mesh_domain_3 Base; - - typedef typename Base::Sphere_3 Sphere_3; - typedef typename Base::FT FT; - typedef BGT Geom_traits; - typedef CGAL::Bbox_3 Bbox_3; - typedef CGAL::Identity Identity; - - - /// \name Creation - /// @{ - - /*! - Construction from an image. - @param image the image - @param error_bound is relative to the size of the image. - */ - Labeled_image_mesh_domain_3(const Image& image - ,const FT& error_bound = FT(1e-3) -#ifndef DOXYGEN_RUNNING - ,Subdomain_index value_outside = 0 - ,Null null = Null() - ,CGAL::Random* p_rng = nullptr -#endif - ) - : 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) - {} - - /// @} - - Labeled_image_mesh_domain_3(const Image& image, - const FT error_bound, - CGAL::Random* 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 - virtual ~Labeled_image_mesh_domain_3() {} - - using Base::bbox; - -private: - // Returns a box enclosing image `im` - Bbox_3 compute_bounding_box(const Image& im) const - { - return Bbox_3(-im.vx()+im.tx(), - -im.vy()+im.ty(), - -im.vz()+im.tz(), - double(im.xdim()+1)*im.vx()+im.tx(), - double(im.ydim()+1)*im.vy()+im.ty(), - double(im.zdim()+1)*im.vz()+im.tz()); - } -}; // end class Labeled_image_mesh_domain_3 - - - -} // end namespace CGAL - -#include - -#endif // CGAL_LABELED_IMAGE_MESH_DOMAIN_3_H 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 a8cfa8a2610..4934f22a7e9 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 @@ -528,9 +528,7 @@ whose endpoints are the added corners. \cgalModels `MeshDomainWithFeatures_3` \sa `MeshPolyline_3` -\sa `CGAL::Implicit_mesh_domain_3` \sa `CGAL::Polyhedral_mesh_domain_3` -\sa `CGAL::Labeled_image_mesh_domain_3` */ template < typename MD > class Mesh_domain_with_polyline_features_3 diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp deleted file mode 100644 index b2ba365111f..00000000000 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include - -#include "test_meshing_utilities.h" - -#include -#include -#include - -#include - -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; - -template -struct Greater_than { - typedef T argument_type; - Greater_than(const T& second) : second(second) {} - bool operator()(const T& first) const { - return std::greater()(first, second); - } - T second; -}; - -template -struct Image_tester : public Tester -{ -public: - void image() const - { - typedef float Image_word_type; - typedef CGAL::Image_3 Image; - typedef CGAL::Gray_image_mesh_domain_3< - Image, - K_e_i, - Image_word_type, - Greater_than > Mesh_domain; - - typedef typename CGAL::Mesh_triangulation_3< - Mesh_domain, - CGAL::Kernel_traits::Kernel, - Concurrency_tag>::type Tr; - typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; - typedef CGAL::Mesh_criteria_3 Mesh_criteria; - - CGAL_USE_TYPE(typename Mesh_domain::Surface_patch_index); - - //------------------------------------------------------- - // Data generation - //------------------------------------------------------- - Image image; - if (!image.read(CGAL::data_file_path("images/skull_2.9.inr"))) - { - std::cout << "Image reading error. Exit test.\n"; - return; - } - - std::cout << "\tSeed is\t" - << CGAL::get_default_random().get_seed() << std::endl; - - // Domain - Mesh_domain domain(image, - 2.9f, //isovalue - 0.f, //value_outside - 1e-3, //error_bound - &CGAL::get_default_random());//random generator for determinism - - // Mesh criteria - Mesh_criteria criteria(facet_angle = 30, - facet_size = 6, - facet_distance = 2, - facet_topology = CGAL::MANIFOLD, - cell_radius_edge_ratio = 3, - cell_size = 8); - - // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), - no_exude(), - mesh_3_options(number_of_initial_points = 30), - non_manifold() - ); - - // Verify - this->verify_c3t3_volume(c3t3, 1236086 * 0.95, 1236086 * 1.05); - this->verify(c3t3, domain, criteria, Bissection_tag()); - } -}; - - -int main() -{ - Image_tester<> test_epic; - std::cerr << "Mesh generation from a 3D image:\n"; - test_epic.image(); - -#ifdef CGAL_LINKED_WITH_TBB - Image_tester test_epic_p; - std::cerr << "Parallel mesh generation from a 3D image:\n"; - test_epic_p.image(); -#endif - - return EXIT_SUCCESS; -} diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp deleted file mode 100644 index 8107c4cefb5..00000000000 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#define CGAL_MESH_3_VERBOSE 1 -#include - -#include "test_meshing_utilities.h" - -#include -#include -#include - -template -struct Image_tester : public Tester -{ -public: - void image() const - { - typedef CGAL::Image_3 Image; - typedef CGAL::Labeled_image_mesh_domain_3 Mesh_domain; - - typedef typename CGAL::Mesh_triangulation_3< - Mesh_domain, - CGAL::Kernel_traits::Kernel, - Concurrency_tag>::type Tr; - typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; - - typedef CGAL::Mesh_criteria_3 Mesh_criteria; - typedef typename Mesh_criteria::Facet_criteria Facet_criteria; - typedef typename Mesh_criteria::Cell_criteria Cell_criteria; - - //------------------------------------------------------- - // Data generation - //------------------------------------------------------- - Image image; - image.read(CGAL::data_file_path("images/liver.inr.gz")); - - std::cout << "\tSeed is\t" - << CGAL::get_default_random().get_seed() << std::endl; - Mesh_domain domain(image, 1e-6, &CGAL::get_default_random()); - - // Set mesh criteria - Facet_criteria facet_criteria(25, 20*image.vx(), 5*image.vx()); - Cell_criteria cell_criteria(4, 25*image.vx()); - Mesh_criteria criteria(facet_criteria, cell_criteria); - - // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb()); - - // Verify - this->verify_c3t3_volume(c3t3, 1772330*0.95, 1772330*1.05); - this->verify(c3t3,domain,criteria, Bissection_tag()); - - typedef typename Mesh_domain::Surface_patch_index Patch_id; - CGAL_static_assertion(CGAL::Output_rep::is_specialized); - CGAL_USE_TYPE(Patch_id); - } - -}; - -int main() -{ - Image_tester<> test_epic; - std::cerr << "Mesh generation from a 3D image:\n"; - test_epic.image(); - -#ifdef CGAL_LINKED_WITH_TBB - Image_tester test_epic_p; - std::cerr << "Parallel mesh generation from a 3D image:\n"; - test_epic_p.image(); -#endif - - return EXIT_SUCCESS; -} diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp deleted file mode 100644 index 6a7a8aa0b57..00000000000 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include -#include - -#include "test_meshing_utilities.h" - -#include - -template -struct Implicit_tester : public Tester -{ - typedef typename K::Point_3 Point; - typedef typename K::FT FT; - static FT sphere_function (const Point& p) - { - const FT x2=p.x()*p.x(), y2=p.y()*p.y(), z2=p.z()*p.z(); - return x2+y2+z2-1; - } - - void implicit() const - { - typedef FT (Function)(const Point&); - typedef CGAL::Implicit_mesh_domain_3 Mesh_domain; - - typedef typename CGAL::Mesh_triangulation_3< - Mesh_domain, - typename CGAL::Kernel_traits::Kernel, - Concurrency_tag>::type Tr; - typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; - - typedef CGAL::Mesh_criteria_3 Mesh_criteria; - typedef typename Mesh_criteria::Facet_criteria Facet_criteria; - typedef typename Mesh_criteria::Cell_criteria Cell_criteria; - - typedef typename K::Sphere_3 Sphere_3; - - typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; - - //------------------------------------------------------- - // Data generation - //------------------------------------------------------- - std::cout << "\tSeed is\t" - << CGAL::get_default_random().get_seed() << std::endl; - - Mesh_domain domain(Implicit_tester::sphere_function, - Sphere_3(CGAL::ORIGIN,2.), - 1e-3, - &CGAL::get_default_random()); - - // Set mesh criteria - Facet_criteria facet_criteria(0, 0, 0.3); - Cell_criteria cell_criteria(0, 0.5); - Mesh_criteria criteria(facet_criteria, cell_criteria); - - std::vector initial_points; - initial_points.push_back(Point(1,0,0)); - initial_points.push_back(Point(0,1,0)); - initial_points.push_back(Point(0,0,1)); - initial_points.push_back(Point(-1,0,0)); - initial_points.push_back(Point(0,-1,0)); - initial_points.push_back(Point(0,0,-1)); - - // Mesh generation - C3t3 c3t3; - c3t3.insert_surface_points(initial_points.begin(), - initial_points.end(), - domain.index_from_surface_patch_index(Surface_patch_index(0,1))); - - CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb()); - - CGAL::remove_far_points_in_mesh_3(c3t3); - -#ifdef CGAL_LINKED_WITH_TBB - // Parallel - if (boost::is_convertible::value) - { - this->verify(c3t3, domain, criteria, Bissection_tag(), 40, 65, 60, 110); - } - else -#endif //CGAL_LINKED_WITH_TBB - { - // Verify - this->verify(c3t3, domain, criteria, Bissection_tag(), 50, 58, 80, 90); - } - } -}; - - -int main() -{ - Implicit_tester test_epic; - std::cerr << "Mesh generation from an implicit function:\n"; - test_epic.implicit(); - -#ifdef CGAL_LINKED_WITH_TBB - Implicit_tester test_epic_p; - std::cerr << "Parallel mesh generation from an implicit function:\n"; - test_epic_p.implicit(); -#endif - return EXIT_SUCCESS; -} From 7b91a3d972551759756d06e01c5d049109e12ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 26 May 2023 13:47:20 +0200 Subject: [PATCH 048/156] Fix compilation --- Mesh_3/test/Mesh_3/XML_exporter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/test/Mesh_3/XML_exporter.h b/Mesh_3/test/Mesh_3/XML_exporter.h index 8ecb25600b6..5be7055d320 100644 --- a/Mesh_3/test/Mesh_3/XML_exporter.h +++ b/Mesh_3/test/Mesh_3/XML_exporter.h @@ -185,7 +185,7 @@ public: m_xml_fstream << " " << std::endl; // Save current pointer position - std::ofstream::streampos pos = m_xml_fstream.tellp(); + std::streampos pos = m_xml_fstream.tellp(); // Close the XML file (temporarily) so that the XML file is always correct m_xml_fstream << "" << std::endl; // Restore the pointer position so that the next "add_element" will overwrite From 388ae042c6913dca60fbf135edcd18ca6da67c62 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Wed, 31 May 2023 09:11:28 +0200 Subject: [PATCH 049/156] Fix typo --- Documentation/doc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 404d93efa66..f6cb41191d5 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -403,7 +403,7 @@ else() endif() #special cases -foreach(pkg "Mesh_level") +foreach(pkg "Mesher_level") if(CGAL_BRANCH_BUILD) set(CGAL_${pkg}_INCLUDE_DIR "${CGAL_ROOT}/${pkg}/include") else() From 8f0a9dd99685d6b7704b2297baede974b5a84543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 31 May 2023 11:34:37 +0200 Subject: [PATCH 050/156] Fix two links --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 90afbe72b31..4b4a6743270 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -296,7 +296,7 @@ also inserts a small set of auxiliary vertices that belong to the triangulation but are isolated from the complex at the end of the meshing process. These so-called \em isolated vertices belong to the triangulation but not to any cell -of the `C3T3`. They can be removed using the function `remove_isolated_vertices()`. +of the `C3T3`. They can be removed using the function `CGAL::Polygon_mesh_processing::remove_isolated_vertices()`. \section Mesh_3_section_interface Interface @@ -725,7 +725,7 @@ to the voxels surface, causing an aliasing effect. A solution to generate a smooth and accurate output surface was described by Stalling et al in \cgalCite{stalling1998weighted}. It consists in generating a second input image, made of integer coefficients called *weights*, and use those weights to define smoother domain boundaries. -The 3D image of weights can be generated using `CGAL::Mesh_3::generate_weights()` as shown in +The 3D image of weights can be generated using `CGAL::Mesh_3::generate_label_weights()` as shown in the following example. \cgalExample{Mesh_3/mesh_3D_weighted_image.cpp} From 21358ac490cad6635cb7198b7cbef268e78c9d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 31 May 2023 17:41:39 +0200 Subject: [PATCH 051/156] Clean CMakelists.txt --- Mesh_3/test/Mesh_3/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Mesh_3/test/Mesh_3/CMakeLists.txt b/Mesh_3/test/Mesh_3/CMakeLists.txt index 2a8e19e1c38..b0e9e250c27 100644 --- a/Mesh_3/test/Mesh_3/CMakeLists.txt +++ b/Mesh_3/test/Mesh_3/CMakeLists.txt @@ -30,17 +30,14 @@ create_single_source_cgal_program( "test_without_detect_features.cpp" ) if(CGAL_ImageIO_USE_ZLIB) create_single_source_cgal_program( "test_meshing_3D_image.cpp" ) - create_single_source_cgal_program( "test_meshing_3D_image_deprecated.cpp" ) create_single_source_cgal_program( "test_meshing_3D_image_with_features.cpp" ) create_single_source_cgal_program( "test_meshing_3D_gray_image.cpp" ) - create_single_source_cgal_program( "test_meshing_3D_gray_image_deprecated.cpp" ) create_single_source_cgal_program( "test_min_size_criteria.cpp") else() message(STATUS "NOTICE: The test 'test_meshing_3D_image' requires the ZLIB library, and will not be compiled.") endif() create_single_source_cgal_program( "test_meshing_implicit_function.cpp" ) -create_single_source_cgal_program( "test_meshing_implicit_function_deprecated.cpp" ) create_single_source_cgal_program( "test_meshing_polyhedral_complex.cpp" ) create_single_source_cgal_program( "test_meshing_polyhedron.cpp" ) create_single_source_cgal_program( "test_meshing_polylines_only.cpp" ) @@ -66,12 +63,9 @@ foreach(target test_mesh_criteria_creation test_without_detect_features test_meshing_3D_image - test_meshing_3D_image_deprecated test_meshing_3D_image_with_features test_meshing_3D_gray_image - test_meshing_3D_gray_image_deprecated test_meshing_implicit_function - test_meshing_implicit_function_deprecated test_meshing_polyhedral_complex test_meshing_polyhedron test_meshing_polylines_only From 1237c7a39873bc2d7a6c4efae7e7f3decaee6fed Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 9 Jun 2023 12:45:19 +0200 Subject: [PATCH 052/156] Remove a warning for lcc tests --- .../test/Linear_cell_complex/Linear_cell_complex_2_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.cpp b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.cpp index 28195f35354..89f981f53d1 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.cpp @@ -32,7 +32,8 @@ struct Myattrib : public CGAL::Cell_attribute_with_point struct MonInfo { - MonInfo(int i=0) : mnb(i==0?rand():i), ptr(reinterpret_cast(this)) + MonInfo(long long int i=0) : mnb(i==0?rand():static_cast(i)), + ptr(reinterpret_cast(this)) {} bool operator==(const MonInfo& info) const From a9e1d599aa8bbe679bc8ae025b467c4db674c9ef Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 13 Jun 2023 12:45:58 +0200 Subject: [PATCH 053/156] more warnings lcc --- .../test/Linear_cell_complex/Linear_cell_complex_3_test.cpp | 3 ++- .../test/Linear_cell_complex/Linear_cell_complex_4_test.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.cpp b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.cpp index c1d6eb4cdfe..6e04cbb07a3 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.cpp @@ -32,7 +32,8 @@ struct Myattrib : public CGAL::Cell_attribute_with_point struct MonInfo { - MonInfo(int i=0) : mnb(i==0?rand():i), ptr(reinterpret_cast(this)) + MonInfo(long long int i=0) : mnb(i==0?rand():static_cast(i)), + ptr(reinterpret_cast(this)) {} bool operator==(const MonInfo& info) const diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_4_test.cpp b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_4_test.cpp index 737e6b965ba..b4d88213275 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_4_test.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_4_test.cpp @@ -35,7 +35,8 @@ struct Myattrib : public CGAL::Cell_attribute_with_point struct MonInfo { - MonInfo(int i=0) : mnb(i==0?rand():i), ptr(reinterpret_cast(this)) + MonInfo(long long int i=0) : mnb(i==0?rand():static_cast(i)), + ptr(reinterpret_cast(this)) {} bool operator==(const MonInfo& info) const From 71b4e4f08f72a0724bfcf9fad0f24252539b7dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 28 Apr 2023 20:27:13 +0200 Subject: [PATCH 054/156] boost::shared_ptr => std::shared_ptr --- CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp | 5 +- .../random-forest/common-libraries.hpp | 2 +- .../Feature/Gradient_of_feature.h | 2 +- GraphicsView/demo/Polygon/Polygon_2.cpp | 5 +- Installation/CHANGES.md | 1 + .../examples/Point_set_3/point_set_algo.cpp | 2 +- .../Classification/Cluster_classification.h | 4 +- .../Point_set_average_spacing_plugin.cpp | 2 +- .../Point_set_bilateral_smoothing_plugin.cpp | 2 +- .../Point_set/Point_set_clustering_plugin.cpp | 2 +- .../Point_set_outliers_removal_plugin.cpp | 2 +- .../Point_set/Point_set_selection_plugin.cpp | 4 +- .../Point_set_shape_detection_plugin.cpp | 10 ++-- .../Point_set_simplification_plugin.cpp | 6 +-- .../Point_set/Point_set_wlop_plugin.cpp | 2 +- .../include/run_with_qprogressdialog.h | 8 ++-- .../efficient_RANSAC_with_point_access.cpp | 2 +- .../Efficient_RANSAC/Efficient_RANSAC.h | 44 ++++++++--------- .../Efficient_RANSAC/property_map.h | 6 +-- .../test_efficient_RANSAC_cone_parameters.cpp | 2 +- ...t_efficient_RANSAC_cylinder_parameters.cpp | 2 +- ...test_efficient_RANSAC_plane_parameters.cpp | 2 +- .../test_efficient_RANSAC_scene.cpp | 2 +- ...est_efficient_RANSAC_sphere_parameters.cpp | 2 +- ...test_efficient_RANSAC_torus_parameters.cpp | 2 +- ...ompare_kernels_simple_polygon_skeleton.cpp | 4 +- .../create_exterior_skeleton.cpp | 6 +-- ...te_exterior_skeleton_tweaking_skeleton.cpp | 6 +-- .../CGAL/Polygon_offset_builder_2.h | 4 +- .../CGAL/Straight_skeleton_builder_2.h | 4 +- .../CGAL/Straight_skeleton_converter_2.h | 4 +- .../CGAL/arrange_offset_polygons_2.h | 6 +-- .../CGAL/create_offset_polygons_2.h | 8 ++-- ...ffset_polygons_from_polygon_with_holes_2.h | 4 +- .../CGAL/create_straight_skeleton_2.h | 10 ++-- .../Straight_skeleton_2.txt | 4 +- .../Create_offset_polygons_2.cpp | 6 +-- .../Create_saop_from_polygon_with_holes_2.cpp | 6 +-- .../Create_skeleton_and_offset_polygons_2.cpp | 6 +-- ...leton_and_offset_polygons_with_holes_2.cpp | 4 +- .../Create_straight_skeleton_2.cpp | 4 +- ...ght_skeleton_from_polygon_with_holes_2.cpp | 4 +- .../Straight_skeleton_2/Low_level_API.cpp | 6 +-- .../Show_offset_polygon.cpp | 4 +- .../Show_straight_skeleton.cpp | 4 +- .../draw_straight_skeleton_2.cpp | 4 +- .../Straight_skeleton_2/dump_to_eps.h | 4 +- ...offset_of_multiple_polygons_with_holes.cpp | 6 +-- .../examples/Straight_skeleton_2/print.h | 8 ++-- .../include/CGAL/Polygon_offset_builder_2.h | 4 +- .../Straight_skeleton_2/Polygon_iterators.h | 14 +++--- .../CGAL/Straight_skeleton_builder_2.h | 4 +- .../CGAL/Straight_skeleton_converter_2.h | 8 ++-- .../include/CGAL/arrange_offset_polygons_2.h | 16 +++---- .../include/CGAL/create_offset_polygons_2.h | 40 ++++++++-------- ...ffset_polygons_from_polygon_with_holes_2.h | 26 +++++----- .../include/CGAL/create_straight_skeleton_2.h | 24 +++++----- ...aight_skeleton_from_polygon_with_holes_2.h | 4 +- .../include/CGAL/test_offset_builder_types.h | 8 ++-- .../include/CGAL/test_sls_builder_types.h | 8 ++-- .../include/CGAL/test_sls_types.h | 14 +++--- .../test/Straight_skeleton_2/issue4533.cpp | 4 +- .../test/Straight_skeleton_2/issue4684.cpp | 4 +- .../test/Straight_skeleton_2/issue7149.cpp | 2 +- .../test/Straight_skeleton_2/print.h | 8 ++-- .../Straight_skeleton_2/test_sls_offset.cpp | 48 +++++++++---------- .../Straight_skeleton_2/test_sls_simple.cpp | 10 ++-- .../test_straight_skeleton_copy.cpp | 6 +-- .../internal/Geometry_container.h | 4 +- 69 files changed, 246 insertions(+), 259 deletions(-) diff --git a/CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp b/CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp index 7d2026c5981..71557e65968 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp @@ -11,7 +11,6 @@ // Author(s) : Sebastien Loriot, Sylvain Pion #include -#include #include #include #include @@ -38,10 +37,10 @@ const std::string Hmsg[] = { class SkeletonIpelet : public CGAL::Ipelet_base{ - typedef boost::shared_ptr PolygonPtr ; + typedef std::shared_ptr PolygonPtr ; typedef std::vector PolygonPtrVector ; typedef CGAL::Straight_skeleton_2 Skeleton ; - typedef boost::shared_ptr SkeletonPtr ; + typedef std::shared_ptr SkeletonPtr ; void draw_straight_skeleton(const Skeleton& skeleton,double); diff --git a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/common-libraries.hpp b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/common-libraries.hpp index c20b9b7155f..6d2ebb01acf 100644 --- a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/common-libraries.hpp +++ b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/common-libraries.hpp @@ -45,7 +45,7 @@ #include #endif #include -#include +#include #include #include #include diff --git a/Classification/include/CGAL/Classification/Feature/Gradient_of_feature.h b/Classification/include/CGAL/Classification/Feature/Gradient_of_feature.h index 85d703c5ed1..d87ee8f2830 100644 --- a/Classification/include/CGAL/Classification/Feature/Gradient_of_feature.h +++ b/Classification/include/CGAL/Classification/Feature/Gradient_of_feature.h @@ -37,7 +37,7 @@ class Gradient_of_feature : public Feature_base const InputRange& m_input; ItemMap m_map; Feature_handle m_feature; - boost::shared_ptr m_query; + std::shared_ptr m_query; public: /*! diff --git a/GraphicsView/demo/Polygon/Polygon_2.cpp b/GraphicsView/demo/Polygon/Polygon_2.cpp index 9463c2e979b..67c16d0b3dc 100644 --- a/GraphicsView/demo/Polygon/Polygon_2.cpp +++ b/GraphicsView/demo/Polygon/Polygon_2.cpp @@ -1,5 +1,4 @@ #include -#include // CGAL headers #include #include @@ -42,9 +41,9 @@ typedef CGAL::Polygon_with_holes_2 > Polygon_with_holes_2 typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr SsPtr ; -typedef boost::shared_ptr PolygonPtr ; +typedef std::shared_ptr PolygonPtr ; typedef std::vector PolygonPtr_vector ; diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index a505215bd00..486f43ea21f 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -10,6 +10,7 @@ Release date: October 2023 - **Breaking change**: C++17 is now required - Support for Visual `C++` 14.0 (Visual studio 2015) is dropped. +- **Breaking change**: The usage of `boost::shared_ptr` has been replaced by `std::shared_ptr`. Packages affected are 2D Straight Line Skeleton and Shape Detection. [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) diff --git a/Point_set_3/examples/Point_set_3/point_set_algo.cpp b/Point_set_3/examples/Point_set_3/point_set_algo.cpp index 12c98682475..19f10f5ecfb 100644 --- a/Point_set_3/examples/Point_set_3/point_set_algo.cpp +++ b/Point_set_3/examples/Point_set_3/point_set_algo.cpp @@ -68,7 +68,7 @@ int main (int, char**) parameters.normal_threshold = 0.9; ransac.detect(parameters); - for(boost::shared_ptr shape : ransac.shapes()) + for(std::shared_ptr shape : ransac.shapes()) if (Sphere* sphere = dynamic_cast(shape.get())) std::cerr << "Detected sphere of center " << sphere->center() // Center should be approx 0, 0, 0 << " and of radius " << sphere->radius() << std::endl; // Radius should be approx 1 diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h index 224a66d20c7..ef4d006e2ce 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h @@ -98,7 +98,7 @@ class Cluster_classification : public Item_classification_base void add_cluster_features () { - m_eigen = boost::make_shared + m_eigen = std::make_shared (Local_eigen_analysis::create_from_point_clusters(m_clusters, Concurrency_tag())); @@ -388,7 +388,7 @@ class Cluster_classification : public Item_classification_base int m_index_color; - boost::shared_ptr m_eigen; + std::shared_ptr m_eigen; bool m_input_is_las; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_average_spacing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_average_spacing_plugin.cpp index d11f45cd623..78c0e2482d4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_average_spacing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_average_spacing_plugin.cpp @@ -27,7 +27,7 @@ struct Compute_average_spacing_functor { Point_set* points; const int nb_neighbors; - boost::shared_ptr result; + std::shared_ptr result; Compute_average_spacing_functor (Point_set* points, const int nb_neighbors) : points (points), nb_neighbors (nb_neighbors), result (new double(0)) { } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_bilateral_smoothing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_bilateral_smoothing_plugin.cpp index c4a13af368d..03f18810236 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_bilateral_smoothing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_bilateral_smoothing_plugin.cpp @@ -29,7 +29,7 @@ struct Bilateral_smoothing_functor Point_set* points; unsigned int neighborhood_size; unsigned int sharpness_angle; - boost::shared_ptr result; + std::shared_ptr result; Bilateral_smoothing_functor (Point_set* points, unsigned int neighborhood_size, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_clustering_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_clustering_plugin.cpp index e898807835f..b998a35750e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_clustering_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_clustering_plugin.cpp @@ -29,7 +29,7 @@ struct Clustering_functor Point_set* points; Point_set::Property_map cluster_map; const double neighbor_radius; - boost::shared_ptr result; + std::shared_ptr result; Clustering_functor (Point_set* points, const double neighbor_radius, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_outliers_removal_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_outliers_removal_plugin.cpp index 925195e38d4..c18343a17a9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_outliers_removal_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_outliers_removal_plugin.cpp @@ -26,7 +26,7 @@ struct Outlier_removal_functor int nb_neighbors; double removed_percentage; double distance_threshold; - boost::shared_ptr result; + std::shared_ptr result; Outlier_removal_functor (Point_set* points, int nb_neighbors, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp index 185ce8930fc..634ae8c699b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp @@ -332,7 +332,7 @@ class Neighborhood typedef CGAL::Fuzzy_sphere Sphere; Scene_points_with_normal_item* points_item; - boost::shared_ptr tree; + std::shared_ptr tree; public: @@ -351,7 +351,7 @@ public: { this->points_item = points_item; - tree = boost::make_shared (points_item->point_set()->begin(), + tree = std::make_shared (points_item->point_set()->begin(), points_item->point_set()->end(), Tree::Splitter(), Search_traits (points_item->point_set()->point_map())); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index fc344cec857..b8117997037 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -440,7 +440,7 @@ private: Scene_surface_mesh_item* sm_item = nullptr; sm_item = new Scene_surface_mesh_item; - boost::shared_ptr rg_plane(boost::make_shared(plane)); + std::shared_ptr rg_plane(std::make_shared(plane)); build_alpha_shape( *(point_item->point_set()), rg_plane, sm_item, search_sphere_radius); @@ -656,7 +656,7 @@ private: std::map color_map; int index = 0; - for(boost::shared_ptr shape : ransac.shapes()) + for(std::shared_ptr shape : ransac.shapes()) { CGAL::Shape_detection::Cylinder *cyl; cyl = dynamic_cast *>(shape.get()); @@ -731,7 +731,7 @@ private: { ss << item->name().toStdString() << "_plane_"; - boost::shared_ptr > pshape + std::shared_ptr > pshape = boost::dynamic_pointer_cast > (shape); Kernel::Point_3 ref = CGAL::ORIGIN + pshape->plane_normal (); @@ -901,7 +901,7 @@ private: } template - void build_alpha_shape (Point_set& points, boost::shared_ptr plane, + void build_alpha_shape (Point_set& points, std::shared_ptr plane, Scene_surface_mesh_item* sm_item, double epsilon); }; // end Polyhedron_demo_point_set_shape_detection_plugin @@ -997,7 +997,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetect_triggered template void Polyhedron_demo_point_set_shape_detection_plugin::build_alpha_shape -(Point_set& points, boost::shared_ptr plane, Scene_surface_mesh_item* sm_item, double epsilon) +(Point_set& points, std::shared_ptr plane, Scene_surface_mesh_item* sm_item, double epsilon) { typedef Kernel::Point_2 Point_2; typedef CGAL::Alpha_shape_vertex_base_2 Vb; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_simplification_plugin.cpp index cc5431609ac..05eb2d41493 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_simplification_plugin.cpp @@ -29,7 +29,7 @@ struct Compute_average_spacing_functor { Point_set* points; const int nb_neighbors; - boost::shared_ptr result; + std::shared_ptr result; Compute_average_spacing_functor (Point_set* points, const int nb_neighbors) : points (points), nb_neighbors (nb_neighbors), result (new double(0)) { } @@ -50,7 +50,7 @@ struct Grid_simplify_functor Point_set* points; double grid_size; unsigned int min_points_per_cell; - boost::shared_ptr result; + std::shared_ptr result; Grid_simplify_functor (Point_set* points, double grid_size, unsigned min_points_per_cell) : points (points), grid_size (grid_size), min_points_per_cell(min_points_per_cell) @@ -72,7 +72,7 @@ struct Hierarchy_simplify_functor Point_set* points; unsigned int max_cluster_size; double max_surface_variation; - boost::shared_ptr result; + std::shared_ptr result; Hierarchy_simplify_functor (Point_set* points, double max_cluster_size, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.cpp index 538a48b32b7..519b4fff4ef 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.cpp @@ -27,7 +27,7 @@ struct Compute_average_spacing_functor { Point_set* points; const int nb_neighbors; - boost::shared_ptr result; + std::shared_ptr result; Compute_average_spacing_functor (Point_set* points, const int nb_neighbors) : points (points), nb_neighbors (nb_neighbors), result (new double(0)) { } diff --git a/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h b/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h index f2657fda3f1..7a6d9744999 100644 --- a/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h +++ b/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h @@ -20,9 +20,9 @@ private: mutable std::size_t nb; public: - boost::shared_ptr latest_adv; - boost::shared_ptr state; - boost::shared_ptr signaler; + std::shared_ptr latest_adv; + std::shared_ptr state; + std::shared_ptr signaler; Signal_callback(bool) : latest_adv (new double(0)) @@ -71,7 +71,7 @@ public: class Functor_with_signal_callback { protected: - boost::shared_ptr m_callback; + std::shared_ptr m_callback; public: Signal_callback* callback() { return m_callback.get(); } diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_point_access.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_point_access.cpp index f4e5a859bca..34abf4d8049 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_point_access.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_point_access.cpp @@ -99,7 +99,7 @@ int main(int argc, char** argv) { Efficient_ransac::Shape_range::iterator it = shapes.begin(); while (it != shapes.end()) { - boost::shared_ptr shape = *it; + std::shared_ptr shape = *it; // Use Shape_base::info() to print the parameters of the detected shape. std::cout << (*it)->info(); diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h index 53331b8d709..3612ac02c70 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h @@ -37,7 +37,7 @@ // boost -------------- #include -#include +#include #include //--------------------- @@ -104,36 +104,36 @@ public: #ifdef DOXYGEN_RUNNING typedef unspecified_type Shape_range; - ///< `Iterator_range` with a bidirectional constant iterator type with value type `boost::shared_ptr`. + ///< `Iterator_range` with a bidirectional constant iterator type with value type `std::shared_ptr`. typedef unspecified_type Plane_range; - ///< `Iterator_range` with a bidirectional constant iterator type with value type `boost::shared_ptr`. + ///< `Iterator_range` with a bidirectional constant iterator type with value type `std::shared_ptr`. #else struct Shape_range : public Iterator_range< - typename std::vector >::const_iterator> { + typename std::vector >::const_iterator> { typedef Iterator_range< - typename std::vector >::const_iterator> Base; + typename std::vector >::const_iterator> Base; - Shape_range(boost::shared_ptr > > + Shape_range(std::shared_ptr > > extracted_shapes) : Base(make_range(extracted_shapes->begin(), extracted_shapes->end())), m_extracted_shapes(extracted_shapes) {} private: - boost::shared_ptr > > + std::shared_ptr > > m_extracted_shapes; // keeps a reference to the shape vector }; struct Plane_range : public Iterator_range< - typename std::vector >::const_iterator> { + typename std::vector >::const_iterator> { typedef Iterator_range< - typename std::vector >::const_iterator> Base; + typename std::vector >::const_iterator> Base; - Plane_range(boost::shared_ptr > > + Plane_range(std::shared_ptr > > extracted_shapes) : Base(make_range(extracted_shapes->begin(), extracted_shapes->end())), m_extracted_shapes(extracted_shapes) {} private: - boost::shared_ptr > > + std::shared_ptr > > m_extracted_shapes; // keeps a reference to the shape vector }; @@ -291,7 +291,7 @@ public: clear(); m_extracted_shapes = - boost::make_shared > >(); + std::make_shared > >(); m_num_available_points = m_num_total_points = std::distance( m_input_iterator_first, m_input_iterator_beyond); @@ -435,7 +435,7 @@ public: std::vector().swap(m_shape_index); m_extracted_shapes = - boost::make_shared > >(); + std::make_shared > >(); m_num_available_points = m_num_total_points; @@ -488,7 +488,7 @@ public: // Reset data structures possibly used by former search m_extracted_shapes = - boost::make_shared > >(); + std::make_shared > >(); m_num_available_points = m_num_total_points; for (std::size_t i = 0; i < m_num_subsets; i++) { @@ -755,7 +755,7 @@ public: //1. add best candidate to final result. m_extracted_shapes->push_back( - boost::shared_ptr(best_candidate)); + std::shared_ptr(best_candidate)); if (callback && !callback(num_invalid / double(m_num_total_points))) { clear(num_invalid, candidates); @@ -874,7 +874,7 @@ public: /// @{ /*! Returns an `Iterator_range` with a bidirectional iterator with value type - `boost::shared_ptr` over the detected shapes in the order of detection. + `std::shared_ptr` over the detected shapes in the order of detection. Depending on the chosen probability for the detection, the shapes are ordered with decreasing size. */ @@ -884,21 +884,21 @@ public: /*! Returns an `Iterator_range` with a bidirectional iterator with - value type `boost::shared_ptr` over only the + value type `std::shared_ptr` over only the detected planes in the order of detection. Depending on the chosen probability for the detection, the planes are ordered with decreasing size. */ Plane_range planes() const { - boost::shared_ptr > > planes - = boost::make_shared > >(); + std::shared_ptr > > planes + = std::make_shared > >(); for (std::size_t i = 0; i < m_extracted_shapes->size(); ++i) { - boost::shared_ptr pshape + std::shared_ptr pshape = boost::dynamic_pointer_cast((*m_extracted_shapes)[i]); // Ignore all shapes other than plane - if (pshape != boost::shared_ptr()) + if (pshape != std::shared_ptr()) planes->push_back(pshape); } return Plane_range(planes); @@ -1218,7 +1218,7 @@ private: //give the index of the subset of point i std::vector m_index_subsets; - boost::shared_ptr > > m_extracted_shapes; + std::shared_ptr > > m_extracted_shapes; std::vector m_shape_factories; diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/property_map.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/property_map.h index 3fb4ecea249..774a21437cc 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/property_map.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/property_map.h @@ -31,7 +31,7 @@ namespace Shape_detection { class Point_to_shape_index_map { typedef CGAL::Shape_detection::Shape_base Shape; - boost::shared_ptr > m_indices; + std::shared_ptr > m_indices; public: typedef std::size_t key_type; ///< %Index of the point in the random access point range. @@ -50,7 +50,7 @@ namespace Shape_detection { \tparam ShapeRange must be an `Iterator_range` with a bidirectional constant iterator type with value type - `boost::shared_ptr >`. + `std::shared_ptr >`. */ template Point_to_shape_index_map (const PointRange& points, @@ -85,7 +85,7 @@ namespace Shape_detection { { public: typedef CGAL::Shape_detection::Plane Plane_shape; - typedef boost::shared_ptr key_type; + typedef std::shared_ptr key_type; typedef typename Traits::Plane_3 value_type; typedef value_type reference; typedef boost::read_write_property_map_tag category; diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cone_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cone_parameters.cpp index 39ac55d03fc..e907bbbfe0b 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cone_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cone_parameters.cpp @@ -74,7 +74,7 @@ bool test_cone_parameters() { if (shapes.size() != 1) continue; - boost::shared_ptr cone = boost::dynamic_pointer_cast((*shapes.first)); + std::shared_ptr cone = boost::dynamic_pointer_cast((*shapes.first)); // Check: shape detected is a cone. if (!cone) diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cylinder_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cylinder_parameters.cpp index 67cbbf24958..4d05c98d068 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cylinder_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cylinder_parameters.cpp @@ -73,7 +73,7 @@ bool test_cylinder_parameters() { if (shapes.size() != 1) continue; - boost::shared_ptr cyl = boost::dynamic_pointer_cast((*shapes.first)); + std::shared_ptr cyl = boost::dynamic_pointer_cast((*shapes.first)); // Check: shape detected is a cylinder. if (!cyl) diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_plane_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_plane_parameters.cpp index b963ed1e636..e47a2f47216 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_plane_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_plane_parameters.cpp @@ -67,7 +67,7 @@ bool test_plane_parameters() { if (shapes.size() != 1) continue; - boost::shared_ptr pl = boost::dynamic_pointer_cast((*shapes.first)); + std::shared_ptr pl = boost::dynamic_pointer_cast((*shapes.first)); if (!pl) continue; diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_scene.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_scene.cpp index fbe007b13c7..e78e2e3ca5a 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_scene.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_scene.cpp @@ -75,7 +75,7 @@ bool test_scene(int argc, char** argv) { // Iterate through all shapes and access each point. while (it != shapes.end()) { - boost::shared_ptr shape = *it; + std::shared_ptr shape = *it; // Sum distances of points to detected shapes. FT sum_distances = 0; diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_sphere_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_sphere_parameters.cpp index 0dbc63bb9de..c6dcb0e0999 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_sphere_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_sphere_parameters.cpp @@ -70,7 +70,7 @@ bool test_sphere_parameters() { if (shapes.size() != 1) continue; - boost::shared_ptr sphere = boost::dynamic_pointer_cast((*shapes.first)); + std::shared_ptr sphere = boost::dynamic_pointer_cast((*shapes.first)); // Check: shape detected is a cylinder. if (!sphere) diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_torus_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_torus_parameters.cpp index 42138f178ff..c380d26c7f9 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_torus_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_torus_parameters.cpp @@ -72,7 +72,7 @@ bool test_torus_parameters() { if (shapes.size() != 1) continue; - boost::shared_ptr torus = + std::shared_ptr torus = boost::dynamic_pointer_cast((*shapes.first)); // Check: shape detected is a torus. diff --git a/Straight_skeleton_2/benchmark/Straight_skeleton_2/compare_kernels_simple_polygon_skeleton.cpp b/Straight_skeleton_2/benchmark/Straight_skeleton_2/compare_kernels_simple_polygon_skeleton.cpp index c75bc824e4b..45b78c18a09 100644 --- a/Straight_skeleton_2/benchmark/Straight_skeleton_2/compare_kernels_simple_polygon_skeleton.cpp +++ b/Straight_skeleton_2/benchmark/Straight_skeleton_2/compare_kernels_simple_polygon_skeleton.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -97,7 +97,7 @@ void build_skeleton(const char* fname) time.start(); SsBuilder ssb; ssb.enter_contour(pgn.vertices_begin(), pgn.vertices_end()); - boost::shared_ptr straight_ske = ssb.construct_skeleton(); + std::shared_ptr straight_ske = ssb.construct_skeleton(); time.stop(); std::cout << "Time spent to build skeleton " << time.time() << "\n"; diff --git a/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton.cpp b/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton.cpp index c20f3601883..206d7fdaeca 100644 --- a/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton.cpp +++ b/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton.cpp @@ -1,7 +1,5 @@ #include -#include - #include #include #include @@ -13,8 +11,8 @@ typedef K::Point_2 Point ; typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr PolygonPtr ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr PolygonPtr ; +typedef std::shared_ptr SsPtr ; typedef std::vector PolygonPtrVector ; diff --git a/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton_tweaking_skeleton.cpp b/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton_tweaking_skeleton.cpp index 0f8da09cbfc..438017f36f6 100644 --- a/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton_tweaking_skeleton.cpp +++ b/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton_tweaking_skeleton.cpp @@ -1,7 +1,5 @@ #include -#include - #include #include #include @@ -13,8 +11,8 @@ typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Straight_skeleton_2 Ss ; typedef Ss::Halfedge_const_iterator Halfedge_const_iterator ; -typedef boost::shared_ptr PolygonPtr ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr PolygonPtr ; +typedef std::shared_ptr SsPtr ; typedef std::vector PolygonPtrVector ; diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Polygon_offset_builder_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Polygon_offset_builder_2.h index 3f4db57e881..65cbf5cbb71 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Polygon_offset_builder_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Polygon_offset_builder_2.h @@ -91,12 +91,12 @@ or external angle approaches `0`, numerical overflow may prevent some of the pol If that happens, the failed contour just won't be added into the resulting sequence. \tparam OutputIterator must be a model of the OutputIterator category whose `value_type` - is a `boost::shared_ptr` holding the dynamically allocated instances of type `Container`. + is a `std::shared_ptr` holding the dynamically allocated instances of type `Container`. \param t the offset value \param out an output iterator. For each resulting offset contour, a default constructed instance of `Container` type, is dynamically allocated and each offset vertex is added to it. - A `boost::shared_ptr` holding onto the dynamically allocated container is inserted + A `std::shared_ptr` holding onto the dynamically allocated container is inserted into the output sequence via the OutputIterator `out`. \returns an `OutputIterator` past-the-end of the resulting sequence, which contains each offset contour generated. diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h index 0f832497438..1c0c422aa36 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h @@ -195,7 +195,7 @@ must be entered before calling `construct_skeleton()`. After `construct_skeleton()` completes, you cannot enter more contours and/or call `construct_skeleton()` again. If you need another straight skeleton for another polygon you must instantiate and use another builder. -The result is a dynamically allocated instance of the `Ss` class, wrapped in a `boost::shared_ptr`. +The result is a dynamically allocated instance of the `Ss` class, wrapped in a `std::shared_ptr`. If the construction process fails for whatever reason (such as a nearly-degenerate vertex whose internal or external angle is almost zero), the return value will be null, represented @@ -204,7 +204,7 @@ by a default constructed `shared_ptr`. The algorithm automatically checks the consistency of the result, thus, if it is not nullptr, it is guaranteed to be valid. */ -boost::shared_ptr construct_skeleton(); +std::shared_ptr construct_skeleton(); /// @} diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h index d3ff08ad9f4..a5ea28252e2 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h @@ -14,7 +14,7 @@ using the items converter `ic` to convert the geometric embedding to the types o \sa `CGAL::Straight_skeleton_converter_2` */ template -boost::shared_ptr +std::shared_ptr convert_straight_skeleton_2( Source_skeleton const& s, Items_converted const& ic = Items_converter() ); @@ -77,7 +77,7 @@ Straight_skeleton_converter_2( const Items_converter& c = Items_converter() ); /*! returns a new straight skeleton data structure with the same combinatorial and geometric data as `s` using the items converter to convert the geometric embeeding to the types of the target traits. */ -boost::shared_ptr operator()( const Source_skeleton& s) const; +std::shared_ptr operator()( const Source_skeleton& s) const; /// @} diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/arrange_offset_polygons_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/arrange_offset_polygons_2.h index 49c4814f04f..9b558743b36 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/arrange_offset_polygons_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/arrange_offset_polygons_2.h @@ -8,16 +8,16 @@ by `create_offset_polygons_2()` into 2D polygons with holes by determining geome relationships using a simple algorithm based on the particular characteristics of offset polygons. The function determines parent-hole relationships among the polygons given by `[begin,end]` creating -`boost::shared_ptr< GeneralPolygonWithHoles_2 >` objects added to the output sequence given `out`. +`std::shared_ptr< GeneralPolygonWithHoles_2 >` objects added to the output sequence given `out`. A `CLOCKWISE` oriented polygon `H` is a hole of a `COUNTERCLOCKWISE` polygon `P`, iff at least one vertex of `H` is `ON_BOUNDED_SIDE` of `P`. This function should not be used to arrange arbitrary polygons into polygons with holes unless they meet the requirements specified below. \tparam K must be a model of `Kernel`. \tparam InputPolygonPtrIterator must be a model of `InputIterator` whose `value_type` is a smart pointer -(such as `boost::shared_ptr`) whose `element_type` is a model of `SequenceContainer` with value type `K::Point_2`. +(such as `std::shared_ptr`) whose `element_type` is a model of `SequenceContainer` with value type `K::Point_2`. \tparam OutputPolygonWithHolesPtrIterator must be a model of `OutputIterator` whose `value_type` is a smart pointer -(such as `boost::shared_ptr`) whose `element_type` is a model of `GeneralPolygonWithHoles_2`. +(such as `std::shared_ptr`) whose `element_type` is a model of `GeneralPolygonWithHoles_2`. \pre The input polygons must be simple. \pre The set of input polygons are unique and interior disjoint. That is, given distinct polygons diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h index 831b3967b62..1d4b660c8a1 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h @@ -25,7 +25,7 @@ of a polygon with holes, the offset polygons will be generated in its exterior. \sa `Polygon_offset_builder_2` */ template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > create_offset_polygons_2 ( FT offset, const StraightSkeleton& s, OfK k = Exact_predicates_inexact_constructions_kernel ) ; @@ -63,7 +63,7 @@ polygons to be constructed. \sa `Polygon_offset_builder_2` */ template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > create_exterior_skeleton_and_offset_polygons_2( FT offset, const InKPolygon& poly, OfK ofk = Exact_predicates_inexact_constructions_kernel, @@ -100,7 +100,7 @@ and `create_offset_polygons_2()` instead. \sa `Polygon_offset_builder_2` */ template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > create_interior_skeleton_and_offset_polygons_2 ( FT offset, const InKPolygon& outer_boundary, HoleIterator holes_begin, @@ -135,7 +135,7 @@ and `create_offset_polygons_2()` instead. \sa `Polygon_offset_builder_2` */ template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > create_interior_skeleton_and_offset_polygons_2 ( FT offset, const InKPolygon& poly, OfK ofk = CGAL::Exact_predicates_inexact_constructions_kernel, diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h index b2eea3ecf4b..ea2025cb49e 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h @@ -25,7 +25,7 @@ This is equivalent to `arrange_offset_polygons_2(create_interior_skeleton_and_of \sa `Polygon_offset_builder_2` */ template -std::vector< boost::shared_ptr< OfKPolygon > > +std::vector< std::shared_ptr< OfKPolygon > > create_interior_skeleton_and_offset_polygons_with_holes_2(FT offset, const InKPolygon& poly_with_holes, OfK ofk = CGAL::Exact_predicates_inexact_constructions_kernel, @@ -63,7 +63,7 @@ having reversed the orientation of all other polygons. \sa `Polygon_offset_builder_2` */ template -std::vector > +std::vector > create_exterior_skeleton_and_offset_polygons_with_holes_2(FT offset, const InKPolygon& poly_with_holes, OfK ofk = Exact_predicates_inexact_constructions_kernel, diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_straight_skeleton_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_straight_skeleton_2.h index 3840424cd21..7d175b73f98 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_straight_skeleton_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_straight_skeleton_2.h @@ -26,7 +26,7 @@ from this exterior skeleton, as computed by the function `compute_outer_frame_ma \sa `CGAL::Straight_skeleton_builder_2` */ template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_exterior_straight_skeleton_2( FT max_offset, PointIterator vertices_begin, PointIterator vertices_end, @@ -56,7 +56,7 @@ from this exterior skeleton, as computed by the function `compute_outer_frame_ma \sa `CGAL::Straight_skeleton_builder_2` */ template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_exterior_straight_skeleton_2 ( FT max_offset, const Polygon& P, SsK k = CGAL::Exact_predicates_inexact_constructions_kernel ) ; @@ -82,7 +82,7 @@ holes given by `[holes_begin,holes_end]`. \sa `CGAL::Straight_skeleton_builder_2` */ template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_interior_straight_skeleton_2 ( PointIterator outer_contour_vertices_begin, PointIterator outer_contour_vertices_end, HoleIterator holes_begin, @@ -105,7 +105,7 @@ polygon whose outer boundary is given by the point sequence \sa `CGAL::Straight_skeleton_builder_2` */ template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_interior_straight_skeleton_2 ( PointIterator outer_contour_vertices_begin, PointIterator outer_contour_vertices_end, SsK k = CGAL::Exact_predicates_inexact_constructions_kernel ) ; @@ -127,7 +127,7 @@ polygon `outer_contour`. \sa `CGAL::Straight_skeleton_builder_2` */ template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_interior_straight_skeleton_2 ( const Polygon& outer_contour, SsK k = CGAL::Exact_predicates_inexact_constructions_kernel ) ; diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/Straight_skeleton_2.txt b/Straight_skeleton_2/doc/Straight_skeleton_2/Straight_skeleton_2.txt index 30063a178b5..0c05bf7e5e2 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/Straight_skeleton_2.txt +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/Straight_skeleton_2.txt @@ -368,11 +368,11 @@ To construct a set of inward offset contours the user must: (3) Call `Polygon_offset_builder_2::construct_offset_contours()` passing the desired offset distance and an output iterator that can store a -`boost::shared_ptr` of `Container` instances +`std::shared_ptr` of `Container` instances into a resulting sequence (typically, a back insertion iterator) Each element in the resulting sequence is an offset contour, given by -a `boost::shared_ptr` holding a dynamically allocated instance +a `std::shared_ptr` holding a dynamically allocated instance of the Container type. Such a container can be any model of the `SequenceContainer` concept, for example, a `CGAL::Polygon_2`, or just a `std::vector` of 2D points. diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_offset_polygons_2.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_offset_polygons_2.cpp index fed81126621..f89d23f0018 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_offset_polygons_2.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_offset_polygons_2.cpp @@ -4,7 +4,7 @@ #include #include "print.h" -#include +#include #include #include @@ -15,8 +15,8 @@ typedef K::Point_2 Point ; typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr PolygonPtr ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr PolygonPtr ; +typedef std::shared_ptr SsPtr ; typedef std::vector PolygonPtrVector ; diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_saop_from_polygon_with_holes_2.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_saop_from_polygon_with_holes_2.cpp index 95eca620ae7..ba3e555ec09 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_saop_from_polygon_with_holes_2.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_saop_from_polygon_with_holes_2.cpp @@ -4,7 +4,7 @@ #include #include "print.h" -#include +#include #include #include @@ -16,8 +16,8 @@ typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes ; typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr PolygonPtr ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr PolygonPtr ; +typedef std::shared_ptr SsPtr ; typedef std::vector PolygonPtrVector ; diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_skeleton_and_offset_polygons_2.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_skeleton_and_offset_polygons_2.cpp index d0b1a979669..572814f6682 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_skeleton_and_offset_polygons_2.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_skeleton_and_offset_polygons_2.cpp @@ -4,7 +4,7 @@ #include #include "print.h" -#include +#include #include #include @@ -16,8 +16,8 @@ typedef K::Point_2 Point ; typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr PolygonPtr ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr PolygonPtr ; +typedef std::shared_ptr SsPtr ; typedef std::vector PolygonPtrVector ; diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_skeleton_and_offset_polygons_with_holes_2.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_skeleton_and_offset_polygons_with_holes_2.cpp index bf91a2de00d..2bdd31e75f7 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_skeleton_and_offset_polygons_with_holes_2.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_skeleton_and_offset_polygons_with_holes_2.cpp @@ -4,7 +4,7 @@ #include #include "print.h" -#include +#include #include #include @@ -15,7 +15,7 @@ typedef K::Point_2 Point ; typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Polygon_with_holes_2 PolygonWithHoles ; -typedef boost::shared_ptr PolygonWithHolesPtr ; +typedef std::shared_ptr PolygonWithHolesPtr ; typedef std::vector PolygonWithHolesPtrVector; diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_straight_skeleton_2.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_straight_skeleton_2.cpp index ce2e11e57f9..08e57f794af 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_straight_skeleton_2.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_straight_skeleton_2.cpp @@ -4,8 +4,6 @@ #include #include "print.h" -#include - #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K ; @@ -14,7 +12,7 @@ typedef K::Point_2 Point ; typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr SsPtr ; int main() { diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_straight_skeleton_from_polygon_with_holes_2.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_straight_skeleton_from_polygon_with_holes_2.cpp index 3dfe3b48437..98dc57fac28 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_straight_skeleton_from_polygon_with_holes_2.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_straight_skeleton_from_polygon_with_holes_2.cpp @@ -4,7 +4,7 @@ #include #include "print.h" -#include +#include #include @@ -15,7 +15,7 @@ typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes ; typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr SsPtr ; int main() { diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Low_level_API.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Low_level_API.cpp index 798228788ba..52e405a4dd3 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Low_level_API.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Low_level_API.cpp @@ -7,7 +7,7 @@ #include #include "print.h" -#include +#include #include #include @@ -22,7 +22,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_2 Point_2; typedef CGAL::Polygon_2 Contour; -typedef boost::shared_ptr ContourPtr; +typedef std::shared_ptr ContourPtr; typedef std::vector ContourSequence ; typedef CGAL::Straight_skeleton_2 Ss; @@ -97,7 +97,7 @@ int main() ssb.enter_contour(star.rbegin(),star.rend()); // Construct the skeleton - boost::shared_ptr ss = ssb.construct_skeleton(); + std::shared_ptr ss = ssb.construct_skeleton(); // Proceed only if the skeleton was correctly constructed. if ( ss ) diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Show_offset_polygon.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Show_offset_polygon.cpp index 296d721cc40..8a35567dafd 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Show_offset_polygon.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Show_offset_polygon.cpp @@ -4,7 +4,7 @@ #include #include "dump_to_eps.h" -#include +#include #include #include @@ -16,7 +16,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K ; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes ; -typedef boost::shared_ptr Polygon_with_holes_ptr ; +typedef std::shared_ptr Polygon_with_holes_ptr ; typedef std::vector Polygon_with_holes_ptr_vector ; diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Show_straight_skeleton.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Show_straight_skeleton.cpp index 080749ec962..1273b49f785 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Show_straight_skeleton.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Show_straight_skeleton.cpp @@ -6,8 +6,6 @@ #include #include -#include - #include #include #include @@ -21,7 +19,7 @@ typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes ; typedef CGAL::Straight_skeleton_2 Straight_skeleton ; -typedef boost::shared_ptr Straight_skeleton_ptr ; +typedef std::shared_ptr Straight_skeleton_ptr ; int main( int argc, char* argv[] ) { diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/draw_straight_skeleton_2.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/draw_straight_skeleton_2.cpp index c86c3f4593e..96f3da42c1d 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/draw_straight_skeleton_2.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/draw_straight_skeleton_2.cpp @@ -4,8 +4,6 @@ #include #include -#include - #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K ; @@ -14,7 +12,7 @@ typedef K::Point_2 Point ; typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr SsPtr ; int main() { diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/dump_to_eps.h b/Straight_skeleton_2/examples/Straight_skeleton_2/dump_to_eps.h index 5e94bf72b3d..efc8694a921 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/dump_to_eps.h +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/dump_to_eps.h @@ -84,11 +84,11 @@ void dump_to_eps( CGAL::Straight_skeleton_2 const& aSkeleton, char const* aTy template void dump_to_eps ( CGAL::Polygon_with_holes_2 const& aInput - , std::vector< boost::shared_ptr< CGAL::Polygon_with_holes_2 > > const& aOutput + , std::vector< std::shared_ptr< CGAL::Polygon_with_holes_2 > > const& aOutput , std::ostream& rOut ) { - typedef std::vector< boost::shared_ptr< CGAL::Polygon_with_holes_2 > > PolyWH_vector ; + typedef std::vector< std::shared_ptr< CGAL::Polygon_with_holes_2 > > PolyWH_vector ; CGAL::Bbox_2 lBbox = CGAL::bbox_2(aInput); diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp index f6e0a86a931..d2da4691924 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include @@ -17,8 +17,8 @@ typedef K::Point_2 Point ; typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Polygon_with_holes_2 PolygonWithHoles ; -typedef boost::shared_ptr PolygonWithHolesPtr ; -typedef boost::shared_ptr PolygonPtr ; +typedef std::shared_ptr PolygonWithHolesPtr ; +typedef std::shared_ptr PolygonPtr ; typedef std::vector PolygonWithHolesPtrVector; typedef std::vector PolygonPtrVector; diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/print.h b/Straight_skeleton_2/examples/Straight_skeleton_2/print.h index 4afc5e4a3bd..216e11f0dd6 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/print.h +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/print.h @@ -21,9 +21,9 @@ void print_polygon ( CGAL::Polygon_2 const& poly ) } template -void print_polygons ( std::vector< boost::shared_ptr< CGAL::Polygon_2 > > const& polies ) +void print_polygons ( std::vector< std::shared_ptr< CGAL::Polygon_2 > > const& polies ) { - typedef std::vector< boost::shared_ptr< CGAL::Polygon_2 > > PolygonVector ; + typedef std::vector< std::shared_ptr< CGAL::Polygon_2 > > PolygonVector ; std::cout << "Polygon list with " << polies.size() << " polygons" << std::endl ; @@ -45,10 +45,10 @@ void print_polygon_with_holes ( CGAL::Polygon_with_holes_2 const& polywh ) } template -void print_polygons_with_holes ( std::vector< boost::shared_ptr< CGAL::Polygon_with_holes_2 > > const& polies ) +void print_polygons_with_holes ( std::vector< std::shared_ptr< CGAL::Polygon_with_holes_2 > > const& polies ) { - typedef std::vector< boost::shared_ptr< CGAL::Polygon_with_holes_2 > > PolygonWithHolesVector ; + typedef std::vector< std::shared_ptr< CGAL::Polygon_with_holes_2 > > PolygonWithHolesVector ; std::cout << "Polygon_with_holes list with " << polies.size() << " element" << std::endl ; diff --git a/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_2.h b/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_2.h index 9d498c8f7ea..3ddac56aa28 100644 --- a/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_2.h +++ b/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_2.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include @@ -71,7 +71,7 @@ public : typedef boost::optional OptionalPoint_2 ; - typedef boost::shared_ptr ContainerPtr ; + typedef std::shared_ptr ContainerPtr ; Polygon_offset_builder_2( Ss const& aSs, Traits const& aTraits = Traits(), Visitor const& aVisitor = Visitor() ) ; diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_iterators.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_iterators.h index 4740194987b..04aa6864b4c 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_iterators.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_iterators.h @@ -15,7 +15,7 @@ #include -#include +#include namespace CGAL { namespace CGAL_SS_i { @@ -33,11 +33,11 @@ inline typename Poly::const_iterator vertices_end ( Poly const& aPoly ) { return aPoly.end() ; } template -inline typename Poly::const_iterator vertices_begin ( boost::shared_ptr const& aPoly ) +inline typename Poly::const_iterator vertices_begin ( std::shared_ptr const& aPoly ) { return aPoly->begin() ; } template -inline typename Poly::const_iterator vertices_end ( boost::shared_ptr const& aPoly ) +inline typename Poly::const_iterator vertices_end ( std::shared_ptr const& aPoly ) { return aPoly->end() ; } // Polygon_2 @@ -52,11 +52,11 @@ vertices_end( Polygon_2 const& aPoly ) { return aPoly.vertices_end() ; } template -inline typename Polygon_2::Vertex_const_iterator vertices_begin ( boost::shared_ptr > const& aPoly ) +inline typename Polygon_2::Vertex_const_iterator vertices_begin ( std::shared_ptr > const& aPoly ) { return aPoly->vertices_begin() ; } template -inline typename Polygon_2::Vertex_const_iterator vertices_end( boost::shared_ptr > const& aPoly ) +inline typename Polygon_2::Vertex_const_iterator vertices_end( std::shared_ptr > const& aPoly ) { return aPoly->vertices_end() ; } // Polygon_with_holes_2 @@ -72,12 +72,12 @@ vertices_end( Polygon_with_holes_2 const& aPoly ) template inline typename Polygon_with_holes_2::Polygon_2::Vertex_const_iterator -vertices_begin ( boost::shared_ptr > const& aPoly ) +vertices_begin ( std::shared_ptr > const& aPoly ) { return aPoly->outer_boundary().vertices_begin() ; } template inline typename Polygon_with_holes_2::Polygon_2::Vertex_const_iterator -vertices_end( boost::shared_ptr > const& aPoly ) +vertices_end( std::shared_ptr > const& aPoly ) { return aPoly->outer_boundary().vertices_end() ; } } // namespace CGAL_SS_i diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h index c0fea4462de..c7e3f77fbd7 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -111,7 +111,7 @@ public: typedef SSkel_ SSkel ; typedef Visitor_ Visitor ; - typedef boost::shared_ptr SSkelPtr ; + typedef std::shared_ptr SSkelPtr ; private : diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_converter_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_converter_2.h index 650b1894a2a..0665d6de374 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_converter_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_converter_2.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -163,7 +163,7 @@ struct Straight_skeleton_converter_2 typedef typename Source_skeleton::Traits Source_traits ; typedef typename Target_skeleton::Traits Target_traits ; - typedef boost::shared_ptr Target_skeleton_ptr ; + typedef std::shared_ptr Target_skeleton_ptr ; typedef typename Source_skeleton::Vertex_const_iterator Source_vertex_const_iterator ; typedef typename Source_skeleton::Halfedge_const_iterator Source_halfedge_const_iterator ; @@ -333,7 +333,7 @@ private : } ; template -boost::shared_ptr +std::shared_ptr convert_straight_skeleton_2 ( Source_skeleton const& aSrc, Items_converter const& ic ) { typedef Straight_skeleton_converter_2 Skeleton_converter ; @@ -345,7 +345,7 @@ convert_straight_skeleton_2 ( Source_skeleton const& aSrc, Items_converter const } template -boost::shared_ptr +std::shared_ptr convert_straight_skeleton_2 ( Source_skeleton const& aSrc ) { typedef Straight_skeleton_items_converter_2 Items_converter ; 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 4ceae69e570..840e0950b84 100644 --- a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin typedef typename std::iterator_traits::difference_type difference_type ; typedef typename std::iterator_traits::value_type PolygonPtr ; - typedef boost::shared_ptr PolygonWithHolesPtr ; + typedef std::shared_ptr PolygonWithHolesPtr ; difference_type lSize = std::distance(aBegin,aEnd); @@ -113,18 +113,18 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin } template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline -arrange_offset_polygons_2 ( std::vector > const& aPolygons, +arrange_offset_polygons_2 ( std::vector > const& aPolygons, bool& no_error) { - typedef std::vector< boost::shared_ptr > result_type ; + typedef std::vector< std::shared_ptr > result_type ; typedef std::back_insert_iterator Back_inserter; typedef typename PolygonWithHoles::General_polygon_2 Polygon_2 ; typedef typename Kernel_traits::type>::Kernel K ; - typedef typename std::vector >::const_iterator PolygonIterator ; + typedef typename std::vector >::const_iterator PolygonIterator ; result_type rResult ; no_error = arrange_offset_polygons_2( @@ -134,9 +134,9 @@ arrange_offset_polygons_2 ( std::vector > const& aPol } template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline -arrange_offset_polygons_2 ( std::vector > const& aPolygons) +arrange_offset_polygons_2 ( std::vector > const& aPolygons) { bool no_error; return arrange_offset_polygons_2(aPolygons, no_error); diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h index dbaa31bbcb8..9a8a97012cb 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -103,7 +103,7 @@ struct Default_return_polygon_with_holes_type // Polygon ty }; template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_partial_interior_straight_skeleton_2 ( FT const& aMaxTime , PointIterator aOuterContour_VerticesBegin , PointIterator aOuterContour_VerticesEnd @@ -139,7 +139,7 @@ create_partial_interior_straight_skeleton_2 ( FT const& aMaxTime } template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_partial_exterior_straight_skeleton_2 ( FT const& aMaxOffset , PointIterator aVerticesBegin , PointIterator aVerticesEnd @@ -152,7 +152,7 @@ create_partial_exterior_straight_skeleton_2 ( FT const& aMaxOffset typedef typename Kernel_traits::Kernel IK; typedef typename IK::FT IFT; - boost::shared_ptr > rSkeleton; + std::shared_ptr > rSkeleton; // That's because we might not have FT == IK::FT (e.g. `double` and `Core`) // Note that we can also have IK != K (e.g. `Simple_cartesian` and `EPICK`) @@ -199,10 +199,10 @@ create_partial_exterior_straight_skeleton_2 ( FT const& aMaxOffset // Kernel != Skeleton::kernel. The skeleton is converted to Straight_skeleton_2 // template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& , Tag_false ) { - typedef boost::shared_ptr OutPolygonPtr ; + typedef std::shared_ptr OutPolygonPtr ; typedef std::vector OutPolygonPtrVector ; typedef Straight_skeleton_2 OfSkeleton ; @@ -212,7 +212,7 @@ create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& , Ta OutPolygonPtrVector rR ; - boost::shared_ptr lConvertedSs = convert_straight_skeleton_2(aSs); + std::shared_ptr lConvertedSs = convert_straight_skeleton_2(aSs); OffsetBuilder ob( *lConvertedSs ); ob.construct_offset_contours(aOffset, std::back_inserter(rR) ) ; @@ -223,10 +223,10 @@ create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& , Ta // Kernel == Skeleton::kernel, no conversion // template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& /*k*/, Tag_true ) { - typedef boost::shared_ptr OutPolygonPtr ; + typedef std::shared_ptr OutPolygonPtr ; typedef std::vector OutPolygonPtrVector ; typedef Polygon_offset_builder_traits_2 OffsetBuilderTraits; @@ -242,7 +242,7 @@ create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& /*k* // Allow failure due to invalid straight skeletons to go through the users template -Skeleton const& dereference ( boost::shared_ptr const& ss ) +Skeleton const& dereference ( std::shared_ptr const& ss ) { CGAL_precondition(ss.get() != 0); return *ss; @@ -251,7 +251,7 @@ Skeleton const& dereference ( boost::shared_ptr const& ss ) } // namespace CGAL_SS_i template -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline create_offset_polygons_2(const FT& aOffset, const Skeleton& aSs, @@ -263,7 +263,7 @@ create_offset_polygons_2(const FT& aOffset, template, class FT, class Skeleton> -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline create_offset_polygons_2(const FT& aOffset, const Skeleton& aSs) @@ -278,7 +278,7 @@ create_offset_polygons_2(const FT& aOffset, template::type> -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aOuterBoundary, @@ -302,7 +302,7 @@ create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, template::type> -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aOuterBoundary, @@ -319,7 +319,7 @@ create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, // Overload where Polygon actually is a simple polygon (no holes) template::type> -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly, @@ -337,7 +337,7 @@ create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, // Overloads common to both polygons with and without holes, a simple polygon is returned in any case template::type> -std::vector > +std::vector > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly, @@ -350,7 +350,7 @@ create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, template::type> -std::vector > +std::vector > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly) @@ -369,7 +369,7 @@ create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, // Overload where Polygon actually is a simple polygon (no holes) template::type> -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly, @@ -392,7 +392,7 @@ create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, // Overloads common to both polygons with and without holes, a simple polygons are returned in any case template::type> -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly, @@ -405,7 +405,7 @@ create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, template::type> -std::vector< boost::shared_ptr > +std::vector< std::shared_ptr > inline create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly) diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h index 745ce692b68..1edf67e1129 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include @@ -38,7 +38,7 @@ namespace CGAL { // overload where PolygonWithHoles actually is a type of Polygon that supports holes template::type> // Hole-less polygon type -std::vector > +std::vector > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const PolygonWithHoles& aPoly, @@ -57,7 +57,7 @@ create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, // Polygon might be a Polygon with holes or not, but it returns a Polygon with holes template::type> -std::vector > +std::vector > inline create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly, @@ -70,7 +70,7 @@ create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, template::type> -std::vector > +std::vector > inline create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly, @@ -83,7 +83,7 @@ create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, template::type> -std::vector > +std::vector > inline create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly) @@ -102,7 +102,7 @@ create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, // Polygon might be a Polygon with holes or not, but it returns a Polygon with holes template::type> -std::vector > +std::vector > inline create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly, @@ -110,7 +110,7 @@ create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const SsK& ssk) { typedef typename CGAL_SS_i::Default_return_polygon_type::type Polygon_; - std::vector > raw_output = + std::vector > raw_output = create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly, ofk, ssk); // filter offset of the outer frame @@ -129,7 +129,7 @@ create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, if (outer_id != (raw_output.size()-1)) std::swap(raw_output[outer_id], raw_output.back()); raw_output.pop_back(); - for (boost::shared_ptr ptr : raw_output) + for (std::shared_ptr ptr : raw_output) ptr->reverse_orientation(); return arrange_offset_polygons_2(raw_output); @@ -140,7 +140,7 @@ create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, // overload where PolygonWithHoles actually is a type of Polygon that supports holes template::type> -std::vector > +std::vector > inline create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, const PolygonWithHoles& aPoly, @@ -149,14 +149,14 @@ create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, std::enable_if_t< CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { - std::vector > polygons = + std::vector > polygons = create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), ofk, ssk); for (typename PolygonWithHoles::Hole_const_iterator hit=aPoly.holes_begin(); hit!=aPoly.holes_end(); ++hit) { typename PolygonWithHoles::Polygon_2 hole = *hit; hole.reverse_orientation(); - std::vector > hole_polygons = + std::vector > hole_polygons = create_interior_skeleton_and_offset_polygons_2(aOffset, hole, ofk,ssk); @@ -168,7 +168,7 @@ create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, template::type> -std::vector > +std::vector > inline create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly, @@ -181,7 +181,7 @@ create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, template::type> -std::vector > +std::vector > inline create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly) diff --git a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h index aa73ed322c6..d88fb85ac50 100644 --- a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -31,7 +31,7 @@ namespace CGAL { template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin , PointIterator aOuterContour_VerticesEnd , HoleIterator aHolesBegin @@ -61,7 +61,7 @@ create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin } template -boost::shared_ptr< Straight_skeleton_2< Exact_predicates_inexact_constructions_kernel > > +std::shared_ptr< Straight_skeleton_2< Exact_predicates_inexact_constructions_kernel > > inline create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin , PointIterator aOuterContour_VerticesEnd @@ -78,7 +78,7 @@ create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin } template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > inline create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin , PointIterator aOuterContour_VerticesEnd @@ -98,7 +98,7 @@ create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin } template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > inline create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin , PointIterator aOuterContour_VerticesEnd @@ -111,7 +111,7 @@ create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin } template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > inline create_interior_straight_skeleton_2 ( Polygon const& aOutContour, K const& k, @@ -125,7 +125,7 @@ create_interior_straight_skeleton_2 ( Polygon const& aOutContour, } template -boost::shared_ptr< Straight_skeleton_2< Exact_predicates_inexact_constructions_kernel > > +std::shared_ptr< Straight_skeleton_2< Exact_predicates_inexact_constructions_kernel > > inline create_interior_straight_skeleton_2 ( Polygon const& aOutContour ) { @@ -138,7 +138,7 @@ create_interior_straight_skeleton_2 ( Polygon const& aOutContour ) /// EXTERIOR template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > create_exterior_straight_skeleton_2 ( FT const& aMaxOffset , PointIterator aVerticesBegin , PointIterator aVerticesEnd @@ -151,7 +151,7 @@ create_exterior_straight_skeleton_2 ( FT const& aMaxOffset typedef typename Kernel_traits::Kernel IK; typedef typename IK::FT IFT; - boost::shared_ptr > rSkeleton; + std::shared_ptr > rSkeleton; // That's because we might not have FT == IK::FT (e.g. `double` and `Core`) // Note that we can also have IK != K (e.g. `Simple_cartesian` and `EPICK`) @@ -195,7 +195,7 @@ create_exterior_straight_skeleton_2 ( FT const& aMaxOffset } template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > inline create_exterior_straight_skeleton_2 ( FT const& aMaxOffset , PointIterator aVerticesBegin @@ -210,7 +210,7 @@ create_exterior_straight_skeleton_2 ( FT const& aMaxOffset } template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > inline create_exterior_straight_skeleton_2 ( FT const& aMaxOffset, Polygon const& aPoly, K const& k ) { @@ -222,7 +222,7 @@ create_exterior_straight_skeleton_2 ( FT const& aMaxOffset, Polygon const& aPoly } template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > inline create_exterior_straight_skeleton_2 ( FT const& aMaxOffset, Polygon const& aPoly ) { diff --git a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_from_polygon_with_holes_2.h index 34ededf3da7..9693981d4e0 100644 --- a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_from_polygon_with_holes_2.h @@ -20,14 +20,14 @@ #include -#include +#include #include namespace CGAL { template -boost::shared_ptr< Straight_skeleton_2 > +std::shared_ptr< Straight_skeleton_2 > inline create_interior_straight_skeleton_2 ( Polygon const& aPolyWithHoles, K const& k, diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_offset_builder_types.h b/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_offset_builder_types.h index e4470f20366..7f6217477a8 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_offset_builder_types.h +++ b/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_offset_builder_types.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -29,10 +29,10 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; typedef CGAL::Aff_transformation_2 Transformation; typedef std::vector Polygon_2; -typedef boost::shared_ptr PolygonPtr; +typedef std::shared_ptr PolygonPtr; typedef CGAL::Segment_2 Segment; typedef std::vector Region ; -typedef boost::shared_ptr RegionPtr ; +typedef std::shared_ptr RegionPtr ; typedef std::vector Regions ; typedef std::vector Doubles ; @@ -51,7 +51,7 @@ typedef Sls::Vertex_const_handle Vertex_const_handle ; typedef CGAL::HalfedgeDS_const_decorator Sls_const_decorator ; -typedef boost::shared_ptr SlsPtr ; +typedef std::shared_ptr SlsPtr ; #endif diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_builder_types.h b/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_builder_types.h index f41d7f30f81..7a77342eba1 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_builder_types.h +++ b/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_builder_types.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include //typedef CGAL::Simple_cartesian K ; @@ -30,10 +30,10 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; typedef CGAL::Aff_transformation_2 Transformation; typedef std::vector Polygon_2; -typedef boost::shared_ptr PolygonPtr; +typedef std::shared_ptr PolygonPtr; typedef CGAL::Segment_2 Segment; typedef std::vector Region ; -typedef boost::shared_ptr RegionPtr ; +typedef std::shared_ptr RegionPtr ; typedef std::vector Regions ; typedef std::vector Doubles ; @@ -50,7 +50,7 @@ typedef Sls::Vertex_const_handle Vertex_const_handle ; typedef CGAL::HalfedgeDS_const_decorator Sls_const_decorator ; -typedef boost::shared_ptr SlsPtr ; +typedef std::shared_ptr SlsPtr ; #endif diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_types.h b/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_types.h index c45acacbdda..cc55c28210a 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_types.h +++ b/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_types.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -50,16 +50,16 @@ typedef std::vector Doubles ; typedef CGAL::Segment_2 ISegment; typedef std::vector IPolygon; -typedef boost::shared_ptr IPolygonPtr; +typedef std::shared_ptr IPolygonPtr; typedef std::vector IRegion ; -typedef boost::shared_ptr IRegionPtr ; +typedef std::shared_ptr IRegionPtr ; typedef std::vector IRegions ; typedef CGAL::Segment_2 OSegment; typedef std::vector OPolygon; -typedef boost::shared_ptr OPolygonPtr; +typedef std::shared_ptr OPolygonPtr; typedef std::vector ORegion ; -typedef boost::shared_ptr ORegionPtr ; +typedef std::shared_ptr ORegionPtr ; typedef std::vector ORegions ; typedef CGAL::Straight_skeleton_2 ISls; @@ -157,8 +157,8 @@ public: typedef CGAL::HalfedgeDS_const_decorator Sls_const_decorator ; -typedef boost::shared_ptr ISlsPtr ; -typedef boost::shared_ptr OSlsPtr ; +typedef std::shared_ptr ISlsPtr ; +typedef std::shared_ptr OSlsPtr ; typedef CGAL::Straight_skeleton_items_converter_2 SlsItemsConverter ; diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/issue4533.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/issue4533.cpp index d552e1241a4..4f59ee87fc2 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/issue4533.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/issue4533.cpp @@ -5,7 +5,7 @@ #include "print.h" #include -#include +#include #include @@ -15,7 +15,7 @@ typedef K::Point_2 Point; typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Straight_skeleton_2 Ss; -typedef boost::shared_ptr SsPtr; +typedef std::shared_ptr SsPtr; int main() { diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/issue4684.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/issue4684.cpp index 560d8c01403..47dd764e525 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/issue4684.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/issue4684.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include @@ -13,7 +13,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; typedef CGAL::Polygon_2 Polygon_2; -typedef boost::shared_ptr PolygonPtr; +typedef std::shared_ptr PolygonPtr; void low_precision_run() { diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/issue7149.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/issue7149.cpp index 9acead190b0..709a1fb0bf7 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/issue7149.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/issue7149.cpp @@ -83,7 +83,7 @@ void test(const PointRange& points, K()); assert(ss_ptr); - std::vector > offset_polygons_ptrs = + std::vector > offset_polygons_ptrs = CGAL::create_offset_polygons_2(FT(offset), CGAL::CGAL_SS_i::dereference(ss_ptr), K()); std::cout << offset_polygons_ptrs.size() << " polygon(s)" << std::endl; diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/print.h b/Straight_skeleton_2/test/Straight_skeleton_2/print.h index abaa74d9e46..a3cc881f479 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/print.h +++ b/Straight_skeleton_2/test/Straight_skeleton_2/print.h @@ -24,9 +24,9 @@ void print_polygon ( CGAL::Polygon_2 const& poly ) } template -void print_polygons ( std::vector< boost::shared_ptr< CGAL::Polygon_2 > > const& polies ) +void print_polygons ( std::vector< std::shared_ptr< CGAL::Polygon_2 > > const& polies ) { - typedef std::vector< boost::shared_ptr< CGAL::Polygon_2 > > PolygonVector ; + typedef std::vector< std::shared_ptr< CGAL::Polygon_2 > > PolygonVector ; std::cout << "Polygon list with " << polies.size() << " polygons" << std::endl ; @@ -48,10 +48,10 @@ void print_polygon_with_holes ( CGAL::Polygon_with_holes_2 const& polywh ) } template -void print_polygons_with_holes ( std::vector< boost::shared_ptr< CGAL::Polygon_with_holes_2 > > const& polies ) +void print_polygons_with_holes ( std::vector< std::shared_ptr< CGAL::Polygon_with_holes_2 > > const& polies ) { - typedef std::vector< boost::shared_ptr< CGAL::Polygon_with_holes_2 > > PolygonWithHolesVector ; + typedef std::vector< std::shared_ptr< CGAL::Polygon_with_holes_2 > > PolygonWithHolesVector ; std::cout << "Polygon_with_holes list with " << polies.size() << " element" << std::endl ; 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 02082ff8724..db7ec3b1622 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -37,7 +37,7 @@ void Straight_skeleton_traits_external_trace(std::string m) #include #include -#include +#include #include #include @@ -60,10 +60,10 @@ void test_API() Polygon_2 p; Polygon_with_holes_2 pwh; - std::vector< boost::shared_ptr > res; - std::vector< boost::shared_ptr > res_EPICK; - std::vector< boost::shared_ptr > res_w; - std::vector< boost::shared_ptr > res_w_EPICK; + std::vector< std::shared_ptr > res; + std::vector< std::shared_ptr > res_EPICK; + std::vector< std::shared_ptr > res_w; + std::vector< std::shared_ptr > res_w_EPICK; // First kernel is the offset construction (and thus output kernel), second kernel is the skeleton construction @@ -135,7 +135,7 @@ void test_API() } template -bool is_valid(const boost::shared_ptr& ss) +bool is_valid(const std::shared_ptr& ss) { typedef typename StraightSkeleton::Traits::Point_2 Point; @@ -176,7 +176,7 @@ void test_offset_square() typedef typename K::Point_2 Point; typedef CGAL::Polygon_2 Polygon_2; - typedef boost::shared_ptr Polygon_ptr; + typedef std::shared_ptr Polygon_ptr; typedef std::vector Polygon_ptr_container; typedef CGAL::Straight_skeleton_2 Ss; @@ -193,7 +193,7 @@ void test_offset_square() Skeleton_builder ssb; ssb.enter_contour(square.begin(), square.end()); - boost::shared_ptr ss = ssb.construct_skeleton(); + std::shared_ptr ss = ssb.construct_skeleton(); assert(is_valid(ss)); Polygon_ptr_container offset_polys = @@ -216,7 +216,7 @@ void test_offset_four_square_holes() typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - typedef boost::shared_ptr Polygon_with_holes_2_ptr; + typedef std::shared_ptr Polygon_with_holes_2_ptr; typedef std::vector Polygon_with_holes_2_ptr_container; Polygon_2 outer, hole1, hole2, hole3, hole4; @@ -275,7 +275,7 @@ void test_offset_L() typedef typename K::Point_2 Point; typedef CGAL::Polygon_2 Polygon_2; - typedef boost::shared_ptr Polygon_ptr; + typedef std::shared_ptr Polygon_ptr; typedef std::vector Polygon_ptr_container; typedef CGAL::Straight_skeleton_2 Ss; @@ -296,7 +296,7 @@ void test_offset_L() Skeleton_builder ssb; ssb.enter_contour(L.begin(), L.end()); - boost::shared_ptr ss = ssb.construct_skeleton(); + std::shared_ptr ss = ssb.construct_skeleton(); assert(is_valid(ss)); Polygon_ptr_container offset_polys = @@ -320,7 +320,7 @@ void test_offset_polygon_with_hole() typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - typedef boost::shared_ptr Polygon_with_holes_2_ptr; + typedef std::shared_ptr Polygon_with_holes_2_ptr; typedef std::vector Polygon_with_holes_2_ptr_container; // Square with a non-centered square hole @@ -409,7 +409,7 @@ void test_offset_pinched() typedef typename K::FT FT; typedef typename K::Point_2 Point; typedef CGAL::Polygon_2 Polygon_2; - typedef boost::shared_ptr Polygon_ptr; + typedef std::shared_ptr Polygon_ptr; typedef std::vector Polygon_ptrs; typedef CGAL::Straight_skeleton_2 Ss; @@ -447,7 +447,7 @@ void test_offset_pinched() Skeleton_builder ssb; ssb.enter_contour(input.begin(), input.end()); - boost::shared_ptr ss = ssb.construct_skeleton(); + std::shared_ptr ss = ssb.construct_skeleton(); assert(is_valid(ss)); // The two splitting fronts meet in the middle, and at that time, @@ -490,7 +490,7 @@ void test_offset_multiple_CCs() typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef CGAL::Polygon_2 Contour; - typedef boost::shared_ptr ContourPtr; + typedef std::shared_ptr ContourPtr; typedef std::vector Contour_sequence; typedef CGAL::Straight_skeleton_2 Ss; @@ -542,7 +542,7 @@ void test_offset_multiple_CCs() ssb.enter_contour(frame, frame+4); ssb.enter_contour(input.rbegin(), input.rend()); - boost::shared_ptr ss = ssb.construct_skeleton(); + std::shared_ptr ss = ssb.construct_skeleton(); assert(is_valid(ss)); Contour_sequence offset_contours; @@ -564,7 +564,7 @@ void test_offset_non_manifold() typedef typename K::Point_2 Point; typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - typedef boost::shared_ptr Polygon_with_holes_ptr; + typedef std::shared_ptr Polygon_with_holes_ptr; typedef std::vector Polygon_with_holes_ptrs; typedef CGAL::Straight_skeleton_2 Ss; @@ -588,7 +588,7 @@ void test_offset_non_manifold() ssb.enter_contour(outer.begin(), outer.end()); ssb.enter_contour(hole.begin(), hole.end()); - boost::shared_ptr ss = ssb.construct_skeleton(); + std::shared_ptr ss = ssb.construct_skeleton(); assert(is_valid(ss)); // The two splitting fronts meet in the middle, and at that time, @@ -647,7 +647,7 @@ void test_offset_non_manifold_2() typedef typename K::Point_2 Point; typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - typedef boost::shared_ptr Polygon_with_holes_ptr; + typedef std::shared_ptr Polygon_with_holes_ptr; typedef std::vector Polygon_with_holes_ptrs; typedef CGAL::Straight_skeleton_2 Ss; @@ -679,7 +679,7 @@ void test_offset_non_manifold_2() ssb.enter_contour(outer.begin(), outer.end()); ssb.enter_contour(hole.begin(), hole.end()); - boost::shared_ptr ss = ssb.construct_skeleton(); + std::shared_ptr ss = ssb.construct_skeleton(); assert(is_valid(ss)); // Similar to the previous function, a split event happens and at that particular time, @@ -733,7 +733,7 @@ void test_offset_polygon_exterior() typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - typedef boost::shared_ptr Polygon_with_holes_2_ptr; + typedef std::shared_ptr Polygon_with_holes_2_ptr; typedef std::vector Polygon_with_holes_2_ptr_container; Polygon_2 poly; @@ -815,7 +815,7 @@ void test_offset_polygon_with_holes_exterior() typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - typedef boost::shared_ptr Polygon_with_holes_2_ptr; + typedef std::shared_ptr Polygon_with_holes_2_ptr; typedef std::vector Polygon_with_holes_2_ptr_container; Polygon_2 outer ; @@ -855,7 +855,7 @@ void test_offset(const char* filename) typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; - typedef boost::shared_ptr Polygon_with_holes_2_ptr; + typedef std::shared_ptr Polygon_with_holes_2_ptr; typedef std::vector Polygon_with_holes_2_ptr_container; typedef CGAL::Straight_skeleton_2 Ss; @@ -920,7 +920,7 @@ void test_offset(const char* filename) ssb.enter_contour(polys[i+1].begin(), polys[i+1].end()); } - boost::shared_ptr ss = ssb.construct_skeleton(); + std::shared_ptr ss = ssb.construct_skeleton(); assert(is_valid(ss)); std::set offset_times; diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp index 4bddf279d39..e134a2746a7 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp @@ -34,7 +34,7 @@ void Straight_skeleton_traits_external_trace(std::string m) #include #include -#include +#include #include #include @@ -53,10 +53,10 @@ void test_API() typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; typedef CGAL::Straight_skeleton_2 Straight_skeleton_EPICK; - typedef boost::shared_ptr Straight_skeleton_Ptr_EPICK; + typedef std::shared_ptr Straight_skeleton_Ptr_EPICK; typedef CGAL::Straight_skeleton_2 Straight_skeleton; - typedef boost::shared_ptr Straight_skeleton_Ptr; + typedef std::shared_ptr Straight_skeleton_Ptr; Polygon_2 p; Straight_skeleton_Ptr_EPICK ss0 = CGAL::create_interior_straight_skeleton_2(p); @@ -72,7 +72,7 @@ void test_API() } template -bool is_valid(const boost::shared_ptr& ss) +bool is_valid(const std::shared_ptr& ss) { typedef typename StraightSkeleton::Traits::Point_2 Point; typedef CGAL::Polygon_2 Polygon_2; @@ -136,7 +136,7 @@ void test_skeleton(const char* filename, typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; typedef CGAL::Straight_skeleton_2 Straight_skeleton; - typedef boost::shared_ptr Straight_skeleton_Ptr; + typedef std::shared_ptr Straight_skeleton_Ptr; std::ifstream in(filename); assert(in); diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_straight_skeleton_copy.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_straight_skeleton_copy.cpp index acbe7d848b2..b263a98658d 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_straight_skeleton_copy.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_straight_skeleton_copy.cpp @@ -1,7 +1,5 @@ #include -#include - #include #include #include @@ -12,8 +10,8 @@ typedef K::Point_2 Point ; typedef CGAL::Polygon_2 Polygon_2 ; typedef CGAL::Straight_skeleton_2 Ss ; -typedef boost::shared_ptr PolygonPtr ; -typedef boost::shared_ptr SsPtr ; +typedef std::shared_ptr PolygonPtr ; +typedef std::shared_ptr SsPtr ; typedef std::vector PolygonPtrVector ; diff --git a/Stream_support/include/CGAL/Stream_support/internal/Geometry_container.h b/Stream_support/include/CGAL/Stream_support/internal/Geometry_container.h index e5be891d9b2..e3e26fe8b61 100644 --- a/Stream_support/include/CGAL/Stream_support/internal/Geometry_container.h +++ b/Stream_support/include/CGAL/Stream_support/internal/Geometry_container.h @@ -16,7 +16,7 @@ #define GEOMETRY_CONTAINER_H #include #include -#include +#include struct Dummy_deleter{ template @@ -45,7 +45,7 @@ struct Geometry_container{ typedef typename Range::const_reverse_iterator const_reverse_iterator; typedef typename Range::size_type size_type; typedef typename Range::value_type value_type; - boost::shared_ptr range; + std::shared_ptr range; bool must_delete; // // Default constructor. From 604dcdc4357ad1c24466a5167da0ceb90fa6615a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 28 Apr 2023 20:45:26 +0200 Subject: [PATCH 055/156] boost::optional => std::optional --- .../doc/AABB_tree/Concepts/AABBGeomTraits.h | 2 +- .../Concepts/AABBRayIntersectionTraits.h | 6 +- AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h | 4 +- ..._polyhedron_facet_intersection_example.cpp | 4 +- .../AABB_tree/AABB_ray_shooting_example.cpp | 2 +- AABB_tree/include/CGAL/AABB_traits.h | 18 ++--- AABB_tree/include/CGAL/AABB_tree.h | 18 ++--- .../internal/AABB_ray_intersection.h | 22 +++--- .../internal/AABB_traversal_traits.h | 12 +-- AABB_tree/test/AABB_tree/AABB_test_util.h | 22 +++--- .../test/AABB_tree/aabb_any_all_benchmark.cpp | 2 +- .../aabb_correctness_triangle_test.cpp | 2 +- .../AABB_tree/aabb_test_ray_intersection.cpp | 10 +-- .../Algebraic_curve_kernel_2.h | 8 +- .../Algebraic_kernel_d/Algebraic_real_d_1.h | 2 +- ...ebraic_real_quadratic_refinement_rep_bfi.h | 24 +++--- .../Algebraic_kernel_d/Algebraic_real_rep.h | 4 +- .../Bitstream_descartes_E08_tree.h | 2 +- .../Algebraic_kernel_d/Curve_analysis_2.h | 28 +++---- .../Curve_pair_analysis_2.h | 34 ++++---- .../Algebraic_kernel_d/Status_line_CA_1.h | 6 +- .../Algebraic_kernel_d/Status_line_CPA_1.h | 2 +- .../CGAL/Algebraic_kernel_d/Xy_coordinate_2.h | 4 +- .../Alpha_shapes_2/internal/Lazy_alpha_nt_2.h | 4 +- .../Alpha_shapes_3/internal/Lazy_alpha_nt_3.h | 6 +- .../AlgebraicCurveParser.cpp | 2 +- .../AlgebraicCurveParser.h | 4 +- .../EnvelopeCallback.cpp | 2 +- .../GraphicsViewCurveInput.cpp | 36 ++++----- .../GraphicsViewCurveInputTyped.h | 50 ++++++------ .../Arrangement_on_surface_2/PointSnapper.cpp | 16 ++-- .../Arrangement_on_surface_2/PointSnapper.h | 2 +- .../Arrangement_on_surface_2/Utils/Utils.cpp | 16 ++-- .../Arrangement_on_surface_2/Utils/Utils.h | 16 ++-- .../unb_planar_vertical_decomposition.cpp | 2 +- .../CGAL/Arr_algebraic_segment_traits_2.h | 24 +++--- .../include/CGAL/Arr_batched_point_location.h | 2 +- .../Arr_bounded_planar_topology_traits_2.h | 4 +- .../include/CGAL/Arr_overlay_2.h | 10 +-- .../Arr_lm_nearest_neighbor.h | 2 +- .../CGAL/Arr_point_location/Td_active_edge.h | 6 +- .../Arr_point_location/Td_active_trapezoid.h | 18 ++--- .../Trapezoidal_decomposition_2.h | 38 ++++----- .../Trapezoidal_decomposition_2_impl.h | 10 +-- .../include/CGAL/Arr_point_location_result.h | 10 +-- .../include/CGAL/Arr_simple_point_location.h | 8 +- .../CGAL/Arr_spherical_topology_traits_2.h | 2 +- .../Arr_bounded_planar_vert_decomp_helper.h | 2 +- .../Arr_spherical_topology_traits_2_impl.h | 10 +-- .../Arr_spherical_vert_decomp_helper.h | 2 +- .../Arr_unb_planar_topology_traits_2_impl.h | 6 +- .../Arr_unb_planar_vert_decomp_helper.h | 2 +- .../CGAL/Arr_unb_planar_topology_traits_2.h | 2 +- .../include/CGAL/Arrangement_zone_2.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/Arc_2.h | 16 ++-- .../Curve_renderer_facade.h | 4 +- .../Fig_stream_Curve_renderer_2.h | 2 +- .../Generic_arc_2.h | 4 +- .../Generic_point_2.h | 4 +- .../Curved_kernel_via_analysis_2/Point_2.h | 12 +-- .../Sweep_curves_adapter_2.h | 2 +- .../gfx/Curve_renderer_2.h | 4 +- .../Surface_sweep_2/Arr_overlay_ss_visitor.h | 6 +- .../Surface_sweep_2/Arr_overlay_traits_2.h | 34 ++++---- .../Arr_vert_decomp_ss_visitor.h | 2 +- .../Vertical_decomposition_test.h | 2 +- BGL/include/CGAL/boost/graph/helpers.h | 4 +- .../Concepts/BarycentricCoordinates_2.h | 6 +- .../Discrete_harmonic_2.h | 32 ++++---- .../Generalized_barycentric_coordinates_2.h | 78 +++++++++---------- .../Barycentric_coordinates_2/Mean_value_2.h | 32 ++++---- .../Barycentric_coordinates_2/Wachspress_2.h | 32 ++++---- .../internal/utils_2.h | 14 ++-- .../segment_coordinates_2.h | 8 +- .../triangle_coordinates_2.h | 8 +- .../test_dh_deprecated_api.cpp | 2 +- .../test_mv_deprecated_api.cpp | 2 +- .../test_sc_deprecated_api.cpp | 2 +- .../test_tc_deprecated_api.cpp | 2 +- .../test_wp_deprecated_api.cpp | 2 +- .../include/CGAL/Cartesian_converter.h | 6 +- .../Safe_circulator_from_iterator.h | 8 +- .../dual/halfspace_intersection_3.h | 2 +- ...fspace_intersection_with_constructions_3.h | 2 +- .../Convex_hull_3/lloyd_algorithm.cpp | 2 +- .../dual/halfspace_intersection_3.h | 10 +-- .../halfspace_intersection_interior_point_3.h | 8 +- ...fspace_intersection_with_constructions_3.h | 8 +- .../test_halfspace_intersections.cpp | 6 +- .../Envelope_2/Env_divide_and_conquer_2.h | 2 +- .../Env_divide_and_conquer_2_impl.h | 6 +- .../CGAL/Filtered_predicate_with_state.h | 4 +- Filtered_kernel/include/CGAL/Lazy.h | 42 +++++----- Filtered_kernel/include/CGAL/Lazy_kernel.h | 4 +- Installation/CHANGES.md | 1 + .../Intersections_2/variant_any_object.cpp | 8 +- .../include/CGAL/Intersection_traits.h | 6 +- .../include/CGAL/Intersection_traits_2.h | 18 ++--- .../CGAL/Intersections_2/Bbox_2_Bbox_2.h | 4 +- .../include/CGAL/Intersection_traits_3.h | 72 ++++++++--------- .../CGAL/Intersections_3/Bbox_3_Bbox_3.h | 6 +- .../CGAL/Intersections_3/Line_3_Plane_3.h | 6 +- .../Intersections_3/Plane_3_Plane_3_Plane_3.h | 2 +- .../internal/Bbox_3_Segment_3_intersection.h | 6 +- .../Iso_cuboid_3_Plane_3_intersection.h | 2 +- .../internal/Line_3_Plane_3_intersection.h | 6 +- .../Plane_3_Plane_3_Plane_3_intersection.h | 12 +-- .../Plane_3_Tetrahedron_3_intersection.h | 2 +- .../internal/Ray_3_Triangle_3_intersection.h | 12 +-- .../Tetrahedron_3_Triangle_3_intersection.h | 2 +- .../test_intersections_Tetrahedron_3.cpp | 2 +- .../Kernel_23/CGAL/Projection_traits_xy_3.h | 2 +- Kernel_23/doc/Kernel_23/CGAL/intersections.h | 12 +-- Kernel_23/doc/Kernel_23/Kernel_23.txt | 2 +- Kernel_23/include/CGAL/Kernel/Type_mapper.h | 6 +- .../include/CGAL/Kernel/function_objects.h | 10 +-- .../Kernel_23/internal/Projection_traits_3.h | 8 +- .../internal/Projection_traits_base_3.h | 38 ++++----- .../CGAL/_test_all_linear_intersections.h | 4 +- Kernel_d/doc/Kernel_d/CGAL/intersections_d.h | 4 +- Kernel_d/doc/Kernel_d/Kernel_d.txt | 2 +- .../include/CGAL/Kernel_d/function_objects.h | 18 ++--- Mesh_3/benchmark/Mesh_3/StdAfx.h | 2 +- .../Concepts/IntersectionGeometricTraits_3.h | 4 +- .../doc/Mesh_3/Concepts/MeshCellCriteria_3.h | 2 +- Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h | 8 +- .../doc/Mesh_3/Concepts/MeshFacetCriteria_3.h | 2 +- .../Concepts/MeshTriangulationTraits_3.h | 6 +- .../Mesh_3/mesh_hybrid_mesh_domain.cpp | 4 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 6 +- Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h | 34 ++++---- .../CGAL/Mesh_3/Protect_edges_sizing_field.h | 4 +- Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h | 2 +- Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h | 6 +- Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h | 12 +-- .../Sizing_field_with_aabb_tree.h | 8 +- ...tialize_triangulation_from_labeled_image.h | 4 +- .../CGAL/Mesh_3/mesh_standard_criteria.h | 6 +- .../CGAL/Mesh_3/polylines_to_protect.h | 16 ++-- .../include/CGAL/Mesh_3/vertex_perturbation.h | 2 +- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 12 +-- .../include/CGAL/Polyhedral_mesh_domain_3.h | 12 +-- .../AABB_traversal_traits_with_join.h | 12 +-- .../Minkowski_sum_2/AABB_tree_with_join.h | 10 +-- Nef_2/include/CGAL/Nef_2/HDS_items.h | 10 +-- ...xact_triangulation_euclidean_traits_xy_3.h | 16 ++-- ...xact_triangulation_euclidean_traits_xz_3.h | 16 ++-- ...xact_triangulation_euclidean_traits_yz_3.h | 16 ++-- Nef_3/include/CGAL/Nef_3/SNC_structure.h | 34 ++++---- Nef_S2/include/CGAL/Nef_S2/Sphere_map.h | 16 ++-- .../CGAL/Sqrt_extension/Sqrt_extension_type.h | 4 +- .../OTR_2/Reconstruction_triangulation_2.h | 34 ++++---- .../Protect_edges_sizing_field.h | 4 +- .../voronoi_covariance_3.h | 2 +- .../include/CGAL/structure_point_set.h | 4 +- ...refinement_mesh_union_and_intersection.cpp | 2 +- .../Polygon_mesh_processing/corefinement.h | 52 ++++++------- .../Corefinement/Face_graph_output_builder.h | 16 ++-- .../internal/Corefinement/face_graph_utils.h | 12 +-- .../Corefinement/intersection_nodes.h | 4 +- .../Hole_filling/Triangulate_hole_polyline.h | 10 +-- .../Isotropic_remeshing/remesh_impl.h | 6 +- .../Axis_parallel_plane_traits.h | 4 +- .../Point_inside_vertical_ray_cast.h | 12 +-- .../internal/Smoothing/curvature_flow_impl.h | 8 +- .../CGAL/Polygon_mesh_processing/locate.h | 2 +- .../repair_degeneracies.h | 18 ++--- .../include/CGAL/Polygon_mesh_slicer.h | 4 +- .../include/CGAL/Polyhedral_envelope.h | 16 ++-- .../include/CGAL/Side_of_triangle_mesh.h | 6 +- .../Polyhedral_envelope_filter.h | 14 ++-- .../test_corefinement_and_constraints.cpp | 6 +- .../test_corefinement_bool_op.cpp | 2 +- .../test_pmp_locate.cpp | 6 +- Polyhedron/demo/Polyhedron/MainWindow.cpp | 4 +- .../Plugins/Mesh_3/Io_image_plugin.cpp | 10 +-- .../Plugins/Mesh_3/Mesh_3_plugin.cpp | 10 +-- .../PMP/Point_inside_polyhedron_plugin.cpp | 8 +- .../Plugins/PMP/Selection_plugin.cpp | 4 +- .../Edit_polyhedron_plugin.cpp | 4 +- .../Scene_edit_polyhedron_item.cpp | 4 +- .../Scene_edit_polyhedron_item.h | 4 +- .../Scene_polyhedron_selection_item.h | 14 ++-- .../Polyhedron/Travel_isolated_components.h | 2 +- .../PolylineSimplificationCostFunction.h | 4 +- .../Hybrid_squared_distance_cost.h | 2 +- .../Scaled_squared_distance_cost.h | 6 +- .../Squared_distance_cost.h | 2 +- .../CGAL/Polyline_simplification_2/simplify.h | 6 +- STL_Extension/doc/STL_Extension/CGAL/Object.h | 4 +- .../doc/STL_Extension/CGAL/iterator.h | 6 +- .../Dispatch_output_iterator.cpp | 2 +- .../include/CGAL/Modifiable_priority_queue.h | 14 ++-- STL_Extension/include/CGAL/Object.h | 4 +- .../internal/boost/relaxed_heap.hpp | 14 ++-- STL_Extension/include/CGAL/iterator.h | 4 +- .../test/STL_Extension/test_Object.cpp | 6 +- .../STL_Extension/test_dispatch_output.cpp | 4 +- .../doc/Spatial_searching/CGAL/Kd_tree.h | 2 +- .../doc/Spatial_searching/CGAL/Kd_tree_node.h | 2 +- .../searching_with_circular_query.cpp | 2 +- Spatial_searching/include/CGAL/Kd_tree.h | 6 +- Spatial_searching/include/CGAL/Kd_tree_node.h | 18 ++--- .../include/CGAL/Point_container.h | 6 +- ...te_exterior_skeleton_tweaking_skeleton.cpp | 4 +- .../CGAL/Straight_skeleton_builder_2.h | 2 +- .../CGAL/compute_outer_frame_margin.h | 2 +- .../Concepts/PolygonOffsetBuilderTraits_2.h | 2 +- .../StraightSkeletonBuilderTraits_2.h | 4 +- .../Straight_skeleton_2/Low_level_API.cpp | 2 +- ...offset_of_multiple_polygons_with_holes.cpp | 2 +- .../include/CGAL/Polygon_offset_builder_2.h | 6 +- .../CGAL/Polygon_offset_builder_traits_2.h | 6 +- .../Polygon_offset_builder_2_impl.h | 2 +- .../Straight_skeleton_aux.h | 2 +- .../Straight_skeleton_builder_2_impl.h | 2 +- .../Straight_skeleton_builder_traits_2_aux.h | 38 ++++----- .../include/CGAL/Straight_skeleton_2/debug.h | 4 +- .../CGAL/Straight_skeleton_builder_2.h | 6 +- .../CGAL/Straight_skeleton_builder_traits_2.h | 34 ++++---- .../include/CGAL/compute_outer_frame_margin.h | 12 +-- .../constructions/Polygon_offset_cons_ftC2.h | 8 +- .../Straight_skeleton_cons_ftC2.h | 42 +++++----- .../include/CGAL/create_offset_polygons_2.h | 6 +- .../include/CGAL/create_straight_skeleton_2.h | 4 +- .../predicates/Polygon_offset_pred_ftC2.h | 8 +- .../predicates/Straight_skeleton_pred_ftC2.h | 14 ++-- .../include/CGAL/test_sls_traits_aux.cpp | 2 +- .../test/Straight_skeleton_2/test_sls.cpp | 10 +-- .../Straight_skeleton_2/test_sls_offset.cpp | 2 +- .../examples/Surface_mesh/sm_aabbtree.cpp | 4 +- .../CGAL/Variational_shape_approximation.h | 12 +-- .../vsa_correctness_test.cpp | 4 +- .../vsa_teleportation_test.cpp | 2 +- .../Surface_mesh_deformation_test_commons.h | 2 +- .../internal/AABB_traversal_traits.h | 2 +- .../internal/Filters.h | 6 +- .../internal/SDF_calculation.h | 22 +++--- .../Concepts/SurfaceMeshShortestPathTraits.h | 2 +- .../Surface_mesh_shortest_path.h | 2 +- .../Bounded_distance_placement.h | 2 +- .../Bounded_normal_change_filter.h | 4 +- .../Bounded_normal_change_placement.h | 2 +- .../Edge_collapse/Constrained_placement.h | 2 +- .../Policies/Edge_collapse/Edge_length_cost.h | 4 +- .../Edge_collapse/LindstromTurk_cost.h | 4 +- .../Edge_collapse/LindstromTurk_placement.h | 2 +- .../Edge_collapse/Midpoint_placement.h | 2 +- .../Polyhedral_envelope_filter.h | 4 +- .../EdgeCollapseSimplificationVisitor.h | 6 +- .../Concepts/GetCost.h | 6 +- .../Concepts/GetPlacement.h | 4 +- .../Concepts/PlacementFilter.h | 6 +- .../Surface_mesh_simplification.txt | 2 +- .../edge_collapse_bounded_normal_change.cpp | 6 +- .../edge_collapse_visitor_surface_mesh.cpp | 6 +- .../include/CGAL/Cartesian/MatrixC33.h | 6 +- .../Edge_collapse_visitor_base.h | 6 +- .../Bounded_distance_placement.h | 14 ++-- .../Bounded_normal_change_filter.h | 8 +- .../Bounded_normal_change_placement.h | 8 +- .../Edge_collapse/Constrained_placement.h | 2 +- .../Policies/Edge_collapse/Edge_length_cost.h | 4 +- .../Edge_collapse/FastEnvelope_filter.h | 10 +-- .../Edge_collapse/LindstromTurk_cost.h | 4 +- .../Edge_collapse/LindstromTurk_placement.h | 2 +- .../Edge_collapse/Midpoint_placement.h | 4 +- .../internal/GarlandHeckbert_policy_base.h | 14 ++-- .../internal/Lindstrom_Turk_core.h | 10 +-- .../internal/Common.h | 8 +- .../internal/Edge_collapse.h | 14 ++-- .../test_edge_collapse_Envelope.cpp | 6 +- .../test_edge_collapse_Polyhedron_3.cpp | 12 +-- .../include/CGAL/AABB_polyhedral_oracle.h | 6 +- .../internal/flip_edges.h | 20 ++--- .../internal/smooth_vertices.h | 16 ++-- .../tetrahedral_adaptive_remeshing_impl.h | 10 +-- Three/include/CGAL/Three/exceptions.h | 4 +- .../include/CGAL/Delaunay_triangulation.h | 4 +- .../include/CGAL/Regular_triangulation.h | 4 +- Triangulation/include/CGAL/Triangulation.h | 8 +- .../ConstrainedTriangulationTraits_2.h | 2 +- 282 files changed, 1257 insertions(+), 1256 deletions(-) diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h index 2f1fdc3e5c6..e6d51ffdb75 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h @@ -47,7 +47,7 @@ Provides the operator: `return_type operator()(const Query& q, const Primitive::Datum& d)`, which computes the intersection between `q` and `d`. The type of the returned object -must be a `boost::optional` of a `boost::variant` of the possible intersection types. +must be a `std::optional` of a `boost::variant` of the possible intersection types. */ typedef unspecified_type Intersect_3; diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h index 215cbd65924..3b186c9ff22 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h @@ -25,15 +25,15 @@ public: /*! A functor object to compute the distance between the source of a ray and its closest intersection point between the ray and a primitive or a bounding box. - An empty `boost::optional` is returned, if there is no intersection. + An empty `std::optional` is returned, if there is no intersection. When there is an intersection, an object of type `FT` is returned such that if `i1` and `i2` are two intersection points, then `i1` is closer to the source of the ray than `i2` iff `n1 < n2`, `n1` and `n2` being the numbers returned for `i1` and `i2` respectively. Provides the operators: - `boost::optional operator()(const Ray_3& r, const Bounding_box& bbox)`. - `boost::optional::%Type > > + `std::optional operator()(const Ray_3& r, const Bounding_box& bbox)`. + `std::optional::%Type > > operator()(const Ray_3& r, const Primitive& primitive)`. A common algorithm to compute the intersection between a bounding box and a ray is ::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive. +`std::optional::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive. \cgalHeading{Note on Backward Compatibility} -Before the release 4.3 of \cgal, the return type of this function used to be `boost::optional`. +Before the release 4.3 of \cgal, the return type of this function used to be `std::optional`. */ typedef unspecified_type Intersection; diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp index 4a4a1e61306..e01e49c0b6e 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp @@ -19,8 +19,8 @@ typedef CGAL::Polyhedron_3 Polyhedron; typedef CGAL::AABB_face_graph_triangle_primitive Primitive; typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; -typedef boost::optional< Tree::Intersection_and_primitive_id::Type > Segment_intersection; -typedef boost::optional< Tree::Intersection_and_primitive_id::Type > Plane_intersection; +typedef std::optional< Tree::Intersection_and_primitive_id::Type > Segment_intersection; +typedef std::optional< Tree::Intersection_and_primitive_id::Type > Plane_intersection; typedef Tree::Primitive_id Primitive_id; int main() diff --git a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp index d3b2af45913..fc450abd5a8 100644 --- a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp @@ -23,7 +23,7 @@ typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef CGAL::AABB_face_graph_triangle_primitive Primitive; typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; -typedef boost::optional::Type> Ray_intersection; +typedef std::optional::Type> Ray_intersection; struct Skip { diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index b2eb87dc8f6..f5c1c1240a1 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -27,7 +27,7 @@ #include -#include +#include /// \file AABB_traits.h @@ -39,7 +39,7 @@ template struct Remove_optional { typedef T type; }; template -struct Remove_optional< ::boost::optional > { typedef T type; }; +struct Remove_optional< ::std::optional > { typedef T type; }; //helper controlling whether extra data should be stored in the AABB_tree traits class template ::value> @@ -85,7 +85,7 @@ struct AABB_traits_base_2{ typedef typename CGAL::Bbox_3 Bounding_box; struct Intersection_distance { - boost::optional operator()(const Ray_3& ray, const Bounding_box& bbox) const { + std::optional operator()(const Ray_3& ray, const Bounding_box& bbox) const { FT t_near = -DBL_MAX; // std::numeric_limits::lowest(); C++1903 FT t_far = DBL_MAX; @@ -101,7 +101,7 @@ struct AABB_traits_base_2{ for(int i = 0; i < 3; ++i, ++source_iter, ++direction_iter) { if(*direction_iter == 0) { if((*source_iter < (bbox.min)(i)) || (*source_iter > (bbox.max)(i))) { - return boost::none; + return std::nullopt; } } else { FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter; @@ -118,7 +118,7 @@ struct AABB_traits_base_2{ // t_far = t2; if(t_near > t_far || t_far < FT(0.)) - return boost::none; + return std::nullopt; } } @@ -193,7 +193,7 @@ public: /// `Intersection_and_primitive_id::%Type::first_type` is found according to /// the result type of `GeomTraits::Intersect_3::operator()`. If it is - /// `boost::optional` then it is `T`, and the result type otherwise. + /// `std::optional` then it is `T`, and the result type otherwise. template struct Intersection_and_primitive_id { typedef decltype( @@ -364,12 +364,12 @@ public: Intersection(const AABB_traits& traits) :m_traits(traits) {} template - boost::optional< typename Intersection_and_primitive_id::Type > + std::optional< typename Intersection_and_primitive_id::Type > operator()(const Query& query, const typename AT::Primitive& primitive) const { auto inter_res = GeomTraits().intersect_3_object()(query, internal::Primitive_helper::get_datum(primitive,m_traits)); if (!inter_res) - return boost::none; - return boost::make_optional( std::make_pair(*inter_res, primitive.id()) ); + return std::nullopt; + return std::make_optional( std::make_pair(*inter_res, primitive.id()) ); } }; diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 0016d4ecc09..4645264460e 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #ifdef CGAL_HAS_THREADS @@ -271,7 +271,7 @@ public: /// \tparam Query must be a type for which `Do_intersect` operators are /// defined in the traits class `AABBTraits`. template - boost::optional any_intersected_primitive(const Query& query) const; + std::optional any_intersected_primitive(const Query& query) const; ///@} /// \name Intersections @@ -294,7 +294,7 @@ public: /// \tparam Query must be a type for which `Do_intersect` and `Intersection` operators are /// defined in the traits class `AABBTraits`. template - boost::optional< typename Intersection_and_primitive_id::Type > + std::optional< typename Intersection_and_primitive_id::Type > any_intersection(const Query& query) const; @@ -318,12 +318,12 @@ public: /// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to /// call this member function. template - boost::optional< typename Intersection_and_primitive_id::Type > + std::optional< typename Intersection_and_primitive_id::Type > first_intersection(const Ray& query, const SkipFunctor& skip) const; /// \cond template - boost::optional< typename Intersection_and_primitive_id::Type > + std::optional< typename Intersection_and_primitive_id::Type > first_intersection(const Ray& query) const { return first_intersection(query, boost::lambda::constant(false)); @@ -343,12 +343,12 @@ public: /// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to /// call this member function. template - boost::optional + std::optional first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const; /// \cond template - boost::optional + std::optional first_intersected_primitive(const Ray& query) const { return first_intersected_primitive(query, boost::lambda::constant(false)); @@ -964,7 +964,7 @@ public: template template - boost::optional< typename AABB_tree::template Intersection_and_primitive_id::Type > + std::optional< typename AABB_tree::template Intersection_and_primitive_id::Type > AABB_tree::any_intersection(const Query& query) const { using namespace CGAL::internal::AABB_tree; @@ -976,7 +976,7 @@ public: template template - boost::optional::Primitive_id> + std::optional::Primitive_id> AABB_tree::any_intersected_primitive(const Query& query) const { using namespace CGAL::internal::AABB_tree; diff --git a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h index ff091ce6c24..1bc03ff4cf4 100644 --- a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include # if defined(BOOST_MSVC) # pragma warning(push) @@ -43,7 +43,7 @@ class AABB_ray_intersection { public: AABB_ray_intersection(const AABBTree& tree) : tree_(tree) {} - boost::optional< Ray_intersection_and_primitive_id > + std::optional< Ray_intersection_and_primitive_id > ray_intersection(const Ray& query, SkipFunctor skip) const { // We hit the root, now continue on the children. Keep track of // nb_primitives through a variable in each Node on the stack. In @@ -63,7 +63,7 @@ public: Heap_type pq; // pq.reserve(tree_.size() / 2); - boost::optional< Ray_intersection_and_primitive_id > + std::optional< Ray_intersection_and_primitive_id > intersection, /* the temporary for calculating the result */ p; /* the current best intersection */ @@ -121,7 +121,7 @@ public: // right child const Node* child = &(current.node->right_child()); - boost::optional< FT > dist = intersection_distance_obj(query, child->bbox()); + std::optional< FT > dist = intersection_distance_obj(query, child->bbox()); if(dist) pq.push(Node_ptr_with_ft(child, *dist, 2)); @@ -130,7 +130,7 @@ public: default: // Children both inner nodes { const Node* child = &(current.node->left_child()); - boost::optional dist = intersection_distance_obj(query, child->bbox()); + std::optional dist = intersection_distance_obj(query, child->bbox()); if(dist) pq.push(Node_ptr_with_ft(child, *dist, current.nb_primitives/2)); @@ -198,7 +198,7 @@ private: template template -boost::optional< typename AABB_tree::template Intersection_and_primitive_id::Type > +std::optional< typename AABB_tree::template Intersection_and_primitive_id::Type > AABB_tree::first_intersection(const Ray& query, const SkipFunctor& skip) const { static_assert((std::is_same::value), @@ -219,22 +219,22 @@ AABB_tree::first_intersection(const Ray& query, break; } } - return boost::none; + return std::nullopt; } template template -boost::optional::Primitive_id> +std::optional::Primitive_id> AABB_tree::first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const { - boost::optional< + std::optional< typename AABB_tree:: template Intersection_and_primitive_id::Type > res = first_intersection(query, skip); if ( (bool) res ) - return boost::make_optional( res->second ); - return boost::none; + return std::make_optional( res->second ); + return std::nullopt; } } diff --git a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h index fe7e85effdd..645ce1347cb 100644 --- a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h +++ b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h @@ -17,7 +17,7 @@ #include -#include +#include namespace CGAL { @@ -69,7 +69,7 @@ class First_intersection_traits public: typedef - boost::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > + std::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > Result; public: First_intersection_traits(const AABBTraits& traits) @@ -124,7 +124,7 @@ public: void intersection(const Query& query, const Primitive& primitive) { - boost::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > + std::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > intersection = m_traits.intersection_object()(query, primitive); if(intersection) @@ -211,7 +211,7 @@ public: { if( m_traits.do_intersect_object()(query, primitive) ) { - m_result = boost::optional(primitive.id()); + m_result = std::optional(primitive.id()); m_is_found = true; } } @@ -221,12 +221,12 @@ public: return m_traits.do_intersect_object()(query, node.bbox()); } - boost::optional result() const { return m_result; } + std::optional result() const { return m_result; } bool is_intersection_found() const { return m_is_found; } private: bool m_is_found; - boost::optional m_result; + std::optional m_result; const AABBTraits& m_traits; }; diff --git a/AABB_tree/test/AABB_tree/AABB_test_util.h b/AABB_tree/test/AABB_tree/AABB_test_util.h index 5b73a20f9f2..61ddd98f3bd 100644 --- a/AABB_tree/test/AABB_tree/AABB_test_util.h +++ b/AABB_tree/test/AABB_tree/AABB_test_util.h @@ -95,20 +95,20 @@ void test_all_intersection_query_types(Tree& tree) tree.all_intersected_primitives(segment,std::back_inserter(primitives)); // any_intersection - boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > r = tree.any_intersection(ray); - boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > l = tree.any_intersection(line); - boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > s = tree.any_intersection(segment); + std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > r = tree.any_intersection(ray); + std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > l = tree.any_intersection(line); + std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > s = tree.any_intersection(segment); // any_intersected_primitive - boost::optional optional_primitive; + std::optional optional_primitive; optional_primitive = tree.any_intersected_primitive(ray); optional_primitive = tree.any_intersected_primitive(line); optional_primitive = tree.any_intersected_primitive(segment); // all_intersections - std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_r; - std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_l; - std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_s; + std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_r; + std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_l; + std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_s; tree.all_intersections(ray,std::back_inserter(intersections_r)); tree.all_intersections(line,std::back_inserter(intersections_l)); tree.all_intersections(segment,std::back_inserter(intersections_s)); @@ -322,7 +322,7 @@ class Naive_implementations typedef typename Traits::Point_3 Point; typedef typename Traits::Point_and_primitive_id Point_and_primitive_id; - typedef boost::optional Intersection_result; + typedef std::optional Intersection_result; const Traits& m_traits; public: @@ -380,7 +380,7 @@ public: Polyhedron_primitive_iterator it = Pr_generator().begin(p); for ( ; it != Pr_generator().end(p) ; ++it ) { - boost::optional< typename Traits::template Intersection_and_primitive_id::Type > + std::optional< typename Traits::template Intersection_and_primitive_id::Type > intersection = m_traits.intersection_object()(query, Pr(it,p)); if ( intersection ) *out++ = *intersection; @@ -653,7 +653,7 @@ private: } // any_intersected_primitive test (do not count time here) - typedef boost::optional Any_primitive; + typedef std::optional Any_primitive; Any_primitive primitive = tree.any_intersected_primitive(query); // Check: verify we do get the result by naive method @@ -723,7 +723,7 @@ private: } // Any intersection test (do not count time here) - boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > + std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > intersection = tree.any_intersection(query); // Check: verify we do get the result by naive method diff --git a/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp b/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp index 5e09d6c2291..eb6fef9082a 100644 --- a/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp +++ b/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp @@ -46,7 +46,7 @@ std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, lo v.reserve(elements); for(; b != e; ++b) { tree.all_intersections(*b, std::back_inserter(v)); - boost::optional o = tree.any_intersection(*b); + std::optional o = tree.any_intersection(*b); if(o) ++counter; } diff --git a/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp index 13eb303b771..54ef4c600f6 100644 --- a/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp @@ -65,7 +65,7 @@ int test() return EXIT_FAILURE; } - boost::optional any; + std::optional any; any = tree.any_intersection(pq); if(!any) { diff --git a/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp b/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp index 4e86ed22d7f..cbe92baaf70 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp @@ -36,7 +36,7 @@ FT point_on_ray_dist(const Ray& ray, const Point& point) { std::size_t accum = 0; -boost::optional< +std::optional< Tree::Intersection_and_primitive_id::Type > min_intersection(const Tree& tree, const Ray& ray) { @@ -46,9 +46,9 @@ min_intersection(const Tree& tree, const Ray& ray) { tree.all_intersections(ray, std::back_inserter(all_intersections)); accum += all_intersections.size(); Tree::FT min_distance = DBL_MAX; - boost::optional< + std::optional< Tree::Intersection_and_primitive_id::Type - > mini = boost::none; + > mini = std::nullopt; for(IntersectionVector::iterator it2 = all_intersections.begin(); it2 != all_intersections.end(); ++it2) { if(Point* point = boost::get(&(it2->first))) { @@ -125,7 +125,7 @@ int main() rays.reserve(NB_RAYS); std::transform(v1.begin(), v1.end(), v2.begin(), std::back_inserter(rays), boost::value_factory()); - std::vector< boost::optional::Type > > primitives1, primitives2; + std::vector< std::optional::Type > > primitives1, primitives2; primitives1.reserve(NB_RAYS); primitives2.reserve(NB_RAYS); @@ -140,7 +140,7 @@ int main() } assert(primitives1.size() == primitives2.size()); // Different amount of primitives intersected assert(std::equal(primitives1.begin(), primitives1.end(), primitives2.begin())); // Primitives mismatch - std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), boost::none); + std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), std::nullopt); std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl; std::cout << "Primitive method had to sort " << accum/NB_RAYS << " intersections on average." << std::endl; 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 a02edebb8e1..b249fbf4629 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 @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include @@ -359,7 +359,7 @@ public: 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(::std::nullopt),_outer(::std::nullopt) {} typedef typename InnerFunctor::argument_type argument_type; typedef typename OuterFunctor::result_type result_type; @@ -371,8 +371,8 @@ public: return _outer.get()(_inner.get()(arg)); } private: - ::boost::optional _inner; - ::boost::optional _outer; + ::std::optional _inner; + ::std::optional _outer; }; template diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h index 2b5a30867ce..9c23acc6bd0 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h @@ -174,7 +174,7 @@ public: long old_precision = get_precision( BFI() ); set_precision( BFI(), 53 ); std::pair interval = CGAL::to_interval( convert_to_bfi( (*this))); - this->ptr()->interval_option = boost::optional< std::pair >(interval); + this->ptr()->interval_option = std::optional< std::pair >(interval); set_precision( BFI(), old_precision ); return *(this->ptr()->interval_option); } 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 b7e686d4203..9e1cff2083b 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 @@ -86,10 +86,10 @@ private: CGAL::Polynomial_traits_d::template Rebind ::Other::Type BFI_polynomial; - mutable boost::optional + mutable std::optional < BFI_polynomial > f_bfi_; - mutable boost::optional low_bfi_, f_low_bfi_, + mutable std::optional low_bfi_, f_low_bfi_, high_bfi_, f_high_bfi_; mutable long N; @@ -229,21 +229,21 @@ protected: bool poly_changed = (P!=this->polynomial()); if(poly_changed) { - f_bfi_ = boost::none; + f_bfi_ = std::nullopt; } if(poly_changed || LOW != this->low()) { - f_low_bfi_ = low_bfi_ = boost::none; + f_low_bfi_ = low_bfi_ = std::nullopt; } if(poly_changed || HIGH != this->high()) { - f_high_bfi_ = high_bfi_ = boost::none; + f_high_bfi_ = high_bfi_ = std::nullopt; } Base::set_implicit_rep(P,LOW,HIGH,dummy_bool); } virtual void set_explicit_rep(const Field& m) const { - f_bfi_ = boost::none; - f_low_bfi_ = low_bfi_ = boost::none; - f_high_bfi_ = high_bfi_ = boost::none; + f_bfi_ = std::nullopt; + f_low_bfi_ = low_bfi_ = std::nullopt; + f_high_bfi_ = high_bfi_ = std::nullopt; Base::set_explicit_rep(m); } @@ -256,13 +256,13 @@ public: if(this->is_rational()) return; if(old_low_!=this->low_) { - f_low_bfi_ = low_bfi_ = boost::none; + f_low_bfi_ = low_bfi_ = std::nullopt; } if(old_high_!=this->high_) { - f_high_bfi_ = high_bfi_ = boost::none; + f_high_bfi_ = high_bfi_ = std::nullopt; } if(old_pol != this->polynomial()) { - f_bfi_ = boost::none; + f_bfi_ = std::nullopt; } } @@ -490,7 +490,7 @@ public: Poly f_old = this->polynomial(); Base::simplify(); if(f_old != this->polynomial()) { - f_bfi_ = boost::none; + f_bfi_ = std::nullopt; } } }; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep.h index cecfb57c971..95e8907ad55 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include namespace CGAL { @@ -56,7 +56,7 @@ private: typedef Algebraic_real_rep Self; public: - typedef boost::optional< std::pair > Interval_option; + typedef std::optional< std::pair > Interval_option; mutable Poly polynomial_; //!< square free polynomial mutable Rational low_; //!< lower endpoint of interval 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 2f7719bb362..bf607e75f15 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 @@ -31,7 +31,7 @@ #include #include -#include +#include /* * AUXILIARY CLASSES AND FUNCTIONS diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h index b8bd5995a6f..a11c4283a98 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h @@ -197,7 +197,7 @@ private: size_type index_of_content_root; size_type mult_of_prim_lcoeff_root; size_type index_of_prim_lcoeff_root; - boost::optional stack; + std::optional stack; }; // Functor to get the X_coordinate of an Event_coordinate @@ -211,14 +211,14 @@ private: //! The object holding the information about events, as an optional - mutable boost::optional > + mutable std::optional > event_coordinates; //! The algebraic kernel to use Algebraic_kernel_with_analysis_2* _m_kernel; //! The polynomial defining the curve - boost::optional f; + std::optional f; //! How degenerate situations are handled CGAL::Degeneracy_strategy degeneracy_strategy; @@ -231,24 +231,24 @@ private: * \c f/cont(f). The corresponding curve is equal to the curve of \c f, * only without vertical line components. */ - mutable boost::optional f_primitive; + mutable std::optional f_primitive; //! the polynomial containing all roots of the resultant of the primitive //! part of f and its y-derivative - mutable boost::optional + mutable std::optional resultant_of_primitive_and_derivative_y; //! the polynomial containing all roots of the resultant of the primitive //! part of f and its x-derivative - mutable boost::optional + mutable std::optional resultant_of_primitive_and_derivative_x; //! The Sturm-Habicht polynomials of f - mutable boost::optional > + mutable std::optional > sturm_habicht_of_primitive; //! The content of f - mutable boost::optional content; + mutable std::optional content; //! The non-working shear factors, as far as known mutable std::set bad_shears; @@ -257,10 +257,10 @@ private: mutable std::map sheared_curves; //! Has the curve vertical line components - mutable boost::optional has_vertical_component; + mutable std::optional has_vertical_component; //! The intermediate values - mutable boost::optional > > + mutable std::optional > > intermediate_values; //! stores Y_values at rational coordinate @@ -273,7 +273,7 @@ private: * are asymptotic to y=beta, * or go to +/- infty also in y-direction */ - mutable boost::optional > + mutable std::optional > horizontal_asymptotes_left, horizontal_asymptotes_right; //! friends @@ -547,7 +547,7 @@ private: if(! this->ptr()->intermediate_values) { this->ptr()->intermediate_values - = std::vector > + = std::vector > (number_of_status_lines_with_event()+1); } @@ -1720,7 +1720,7 @@ private: private: // Returns the intermediate values for intervals between events - std::vector >& intermediate_values() const + std::vector >& intermediate_values() const { if(! this->ptr()->intermediate_values) { // This is created during event_coordiantes() @@ -1916,7 +1916,7 @@ private: static_cast(content_roots.size())); this->ptr()->intermediate_values - = std::vector > + = std::vector > (event_coordinate_vector.size()+1); this->ptr()->event_coordinates = event_coordinate_vector; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index 05b97af9bcd..a38cf2ab659 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -136,9 +136,9 @@ public: typedef std::vector Slice_info; - typedef boost::optional Lazy_slice_info; + typedef std::optional Lazy_slice_info; - typedef boost::optional Lazy_bound; + typedef std::optional Lazy_bound; typedef CGAL::internal::Event_indices Event_indices; @@ -151,11 +151,11 @@ public: typedef std::vector > Intersection_info_container; - typedef boost::optional + typedef std::optional Lazy_intersection_info_container; // For lazy evaluation of Status_line_CPA_1s. - typedef boost::optional Lazy_status_line_CPA_1; + typedef std::optional Lazy_status_line_CPA_1; //! @} @@ -191,31 +191,31 @@ private: Polynomial_2 g; - mutable boost::optional > subresultants; + mutable std::optional > subresultants; - mutable boost::optional > + mutable std::optional > principal_subresultants; - mutable boost::optional > + mutable std::optional > coprincipal_subresultants; - mutable boost::optional resultant; + mutable std::optional resultant; - mutable boost::optional > resultant_roots; - mutable boost::optional > + mutable std::optional > resultant_roots; + mutable std::optional > event_x_coordinates; - mutable boost::optional > + mutable std::optional > multiplicities_of_resultant_roots; - mutable boost::optional > stripe_values; + mutable std::optional > stripe_values; mutable std::vector< Lazy_status_line_CPA_1 > event_slices; - mutable boost::optional > intermediate_values; + mutable std::optional > intermediate_values; - mutable boost::optional< std::vector< Lazy_status_line_CPA_1 > > + mutable std::optional< std::vector< Lazy_status_line_CPA_1 > > intermediate_slices; - mutable boost::optional > event_indices; + mutable std::optional > event_indices; mutable Lazy_intersection_info_container intersection_info_container; @@ -530,7 +530,7 @@ private: /* * \brief Computes the intermediate x-coordinates and their status lines * - * In fact, it only fills the data fields with boost::none instances, + * In fact, it only fills the data fields with std::nullopt instances, * according to the lazy philosophy of the whole class. */ void compute_intermediate_values_and_slices() const; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h index 2bd1c6515c1..c1260d26a45 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h @@ -127,7 +127,7 @@ public: //Arc_pair _m_num_arcs; //! sequence of arcs crossing this status line (valid only event lines) - mutable boost::optional _m_arcs; + mutable std::optional _m_arcs; //! number of arcs intersecting this status line mutable int _m_total_arcs; @@ -160,10 +160,10 @@ public: std::vector< int > multiplicities_;*/ // stores algebraic real over the vertical line - mutable std::vector >_m_xy_coords; + mutable std::vector >_m_xy_coords; // stores the isolator instance - mutable boost::optional isolator; + mutable std::optional isolator; // befriending the handle friend class Status_line_CA_1; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CPA_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CPA_1.h index 26fb94416d1..c3fb08048e7 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CPA_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CPA_1.h @@ -75,7 +75,7 @@ public: // represents x-coordinate of event of rational value over interval // computed only by demand - mutable boost::optional _m_x; + mutable std::optional _m_x; // for each event point stores a pair of arcnos of the 1st and 2nd curve // or -1 if respective curve is not involved 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 81a74c56c38..44432d3b2af 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 @@ -81,10 +81,10 @@ public: mutable int _m_arcno; // y-coordinate - mutable boost::optional< Algebraic_real_1 > _m_y; + mutable std::optional< Algebraic_real_1 > _m_y; //! A bounding box for the given point - mutable boost::optional< std::pair > _m_bbox_2_pair; + mutable std::optional< std::pair > _m_bbox_2_pair; }; diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h index 22565c21d85..85afa0a6044 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h @@ -167,7 +167,7 @@ class Lazy_alpha_nt_2 //members //the members can be updated when calling method exact() - mutable boost::optional exact_; + mutable std::optional exact_; mutable NT_approx approx_; //private functions @@ -235,7 +235,7 @@ public: const NT_exact& exact() const { - if (exact_ == boost::none) { + if (exact_ == std::nullopt) { update_exact(); approx_=to_interval(*exact_); } diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h index f20b050c1a2..8d461cd93a5 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include @@ -158,7 +158,7 @@ class Lazy_alpha_nt_3{ //members //the members can be updated when calling method exact() - mutable boost::optional exact_; + mutable std::optional exact_; mutable NT_approx approx_; //private functions @@ -229,7 +229,7 @@ public: } const NT_exact& exact() const { - if (exact_ == boost::none){ + if (exact_ == std::nullopt){ update_exact(); approx_=to_interval(*exact_); } diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveParser.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveParser.cpp index 009eede6a79..d22b0d1474e 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveParser.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveParser.cpp @@ -135,7 +135,7 @@ static inline bool hasValidChars(const std::string& expression, int dimension) } template -boost::optional +std::optional AlgebraicCurveParser::operator()(const std::string& expression) { using Traits = CGAL::Polynomial_traits_d; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveParser.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveParser.h index e838f2e3c0d..b5406743cb3 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveParser.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveParser.h @@ -22,12 +22,12 @@ #include #include -#include +#include template struct AlgebraicCurveParser { - boost::optional operator()(const std::string& expression); + std::optional operator()(const std::string& expression); }; #endif //ARRANGEMENT_ON_SURFACE_2_DEMO_ALGEBRAICCURVEPARSERNEW_H diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/EnvelopeCallback.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/EnvelopeCallback.cpp index 71bb0f1d3c9..fe9eee32700 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/EnvelopeCallback.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/EnvelopeCallback.cpp @@ -223,7 +223,7 @@ void EnvelopeCallback< Arr_>::updateEnvelope( bool lower ) { if (!e->is_empty()) { - boost::optional leftPoint, rightPoint; + std::optional leftPoint, rightPoint; if (e->left()) leftPoint = e->left()->point(); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInput.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInput.cpp index 441cdf5271b..9c15b61bd94 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInput.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInput.cpp @@ -131,7 +131,7 @@ template void GraphicsViewCurveInput::curveInputDoneEvent( const std::vector& clickedPoints, CurveType type) { - boost::optional cv = + std::optional cv = this->curveGenerator.generate(clickedPoints, type); if (cv) { @@ -144,9 +144,9 @@ void GraphicsViewCurveInput::curveInputDoneEvent( template auto CurveGeneratorBase::generate( const std::vector& clickedPoints, CurveType type) - -> boost::optional + -> std::optional { - boost::optional res; + std::optional res; switch (type) { case CurveType::Segment: @@ -190,7 +190,7 @@ void CurveGeneratorBase::setTraits(const ArrTraits* traits_) // Curve Generator Segment Traits template auto CurveGenerator>::generateSegment( - const std::vector& clickedPoints) -> boost::optional + const std::vector& clickedPoints) -> std::optional { Curve_2 res{clickedPoints[0], clickedPoints[1]}; return res; @@ -200,7 +200,7 @@ auto CurveGenerator>::generateSegment( template auto CurveGenerator>:: generatePolyline(const std::vector& clickedPoints) - -> boost::optional + -> std::optional { if (clickedPoints.size() < 2) return {}; @@ -212,7 +212,7 @@ auto CurveGenerator>:: // Curve Generator Linear Traits template auto CurveGenerator>::generateSegment( - const std::vector& points) -> boost::optional + const std::vector& points) -> std::optional { Curve_2 res = Curve_2(Segment_2(points[0], points[1])); return res; @@ -220,7 +220,7 @@ auto CurveGenerator>::generateSegment( template auto CurveGenerator>::generateRay( - const std::vector& points) -> boost::optional + const std::vector& points) -> std::optional { Curve_2 res = Curve_2(Ray_2(points[0], points[1])); return res; @@ -228,7 +228,7 @@ auto CurveGenerator>::generateRay( template auto CurveGenerator>::generateLine( - const std::vector& points) -> boost::optional + const std::vector& points) -> std::optional { Curve_2 res = Curve_2(Line_2(points[0], points[1])); return res; @@ -238,7 +238,7 @@ auto CurveGenerator>::generateLine( template auto CurveGenerator>:: generateSegment(const std::vector& points) - -> boost::optional + -> std::optional { Curve_2 res = Curve_2(Rat_segment_2(points[0], points[1])); return res; @@ -246,7 +246,7 @@ auto CurveGenerator>:: template auto CurveGenerator>:: - generateCircle(const std::vector& points) -> boost::optional + generateCircle(const std::vector& points) -> std::optional { auto sq_rad = (points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) + @@ -258,7 +258,7 @@ auto CurveGenerator>:: template auto CurveGenerator>:: generateEllipse(const std::vector& points) - -> boost::optional + -> std::optional { auto x1 = (CGAL::min)(points[0].x(), points[1].x()); auto y1 = (CGAL::min)(points[0].y(), points[1].y()); @@ -286,7 +286,7 @@ auto CurveGenerator>:: template auto CurveGenerator>:: generateThreePointCircularArc(const std::vector& points) - -> boost::optional + -> std::optional { auto& qp1 = points[0]; auto& qp2 = points[1]; @@ -310,7 +310,7 @@ auto CurveGenerator>:: template auto CurveGenerator>:: generateFivePointConicArc(const std::vector& points) - -> boost::optional + -> std::optional { auto& qp0 = points[0]; auto& qp1 = points[1]; @@ -341,7 +341,7 @@ auto CurveGenerator>:: // CurveGenerator Algebraic Traits template auto CurveGenerator>:: - generateLine(const std::vector& points) -> boost::optional + generateLine(const std::vector& points) -> std::optional { RationalTraits ratTraits; @@ -379,7 +379,7 @@ auto CurveGenerator>:: template auto CurveGenerator>:: - generateCircle(const std::vector& points) -> boost::optional + generateCircle(const std::vector& points) -> std::optional { auto sq_rad = (points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) + @@ -390,7 +390,7 @@ auto CurveGenerator>:: template auto CurveGenerator>:: generateEllipse(const std::vector& points) - -> boost::optional + -> std::optional { auto rx = (points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) / 4.; @@ -404,7 +404,7 @@ auto CurveGenerator>:: template auto CurveGenerator>:: generateEllipse_(const Point_2& center, Rational rxRat, Rational ryRat) - -> boost::optional + -> std::optional { RationalTraits ratTraits; @@ -438,7 +438,7 @@ template < auto CurveGenerator< Arr_Bezier_curve_traits_2>:: generateBezier(const std::vector& clickedPoints) - -> boost::optional + -> std::optional { if (clickedPoints.size() < 2) return {}; return Curve_2{clickedPoints.begin(), clickedPoints.end()}; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInputTyped.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInputTyped.h index 1c8a1b94699..a62e69ac277 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInputTyped.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GraphicsViewCurveInputTyped.h @@ -45,26 +45,26 @@ public: void setTraits(const ArrTraits* traits_); - boost::optional + std::optional generate(const std::vector& clickedPoints, CurveType type); - virtual boost::optional + virtual std::optional generateSegment(const std::vector&) { return {}; } - virtual boost::optional + virtual std::optional generateRay(const std::vector&) { return {}; } - virtual boost::optional + virtual std::optional generateLine(const std::vector&) { return {}; } - virtual boost::optional + virtual std::optional generatePolyline(const std::vector&) { return {}; } - virtual boost::optional + virtual std::optional generateCircle(const std::vector&) { return {}; } - virtual boost::optional + virtual std::optional generateEllipse(const std::vector&) { return {}; } - virtual boost::optional + virtual std::optional generateThreePointCircularArc(const std::vector&) { return {}; } - virtual boost::optional + virtual std::optional generateFivePointConicArc(const std::vector&) { return {}; } - virtual boost::optional + virtual std::optional generateBezier(const std::vector&) { return {}; } const ArrTraits* traits; @@ -85,7 +85,7 @@ struct CurveGenerator> : using Super = CurveGeneratorBase; using Point_2 = typename Super::Point_2; - boost::optional + std::optional generateSegment(const std::vector&) override; }; @@ -98,7 +98,7 @@ struct CurveGenerator> : using Super = CurveGeneratorBase; using Point_2 = typename Super::Point_2; - boost::optional + std::optional generatePolyline(const std::vector&) override; }; @@ -118,14 +118,14 @@ struct CurveGenerator> : using Super = CurveGeneratorBase; using Point_2 = typename Super::Point_2; - boost::optional + std::optional generateSegment(const std::vector&) override; - boost::optional generateCircle(const std::vector&) override; - boost::optional + std::optional generateCircle(const std::vector&) override; + std::optional generateEllipse(const std::vector&) override; - boost::optional + std::optional generateThreePointCircularArc(const std::vector&) override; - boost::optional + std::optional generateFivePointConicArc(const std::vector&) override; }; @@ -143,10 +143,10 @@ struct CurveGenerator> : using Super = CurveGeneratorBase; using Point_2 = typename Super::Point_2; - boost::optional + std::optional generateSegment(const std::vector&) override; - boost::optional generateRay(const std::vector&) override; - boost::optional generateLine(const std::vector&) override; + std::optional generateRay(const std::vector&) override; + std::optional generateLine(const std::vector&) override; }; template @@ -165,13 +165,13 @@ struct CurveGenerator> : using Super = CurveGeneratorBase; using Point_2 = typename Super::Point_2; - boost::optional generateLine(const std::vector&) override; - boost::optional generateCircle(const std::vector&) override; - boost::optional + std::optional generateLine(const std::vector&) override; + std::optional generateCircle(const std::vector&) override; + std::optional generateEllipse(const std::vector&) override; private: - boost::optional generateEllipse_(const Point_2&, Rational, Rational); + std::optional generateEllipse_(const Point_2&, Rational, Rational); }; template < @@ -188,7 +188,7 @@ struct CurveGenerator< using Point_2 = typename Super::Point_2; using Curve_2 = typename ArrTraits::Curve_2; - boost::optional generateBezier(const std::vector&) override; + std::optional generateBezier(const std::vector&) override; }; template diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointSnapper.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointSnapper.cpp index 9194c35a749..cefb4e8e5c0 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointSnapper.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointSnapper.cpp @@ -16,7 +16,7 @@ #include "ArrangementTypesUtils.h" #include "PointSnapper.h" -#include +#include template class PointSnapper : public PointSnapperBase @@ -26,7 +26,7 @@ class PointSnapper : public PointSnapperBase public: PointSnapper(QGraphicsScene*, GridGraphicsItem*, Arrangement*); - boost::optional snapToArrangement(const QPointF& qpt) override; + std::optional snapToArrangement(const QPointF& qpt) override; private: Arrangement* arr; @@ -170,7 +170,7 @@ PointSnapper::PointSnapper( } template -inline boost::optional snapToArrangement( +inline std::optional snapToArrangement( const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr) { using Point_2 = PointSnapperBase::Point_2; @@ -215,7 +215,7 @@ struct SnapToArrangement { using Point_2 = PointSnapperBase::Point_2; template - boost::optional + std::optional operator()(const QPointF& qpt, const QTransform&, Arrangement*) { return Point_2{qpt.x(), qpt.y()}; @@ -226,7 +226,7 @@ struct SnapToArrangement> { using Point_2 = PointSnapperBase::Point_2; template - boost::optional operator()( + std::optional operator()( const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr) { return snapToArrangement(qpt, worldTransform, arr); @@ -237,7 +237,7 @@ struct SnapToArrangement> { using Point_2 = PointSnapperBase::Point_2; template - boost::optional operator()( + std::optional operator()( const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr) { return snapToArrangement(qpt, worldTransform, arr); @@ -248,7 +248,7 @@ struct SnapToArrangement> { using Point_2 = PointSnapperBase::Point_2; template - boost::optional operator()( + std::optional operator()( const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr) { return snapToArrangement(qpt, worldTransform, arr); @@ -257,7 +257,7 @@ struct SnapToArrangement> template auto PointSnapper::snapToArrangement(const QPointF& qpt) - -> boost::optional + -> std::optional { using Traits = typename Arrangement::Geometry_traits_2; auto view = getView(); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointSnapper.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointSnapper.h index 9829f831f5d..2d2a186235e 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointSnapper.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PointSnapper.h @@ -50,7 +50,7 @@ public: protected: PointSnapperBase(QGraphicsScene* scene, GridGraphicsItem* grid); Point_2 snapToGrid(const QPointF& qpt); - virtual boost::optional snapToArrangement(const QPointF& qpt) = 0; + virtual std::optional snapToArrangement(const QPointF& qpt) = 0; GridGraphicsItem* gridGraphicsItem; bool snapToGridEnabled; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp index 5fcdeb8fc3c..2b44a70e0fe 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp @@ -404,8 +404,8 @@ Construct_x_monotone_subcurve_2::Construct_x_monotone_subcurve_2( template auto Construct_x_monotone_subcurve_2::operator()( - const X_monotone_curve_2& curve, const boost::optional& pLeft, - const boost::optional& pRight) -> X_monotone_curve_2 + const X_monotone_curve_2& curve, const std::optional& pLeft, + const std::optional& pRight) -> X_monotone_curve_2 { Point_2 pMin, pMax; bool unbounded_min = false; @@ -457,8 +457,8 @@ template auto Construct_x_monotone_subcurve_2< CGAL::Arr_conic_traits_2>:: operator()( - const X_monotone_curve_2& curve, const boost::optional& pLeft, - const boost::optional& pRight) -> X_monotone_curve_2 + const X_monotone_curve_2& curve, const std::optional& pLeft, + const std::optional& pRight) -> X_monotone_curve_2 { // TODO: handle when pLeft or pRight is null @@ -500,8 +500,8 @@ template < auto Construct_x_monotone_subcurve_2>:: operator()( - const X_monotone_curve_2& curve, const boost::optional& pLeft, - const boost::optional& pRight) -> X_monotone_curve_2 + const X_monotone_curve_2& curve, const std::optional& pLeft, + const std::optional& pRight) -> X_monotone_curve_2 { auto pMin = this->construct_min_vertex_2(curve); auto pMax = this->construct_max_vertex_2(curve); @@ -563,8 +563,8 @@ template auto Construct_x_monotone_subcurve_2< CGAL::Arr_rational_function_traits_2>:: operator()( - const X_monotone_curve_2& curve, const boost::optional& pLeft, - const boost::optional& pRight) -> X_monotone_curve_2 + const X_monotone_curve_2& curve, const std::optional& pLeft, + const std::optional& pRight) -> X_monotone_curve_2 { Point_2 pMin, pMax; bool unbounded_min = false; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.h index 3775dfa43af..99b66c089d9 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.h @@ -358,8 +358,8 @@ public: projection. */ X_monotone_curve_2 operator() ( const X_monotone_curve_2& curve, - const boost::optional& pLeft, - const boost::optional& pRight ); + const std::optional& pLeft, + const std::optional& pRight ); protected: const ArrTraits* traits; @@ -406,8 +406,8 @@ public: Return the subcurve of curve bracketed by pLeft and pRight. */ X_monotone_curve_2 operator() ( const X_monotone_curve_2& curve, - const boost::optional& pLeft, - const boost::optional& pRight ); + const std::optional& pLeft, + const std::optional& pRight ); }; // class Construct_x_monotone_subcurve_2 for Arr_conic_traits_2 @@ -436,8 +436,8 @@ public: Return the subcurve of curve bracketed by pLeft and pRight. */ X_monotone_curve_2 operator()( - const X_monotone_curve_2& curve, const boost::optional& pLeft, - const boost::optional& pRight); + const X_monotone_curve_2& curve, const std::optional& pLeft, + const std::optional& pRight); protected: const ArrTraits* traits; @@ -478,8 +478,8 @@ public: projection. */ X_monotone_curve_2 operator() ( const X_monotone_curve_2& curve, - const boost::optional& pLeft, - const boost::optional& pRight ); + const std::optional& pLeft, + const std::optional& pRight ); protected: const Traits* traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp index 831e0e44395..95bdc262b29 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp @@ -10,7 +10,7 @@ typedef boost::variant Cell_type; -typedef boost::optional Vert_decomp_type; +typedef std::optional Vert_decomp_type; typedef std::pair Vert_decomp_pair; typedef std::pair Vert_decomp_entry; typedef std::list Vert_decomp_list; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index 85f1b7c5acf..02e44f64cef 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -25,7 +25,7 @@ #include -#include +#include #include namespace CGAL { @@ -267,8 +267,8 @@ public: template OutputIterator x_monotone_segment(Curve_2 cv, Point_2 p, - boost::optional start, - boost::optional end, + std::optional start, + std::optional end, OutputIterator out) const { typedef boost::variant @@ -407,19 +407,19 @@ public: Site_of_point site_of_p, OutputIterator out) const { if(site_of_p==POINT_IN_INTERIOR) { - return x_monotone_segment(cv,p,boost::none, boost::none,out); + return x_monotone_segment(cv,p,std::nullopt, std::nullopt,out); } else if(site_of_p==MIN_ENDPOINT) { return x_monotone_segment(cv, p, - boost::optional(p), - boost::none, + std::optional(p), + std::nullopt, out); } CGAL_assertion(site_of_p==MAX_ENDPOINT); return x_monotone_segment(cv, p, - boost::none, - boost::optional(p), + std::nullopt, + std::optional(p), out); } @@ -468,15 +468,15 @@ public: return x_monotone_segment (cv, end_left, - boost::optional(end_left), - boost::optional(end_right), + std::optional(end_left), + std::optional(end_right), out); } else { return x_monotone_segment (cv, end_right, - boost::optional(end_left), - boost::optional(end_right), + std::optional(end_left), + std::optional(end_right), out); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h index af58c261240..81fec7a3785 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h @@ -41,7 +41,7 @@ namespace Ss2 = Surface_sweep_2; * \param oi Output: An output iterator for the query results. * \pre The value-type of PointsIterator is Arrangement::Point_2, * and the value-type of OutputIterator is is pair, - * where Result is boost::optional >. * It represents the arrangement feature containing the point. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h index 8b4a3e1eca2..e7aea3a8d19 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h @@ -305,7 +305,7 @@ public: * \pre The curve has a boundary condition in either x or y. * \return An object that wraps the curve end. */ - boost::optional > + std::optional > place_boundary_vertex(Face*, const X_monotone_curve_2&, Arr_curve_end, @@ -314,7 +314,7 @@ public: { // This function should never be called: CGAL_error(); - return boost::none; + return std::nullopt; } /*! Locate the predecessor halfedge for the given curve around a given diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h index 5a32bb997d7..37f0a05f550 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h @@ -24,7 +24,7 @@ */ #include -#include +#include #include #include #include @@ -284,8 +284,8 @@ overlay(const Arrangement_on_surface_2& arr1 if (vit1->is_isolated()) { typename Arr_a::Vertex_const_handle v1 = vit1; pts_vec[i++] = - Ovl_point_2(vit1->point(), boost::make_optional(Cell_handle_red(v1)), - boost::optional()); + Ovl_point_2(vit1->point(), std::make_optional(Cell_handle_red(v1)), + std::optional()); } } @@ -294,8 +294,8 @@ overlay(const Arrangement_on_surface_2& arr1 if (vit2->is_isolated()) { typename Arr_b::Vertex_const_handle v2 = vit2; pts_vec[i++] = - Ovl_point_2(vit2->point(), boost::optional(), - boost::make_optional(Cell_handle_blue(v2))); + Ovl_point_2(vit2->point(), std::optional(), + std::make_optional(Cell_handle_blue(v2))); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h index 71059ab2be4..e7c4a5b1dd5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace CGAL { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h index f901bb72565..eb161a353c5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h @@ -145,13 +145,13 @@ public: //Dag_node* m_dag_node; //pointer to the search structure (DAG) node /*! Initialize the trapezoid's neighbors. */ - inline void init_neighbors(boost::optional next) + inline void init_neighbors(std::optional next) { set_next((next) ? *next : Td_map_item(0)); } /*! \copydoc init_neighbors * \deprecated please use #init_neighbors */ - CGAL_DEPRECATED inline void init_neighbours(boost::optional next) + CGAL_DEPRECATED inline void init_neighbours(std::optional next) { init_neighbors(next); } /*! Set the DAG node. */ @@ -199,7 +199,7 @@ public: /*! Constructor given Vertex & Halfedge handles. */ Td_active_edge (Halfedge_const_handle he , Dag_node* node = 0, - boost::optional next = boost::none) + std::optional next = std::nullopt) { PTR = new Data(he, (next) ? *next : Td_map_item(0), node); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h index 06b384daed9..2872d256310 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h @@ -24,7 +24,7 @@ #include #include -#include +#include #ifdef CGAL_TD_DEBUG @@ -163,8 +163,8 @@ private: //Dag_node* m_dag_node; //pointer to the search structure (DAG) node /*! Initialize the trapezoid's neighbors. */ - inline void init_neighbors(boost::optional lb, boost::optional lt, - boost::optional rb, boost::optional rt) + inline void init_neighbors(std::optional lb, std::optional lt, + std::optional rb, std::optional rt) { set_lb((lb) ? *lb : Td_map_item(0)); set_lt((lt) ? *lt : Td_map_item(0)); @@ -173,8 +173,8 @@ private: } /*! \copydoc init_neighbors * \deprecated please use #init_neighbors */ - CGAL_DEPRECATED inline void init_neighbours(boost::optional lb, boost::optional lt, - boost::optional rb, boost::optional rt) + CGAL_DEPRECATED inline void init_neighbours(std::optional lb, std::optional lt, + std::optional rb, std::optional rt) { init_neighbors(lb, lt, rb, rt); } /*! Set the DAG node. */ @@ -267,10 +267,10 @@ private: /*! Constructor given Vertex & Halfedge handles. */ Td_active_trapezoid (Vertex_const_handle l, Vertex_const_handle r, Halfedge_const_handle b, Halfedge_const_handle t, - boost::optional lb = boost::none, - boost::optional lt = boost::none, - boost::optional rb = boost::none, - boost::optional rt = boost::none, + std::optional lb = std::nullopt, + std::optional lt = std::nullopt, + std::optional rb = std::nullopt, + std::optional rt = std::nullopt, Dag_node* node = 0) { PTR = new Data (l, r, b, t, (lb) ? *lb : Td_map_item(0), (lt) ? *lt : Td_map_item(0), diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index 097e12d0dcb..7b3b224a223 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -272,7 +272,7 @@ public: Base_map_item_iterator() : traits(0), m_cur_item(Td_map_item(0)){ } Base_map_item_iterator(const Traits* traits_, - boost::optional curr = boost::none) + std::optional curr = std::nullopt) :traits(traits_), m_cur_item((curr) ? *curr : Td_map_item(0) ) { } Base_map_item_iterator(const Base_map_item_iterator &it) @@ -332,12 +332,12 @@ public: public: //constructors In_face_iterator(const Traits* traits_, Halfedge_const_handle sep, - boost::optional curr = boost::none) + std::optional curr = std::nullopt) :Base_map_item_iterator(traits_,curr), m_sep(sep->curve()) { } In_face_iterator(const Traits* traits_, const X_monotone_curve_2& sep, - boost::optional curr = boost::none) + std::optional curr = std::nullopt) :Base_map_item_iterator(traits_,curr), m_sep(sep) { } @@ -790,25 +790,25 @@ public: }; class curve_end_for_fict_vertex_visitor : - public boost::static_visitor > + public boost::static_visitor > { public: - boost::optional operator()(Td_active_fictitious_vertex& t) const + std::optional operator()(Td_active_fictitious_vertex& t) const { return t.curve_end(); } - boost::optional + std::optional operator()(Td_inactive_fictitious_vertex& t) const { return t.curve_end(); } template < typename T > - boost::optional operator()(T& /* t */) const + std::optional operator()(T& /* t */) const { CGAL_assertion(false); - return boost::none; + return std::nullopt; } }; @@ -834,24 +834,24 @@ public: }; class curve_end_for_active_vertex_visitor : - public boost::static_visitor > + public boost::static_visitor > { public: - boost::optional operator()(Td_active_vertex& t) const + std::optional operator()(Td_active_vertex& t) const { return t.curve_end(); } - boost::optional operator()(Td_active_fictitious_vertex& t) const + std::optional operator()(Td_active_fictitious_vertex& t) const { return t.curve_end(); } template < typename T > - boost::optional operator()(T& /* t */) const + std::optional operator()(T& /* t */) const { CGAL_assertion(false); - return boost::none; + return std::nullopt; } }; @@ -878,26 +878,26 @@ public: }; class cv_for_edge_visitor : - public boost::static_visitor > + public boost::static_visitor > { public: - boost::optional + std::optional operator()(Td_active_edge& t) const { return t.halfedge()->curve(); } - boost::optional + std::optional operator()(Td_inactive_edge& t) const { return t.curve(); } template - boost::optional operator()(T& /* t */) const + std::optional operator()(T& /* t */) const { CGAL_assertion(false); - return boost::none; + return std::nullopt; } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h index 15c72e81945..b912b9facc7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h @@ -109,7 +109,7 @@ split_trapezoid_by_vertex(Dag_node& split_node, //CGAL_warning(left_e.is_on_left_boundary() == e.is_on_left_boundary()); //CGAL_warning(right_e.is_on_right_boundary() == e.is_on_right_boundary()); - left_e.init_neighbors(boost::none); + left_e.init_neighbors(std::nullopt); //left_e.init_neighbors(e.lb(),e.lt(),Td_map_item(),right_node.get_data()); right_e.init_neighbors(e.next()); //right_e.init_neighbors(left_node.get_data(),left_node.get_data(),e.rb(),e.rt()); @@ -307,9 +307,9 @@ split_trapezoid_by_halfedge(Dag_node& split_node, Td_active_trapezoid& top = boost::get(top_node.get_data()); - top.init_neighbors(prev_top_tr, split_tr.lt(), boost::none , split_tr.rt()); + top.init_neighbors(prev_top_tr, split_tr.lt(), std::nullopt , split_tr.rt()); bottom.init_neighbors(split_tr.lb(), prev_bottom_tr, split_tr.rb(), - boost::none); + std::nullopt); if (!traits->is_empty_item(prev_bottom_tr)) { Td_active_trapezoid& @@ -1524,7 +1524,7 @@ Trapezoidal_decomposition_2::insert(Halfedge_const_handle he) // create the Td_map_item iterator for traveling along the Trapezoids that // intersect the input Halfedge, using left-low to right-high order In_face_iterator it = follow_curve(p1_node,he,LARGER); - boost::optional curr_trp = boost::none; + std::optional curr_trp = std::nullopt; Td_map_item prev = p1_item; Td_map_item prev_bottom_tr = Td_map_item(0); //active_tr Td_map_item prev_top_tr = Td_map_item(0); //active_tr @@ -1539,7 +1539,7 @@ Trapezoidal_decomposition_2::insert(Halfedge_const_handle he) while(!!it) { //this means as long as the iterator is valid curr_trp = it.trp(); - CGAL_assertion(curr_trp != boost::none); + CGAL_assertion(curr_trp != std::nullopt); prev_bottom_tr = (*curr_trp).lb(); prev_top_tr = (*curr_trp).lt(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h index 1fae9de1d30..db555da63f4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h @@ -19,7 +19,7 @@ // The macro CGAL_ARR_POINT_LOCATION_VERSION controls which version of the // point location is used. Currently two values are supported: // 1. Point location with CGAL::Object -// 2. Point location with boost::optional > +// 2. Point location with std::optional > // The default value is 2. #if !defined(CGAL_ARR_POINT_LOCATION_VERSION) @@ -28,7 +28,7 @@ #include -#include +#include #include #ifdef CGAL_CFG_BOOST_VARIANT_SWAP_BUG @@ -73,7 +73,7 @@ struct Arr_point_location_result { // This function returns either make_object() or a result_type constructor // to generate return values. The Object version takes a dummy template // argument, which is needed for the return of the other option, e.g., - // boost::optional >. + // std::optional >. // In theory a one parameter variant could be returned, but this _could_ // lead to conversion overhead, and so we rather go for the real type. // Overloads for empty returns are also provided. @@ -94,8 +94,8 @@ struct Arr_point_location_result { inline Type make_result(T t) { return Type(t); } static - inline boost::optional empty_optional_result() - { return boost::optional(); } + inline std::optional empty_optional_result() + { return std::optional(); } template static diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h index 099f46edcd6..efdaa8d65d9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h @@ -26,7 +26,7 @@ #include #include -#include +#include namespace CGAL { @@ -60,7 +60,7 @@ protected: #if CGAL_ARR_POINT_LOCATION_VERSION < 2 typedef Result_type Optional_result_type; #else - typedef typename boost::optional Optional_result_type; + typedef typename std::optional Optional_result_type; #endif typedef typename Topology_traits::Dcel Dcel; @@ -75,8 +75,8 @@ protected: inline bool optional_empty(const CGAL::Object& obj) const { return obj.empty(); } inline const Result_type& optional_assign(const CGAL::Object& t) const { return t; } #else - inline bool optional_empty(const boost::optional& t) const { return (!t); } - inline const Result_type& optional_assign(const boost::optional& t) const { return *t; } + inline bool optional_empty(const std::optional& t) const { return (!t); } + inline const Result_type& optional_assign(const std::optional& t) const { return *t; } #endif template diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h index d7b170e979b..97e451bda5f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h @@ -506,7 +506,7 @@ public: * \pre The curve has a boundary condition in either x or y. * \return An object that contains the curve end. */ - boost::optional > + std::optional > place_boundary_vertex(Face* f, const X_monotone_curve_2& xc, Arr_curve_end ind, diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_vert_decomp_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_vert_decomp_helper.h index 2170c332d80..b9f94fd92fc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_vert_decomp_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_vert_decomp_helper.h @@ -49,7 +49,7 @@ public: typedef boost::variant Cell_type; - typedef boost::optional Vert_type; + typedef std::optional Vert_type; protected: // Data members: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h index 9175587a317..ef4da091be7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h @@ -571,7 +571,7 @@ let_me_decide_the_outer_ccb(std::pair< CGAL::Sign, CGAL::Sign> signs1, * represent the curve end along the face boundary. */ template -boost::optional +std::optional ::Vertex*, typename Arr_spherical_topology_traits_2::Halfedge*> > @@ -586,16 +586,16 @@ place_boundary_vertex(Face* /* f */, Arr_parameter_space ps_y) { typedef boost::variant Non_optional_result; - typedef boost::optional Result; + typedef std::optional Result; // std::cout << "place_boundary_vertex()" << std::endl; if (ps_y == ARR_BOTTOM_BOUNDARY) { - if (m_south_pole == nullptr) return boost::none; + if (m_south_pole == nullptr) return std::nullopt; return Result(Non_optional_result(m_south_pole)); } if (ps_y == ARR_TOP_BOUNDARY) { - if (m_north_pole == nullptr) return boost::none; + if (m_north_pole == nullptr) return std::nullopt; return Result(Non_optional_result(m_north_pole)); } @@ -611,7 +611,7 @@ place_boundary_vertex(Face* /* f */, } // The vertex hasn't been created yet, return a null object: - return boost::none; + return std::nullopt; } /*! \brief locate the predecessor halfedge for the given curve around a given diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h index af8e70a3f13..f83aab57b85 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h @@ -50,7 +50,7 @@ public: typedef boost::variant Cell_type; - typedef boost::optional Vert_type; + typedef std::optional Vert_type; protected: typedef typename Arrangement_2::Topology_traits Topology_traits; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h index 4be3568c3a6..f9c7f957c34 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h @@ -296,7 +296,7 @@ are_equal(const Vertex *v, // represent the curve end along the face boundary. // template -boost::optional +std::optional ::Vertex*, typename Arr_unb_planar_topology_traits_2::Halfedge*> > @@ -306,7 +306,7 @@ place_boundary_vertex(Face* f, Arr_parameter_space ps_x, Arr_parameter_space ps_y) { typedef boost::variant Non_optional_result; - typedef boost::optional Result; + typedef std::optional Result; // Get a halfedge on the outer CCB of f and start traversing the CCB. Halfedge* first = *(f->outer_ccbs_begin()); @@ -331,7 +331,7 @@ place_boundary_vertex(Face* f, // If we reached here, we did not find a suitable halfedge, which should // never happen. CGAL_error(); - return boost::none; + return std::nullopt; } //----------------------------------------------------------------------------- diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h index 23fa949e3cd..befc27bb89f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h @@ -48,7 +48,7 @@ public: typedef boost::variant Cell_type; - typedef boost::optional Vert_type; + typedef std::optional Vert_type; protected: typedef typename Arrangement_2::Topology_traits Topology_traits; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h index 30181d7270f..86df601c06a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h @@ -291,7 +291,7 @@ public: * \return An object that contains the curve end. * In our case this object always wraps a fictitious edge. */ - boost::optional > + std::optional > place_boundary_vertex(Face* f, const X_monotone_curve_2& cv, Arr_curve_end ind, diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h index 8f0185a5a03..71fbfd48f9f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h @@ -103,7 +103,7 @@ protected: typedef std::pair Intersection_point; typedef boost::variant Intersection_result; - typedef boost::optional Optional_intersection; + typedef std::optional Optional_intersection; typedef std::list Intersect_list; typedef std::map Intersect_map; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index 2182023925e..8766eac294d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -155,13 +155,13 @@ public: mutable bool _m_left_to_right; //! stores the index of an interval this arc belongs to - mutable boost::optional _m_interval_id; + mutable std::optional _m_interval_id; //! stores boundary value in x-range of non-vertical interval - mutable boost::optional< Bound > _m_boundary_in_interval; + mutable std::optional< Bound > _m_boundary_in_interval; //! stores a bbox for an arc - mutable boost::optional< CGAL::Bbox_2 > _m_bbox; + mutable std::optional< CGAL::Bbox_2 > _m_bbox; //!@} }; @@ -2240,8 +2240,8 @@ protected: rep._m_is_vertical = this->ptr()->_m_is_vertical; rep._m_left_to_right = this->ptr()->_m_left_to_right; - rep._m_interval_id = boost::none; - rep._m_boundary_in_interval = boost::none; + rep._m_interval_id = std::nullopt; + rep._m_boundary_in_interval = std::nullopt; return std::make_pair(Kernel_arc_2(rep), cmp); } @@ -2372,8 +2372,8 @@ protected: this->ptr()->_m_arcno_max = arcno(); // invalidate curve-specific data - this->ptr()->_m_interval_id = boost::none; - this->ptr()->_m_boundary_in_interval = boost::none; + this->ptr()->_m_interval_id = std::nullopt; + this->ptr()->_m_boundary_in_interval = std::nullopt; } //!@} diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h index c1ece0d0d57..df79d30b771 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h @@ -253,8 +253,8 @@ public: class Allocator > inline void draw(const Arc_2& arc, Container< std::vector< Coord_2 >, Allocator >& pts, - boost::optional< Coord_2 > *end_pt1 = nullptr, - boost::optional< Coord_2 > *end_pt2 = nullptr) { + std::optional< Coord_2 > *end_pt1 = nullptr, + std::optional< Coord_2 > *end_pt2 = nullptr) { #ifndef CGAL_CKVA_DUMMY_RENDERER Bbox_2 bbox; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Fig_stream_Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Fig_stream_Curve_renderer_2.h index 55d269ca01b..a7b9453af47 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Fig_stream_Curve_renderer_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Fig_stream_Curve_renderer_2.h @@ -43,7 +43,7 @@ operator << typedef std::pair< int, int > Coord_2; typedef std::vector< Coord_2 > Coord_vec_2; - boost::optional < Coord_2 > p1, p2; + std::optional < Coord_2 > p1, p2; std::list points; Bbox_2 bbox (CGAL::to_double(ws.bounding_rect().xmin()), diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h index c95ee1b85f9..06ec76eb58f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h @@ -83,9 +83,9 @@ public: // end-points (in degenerate case both point to the same object) mutable Generic_point_2 _m_min; - mutable boost::optional _m_max; + mutable std::optional _m_max; // stores native arc object (only for non-degenerate case) - mutable boost::optional _m_arc; + mutable std::optional _m_arc; // whether an arc is degenerate //bool _m_is_degenerate; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h index f993dd009af..c465cae0300 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h @@ -67,12 +67,12 @@ public: _m_point(p) { } - mutable boost::optional _m_arc; // supporting arc for points at inf + mutable std::optional _m_arc; // supporting arc for points at inf // stores respective curve end if this is a point at infinity CGAL::Arr_curve_end _m_end; - mutable boost::optional _m_point; // stores a finite point + mutable std::optional _m_point; // stores a finite point // befriending the handle friend class Generic_point_2; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index 53b5d589b13..f96830c3399 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include @@ -107,22 +107,22 @@ public: //! curve point finite coordinates. They are valid only if boundary in y //! is not set (CGAL::NO_BOUNDARY), otherwise only x-coordinate is //! accessible, i.e., point is in interior - boost::optional< Coordinate_2 > _m_xy; + std::optional< Coordinate_2 > _m_xy; //! x-coordinate of a curve point - boost::optional< Coordinate_1 > _m_x; + std::optional< Coordinate_1 > _m_x; //! curve of point at boundary - boost::optional< Curve_analysis_2 > _m_curve; + std::optional< Curve_analysis_2 > _m_curve; //! arc of point at boundary - boost::optional< int > _m_arcno; + std::optional< int > _m_arcno; //! location of a point in parameter space mutable CGAL::Arr_parameter_space _m_location; //! store a double approximation of point - mutable boost::optional< std::pair< double, double > > _m_doubles; + mutable std::optional< std::pair< double, double > > _m_doubles; }; /*!\brief diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h index 3d1bdff6e91..03d6fcadfbe 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h @@ -22,7 +22,7 @@ #include -#include +#include #include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h index f9551ac46fa..32d3d4cc849 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h @@ -423,8 +423,8 @@ template < class Coord_2, template < class, class > class Container, class Allocator > void draw(const Arc_2& arc, Container< std::vector< Coord_2 >, Allocator >& points, - boost::optional< Coord_2 > *end_pt1 = nullptr, - boost::optional< Coord_2 > *end_pt2 = nullptr) { + std::optional< Coord_2 > *end_pt1 = nullptr, + std::optional< Coord_2 > *end_pt2 = nullptr) { #ifdef CGAL_CKVA_CR_TIMING refine_timer.start(); diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h index ab7b56ce987..7a011211706 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include @@ -524,11 +524,11 @@ void Arr_overlay_ss_visitor::update_event(Event* e, CGAL_assertion(sc->color() == Gt2::RED); Halfedge_handle_red red_he = sc->red_halfedge_handle(); - pt.set_red_cell(boost::make_optional(Cell_handle_red(red_he))); + pt.set_red_cell(std::make_optional(Cell_handle_red(red_he))); } else if (pt.is_blue_cell_empty()) { Halfedge_handle_blue blue_he = sc->blue_halfedge_handle(); - pt.set_blue_cell(boost::make_optional(Cell_handle_blue(blue_he))); + pt.set_blue_cell(std::make_optional(Cell_handle_blue(blue_he))); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h index b38fc25d344..717b31a0d37 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h @@ -23,7 +23,7 @@ */ #include -#include +#include #include @@ -107,19 +107,19 @@ public: typedef boost::variant Cell_handle_red; - typedef boost::optional Optional_cell_red; + typedef std::optional Optional_cell_red; typedef boost::variant Cell_handle_blue; - typedef boost::optional Optional_cell_blue; + typedef std::optional Optional_cell_blue; template Optional_cell_red make_optional_cell_red(Handle_red handle_red) - { return boost::make_optional(Cell_handle_red(handle_red)); } + { return std::make_optional(Cell_handle_red(handle_red)); } template Optional_cell_red make_optional_cell_blue(Handle_blue handle_blue) - { return boost::make_optional(Cell_handle_blue(handle_blue)); } + { return std::make_optional(Cell_handle_blue(handle_blue)); } private: const Gt2* m_base_traits; // The base traits object. @@ -450,16 +450,16 @@ public: if (xcv1.color() == RED) { CGAL_assertion(xcv2.color() == BLUE); red_cell = - boost::make_optional(Cell_handle_red(xcv1.red_halfedge_handle())); + std::make_optional(Cell_handle_red(xcv1.red_halfedge_handle())); blue_cell = - boost::make_optional(Cell_handle_blue(xcv2.blue_halfedge_handle())); + std::make_optional(Cell_handle_blue(xcv2.blue_halfedge_handle())); } else { CGAL_assertion((xcv2.color() == RED) && (xcv1.color() == BLUE)); red_cell = - boost::make_optional(Cell_handle_red(xcv2.red_halfedge_handle())); + std::make_optional(Cell_handle_red(xcv2.red_halfedge_handle())); blue_cell = - boost::make_optional(Cell_handle_blue(xcv1.blue_halfedge_handle())); + std::make_optional(Cell_handle_blue(xcv1.blue_halfedge_handle())); } // Create the extended point and add the multiplicity. @@ -574,15 +574,15 @@ public: red_cell = (! xcv.red_halfedge_handle()->target()->is_at_open_boundary() && m_base_equal(base_p, xcv.red_halfedge_handle()->target()->point())) ? - boost::make_optional(Cell_handle_red(xcv.red_halfedge_handle()->target())) : - boost::make_optional(Cell_handle_red(xcv.red_halfedge_handle())); + std::make_optional(Cell_handle_red(xcv.red_halfedge_handle()->target())) : + std::make_optional(Cell_handle_red(xcv.red_halfedge_handle())); if ((xcv.color() == BLUE) || (xcv.color() == RB_OVERLAP)) blue_cell = (! xcv.blue_halfedge_handle()->target()->is_at_open_boundary() && m_base_equal(base_p, xcv.blue_halfedge_handle()->target()->point())) ? - boost::make_optional(Cell_handle_blue(xcv.blue_halfedge_handle()->target())) : - boost::make_optional(Cell_handle_blue(xcv.blue_halfedge_handle())); + std::make_optional(Cell_handle_blue(xcv.blue_halfedge_handle()->target())) : + std::make_optional(Cell_handle_blue(xcv.blue_halfedge_handle())); return Point_2(base_p, red_cell, blue_cell); } @@ -631,15 +631,15 @@ public: red_cell = (! xcv.red_halfedge_handle()->source()->is_at_open_boundary() && m_base_equal(base_p, xcv.red_halfedge_handle()->source()->point())) ? - boost::make_optional(Cell_handle_red(xcv.red_halfedge_handle()->source())) : - boost::make_optional(Cell_handle_red(xcv.red_halfedge_handle())); + std::make_optional(Cell_handle_red(xcv.red_halfedge_handle()->source())) : + std::make_optional(Cell_handle_red(xcv.red_halfedge_handle())); if ((xcv.color() == BLUE) || (xcv.color() == RB_OVERLAP)) blue_cell = (! xcv.blue_halfedge_handle()->source()->is_at_open_boundary() && m_base_equal(base_p, xcv.blue_halfedge_handle()->source()->point())) ? - boost::make_optional(Cell_handle_blue(xcv.blue_halfedge_handle()->source())) : - boost::make_optional(Cell_handle_blue(xcv.blue_halfedge_handle())); + std::make_optional(Cell_handle_blue(xcv.blue_halfedge_handle()->source())) : + std::make_optional(Cell_handle_blue(xcv.blue_halfedge_handle())); return (Point_2(base_p, red_cell, blue_cell)); } diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h index b6b7be876f6..952bf00e183 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h @@ -69,7 +69,7 @@ public: typedef boost::variant Cell_type; - typedef boost::optional Vert_type; + typedef std::optional Vert_type; typedef std::pair Vert_pair; typedef std::pair Vert_entry; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Vertical_decomposition_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Vertical_decomposition_test.h index 6ffb18e01f3..881c939b5ff 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Vertical_decomposition_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Vertical_decomposition_test.h @@ -46,7 +46,7 @@ public: typedef boost::variant Cell_type; - typedef boost::optional Vert_type; + typedef std::optional Vert_type; typedef typename std::pair Vert_pair; typedef typename std::pair Vert_decomp_entry; diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 21644ebf18f..5ce55025c76 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -60,7 +60,7 @@ bool is_border(typename boost::graph_traits::edge_descriptor ed, cons returns a halfedge which is on a border and whose target vertex is `vd`, if such a halfedge exists. */ template -boost::optional::halfedge_descriptor> +std::optional::halfedge_descriptor> is_border(typename boost::graph_traits::vertex_descriptor vd, const FaceGraph& g) { @@ -72,7 +72,7 @@ is_border(typename boost::graph_traits::vertex_descriptor vd, } } // empty - return boost::optional::halfedge_descriptor>(); + return std::optional::halfedge_descriptor>(); } namespace BGL { diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h index 7f9ea3dfcbb..da4b706b9bb 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h @@ -44,7 +44,7 @@ public: Weights are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. The function returns a pointer to the last stored element. */ - boost::optional + std::optional weights( const Traits::Point_2& query_point, OutputIterator& output) { @@ -57,7 +57,7 @@ public: are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. The function returns a pointer to the last stored element. */ - boost::optional + std::optional coordinates_on_bounded_side( const Traits::Point_2& query_point, OutputIterator& output, @@ -72,7 +72,7 @@ public: are computed with respect to a query point of the type `Traits::Point_2` and stored in the output iterator `output`. The function returns a pointer to the last stored element. */ - boost::optional + std::optional coordinates_on_unbounded_side( const Traits::Point_2& query_point, OutputIterator& output, diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h index 91d96c2f1c4..8ef72b0bce5 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h @@ -24,7 +24,7 @@ #include // Boost headers. -#include +#include // CGAL namespace. namespace CGAL { @@ -98,7 +98,7 @@ public: // This function computes discrete harmonic weights (unnormalized coordinates) for a chosen query point. template - inline boost::optional weights(const Point_2 &query_point, OutputIterator &output) + inline std::optional weights(const Point_2 &query_point, OutputIterator &output) { return weights_2(query_point, output); } @@ -108,7 +108,7 @@ public: // This function computes discrete harmonic barycentric coordinates for a chosen query point on the bounded side of a strictly convex polygon. // \pre The provided polygon is strictly convex. template - inline boost::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) + inline std::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) { switch(type_of_algorithm) { @@ -124,14 +124,14 @@ public: // Pointer cannot be here. Something went wrong. const bool type_of_algorithm_failure = true; CGAL_postcondition( !type_of_algorithm_failure ); - if(!type_of_algorithm_failure) return boost::optional(output); - else return boost::optional(); + if(!type_of_algorithm_failure) return std::optional(output); + else return std::optional(); } // This function computes discrete harmonic barycentric coordinates for a chosen query point on the unbounded side of a strictly convex polygon. // \pre The provided polygon is strictly convex. template - inline boost::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm, const bool warning_tag = true) + inline std::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm, const bool warning_tag = true) { switch(type_of_algorithm) { @@ -147,8 +147,8 @@ public: // Pointer cannot be here. Something went wrong. const bool type_of_algorithm_failure = true; CGAL_postcondition( !type_of_algorithm_failure ); - if(!type_of_algorithm_failure) return boost::optional(output); - else return boost::optional(); + if(!type_of_algorithm_failure) return std::optional(output); + else return std::optional(); } // Information Functions @@ -184,7 +184,7 @@ private: // Compute discrete harmonic weights without normalization. template - boost::optional weights_2(const Point_2 &query_point, OutputIterator &output) + std::optional weights_2(const Point_2 &query_point, OutputIterator &output) { // Get the number of vertices in the polygon. const int n = int(number_of_vertices); @@ -220,7 +220,7 @@ private: ++output; // Return weights. - return boost::optional(output); + return std::optional(output); } // COORDINATES ON BOUNDED SIDE. @@ -228,7 +228,7 @@ private: // Compute discrete harmonic coordinates on the bounded side of the polygon with the slow O(n^2) but precise algorithm. // Here, n - is the number of the polygon's vertices. template - boost::optional coordinates_on_bounded_side_precise_2(const Point_2 &query_point, OutputIterator &output) + std::optional coordinates_on_bounded_side_precise_2(const Point_2 &query_point, OutputIterator &output) { CGAL_precondition( type_of_polygon() == STRICTLY_CONVEX ); @@ -281,13 +281,13 @@ private: ++output; // Return coordinates. - return boost::optional(output); + return std::optional(output); } // Compute discrete harmonic coordinates on the bounded side of the polygon with the fast O(n) but less precise algorithm. // Here, n - is the number of the polygon's vertices. Precision is lost near the boundary (~ 1.0e-10 and closer). template - boost::optional coordinates_on_bounded_side_fast_2(const Point_2 &query_point, OutputIterator &output) + std::optional coordinates_on_bounded_side_fast_2(const Point_2 &query_point, OutputIterator &output) { CGAL_precondition( type_of_polygon() == STRICTLY_CONVEX ); @@ -338,7 +338,7 @@ private: ++output; // Return coordinates. - return boost::optional(output); + return std::optional(output); } // COORDINATES ON UNBOUNDED SIDE. @@ -346,7 +346,7 @@ private: // Compute discrete harmonic coordinates on the unbounded side of the polygon with the slow O(n^2) but precise algorithm. // Here, n - is the number of the polygon's vertices. template - boost::optional coordinates_on_unbounded_side_precise_2(const Point_2 &query_point, OutputIterator &output, bool warning_tag) + std::optional coordinates_on_unbounded_side_precise_2(const Point_2 &query_point, OutputIterator &output, bool warning_tag) { if(warning_tag) std::cout << std::endl << "ATTENTION: Discrete harmonic coordinates might be not well-defined outside the polygon!" << std::endl; @@ -358,7 +358,7 @@ private: // Compute discrete harmonic coordinates on the unbounded side of the polygon with the fast O(n) but less precise algorithm. // Here, n - is the number of the polygon's vertices. Precision is lost near the boundary (~ 1.0e-10 and closer). template - boost::optional coordinates_on_unbounded_side_fast_2(const Point_2 &query_point, OutputIterator &output, bool warning_tag) + std::optional coordinates_on_unbounded_side_fast_2(const Point_2 &query_point, OutputIterator &output, bool warning_tag) { if(warning_tag) std::cout << std::endl << "ATTENTION: Discrete harmonic coordinates might be not well-defined outside the polygon!" << std::endl; diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h index 381291b3a33..94db271c736 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h @@ -24,7 +24,7 @@ #include // Boost headers. -#include +#include // CGAL namespace. namespace CGAL { @@ -118,7 +118,7 @@ public: /// `CGAL::Barycentric_coordinates::PRECISE` - default slow algorithm, which is as precise as possible and /// `CGAL::Barycentric_coordinates::FAST` - fast algorithm, which is less precise but much faster. template - inline boost::optional operator()(const Point_2 &query_point, OutputIterator output, Query_point_location query_point_location = UNSPECIFIED_LOCATION, Type_of_algorithm type_of_algorithm = PRECISE) + inline std::optional operator()(const Point_2 &query_point, OutputIterator output, Query_point_location query_point_location = UNSPECIFIED_LOCATION, Type_of_algorithm type_of_algorithm = PRECISE) { return coordinates_2(query_point, output, query_point_location, type_of_algorithm); } @@ -129,7 +129,7 @@ public: /// \pre The provided query point belongs to the polygon's boundary. /// \pre (0 <= index) && (index < number of the polygon's vertices). template - inline boost::optional compute_on_edge(const Point_2 &query_point, const int index, OutputIterator output) const + inline std::optional compute_on_edge(const Point_2 &query_point, const int index, OutputIterator output) const { return coordinates_on_boundary_2(query_point, index, output); } @@ -139,7 +139,7 @@ public: /// /// \pre (0 <= index) && (index < number of the polygon's vertices). template - inline boost::optional compute_on_vertex(const int index, OutputIterator output) const + inline std::optional compute_on_vertex(const int index, OutputIterator output) const { return coordinates_on_vertex_2(index, output); } @@ -149,7 +149,7 @@ public: /// /// \pre The provided query point belongs to the polygon's interior, excluding the boundary. template - inline boost::optional compute_weights(const Point_2 &query_point, OutputIterator output) + inline std::optional compute_weights(const Point_2 &query_point, OutputIterator output) { return weights_2(query_point, output); } @@ -183,7 +183,7 @@ public: // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of coordinate values. - inline boost::optional > > operator()(const Point_2 &query_point, std::vector &output_vector, Query_point_location query_point_location = UNSPECIFIED_LOCATION, Type_of_algorithm type_of_algorithm = PRECISE) + inline std::optional > > operator()(const Point_2 &query_point, std::vector &output_vector, Query_point_location query_point_location = UNSPECIFIED_LOCATION, Type_of_algorithm type_of_algorithm = PRECISE) { output_vector.reserve(output_vector.size() + number_of_vertices); typedef typename std::back_insert_iterator > OutputIterator; @@ -198,7 +198,7 @@ public: // // \pre The provided query point belongs to the polygon's boundary. // \pre (0 <= index) && (index < number of the polygon's vertices). - inline boost::optional > > compute_on_edge(const Point_2 &query_point, const int index, std::vector &output_vector) const + inline std::optional > > compute_on_edge(const Point_2 &query_point, const int index, std::vector &output_vector) const { output_vector.reserve(output_vector.size() + number_of_vertices); typedef typename std::back_insert_iterator > OutputIterator; @@ -212,7 +212,7 @@ public: // that is placed past-the-end of the resulting sequence of coordinate values. // // \pre (0 <= index) && (index < number of the polygon's vertices). - inline boost::optional > > compute_on_vertex(const int index, std::vector &output_vector) const + inline std::optional > > compute_on_vertex(const int index, std::vector &output_vector) const { output_vector.reserve(output_vector.size() + number_of_vertices); typedef typename std::back_insert_iterator > OutputIterator; @@ -226,7 +226,7 @@ public: // that is placed past-the-end of the resulting sequence of weight values. // // \pre The provided query point belongs to the polygon's interior, excluding the boundary. - inline boost::optional > > compute_weights(const Point_2 &query_point, std::vector &output_vector) + inline std::optional > > compute_weights(const Point_2 &query_point, std::vector &output_vector) { output_vector.reserve(output_vector.size() + number_of_vertices); typedef typename std::back_insert_iterator > OutputIterator; @@ -283,7 +283,7 @@ private: // Compute weights on the bounded side of the polygon - see precondition. template - inline boost::optional weights_2(const Point_2 &query_point, OutputIterator &output) + inline std::optional weights_2(const Point_2 &query_point, OutputIterator &output) { // This is the only global precondition on the computation of weights. CGAL_precondition( CGAL::bounded_side_2(vertex.begin(), vertex.end(), query_point, barycentric_traits) == CGAL::ON_BOUNDED_SIDE ); @@ -295,7 +295,7 @@ private: // Compute coordinates at any point in the plane. template - boost::optional coordinates_2(const Point_2 &query_point, OutputIterator &output, const Query_point_location query_point_location, const Type_of_algorithm type_of_algorithm) + std::optional coordinates_2(const Point_2 &query_point, OutputIterator &output, const Query_point_location query_point_location, const Type_of_algorithm type_of_algorithm) { // Determine a location of the current query point provided by the user. switch(query_point_location) @@ -324,13 +324,13 @@ private: // Pointer cannot be here. Something went wrong. const bool query_point_location_failure = true; CGAL_postcondition( !query_point_location_failure ); - if(!query_point_location_failure) return boost::optional(output); - else return boost::optional(); + if(!query_point_location_failure) return std::optional(output); + else return std::optional(); } // Compute coordinates at any point in the plane with unspecified location. template - boost::optional coordinates_unspecified_2(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) + std::optional coordinates_unspecified_2(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) { // Determine a global location of the current query point. switch(CGAL::bounded_side_2(vertex.begin(), vertex.end(), query_point, barycentric_traits)) @@ -355,15 +355,15 @@ private: // Pointer cannot be here. Something went wrong. const bool query_point_location_failure = true; CGAL_postcondition( !query_point_location_failure ); - if(!query_point_location_failure) return boost::optional(output); - else return boost::optional(); + if(!query_point_location_failure) return std::optional(output); + else return std::optional(); } // COORDINATES ON BOUNDED SIDE. // Compute coordinates on the bounded side of the polygon - precise or fast. template - inline boost::optional coordinates_on_bounded_side_2(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) + inline std::optional coordinates_on_bounded_side_2(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) { CGAL_precondition( CGAL::bounded_side_2(vertex.begin(), vertex.end(), query_point, barycentric_traits) == CGAL::ON_BOUNDED_SIDE ); @@ -374,7 +374,7 @@ private: // Compute coordinates along the boundary of the polygon with beforehand known index of the edge to which the query point belongs. template - boost::optional coordinates_on_boundary_2(const Point_2 &query_point, const int index, OutputIterator &output) const + std::optional coordinates_on_boundary_2(const Point_2 &query_point, const int index, OutputIterator &output) const { CGAL_precondition( CGAL::bounded_side_2(vertex.begin(), vertex.end(), query_point, barycentric_traits) == CGAL::ON_BOUNDARY ); CGAL_precondition( (0 <= index) && (index < int(number_of_vertices)) ); @@ -393,7 +393,7 @@ private: // Compute segment coordinates along the chosen edge with the index = `index`. Segment_coordinates_2 segment_coordinates(vertex[index], vertex[index+1]); - boost::optional success = segment_coordinates(query_point, output); + std::optional success = segment_coordinates(query_point, output); ++output; for(int i = index + 1; i < last; ++i) { @@ -402,20 +402,20 @@ private: } // Return coordinates. - if(success) return boost::optional(output); - else return boost::optional(); + if(success) return std::optional(output); + else return std::optional(); } // Pointer cannot be here. Something went wrong. const bool coordinates_on_boundary_failure = true; CGAL_postcondition( !coordinates_on_boundary_failure ); - if(!coordinates_on_boundary_failure) return boost::optional(output); - else return boost::optional(); + if(!coordinates_on_boundary_failure) return std::optional(output); + else return std::optional(); } // Compute coordinates along the boundary of the polygon without beforehand known index of the edge to which the query point belongs. template - boost::optional coordinates_on_boundary_2(const Point_2 &query_point, OutputIterator &output) const + std::optional coordinates_on_boundary_2(const Point_2 &query_point, OutputIterator &output) const { CGAL_precondition( CGAL::bounded_side_2(vertex.begin(), vertex.end(), query_point, barycentric_traits) == CGAL::ON_BOUNDARY ); @@ -435,7 +435,7 @@ private: // Compute segment coordinates along the edge with the query point. Segment_coordinates_2 segment_coordinates(vertex[index], vertex[index+1]); - boost::optional success = segment_coordinates(query_point, output); + std::optional success = segment_coordinates(query_point, output); if(success) status = true; ++output; break; @@ -452,20 +452,20 @@ private: } // Return coordinates. - if(status == true) return boost::optional(output); - else return boost::optional(); + if(status == true) return std::optional(output); + else return std::optional(); } // Pointer cannot be here. Something went wrong. const bool coordinates_on_boundary_failure = true; CGAL_postcondition( !coordinates_on_boundary_failure ); - if(!coordinates_on_boundary_failure) return boost::optional(output); - else return boost::optional(); + if(!coordinates_on_boundary_failure) return std::optional(output); + else return std::optional(); } // Compute coordinates for a query point lying on the last edge of the polygon. template - boost::optional coordinates_on_last_edge_2(const Point_2 &query_point, const int last, OutputIterator &output) const + std::optional coordinates_on_last_edge_2(const Point_2 &query_point, const int last, OutputIterator &output) const { // Some convenient typedefs. typedef std::vector Coordinate_vector; @@ -478,7 +478,7 @@ private: // Compute segment coordinates along the last edge of the polygon. Segment_coordinates_2 segment_coordinates(vertex[last], vertex[0]); - boost::optional success = segment_coordinates(query_point, std::back_inserter(coordinate)); + std::optional success = segment_coordinates(query_point, std::back_inserter(coordinate)); // Store all the coordinate values. // All the values are zeros apart from those corresponding to the first and the last vertices of the polygon. @@ -492,15 +492,15 @@ private: ++output; // Return computed coordinates. - if(success) return boost::optional(output); - else return boost::optional(); + if(success) return std::optional(output); + else return std::optional(); } // COORDINATES AT VERTEX. // Compute coordinates for a query point lying at one of the polygon's vertices with beforehand known vertex's index. template - boost::optional coordinates_on_vertex_2(const int index, OutputIterator &output) const + std::optional coordinates_on_vertex_2(const int index, OutputIterator &output) const { CGAL_precondition( (0 <= index) && (index < int(number_of_vertices)) ); @@ -519,12 +519,12 @@ private: } // Return coordinates. - return boost::optional(output); + return std::optional(output); } // Compute coordinates for a query point lying at one of the polygon's vertices without beforehand known vertex's index. template - boost::optional coordinates_on_vertex_2(const Point_2 &query_point, OutputIterator &output) const + std::optional coordinates_on_vertex_2(const Point_2 &query_point, OutputIterator &output) const { int index = -1; CGAL_precondition( is_query_point_at_vertex(query_point, index) ); @@ -554,15 +554,15 @@ private: // Return coordinates. CGAL_postcondition( !coordinates_on_vertex_failure ); - if(!coordinates_on_vertex_failure) return boost::optional(output); - else return boost::optional(); + if(!coordinates_on_vertex_failure) return std::optional(output); + else return std::optional(); } // COORDINATES ON UNBOUNDED SIDE. // Compute coordinates on the unbounded side of the polygon - precise or fast. template - inline boost::optional coordinates_on_unbounded_side_2(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) + inline std::optional coordinates_on_unbounded_side_2(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) { CGAL_precondition( CGAL::bounded_side_2(vertex.begin(), vertex.end(), query_point, barycentric_traits) == CGAL::ON_UNBOUNDED_SIDE ); diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h index ef895698b0a..2dca8b2b8fb 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h @@ -26,7 +26,7 @@ // Boost headers. #include -#include +#include // Barycentric coordinates headers. #include @@ -154,7 +154,7 @@ public: // This function computes mean value weights (unnormalized coordinates) for a chosen query point. template - inline boost::optional weights(const Point_2 &query_point, OutputIterator &output) + inline std::optional weights(const Point_2 &query_point, OutputIterator &output) { return weights_2(query_point, output); } @@ -163,7 +163,7 @@ public: // This function computes mean value barycentric coordinates for a chosen query point on the bounded side of a simple polygon. template - inline boost::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) + inline std::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) { switch(type_of_algorithm) { @@ -179,13 +179,13 @@ public: // Pointer cannot be here. Something went wrong. const bool type_of_algorithm_failure = true; CGAL_postcondition( !type_of_algorithm_failure ); - if(!type_of_algorithm_failure) return boost::optional(output); - else return boost::optional(); + if(!type_of_algorithm_failure) return std::optional(output); + else return std::optional(); } // This function computes mean value barycentric coordinates for a chosen query point on the unbounded side of a simple polygon. template - inline boost::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) + inline std::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) { switch(type_of_algorithm) { @@ -201,8 +201,8 @@ public: // Pointer cannot be here. Something went wrong. const bool type_of_algorithm_failure = true; CGAL_postcondition( !type_of_algorithm_failure ); - if(!type_of_algorithm_failure) return boost::optional(output); - else return boost::optional(); + if(!type_of_algorithm_failure) return std::optional(output); + else return std::optional(); } // Information Functions @@ -243,7 +243,7 @@ private: // Compute mean value weights without normalization. template - boost::optional weights_2(const Point_2 &query_point, OutputIterator &output) + std::optional weights_2(const Point_2 &query_point, OutputIterator &output) { // Get the number of vertices in the polygon. const int n = int(number_of_vertices); @@ -293,7 +293,7 @@ private: ++output; // Return weights. - return boost::optional(output); + return std::optional(output); } // COORDINATES ON BOUNDED SIDE. @@ -301,7 +301,7 @@ private: // Compute mean value coordinates on the bounded side of the polygon with the slow O(n^2) but precise algorithm. // Here, n - is the number of the polygon's vertices. template - boost::optional coordinates_on_bounded_side_precise_2(const Point_2 &query_point, OutputIterator &output) + std::optional coordinates_on_bounded_side_precise_2(const Point_2 &query_point, OutputIterator &output) { // Get the number of vertices in the polygon. const int n = int(number_of_vertices); @@ -368,13 +368,13 @@ private: ++output; // Return coordinates. - return boost::optional(output); + return std::optional(output); } // Compute mean value coordinates on the bounded side of the polygon with the fast O(n) but less precise algorithm. // Here, n - is the number of the polygon's vertices. Precision is lost near the boundary (~ 1.0e-10 and closer). template - boost::optional coordinates_on_bounded_side_fast_2(const Point_2 &query_point, OutputIterator &output) + std::optional coordinates_on_bounded_side_fast_2(const Point_2 &query_point, OutputIterator &output) { // Get the number of vertices in the polygon. const int n = int(number_of_vertices); @@ -437,7 +437,7 @@ private: ++output; // Return coordinates. - return boost::optional(output); + return std::optional(output); } // COORDINATES ON UNBOUNDED SIDE. @@ -445,7 +445,7 @@ private: // Compute mean value coordinates on the unbounded side of the polygon with the slow O(n^2) but precise algorithm. // Here, n - is the number of the polygon's vertices. template - boost::optional coordinates_on_unbounded_side_precise_2(const Point_2 &query_point, OutputIterator &output) + std::optional coordinates_on_unbounded_side_precise_2(const Point_2 &query_point, OutputIterator &output) { // Use the same formulas as for the bounded side since they are also valid on the unbounded side. return coordinates_on_bounded_side_precise_2(query_point, output); @@ -454,7 +454,7 @@ private: // Compute mean value coordinates on the unbounded side of the polygon with the fast O(n) but less precise algorithm. // Here, n - is the number of the polygon's vertices. Precision is lost near the boundary (~ 1.0e-10 and closer). template - boost::optional coordinates_on_unbounded_side_fast_2(const Point_2 &query_point, OutputIterator &output) + std::optional coordinates_on_unbounded_side_fast_2(const Point_2 &query_point, OutputIterator &output) { // Use the same formulas as for the bounded side since they are also valid on the unbounded side. return coordinates_on_bounded_side_fast_2(query_point, output); diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h index 469b84a09a3..d43f879bdf5 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h @@ -24,7 +24,7 @@ #include // Boost headers. -#include +#include // CGAL namespace. namespace CGAL { @@ -96,7 +96,7 @@ public: // This function computes Wachspress weights (unnormalized coordinates) for a chosen query point. template - inline boost::optional weights(const Point_2 &query_point, OutputIterator &output) + inline std::optional weights(const Point_2 &query_point, OutputIterator &output) { return weights_2(query_point, output); } @@ -106,7 +106,7 @@ public: // This function computes Wachspress barycentric coordinates for a chosen query point on the bounded side of a strictly convex polygon. // \pre The provided polygon is strictly convex. template - inline boost::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) + inline std::optional coordinates_on_bounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm) { switch(type_of_algorithm) { @@ -122,14 +122,14 @@ public: // Pointer cannot be here. Something went wrong. const bool type_of_algorithm_failure = true; CGAL_postcondition( !type_of_algorithm_failure ); - if(!type_of_algorithm_failure) return boost::optional(output); - else return boost::optional(); + if(!type_of_algorithm_failure) return std::optional(output); + else return std::optional(); } // This function computes Wachspress barycentric coordinates for a chosen query point on the unbounded side of a strictly convex polygon. // \pre The provided polygon is strictly convex. template - inline boost::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm, const bool warning_tag = true) + inline std::optional coordinates_on_unbounded_side(const Point_2 &query_point, OutputIterator &output, const Type_of_algorithm type_of_algorithm, const bool warning_tag = true) { switch(type_of_algorithm) { @@ -145,8 +145,8 @@ public: // Pointer cannot be here. Something went wrong. const bool type_of_algorithm_failure = true; CGAL_postcondition( !type_of_algorithm_failure ); - if(!type_of_algorithm_failure) return boost::optional(output); - else return boost::optional(); + if(!type_of_algorithm_failure) return std::optional(output); + else return std::optional(); } // Information Functions @@ -181,7 +181,7 @@ private: // Compute Wachspress weights without normalization. template - boost::optional weights_2(const Point_2 &query_point, OutputIterator &output) + std::optional weights_2(const Point_2 &query_point, OutputIterator &output) { // Get the number of vertices in the polygon. const int n = int(number_of_vertices); @@ -214,7 +214,7 @@ private: ++output; // Return weights. - return boost::optional(output); + return std::optional(output); } // COORDINATES ON BOUNDED SIDE. @@ -222,7 +222,7 @@ private: // Compute Wachspress coordinates on the bounded side of the polygon with the slow O(n^2) but precise algorithm. // Here, n - is the number of the polygon's vertices. template - boost::optional coordinates_on_bounded_side_precise_2(const Point_2 &query_point, OutputIterator &output) + std::optional coordinates_on_bounded_side_precise_2(const Point_2 &query_point, OutputIterator &output) { CGAL_precondition( type_of_polygon() == STRICTLY_CONVEX ); @@ -265,13 +265,13 @@ private: ++output; // Return coordinates. - return boost::optional(output); + return std::optional(output); } // Compute Wachspress coordinates on the bounded side of the polygon with the fast O(n) but less precise algorithm. // Here, n - is the number of the polygon's vertices. Precision is lost near the boundary (~ 1.0e-10 and closer). template - boost::optional coordinates_on_bounded_side_fast_2(const Point_2 &query_point, OutputIterator &output) + std::optional coordinates_on_bounded_side_fast_2(const Point_2 &query_point, OutputIterator &output) { CGAL_precondition( type_of_polygon() == STRICTLY_CONVEX ); @@ -319,7 +319,7 @@ private: ++output; // Return coordinates. - return boost::optional(output); + return std::optional(output); } // COORDINATES ON UNBOUNDED SIDE. @@ -327,7 +327,7 @@ private: // Compute Wachspress coordinates on the unbounded side of the polygon with the slow O(n^2) but precise algorithm. // Here, n - is the number of the polygon's vertices. template - boost::optional coordinates_on_unbounded_side_precise_2(const Point_2 &query_point, OutputIterator &output, bool warning_tag) + std::optional coordinates_on_unbounded_side_precise_2(const Point_2 &query_point, OutputIterator &output, bool warning_tag) { if(warning_tag) std::cout << std::endl << "ATTENTION: Wachspress coordinates might be not well-defined outside the polygon!" << std::endl; @@ -339,7 +339,7 @@ private: // Compute Wachspress coordinates on the unbounded side of the polygon with the fast O(n) but less precise algorithm. // Here, n - is the number of the polygon's vertices. Precision is lost near the boundary (~ 1.0e-10 and closer). template - boost::optional coordinates_on_unbounded_side_fast_2(const Point_2 &query_point, OutputIterator &output, bool warning_tag) + std::optional coordinates_on_unbounded_side_fast_2(const Point_2 &query_point, OutputIterator &output, bool warning_tag) { if(warning_tag) std::cout << std::endl << "ATTENTION: Wachspress coordinates might be not well-defined outside the polygon!" << std::endl; diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/internal/utils_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/internal/utils_2.h index 7faa4f49eb2..0cc79e16bc0 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/internal/utils_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/internal/utils_2.h @@ -31,7 +31,7 @@ // Boost headers. #include -#include +#include // Internal includes. #include @@ -222,7 +222,7 @@ namespace internal { typename VertexRange, typename GeomTraits, typename PointMap> - boost::optional< std::pair > + std::optional< std::pair > get_edge_index_approximate( const VertexRange& polygon, const typename GeomTraits::Point_2& query, @@ -264,7 +264,7 @@ namespace internal { return std::make_pair(Query_point_location::ON_EDGE, i); } } - return boost::none; + return std::nullopt; } // Why this one does not work for harmonic coordinates? - Due to the imprecisions in the Mesh_2 class. @@ -273,7 +273,7 @@ namespace internal { typename VertexRange, typename GeomTraits, typename PointMap> - boost::optional< std::pair > + std::optional< std::pair > get_edge_index_exact( const VertexRange& polygon, const typename GeomTraits::Point_2& query, @@ -303,7 +303,7 @@ namespace internal { return std::make_pair(Query_point_location::ON_EDGE, i); } } - return boost::none; + return std::nullopt; } // Check whether a query point belongs to the last polygon edge. @@ -409,7 +409,7 @@ namespace internal { typename VertexRange, typename GeomTraits, typename PointMap> - boost::optional< std::pair > + std::optional< std::pair > locate_wrt_polygon_2( const VertexRange& polygon, const typename GeomTraits::Point_2& query, @@ -430,7 +430,7 @@ namespace internal { default: return std::make_pair(Query_point_location::UNSPECIFIED, std::size_t(-1)); } - return boost::none; + return std::nullopt; } } // namespace internal diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/segment_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/segment_coordinates_2.h index b2b3120e0ba..99f9c6fb76f 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/segment_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/segment_coordinates_2.h @@ -245,7 +245,7 @@ namespace Barycentric_coordinates { /// Computes segment barycentric coordinates for a chosen query point with respect to both vertices of the segment. /// Computed coordinates are stored in the output iterator `output`. template - inline boost::optional operator()( + inline std::optional operator()( const Point_2 &query_point, OutputIterator output) { return segment_coordinates_2(query_point, output); @@ -280,7 +280,7 @@ namespace Barycentric_coordinates { // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of coordinate values. - inline boost::optional > > operator()( + inline std::optional > > operator()( const Point_2 &query_point, std::vector &output_vector) { output_vector.reserve(output_vector.size() + 2); @@ -327,7 +327,7 @@ namespace Barycentric_coordinates { // Compute segment coordinates. template - boost::optional segment_coordinates_2( + std::optional segment_coordinates_2( const Point_2 &query_point, OutputIterator &output) { // Project point on the segment and compute the first coordinate. @@ -341,7 +341,7 @@ namespace Barycentric_coordinates { ++output; // Output both coordinates. - return boost::optional(output); + return std::optional(output); } }; diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/triangle_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/triangle_coordinates_2.h index 33dd658db9a..bc681d3bf38 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/triangle_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/triangle_coordinates_2.h @@ -257,7 +257,7 @@ namespace Barycentric_coordinates { /// Computes triangle barycentric coordinates for a chosen query point with respect to all three vertices of the triangle. /// Computed coordinates are stored in the output iterator `output`. template - inline boost::optional operator()( + inline std::optional operator()( const Point_2 &query_point, OutputIterator output) { return triangle_coordinates_2(query_point, output); @@ -298,7 +298,7 @@ namespace Barycentric_coordinates { // This function accepts a container of the type `std::vector` // and returns an iterator of the type `std::back_insert_iterator` // that is placed past-the-end of the resulting sequence of coordinate values. - inline boost::optional > > operator()( + inline std::optional > > operator()( const Point_2 &query_point, std::vector &output_vector) { output_vector.reserve(output_vector.size() + 3); @@ -347,7 +347,7 @@ namespace Barycentric_coordinates { // Compute triangle coordinates. template - boost::optional triangle_coordinates_2( + std::optional triangle_coordinates_2( const Point_2 &query_point, OutputIterator &output) { // Compute some related sub-areas. @@ -372,7 +372,7 @@ namespace Barycentric_coordinates { ++output; // Output all coordinates. - return boost::optional(output); + return std::optional(output); } }; diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp index c19f597f43f..b34ca8c2909 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp @@ -19,7 +19,7 @@ typedef CGAL::Barycentric_coordinates::Triangle_coordinates_2 Triangle_c typedef CGAL::Barycentric_coordinates::Discrete_harmonic_2 Discrete_harmonic; typedef CGAL::Barycentric_coordinates::Generalized_barycentric_coordinates_2 Discrete_harmonic_coordinates; -typedef boost::optional Output_type; +typedef std::optional Output_type; using std::cout; using std::endl; using std::string; diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp index 25436a0bd6e..c4bac5497a4 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp @@ -19,7 +19,7 @@ typedef CGAL::Barycentric_coordinates::Triangle_coordinates_2 Triangle_c typedef CGAL::Barycentric_coordinates::Mean_value_2 Mean_value; typedef CGAL::Barycentric_coordinates::Generalized_barycentric_coordinates_2 Mean_value_coordinates; -typedef boost::optional Output_type; +typedef std::optional Output_type; using std::cout; using std::endl; using std::string; diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp index d0b363c7a7e..9b39a907f43 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp @@ -12,7 +12,7 @@ typedef std::back_insert_iterator Vector_insert_iterator; typedef CGAL::Barycentric_coordinates::Segment_coordinates_2 Segment_coordinates; -typedef boost::optional Output_type; +typedef std::optional Output_type; using std::cout; using std::endl; using std::string; diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp index e37784a8adb..bd83f52a5bd 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp @@ -12,7 +12,7 @@ typedef std::back_insert_iterator Vector_insert_iterator; typedef CGAL::Barycentric_coordinates::Triangle_coordinates_2 Triangle_coordinates; -typedef boost::optional Output_type; +typedef std::optional Output_type; using std::cout; using std::endl; using std::string; diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp index a44bdb5391d..ae349dffb76 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp @@ -19,7 +19,7 @@ typedef CGAL::Barycentric_coordinates::Triangle_coordinates_2 Triangle_c typedef CGAL::Barycentric_coordinates::Wachspress_2 Wachspress; typedef CGAL::Barycentric_coordinates::Generalized_barycentric_coordinates_2 Wachspress_coordinates; -typedef boost::optional Output_type; +typedef std::optional Output_type; using std::cout; using std::endl; using std::string; diff --git a/Cartesian_kernel/include/CGAL/Cartesian_converter.h b/Cartesian_kernel/include/CGAL/Cartesian_converter.h index 916697a972d..c2e9806c2bb 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian_converter.h +++ b/Cartesian_kernel/include/CGAL/Cartesian_converter.h @@ -140,11 +140,11 @@ public: // visit to get the type, and copy construct inside the return type template typename - Type_mapper< boost::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >, + Type_mapper< std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >, K1, K2 >::type - operator()(const boost::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { + operator()(const std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { typedef typename - Type_mapper< boost::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >, + Type_mapper< std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >, K1, K2 >::type result_type; result_type res; if(!o) { diff --git a/Circulator/include/CGAL/Circulator/Safe_circulator_from_iterator.h b/Circulator/include/CGAL/Circulator/Safe_circulator_from_iterator.h index 17b05f8cffb..f1642bce862 100644 --- a/Circulator/include/CGAL/Circulator/Safe_circulator_from_iterator.h +++ b/Circulator/include/CGAL/Circulator/Safe_circulator_from_iterator.h @@ -22,7 +22,7 @@ #include -#include +#include #include @@ -53,9 +53,9 @@ public: private: - boost::optional m_begin; - boost::optional m_end; - boost::optional m_current; + std::optional m_begin; + std::optional m_end; + std::optional m_current; bool m_empty; public: diff --git a/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h b/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h index 2c1bb194951..9ba9d483d82 100644 --- a/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h +++ b/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h @@ -26,6 +26,6 @@ Halfspaces are considered as lower halfspaces, that is if the plane equation is template void halfspace_intersection_3 (PlaneIterator begin, PlaneIterator end, PolygonMesh &pm, - boost::optional::value_type>::Kernel::Point_3> > origin = boost::none); + std::optional::value_type>::Kernel::Point_3> > origin = std::nullopt); } /* namespace CGAL */ diff --git a/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h b/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h index a234d1905ca..76cd8dff9f3 100644 --- a/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h +++ b/Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h @@ -25,7 +25,7 @@ template void halfspace_intersection_with_constructions_3(PlaneIterator pbegin, PlaneIterator pend, PolygonMesh &pm, - boost::optional::value_type>::Kernel::Point_3> > origin = boost::none, + std::optional::value_type>::Kernel::Point_3> > origin = std::nullopt, const Traits & ch_traits = Default_traits); } /* namespace CGAL */ diff --git a/Convex_hull_3/examples/Convex_hull_3/lloyd_algorithm.cpp b/Convex_hull_3/examples/Convex_hull_3/lloyd_algorithm.cpp index 4976b5e4a04..75d8847375d 100644 --- a/Convex_hull_3/examples/Convex_hull_3/lloyd_algorithm.cpp +++ b/Convex_hull_3/examples/Convex_hull_3/lloyd_algorithm.cpp @@ -170,7 +170,7 @@ void lloyd_algorithm (PolyIterator poly_begin, CGAL::halfspace_intersection_3(planes.begin(), planes.end(), P, - boost::make_optional(vit->point())); + std::make_optional(vit->point())); // Centroid apply_function_object_polyhedron(P, centroid_acc); 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 16a685e08dd..7a1921c698d 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 @@ -67,7 +67,7 @@ namespace CGAL // Typedefs for intersection typedef typename Kernel::Plane_3 Plane_3; typedef typename Kernel::Line_3 Line_3; - typedef boost::optional< boost::variant< Point_3, + typedef std::optional< boost::variant< Point_3, Line_3, Plane_3 > > result_inter; @@ -228,7 +228,7 @@ namespace CGAL template void halfspace_intersection_3 (PlaneIterator begin, PlaneIterator end, Polyhedron &P, - boost::optional::value_type>::Kernel::Point_3> origin = boost::none) { + std::optional::value_type>::Kernel::Point_3> origin = std::nullopt) { // Checks whether the intersection is a polyhedron CGAL_assertion_msg(Convex_hull_3::internal::is_intersection_dim_3(begin, end), "halfspace_intersection_3: intersection not a polyhedron"); @@ -242,8 +242,8 @@ namespace CGAL // find a point inside the intersection origin = halfspace_intersection_interior_point_3(begin, end); - CGAL_assertion_msg(origin!=boost::none, "halfspace_intersection_3: problem when determining a point inside the intersection"); - if (origin==boost::none) + CGAL_assertion_msg(origin!=std::nullopt, "halfspace_intersection_3: problem when determining a point inside the intersection"); + if (origin==std::nullopt) return; } @@ -273,7 +273,7 @@ namespace CGAL void halfspace_intersection_3 (PlaneIterator begin, PlaneIterator end, Polyhedron &P, typename Kernel_traits::value_type>::Kernel::Point_3 const& origin) { - halfspace_intersection_3(begin, end , P, boost::make_optional(origin)); + halfspace_intersection_3(begin, end , P, std::make_optional(origin)); } #endif } // namespace CGAL diff --git a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_interior_point_3.h b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_interior_point_3.h index afdab1fdee0..db5b53247ab 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_interior_point_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_interior_point_3.h @@ -165,7 +165,7 @@ public: \ingroup PkgConvexHull3Functions computes a point belonging to the intersection of the halfspaces defined by the planes contained in the range `[begin, end)`. -If the intersection is empty, `boost::none` is returned. +If the intersection is empty, `std::nullopt` is returned. \attention Halfspaces are considered as lower halfspaces that is to say if the plane's equation is \f$ a\, x +b\, y +c\, z + d = 0 \f$ then the corresponding halfspace is defined by \f$ a\, x +b\, y +c\, z + d \le 0 \f$ . @@ -173,7 +173,7 @@ is \f$ a\, x +b\, y +c\, z + d = 0 \f$ then the corresponding halfspace is defin \tparam PlaneIterator must be an input iterator with the value type being a `Plane_3` object from \cgal Kernel */ template -boost::optional::value_type>::Kernel::Point_3> +std::optional::value_type>::Kernel::Point_3> halfspace_intersection_interior_point_3(PlaneIterator begin, PlaneIterator end) { // Types @@ -185,9 +185,9 @@ halfspace_intersection_interior_point_3(PlaneIterator begin, PlaneIterator end) // find a point inside the intersection internal::Interior_polyhedron_3 interior; if (!interior.find(begin, end)) - return boost::none; + return std::nullopt; - return boost::make_optional(interior.inside_point()); + return std::make_optional(interior.inside_point()); } } // namespace CGAL diff --git a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h index 4a0b9c26d44..d8946af7353 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h @@ -90,7 +90,7 @@ namespace CGAL void halfspace_intersection_with_constructions_3(PlaneIterator pbegin, PlaneIterator pend, Polyhedron &P, - boost::optional::value_type>::Kernel::Point_3> origin, + std::optional::value_type>::Kernel::Point_3> origin, const Traits & ch_traits) { typedef typename Kernel_traits::value_type>::Kernel K; typedef typename K::Point_3 Point; @@ -101,8 +101,8 @@ namespace CGAL // find a point inside the intersection origin = halfspace_intersection_interior_point_3(pbegin, pend); - CGAL_assertion_msg(origin!=boost::none, "halfspace_intersection_with_constructions_3: problem when determining a point inside the intersection"); - if (origin==boost::none) + CGAL_assertion_msg(origin!=std::nullopt, "halfspace_intersection_with_constructions_3: problem when determining a point inside the intersection"); + if (origin==std::nullopt) return; } @@ -134,7 +134,7 @@ namespace CGAL void halfspace_intersection_with_constructions_3 (PlaneIterator pbegin, PlaneIterator pend, Polyhedron &P, - boost::optional::value_type>::Kernel::Point_3> const& origin = boost::none) { + std::optional::value_type>::Kernel::Point_3> const& origin = std::nullopt) { typedef typename Kernel_traits::value_type>::Kernel K; typedef typename K::Point_3 Point_3; typedef typename Convex_hull_3::internal::Default_traits_for_Chull_3::type Traits; diff --git a/Convex_hull_3/test/Convex_hull_3/test_halfspace_intersections.cpp b/Convex_hull_3/test/Convex_hull_3/test_halfspace_intersections.cpp index a0eef18da7f..686a2b8c717 100644 --- a/Convex_hull_3/test/Convex_hull_3/test_halfspace_intersections.cpp +++ b/Convex_hull_3/test/Convex_hull_3/test_halfspace_intersections.cpp @@ -32,7 +32,7 @@ void test() CGAL::halfspace_intersection_3(planes.begin(), planes.end(), P1, - boost::make_optional(Point(0, 0, 0)) ); + std::make_optional(Point(0, 0, 0)) ); // test halfspace_intersection_3 with non point inside CGAL::halfspace_intersection_3(planes.begin(), @@ -43,7 +43,7 @@ void test() CGAL::halfspace_intersection_with_constructions_3( planes.begin(), planes.end(), P3, - boost::make_optional(Point(0, 0, 0)) ); + std::make_optional(Point(0, 0, 0)) ); // test halfspace_intersection_with_constructions_3 with non point inside CGAL::halfspace_intersection_with_constructions_3( planes.begin(), @@ -54,7 +54,7 @@ void test() CGAL::halfspace_intersection_with_constructions_3( planes.begin(), planes.end(), P5, - boost::optional(), + std::optional(), K()); assert(num_vertices(P1)==8 && num_faces(P1)==6); diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2.h index fc2f04a27ec..433a6a4949c 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h index 9503e338311..af0f793f4ed 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h @@ -19,7 +19,7 @@ * Definitions of the functions of the Envelope_divide_and_conquer_2 class. */ -#include +#include namespace CGAL { @@ -610,8 +610,8 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, // The intersection points/curves that interest us are the ones in // [v_leftmost, v]. // Without using make_optional we get a "maybe uninitialized" warning with gcc -Wall - boost::optional v_leftmost = - boost::make_optional(false, Vertex_const_handle()); + std::optional v_leftmost = + std::make_optional(false, Vertex_const_handle()); if (is_leftmost1 == true) { if (is_leftmost2 == false) diff --git a/Filtered_kernel/include/CGAL/Filtered_predicate_with_state.h b/Filtered_kernel/include/CGAL/Filtered_predicate_with_state.h index c0b2e2179ca..991fe8247b5 100644 --- a/Filtered_kernel/include/CGAL/Filtered_predicate_with_state.h +++ b/Filtered_kernel/include/CGAL/Filtered_predicate_with_state.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include namespace CGAL { @@ -31,7 +31,7 @@ class Filtered_predicate_with_state C2E c2e; C2A c2a; O1 o1; - mutable boost::optional oep; + mutable std::optional oep; AP ap; typedef typename AP::result_type Ares; diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index e7024f6220b..c9ff97618c3 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -30,7 +30,7 @@ #include #include -#include +#include #include #ifdef CGAL_LAZY_KERNEL_DEBUG # include @@ -1196,7 +1196,7 @@ struct Lazy_construction_optional_for_polygonal_envelope typedef typename LK::Approximate_kernel AK; typedef typename LK::Exact_kernel EK; typedef typename LK::E2A E2A; - typedef boost::optional result_type; + typedef std::optional result_type; CGAL_NO_UNIQUE_ADDRESS AC ac; CGAL_NO_UNIQUE_ADDRESS EC ec; @@ -1209,9 +1209,9 @@ struct Lazy_construction_optional_for_polygonal_envelope { Protect_FPU_rounding P; try { - boost::optional oap = ac(CGAL::approx(l1),CGAL::approx(l2),CGAL::approx(l3)); - if(oap == boost::none){ - return boost::none; + std::optional oap = ac(CGAL::approx(l1),CGAL::approx(l2),CGAL::approx(l3)); + if(oap == std::nullopt){ + return std::nullopt; } // Now we have to construct a rep for a lazy point with the three lazy planes. typedef Lazy_rep_optional_n LazyPointRep; @@ -1221,21 +1221,21 @@ struct Lazy_construction_optional_for_polygonal_envelope // rep = LazyPointRep(2,ap, ec, l1, l2, l3); rep.~LazyPointRep(); new (&rep) LazyPointRep(2, ap, ec, l1, l2, l3); typename LK::Point_3 lp(&rep); - return boost::make_optional(lp); + return std::make_optional(lp); } catch (Uncertain_conversion_exception&) {} } Protect_FPU_rounding P2(CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); - boost::optional oep = ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3)); - if(oep == boost::none){ - return boost::none; + std::optional oep = ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3)); + if(oep == std::nullopt){ + return std::nullopt; } typedef Lazy_rep_0 LazyPointRep; const typename EK::Point_3 ep = *oep; LazyPointRep *rep = new LazyPointRep(ep); typename LK::Point_3 lp(rep); - return boost::make_optional(lp); + return std::make_optional(lp); } // for Intersect_point_3 with Plane_3 Line_3 @@ -1246,9 +1246,9 @@ struct Lazy_construction_optional_for_polygonal_envelope { Protect_FPU_rounding P; try { - boost::optional oap = ac(CGAL::approx(l1),CGAL::approx(l2)); - if(oap == boost::none){ - return boost::none; + std::optional oap = ac(CGAL::approx(l1),CGAL::approx(l2)); + if(oap == std::nullopt){ + return std::nullopt; } // Now we have to construct a rep for a lazy point with the line and the plane. typedef Lazy_rep_optional_n LazyPointRep; @@ -1258,21 +1258,21 @@ struct Lazy_construction_optional_for_polygonal_envelope // rep = LazyPointRep(2, ap, ec, l1, l2); rep.~LazyPointRep(); new (&rep) LazyPointRep(2, ap, ec, l1, l2); typename LK::Point_3 lp(&rep); - return boost::make_optional(lp); + return std::make_optional(lp); } catch (Uncertain_conversion_exception&) {} } Protect_FPU_rounding P2(CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); - boost::optional oep = ec(CGAL::exact(l1), CGAL::exact(l2)); - if(oep == boost::none){ - return boost::none; + std::optional oep = ec(CGAL::exact(l1), CGAL::exact(l2)); + if(oep == std::nullopt){ + return std::nullopt; } typedef Lazy_rep_0 LazyPointRep; const typename EK::Point_3 ep = *oep; LazyPointRep *rep = new LazyPointRep(ep); typename LK::Point_3 lp(rep); - return boost::make_optional(lp); + return std::make_optional(lp); } }; @@ -1427,7 +1427,7 @@ struct Ith_for_intersection_with_variant { template< BOOST_VARIANT_ENUM_PARAMS(typename U) > const T2& - operator()(const boost::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const + operator()(const std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { const std::vector* ptr = (boost::get >(&(*o))); return (*ptr)[i]; @@ -1858,7 +1858,7 @@ struct Variant_cast { template const T& - operator()(const boost::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { + operator()(const std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { // can throw but should never because we always build it inside // a static visitor with the right type return boost::get(*o); @@ -1866,7 +1866,7 @@ struct Variant_cast { template T& - operator()(boost::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { + operator()(std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { // can throw but should never because we always build it inside // a static visitor with the right type, if it throws bad_get return boost::get(*o); diff --git a/Filtered_kernel/include/CGAL/Lazy_kernel.h b/Filtered_kernel/include/CGAL/Lazy_kernel.h index 08a6ebb41a0..6979b6f7b0c 100644 --- a/Filtered_kernel/include/CGAL/Lazy_kernel.h +++ b/Filtered_kernel/include/CGAL/Lazy_kernel.h @@ -178,7 +178,7 @@ private: // The case distinction goes as follows: // result_type == FT => NT // result_type == Object => Object - // result_type == boost::optional => OPTIONAL_ Only for Intersect_point_3_for_polyhedral_envelope which returns a handle for a singleton + // result_type == std::optional => OPTIONAL_ Only for Intersect_point_3_for_polyhedral_envelope which returns a handle for a singleton // result_type == Bbox_2 || result_type == Bbox_3 => BBOX // default => NONE // no result_type => NONE @@ -188,7 +188,7 @@ private: // specializations inside a non-namespace scope. // The default implementation does some default handling, // the special cases are filtered by partial specializations. - template + template struct Lazy_wrapper_traits : boost::mpl::eval_if< internal::Has_result_type, boost::mpl::eval_if< std::is_same< typename boost::remove_cv< diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 486f43ea21f..386d2a27202 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -11,6 +11,7 @@ Release date: October 2023 - **Breaking change**: C++17 is now required - Support for Visual `C++` 14.0 (Visual studio 2015) is dropped. - **Breaking change**: The usage of `boost::shared_ptr` has been replaced by `std::shared_ptr`. Packages affected are 2D Straight Line Skeleton and Shape Detection. +- **Breaking change**: The usage of `boost::optional` has been replaced by `std::optional`. Packages affected are 2D Straight Line Skeleton, 3D Fast Intersection and Distance Computation (AABB Tree), and the Kernel intersection. [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) diff --git a/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp b/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp index 11416d859b7..a7765e4b3c1 100644 --- a/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp +++ b/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -27,7 +27,7 @@ struct Intersection_traits; template struct Intersection_traits { typedef typename boost::variant variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; @@ -53,7 +53,7 @@ OutputIterator intersect_do_iterator(const typename K::Segment_2 &seg1, template -boost::optional< +std::optional< boost::variant > intersection_variant(const typename K::Segment_2 &seg1, @@ -63,7 +63,7 @@ intersection_variant(const typename K::Segment_2 &seg1, typedef CGAL::internal::Segment_2_Segment_2_pair is_t; typedef boost::variant Variant; - typedef boost::optional OptVariant; + typedef std::optional OptVariant; is_t ispair(&seg1, &seg2); switch (ispair.intersection_type()) { diff --git a/Intersections_2/include/CGAL/Intersection_traits.h b/Intersections_2/include/CGAL/Intersection_traits.h index 3bfb327db9e..ca313a2c852 100644 --- a/Intersections_2/include/CGAL/Intersection_traits.h +++ b/Intersections_2/include/CGAL/Intersection_traits.h @@ -27,7 +27,7 @@ struct Intersection_traits { \ typedef typename boost::variant \ variant_type; \ - typedef typename boost::optional< variant_type > result_type; \ + typedef typename std::optional< variant_type > result_type; \ }; #define CGAL_INTERSECTION_TRAITS_3(A, B, R1, R2, R3) \ @@ -35,7 +35,7 @@ struct Intersection_traits { \ typedef typename boost::variant variant_type; \ - typedef typename boost::optional< variant_type > result_type; \ + typedef typename std::optional< variant_type > result_type; \ }; #define CGAL_INTERSECTION_FUNCTION(A, B, DIM) \ @@ -120,7 +120,7 @@ const T* intersect_get(const CGAL::Object& o) { template inline -const T* intersect_get(const boost::optional< boost::variant >& v) { +const T* intersect_get(const std::optional< boost::variant >& v) { return boost::get(&*v); } diff --git a/Intersections_2/include/CGAL/Intersection_traits_2.h b/Intersections_2/include/CGAL/Intersection_traits_2.h index 921405c27f9..df4d10a6c2a 100644 --- a/Intersections_2/include/CGAL/Intersection_traits_2.h +++ b/Intersections_2/include/CGAL/Intersection_traits_2.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -51,7 +51,7 @@ struct Intersection_traits { typedef typename boost::variant< typename K::Point_2, typename K::Segment_2, typename K::Triangle_2, typename std::vector< typename K::Point_2 > > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; @@ -70,7 +70,7 @@ CGAL_INTERSECTION_TRAITS_2(Ray_2, Iso_rectangle_2, Point_2, Segment_2) template struct Intersection_traits { typedef typename boost::variant variant_type; - typedef boost::optional result_type; + typedef std::optional result_type; }; @@ -78,19 +78,19 @@ struct Intersection_traits struct Intersection_traits { typedef typename boost::variant variant_type; - typedef boost::optional result_type; + typedef std::optional result_type; }; template struct Intersection_traits { typedef typename boost::variant variant_type; - typedef boost::optional result_type; + typedef std::optional result_type; }; template struct Intersection_traits { typedef typename boost::variant variant_type; - typedef boost::optional result_type; + typedef std::optional result_type; }; template @@ -99,7 +99,7 @@ struct Intersection_traits > variant_type; - typedef typename boost::optional < variant_type > result_type; + typedef typename std::optional < variant_type > result_type; }; template @@ -119,13 +119,13 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename boost::variant variant_type; - typedef boost::optional result_type; + typedef std::optional result_type; }; template struct Intersection_traits { typedef typename boost::variant variant_type; - typedef boost::optional result_type; + typedef std::optional result_type; }; } // namespace CGAL diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Bbox_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Bbox_2.h index 9b75f968c2e..4081086aa1c 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Bbox_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Bbox_2.h @@ -25,13 +25,13 @@ do_intersect(const CGAL::Bbox_2& c, return CGAL::do_overlap(c, bbox); } -typename boost::optional< typename boost::variant > +typename std::optional< typename boost::variant > inline intersection(const CGAL::Bbox_2& a, const CGAL::Bbox_2& b) { typedef typename boost::variant variant_type; - typedef typename boost::optional result_type; + typedef typename std::optional result_type; if(!do_intersect(a, b)) return result_type(); diff --git a/Intersections_3/include/CGAL/Intersection_traits_3.h b/Intersections_3/include/CGAL/Intersection_traits_3.h index 85287e8c044..a72f5cac923 100644 --- a/Intersections_3/include/CGAL/Intersection_traits_3.h +++ b/Intersections_3/include/CGAL/Intersection_traits_3.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -86,7 +86,7 @@ struct Intersection_traits { typedef typename boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, typename std::vector< typename K::Point_3 > > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; @@ -109,7 +109,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Iso_cuboid_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; @@ -119,7 +119,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Segment_3, typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; template @@ -149,7 +149,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Bbox_3 Point_3, variant of one @@ -157,14 +157,14 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; @@ -173,7 +173,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Iso_cuboid_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; template @@ -185,7 +185,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Iso_cuboid_3 Plane_3, variant of 4 @@ -195,7 +195,7 @@ struct Intersection_traits { boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; template @@ -204,7 +204,7 @@ struct Intersection_traits { boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Iso_cuboid_3 Triangle_3, variant of 4 @@ -214,7 +214,7 @@ struct Intersection_traits boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; template @@ -223,7 +223,7 @@ struct Intersection_traits boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Bbox_3 Plane_3, variant of 4 @@ -233,7 +233,7 @@ struct Intersection_traits { boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; template @@ -242,7 +242,7 @@ struct Intersection_traits { boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Bbox_3 Triangle_3, variant of 4 @@ -252,7 +252,7 @@ struct Intersection_traits { boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; template @@ -261,7 +261,7 @@ struct Intersection_traits { boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Point_3 Line_3, variant of one @@ -269,7 +269,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Line_3 Point_3, variant of one @@ -277,7 +277,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Point_3 Ray_3, variant of one @@ -285,7 +285,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Ray_3 Point_3, variant of one @@ -293,7 +293,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Point_3 Segment_3, variant of one @@ -301,7 +301,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Segment_3 Point_3, variant of one @@ -309,7 +309,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Point_3 Point_3, variant of one @@ -317,7 +317,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Point_3 Plane_3, variant of one @@ -325,7 +325,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Plane_3 Point_3, variant of one @@ -333,7 +333,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Point_3 Triangle_3, variant of one @@ -341,7 +341,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Triangle_3 Point_3, variant of one @@ -349,7 +349,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Point_3 Tetrahedron_3, variant of one @@ -357,7 +357,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Tetrahedron_3 Point_3, variant of one @@ -365,7 +365,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Point_3 Sphere_3, variant of one @@ -373,7 +373,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Sphere_3 Point_3, variant of one @@ -381,7 +381,7 @@ template struct Intersection_traits { typedef typename boost::variant< typename K::Point_3 > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; //Tetrahedron_3 Plane_3, variant of 4 @@ -391,7 +391,7 @@ struct Intersection_traits typedef typename boost::variant< typename K::Point_3 , typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; //Plane_3 Tetrahedron_3, variant of 4 @@ -401,7 +401,7 @@ struct Intersection_traits typedef typename boost::variant< typename K::Point_3 , typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; //Triangle_3 Tetrahedron_3, variant of 4 @@ -411,7 +411,7 @@ struct Intersection_traits typedef typename boost::variant< typename K::Point_3 , typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; // Tetrahedron_3 Triangle_3, variant of 4 @@ -421,7 +421,7 @@ struct Intersection_traits typedef typename boost::variant< typename K::Point_3 , typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; - typedef typename boost::optional< variant_type > result_type; + typedef typename std::optional< variant_type > result_type; }; 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 bb244628c5a..44af7d691c0 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 @@ -24,7 +24,7 @@ #include -#include +#include #include #include @@ -39,13 +39,13 @@ do_intersect(const CGAL::Bbox_3& c, return CGAL::do_overlap(c, bbox); } -typename boost::optional< typename boost::variant< Bbox_3> > +typename std::optional< typename boost::variant< Bbox_3> > inline intersection(const CGAL::Bbox_3& a, const CGAL::Bbox_3& b) { typedef typename boost::variant variant_type; - typedef typename boost::optional result_type; + typedef typename std::optional result_type; if(!do_intersect(a,b)) return result_type(); diff --git a/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h index ec3806b41f7..5689ce58935 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Line_3_Plane_3.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace CGAL { @@ -36,7 +36,7 @@ CGAL_INTERSECTION_FUNCTION(Line_3, Plane_3, 3) template inline -boost::optional +std::optional intersection_point_for_polyhedral_envelope(const Plane_3& plane, const Line_3& line) { @@ -45,7 +45,7 @@ intersection_point_for_polyhedral_envelope(const Plane_3& plane, template inline -boost::optional +std::optional intersection_point_for_polyhedral_envelope(const Line_3& line, const Plane_3& plane) { 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 3030089906c..9d7351039ff 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 @@ -52,7 +52,7 @@ intersection(const Plane_3& plane1, template inline -boost::optional +std::optional intersection_point_for_polyhedral_envelope(const Plane_3& p0, const Plane_3& p1, const Plane_3& p2) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_intersection.h index a82d17dd759..df219948c4e 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_intersection.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -34,7 +34,7 @@ namespace internal { // But it must be a template function since the original kernel must be // taken into account. template -typename boost::optional< boost::variant > +typename std::optional< boost::variant > intersection_bl(const Bbox_3& box, double lpx, double lpy, double lpz, double ldx, double ldy, double ldz, @@ -45,7 +45,7 @@ intersection_bl(const Bbox_3& box, typedef typename K::Vector_3 Vector_3; typedef typename K::Segment_3 Segment_3; - typedef typename boost::optional > result_type; + typedef typename std::optional > result_type; double seg_min = 0.0, seg_max = 1.0; // first on x value diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h index b052243ff0c..7349337fc84 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h @@ -180,7 +180,7 @@ intersection(const typename K::Iso_cuboid_3& cub, } if (all_in || all_out) - return boost::none; + return std::nullopt; if (start_id == -1) return { result_type(corners[solo_id]) }; diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Plane_3_intersection.h index d14c119b56e..737205703e3 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Plane_3_intersection.h @@ -24,7 +24,7 @@ namespace Intersections { namespace internal { template -boost::optional +std::optional intersection_point(const typename K::Plane_3& plane, const typename K::Line_3& line, const K& /*k*/) @@ -41,9 +41,9 @@ intersection_point(const typename K::Plane_3& plane, RT den = plane.a()*line_dir.dx() + plane.b()*line_dir.dy() + plane.c()*line_dir.dz(); if(den == 0) - return boost::none; + return std::nullopt; - return boost::make_optional(Point_3(den*line_pt.hx()-num*line_dir.dx(), + return std::make_optional(Point_3(den*line_pt.hx()-num*line_dir.dx(), den*line_pt.hy()-num*line_dir.dy(), den*line_pt.hz()-num*line_dir.dz(), wmult_hw((K*)0, den, line_pt))); diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_intersection.h index be6ca11f069..bdc881bf75a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_intersection.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -27,7 +27,7 @@ namespace internal { // triple plane intersection template -boost::optional +std::optional intersection_point(const typename K::Plane_3& plane1, const typename K::Plane_3& plane2, const typename K::Plane_3& plane3, @@ -56,7 +56,7 @@ intersection_point(const typename K::Plane_3& plane1, const FT den = minor_0*m22 - minor_1*m12 + minor_2*m02; // determinant of M if(is_zero(den)){ - return boost::none; + return std::nullopt; } const FT num3 = minor_0*b2 - minor_1*b1 + minor_2*b0; // determinant of M with M[x:2] swapped with [b0,b1,b2] @@ -70,17 +70,17 @@ intersection_point(const typename K::Plane_3& plane1, const FT num1 = - minor_3*m21 + minor_4*m11 - minor_5*m01; // determinant of M with M[x:0] swapped with [b0,b1,b2] const FT num2 = minor_3*m20 - minor_4*m10 + minor_5*m00; // determinant of M with M[x:1] swapped with [b0,b1,b2] - return boost::make_optional(typename K::Point_3(num1/den, num2/den, num3/den)); + return std::make_optional(typename K::Point_3(num1/den, num2/den, num3/den)); } template -boost::optional > +std::optional > intersection(const typename K::Plane_3& plane1, const typename K::Plane_3& plane2, const typename K::Plane_3& plane3, const K& k) { - typedef typename boost::optional > result_type; diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Tetrahedron_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Tetrahedron_3_intersection.h index 37e092956d7..0a1afefb0ea 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Tetrahedron_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Tetrahedron_3_intersection.h @@ -164,7 +164,7 @@ intersection(const typename K::Tetrahedron_3& tet, } if (all_in || all_out) - return boost::none; + return std::nullopt; if (start_id == -1) return { result_type(corners[solo_id]) }; diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_intersection.h index 35983013bba..5eeb8d85c8e 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_intersection.h @@ -396,7 +396,7 @@ intersection_coplanar(const typename K::Triangle_3& t, template inline -typename boost::optional +typename std::optional t3r3_intersection_aux(const typename K::Triangle_3& t, const typename K::Ray_3& r, const K& k) @@ -410,7 +410,7 @@ t3r3_intersection_aux(const typename K::Triangle_3& t, return *p; } - return boost::optional(); + return std::optional(); } template @@ -455,7 +455,7 @@ intersection(const typename K::Triangle_3& t, if ( orientation(p,q,a,b) != POSITIVE && orientation(p,q,b,c) != POSITIVE && orientation(p,q,c,a) != POSITIVE ) { - boost::optional op = t3r3_intersection_aux(t,r,k); + std::optional op = t3r3_intersection_aux(t,r,k); if(op) return intersection_return(*op); else return intersection_return(); } @@ -476,7 +476,7 @@ intersection(const typename K::Triangle_3& t, if ( orientation(q,p,a,b) != POSITIVE && orientation(q,p,b,c) != POSITIVE && orientation(q,p,c,a) != POSITIVE ) { - boost::optional op = t3r3_intersection_aux(t,r,k); + std::optional op = t3r3_intersection_aux(t,r,k); if(op) return intersection_return(*op); else return intersection_return(); } @@ -502,7 +502,7 @@ intersection(const typename K::Triangle_3& t, && orientation(q,p,b,c) != POSITIVE && orientation(q,p,c,a) != POSITIVE ) { - boost::optional op = t3r3_intersection_aux(t,r,k); + std::optional op = t3r3_intersection_aux(t,r,k); if(op) return intersection_return(*op); else return intersection_return(); } @@ -515,7 +515,7 @@ intersection(const typename K::Triangle_3& t, && orientation(p,q,b,c) != POSITIVE && orientation(p,q,c,a) != POSITIVE ) { - boost::optional op = t3r3_intersection_aux(t,r,k); + std::optional op = t3r3_intersection_aux(t,r,k); if(op) return intersection_return(*op); else return intersection_return(); } 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 49bc573489e..e3668392be0 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 @@ -148,7 +148,7 @@ intersection(const typename K::Tetrahedron_3& tet, supporting_planes.swap(current_sp); if (res.empty()) - return boost::none; + return std::nullopt; } switch(res.size()) 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 6f45f6200e6..29b21af670f 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Tetrahedron_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Tetrahedron_3.cpp @@ -322,7 +322,7 @@ public: 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); + assert(res != std::nullopt); const std::vector

    *vps = boost::get>(&*res); assert(vps!=nullptr); } diff --git a/Kernel_23/doc/Kernel_23/CGAL/Projection_traits_xy_3.h b/Kernel_23/doc/Kernel_23/CGAL/Projection_traits_xy_3.h index ab57d5cfb67..88afb8e5bff 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Projection_traits_xy_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Projection_traits_xy_3.h @@ -81,7 +81,7 @@ typedef Line_3 Line_2; A construction object. Provides the operator : -`boost::optional< boost::variant > operator()(Segment_2 s1, Segment_2 s2);` +`std::optional< boost::variant > operator()(Segment_2 s1, Segment_2 s2);` which returns a 3D object whose projection on the xy-plane is the intersection of the projections of `s1` and `s2`. If non empty, the returned object is either a segment or a point. diff --git a/Kernel_23/doc/Kernel_23/CGAL/intersections.h b/Kernel_23/doc/Kernel_23/CGAL/intersections.h index 1b6c85341a3..430e37cbcc0 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/intersections.h +++ b/Kernel_23/doc/Kernel_23/CGAL/intersections.h @@ -103,7 +103,7 @@ The following tables give the possible values for `Type1` and `Type2`. The return type of intersecting two objects of the types `Type1` and `Type2` can be specified through the placeholder type specifier `auto`. It is equivalent to -`boost::optional< boost::variant< T... > >`, the last column in the table providing +`std::optional< boost::variant< T... > >`, the last column in the table providing the template parameter pack.

    @@ -193,7 +193,7 @@ the template parameter pack.
    Additional overloads are provided for the type `Point_2` combined with any other type with the result type being -`boost::optional< boost::variant< Point_2 > >`. +`std::optional< boost::variant< Point_2 > >`. Overloads are also provided for the type `Bbox_2`, for all intersections existing with the type `Iso_rectangle_2`. Note that the return type for `Bbox_2` - `Bbox_2` is `Bbox_2` and not `Iso_rectangle_2`. @@ -202,7 +202,7 @@ intersections existing with the type `Iso_rectangle_2`. Note that the return typ The return type of intersecting two objects of the types `Type1` and `Type2` can be specified through the placeholder type specifier `auto`. It is equivalent to -`boost::optional< boost::variant< T... > >`, the last column in the table providing +`std::optional< boost::variant< T... > >`, the last column in the table providing the template parameter pack.
    @@ -351,7 +351,7 @@ the template parameter pack.
    Additional overloads are provided for the type `Point_3` combined with any other type with the result type being -`boost::optional< boost::variant< Point_3 > >`. Overloads are also provided for the type `Bbox_3`, for all +`std::optional< boost::variant< Point_3 > >`. Overloads are also provided for the type `Bbox_3`, for all intersections existing with the type `Iso_cuboid_3`. Note that the return type for `Bbox_3` - `Bbox_3` is `Bbox_3` and not `Iso_cuboid_3`. @@ -363,10 +363,10 @@ The following examples demonstrate the most common use of In the first two examples we intersect a segment and a line. The result type can be specified through the placeholder type specifier `auto`, -but you must anyway know that the result type is a `boost::optional >`, +but you must anyway know that the result type is a `std::optional >`, in order to unpack the point or segment. -`boost::optional` comes in +`std::optional` comes in as there might be no intersection. `boost::variant` comes in as, if there is an intersection, it is either a point or a segment. diff --git a/Kernel_23/doc/Kernel_23/Kernel_23.txt b/Kernel_23/doc/Kernel_23/Kernel_23.txt index 51eeea986db..451829f8eae 100644 --- a/Kernel_23/doc/Kernel_23/Kernel_23.txt +++ b/Kernel_23/doc/Kernel_23/Kernel_23.txt @@ -495,7 +495,7 @@ especially integer types and rationals. Some functions, for example \link intersection_linear_grp `intersection()`\endlink, can return different types of objects. To achieve this in a type-safe way \cgal uses -return values of type `boost::optional< boost::variant< T... > >` where `T...` is a +return values of type `std::optional< boost::variant< T... > >` where `T...` is a list of all possible resulting geometric objects. The exact result type of an intersection can be specified through the placeholder type specifier `auto`. diff --git a/Kernel_23/include/CGAL/Kernel/Type_mapper.h b/Kernel_23/include/CGAL/Kernel/Type_mapper.h index 683b7fe9255..a33224fcd59 100644 --- a/Kernel_23/include/CGAL/Kernel/Type_mapper.h +++ b/Kernel_23/include/CGAL/Kernel/Type_mapper.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -54,8 +54,8 @@ struct Type_mapper_impl, K1, K2 > { }; template < typename T, typename K1, typename K2 > -struct Type_mapper_impl, K1, K2 > { - typedef boost::optional< typename Type_mapper_impl::type > type; +struct Type_mapper_impl, K1, K2 > { + typedef std::optional< typename Type_mapper_impl::type > type; }; diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 07468ad23a8..29d74179a87 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -1764,7 +1764,7 @@ namespace CommonKernelFunctors { Line l2 = construct_line(l21, l22); const auto res = typename K::Intersect_3()(l1,l2); - CGAL_assertion(res!=boost::none); + CGAL_assertion(res!=std::nullopt); const Point* e_pt = boost::get(&(*res)); CGAL_assertion(e_pt!=nullptr); return *e_pt; @@ -2172,7 +2172,7 @@ namespace CommonKernelFunctors { Line line = construct_line( l1, l2 ); const auto res = typename K::Intersect_3()(plane,line); - CGAL_assertion(res!=boost::none); + CGAL_assertion(res!=std::nullopt); const Point* e_pt = boost::get(&(*res)); CGAL_assertion(e_pt!=nullptr); return *e_pt; @@ -2185,7 +2185,7 @@ namespace CommonKernelFunctors { Line line = construct_line( l1, l2 ); const auto res = typename K::Intersect_3()(plane,line); - CGAL_assertion(res!=boost::none); + CGAL_assertion(res!=std::nullopt); const Point* e_pt = boost::get(&(*res)); CGAL_assertion(e_pt!=nullptr); return *e_pt; @@ -3618,7 +3618,7 @@ namespace CommonKernelFunctors { operator()(const T1& t1, const T2& t2) const { return Intersections::internal::intersection(t1, t2, K() ); } - boost::optional > + std::optional > operator()(const Plane_3& pl1, const Plane_3& pl2, const Plane_3& pl3)const { return Intersections::internal::intersection(pl1, pl2, pl3, K() ); } }; @@ -3635,7 +3635,7 @@ namespace CommonKernelFunctors { typedef typename K::Point_3 Point_3; typedef typename K::Line_3 Line_3; typedef typename K::Plane_3 Plane_3; - typedef typename boost::optional result_type; + typedef typename std::optional result_type; result_type operator()(const Plane_3& pl1, const Plane_3& pl2, const Plane_3& pl3) const 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 9f9896ac7eb..d1cb83d135d 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 @@ -428,7 +428,7 @@ public: - boost::optional< boost::variant > + std::optional< boost::variant > operator()(const Segment_3& s1, const Segment_3& s2) const { typedef boost::variant variant_type; @@ -447,7 +447,7 @@ public: auto o = intersection(s1_2,s2_2); if(! o){ - return boost::none; + return std::nullopt; } if(const Segment_2* si = boost::get(&*o)){ @@ -468,7 +468,7 @@ public: src[Projector::y_index] = si->source().y(); tgt[Projector::x_index] = si->target().x(); tgt[Projector::y_index] = si->target().y(); - return boost::make_optional(variant_type(Segment_3( Point_3(src[0],src[1],src[2]),Point_3(tgt[0],tgt[1],tgt[2]) ) ) ); + return std::make_optional(variant_type(Segment_3( Point_3(src[0],src[1],src[2]),Point_3(tgt[0],tgt[1],tgt[2]) ) ) ); } @@ -484,7 +484,7 @@ public: Point_3 res(coords[0],coords[1],coords[2]); CGAL_assertion(x(res)==pi->x() && y(res)==pi->y()); - return boost::make_optional(variant_type(res)); + return std::make_optional(variant_type(res)); } }; diff --git a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h index 42c3bc31859..873ad1bcb14 100644 --- a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h +++ b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h @@ -182,7 +182,7 @@ public: CGAL_TIME_PROFILER("Construct Projected_intersect_3") } - boost::optional > + std::optional > operator()(const Segment& s1, const Segment& s2) { CGAL_PROFILER("Projected_intersect_3::operator()") @@ -204,7 +204,7 @@ public: #ifdef CGAL_T2_PTB_3_DEBUG std::cerr << "planes_intersection is empty\n"; #endif - return boost::none; + return std::nullopt; } if(const Line* line = boost::get(&*planes_intersection)) { @@ -222,7 +222,7 @@ public: #ifdef CGAL_T2_PTB_3_DEBUG std::cerr << "intersection not inside\n"; #endif - return boost::none; + return std::nullopt; } else { @@ -233,10 +233,10 @@ public: cross_product(s1.to_vector(), s2.to_vector()))); if(! inter){ - return boost::none; + return std::nullopt; } if(const Point* point = boost::get(&*inter)){ - return boost::make_optional(variant_type(*point)); + return std::make_optional(variant_type(*point)); } } } @@ -255,50 +255,50 @@ public: bool src1_in_s2 = is_inside_segment(s2, s1.source()); bool tgt1_in_s2 = is_inside_segment(s2, s1.target()); - if (src1_in_s2 && tgt1_in_s2) return boost::make_optional(variant_type(s1)); - if (src2_in_s1 && tgt2_in_s1) return boost::make_optional(variant_type(s2)); + if (src1_in_s2 && tgt1_in_s2) return std::make_optional(variant_type(s1)); + if (src2_in_s1 && tgt2_in_s1) return std::make_optional(variant_type(s2)); if (src1_in_s2) { if (src2_in_s1) { if (cross_product(normal, Vector_3(s1.source(), s2.source())) != NULL_VECTOR) - return boost::make_optional(variant_type(Segment(s1.source(), s2.source()))); + return std::make_optional(variant_type(Segment(s1.source(), s2.source()))); else - return boost::make_optional(variant_type((s1.source()))); + return std::make_optional(variant_type((s1.source()))); } if (tgt2_in_s1) { if (cross_product(normal, Vector_3(s1.source(), s2.target())) != NULL_VECTOR) - return boost::make_optional(variant_type(Segment(s1.source(), s2.target()))); + return std::make_optional(variant_type(Segment(s1.source(), s2.target()))); else - return boost::make_optional(variant_type(s1.source())); + return std::make_optional(variant_type(s1.source())); } // should never get here with a Kernel with exact constructions - return boost::make_optional(variant_type(s1.source())); + return std::make_optional(variant_type(s1.source())); } if (tgt1_in_s2) { if (src2_in_s1) { if (cross_product(normal, Vector_3(s1.target(), s2.source())) != NULL_VECTOR) - return boost::make_optional(variant_type(Segment(s1.target(), s2.source()))); + return std::make_optional(variant_type(Segment(s1.target(), s2.source()))); else - return boost::make_optional(variant_type(s1.target())); + return std::make_optional(variant_type(s1.target())); } if (tgt2_in_s1) { if (cross_product(normal, Vector_3(s1.target(), s2.target())) != NULL_VECTOR) - return boost::make_optional(variant_type(Segment(s1.target(), s2.target()))); + return std::make_optional(variant_type(Segment(s1.target(), s2.target()))); else - return boost::make_optional(variant_type(s1.target())); + return std::make_optional(variant_type(s1.target())); } // should never get here with a Kernel with exact constructions - return boost::make_optional(variant_type(s1.target())); + return std::make_optional(variant_type(s1.target())); } - return boost::none; + return std::nullopt; } - return boost::none; + return std::nullopt; } }; // end class Projected_intersect_3 diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_all_linear_intersections.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_all_linear_intersections.h index 4d2b09ac3b2..2e9aab53fba 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_all_linear_intersections.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_all_linear_intersections.h @@ -1,9 +1,9 @@ #include #include -#include +#include template -bool is_intersection_empty(const boost::optional& t) +bool is_intersection_empty(const std::optional& t) { return bool(t); } diff --git a/Kernel_d/doc/Kernel_d/CGAL/intersections_d.h b/Kernel_d/doc/Kernel_d/CGAL/intersections_d.h index 1ac4f08cf2d..16448e7eff5 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/intersections_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/intersections_d.h @@ -36,7 +36,7 @@ The following table gives the possible values for `Type1` and `Type2`. The return type of intersecting two objects of the types `Type1` and `Type2` can be specified through the placeholder type specifier `auto`. It is equivalent to -`boost::optional< boost::variant< T... > >`, the last column in the table providing +`std::optional< boost::variant< T... > >`, the last column in the table providing the template parameter pack. @@ -155,7 +155,7 @@ void foo(Segment_d seg, Line_d lin) \sa `do_intersect` \sa `Kernel_d::Intersect_d` -\sa `boost::optional` +\sa `std::optional` \sa `boost::variant` */ diff --git a/Kernel_d/doc/Kernel_d/Kernel_d.txt b/Kernel_d/doc/Kernel_d/Kernel_d.txt index fcfbfe0afec..1e1e3361096 100644 --- a/Kernel_d/doc/Kernel_d/Kernel_d.txt +++ b/Kernel_d/doc/Kernel_d/Kernel_d.txt @@ -477,7 +477,7 @@ Intersections on kernel objects currently cover only those objects that are part of flats (`R::Segment_d`, `R::Ray_d`, `R::Line_d`, and `R::Hyperplane_d`). For any pair of objects \f$ o1\f$, \f$ o2\f$ of these types the operation `intersection(o1,o2)` -returns a `boost::optional< boost::variant< T... > >` +returns a `std::optional< boost::variant< T... > >` where `T...` is a list of all possible resulting geometric objects. The return type of intersecting two objects of the types `Type1` and `Type2` can be diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objects.h b/Kernel_d/include/CGAL/Kernel_d/function_objects.h index 221c3c7bbdb..0e073c0272d 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objects.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objects.h @@ -76,22 +76,22 @@ public: template struct result - { typedef boost::optional< boost::variant< Point_d, Line_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Line_d > > type; }; template struct result - { typedef boost::optional< boost::variant< Point_d, Segment_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Segment_d > > type; }; template struct result : result { }; template struct result - { typedef boost::optional< boost::variant< Point_d, Segment_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Segment_d > > type; }; template struct result - { typedef boost::optional< boost::variant< Point_d, Ray_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Ray_d > > type; }; template struct result : result @@ -99,7 +99,7 @@ public: template struct result - { typedef boost::optional< boost::variant< Point_d, Segment_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Segment_d > > type; }; template struct result : result @@ -107,25 +107,25 @@ public: template struct result - { typedef boost::optional< boost::variant< Point_d, Segment_d, Ray_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Segment_d, Ray_d > > type; }; template struct result - { typedef boost::optional< boost::variant< Point_d, Line_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Line_d > > type; }; template struct result : result { }; template struct result - { typedef boost::optional< boost::variant< Point_d, Ray_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Ray_d > > type; }; template struct result : result { }; template struct result - { typedef boost::optional< boost::variant< Point_d, Segment_d > > type; }; + { typedef std::optional< boost::variant< Point_d, Segment_d > > type; }; template struct result : result { }; diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index a07ee4b3f16..9ca9eb02fa7 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -63,7 +63,7 @@ #include #include #include -#include +#include //#include //#include //#include diff --git a/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h index a1b35060f85..93b25870c21 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h @@ -53,9 +53,9 @@ Function object that constructs the intersection between a 3D segment and a 3D triangle. Partial model of `::Kernel::Intersect_3`. Provides the operators: -- `boost::optional< boost::variant< Point_3, Segment_3 > > operator()(Segment_3 seg, Triangle_3 tr)` +- `std::optional< boost::variant< Point_3, Segment_3 > > operator()(Segment_3 seg, Triangle_3 tr)` -- `boost::optional< boost::variant< Point_3, Segment_3 > > operator()(Triangle_3 tr, Segment_3 seg)` +- `std::optional< boost::variant< Point_3, Segment_3 > > operator()(Triangle_3 tr, Segment_3 seg)` which computes the intersection between the triangle and the segment. */ diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCellCriteria_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCellCriteria_3.h index d3b0b83f0a6..909f490b3ae 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCellCriteria_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCellCriteria_3.h @@ -48,7 +48,7 @@ the cell is good with regard to the criteria. In addition, an object of this type must contain an object of type `Cell_quality` if it represents a bad cell. `Cell_quality` must be accessible by `operator*()`. -Note that `boost::optional` is a natural model of this concept. +Note that `std::optional` is a natural model of this concept. */ typedef unspecified_type Is_cell_bad; diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h index 240f9b0f1fb..3a96bdc4c04 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h @@ -138,7 +138,7 @@ A function object to query whether a point is in the input domain or not. In the positive case, it outputs the subdomain which includes the query point. Provides the operator: -`boost::optional operator()(Point_3 p)` +`std::optional operator()(Point_3 p)` */ typedef unspecified_type Is_in_domain; @@ -148,11 +148,11 @@ intersection queries between the surface patches of the domain and objects of type `Segment_3`, `Ray_3` or `Line_3`. Provides the operators: -`boost::optional operator()(Segment_3 s)` +`std::optional operator()(Segment_3 s)` -`boost::optional operator()(Ray_3 r)` +`std::optional operator()(Ray_3 r)` -`boost::optional operator()(Line_3 l)` +`std::optional operator()(Line_3 l)` The return type of the operators tell whether or not the query intersects a surface patch. In the positive case, it provides (through operator*()) the diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshFacetCriteria_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshFacetCriteria_3.h index 325dedeff05..f25f9a0f4f3 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshFacetCriteria_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshFacetCriteria_3.h @@ -55,7 +55,7 @@ the facet is good with regard to the criteria. In addition, an object of this type must contain an object of type `Facet_quality` if it represents a bad facet. `Facet_quality` must be accessible by -`operator*()`. Note that `boost::optional` is +`operator*()`. Note that `std::optional` is a natural model of this concept. */ typedef unspecified_type Is_facet_bad; diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h index e4d5a977a1c..63fcddb7a40 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h @@ -312,11 +312,11 @@ public: /*! A constructor object that must provide the function operators: - `boost::optional< boost::variant< T... > > operator()(Segment_3 s, Plane_3 p)` + `std::optional< boost::variant< T... > > operator()(Segment_3 s, Plane_3 p)` - `boost::optional< boost::variant< T... > > operator()(Ray_3 r, Iso_cuboid i)` + `std::optional< boost::variant< T... > > operator()(Ray_3 r, Iso_cuboid i)` - `boost::optional< boost::variant< T... > > operator()(Segment_3 s, Iso_cuboid i)` + `std::optional< boost::variant< T... > > operator()(Segment_3 s, Iso_cuboid i)` which returns the intersection region of two geometrical objects. */ 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 fb528891cd1..32a612b7b1d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -99,9 +99,9 @@ public: { Is_in_domain(const Hybrid_domain& domain) : r_domain_(domain) {} - boost::optional operator()(const K::Point_3& p) const + std::optional operator()(const K::Point_3& p) const { - boost::optional subdomain_index = + std::optional subdomain_index = r_domain_.implicit_domain.is_in_domain_object()(p); if(subdomain_index) return 2; else return r_domain_.polyhedron_domain.is_in_domain_object()(p); diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index ecc81e96046..a6fd33ab1ec 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -47,7 +47,7 @@ #ifdef CGAL_MESH_3_VERBOSE # include #endif -#include +#include #include #include @@ -374,11 +374,11 @@ public: typedef typename Geom_traits::FT FT; ///@} #else - typedef boost::optional Subdomain; + typedef std::optional Subdomain; // Type of indexes for cells of the input complex typedef Surface_patch_index_ Surface_patch_index; - typedef boost::optional Surface_patch; + typedef std::optional Surface_patch; // Type of indexes to characterize the lowest dimensional face of the input // complex on which a vertex lie diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index 6a812e5581b..4d4ec6d698e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include @@ -643,8 +643,8 @@ class C3T3_helpers typedef typename C3T3::Subdomain_index Subdomain_index; typedef typename C3T3::Index Index; - typedef boost::optional Surface_patch; - typedef boost::optional Subdomain; + typedef std::optional Surface_patch; + typedef std::optional Subdomain; typedef std::vector Cell_vector; typedef std::set Cell_set; @@ -683,7 +683,7 @@ public: // ----------------------------------- // Public interface // ----------------------------------- - typedef boost::optional Update_mesh; + typedef std::optional Update_mesh; using Base::try_lock_point; using Base::try_lock_vertex; @@ -1677,7 +1677,7 @@ private: /** * Returns the least square plane from v, using adjacent surface points */ - std::pair, Bare_point> + std::pair, Bare_point> get_least_square_surface_plane(const Vertex_handle& v, Surface_patch_index index = Surface_patch_index()) const; @@ -1686,15 +1686,15 @@ private: * @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`. + * @return a `std::optional` with the projected point if the projection + * was possible, or `std::nullopt`. * * `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. */ - boost::optional + std::optional project_on_surface_if_possible(const Vertex_handle& v, const Bare_point& p, Surface_patch_index index = Surface_patch_index()) const; @@ -2778,7 +2778,7 @@ rebuild_restricted_delaunay(OutdatedCells& outdated_cells, ++it ) { const Weighted_point& initial_position = tr_.point(*it); - boost::optional opt_new_pos = project_on_surface(*it, cp(initial_position)); + std::optional opt_new_pos = project_on_surface(*it, cp(initial_position)); if ( opt_new_pos ) { @@ -2890,7 +2890,7 @@ rebuild_restricted_delaunay(ForwardIterator first_cell, { Vertex_handle vh = it->first; const Weighted_point& initial_position = tr_.point(vh); - boost::optional opt_new_pos = project_on_surface(vh, cp(initial_position), it->second); + std::optional opt_new_pos = project_on_surface(vh, cp(initial_position), it->second); if ( opt_new_pos ) { @@ -3418,7 +3418,7 @@ project_on_surface_aux(const Bare_point& p, template -std::pair::Plane_3>, +std::pair::Plane_3>, typename C3T3_helpers::Bare_point> C3T3_helpers:: get_least_square_surface_plane(const Vertex_handle& v, @@ -3471,7 +3471,7 @@ get_least_square_surface_plane(const Vertex_handle& v, // In some cases point is not a real surface point if ( triangles.empty() ) - return std::make_pair(boost::none, Bare_point()); + return std::make_pair(std::nullopt, Bare_point()); // Compute least square fitting plane Plane_3 plane; @@ -3498,7 +3498,7 @@ project_on_surface(const Vertex_handle& v, const Bare_point& p, Surface_patch_index index) const { - boost::optional opt_point = + std::optional opt_point = project_on_surface_if_possible(v, p, index); if(opt_point) return *opt_point; else return p; @@ -3506,7 +3506,7 @@ project_on_surface(const Vertex_handle& v, template -boost::optional::Bare_point> +std::optional::Bare_point> C3T3_helpers:: project_on_surface_if_possible(const Vertex_handle& v, const Bare_point& p, @@ -3518,11 +3518,11 @@ project_on_surface_if_possible(const Vertex_handle& v, typename Gt::Equal_3 equal = tr_.geom_traits().equal_3_object(); // Get plane - std::pair, Bare_point> pl_rp + std::pair, Bare_point> pl_rp = get_least_square_surface_plane(v, index); - boost::optional opt_plane = pl_rp.first; - if(!opt_plane) return boost::none; + std::optional opt_plane = pl_rp.first; + if(!opt_plane) return std::nullopt; // Project const Weighted_point& position = tr_.point(v); 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 2fe2261344c..d2f1065785a 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 @@ -53,7 +53,7 @@ #ifndef CGAL_NO_ASSERTIONS # include // for float_prior #endif -#include +#include #include #include #include @@ -1524,7 +1524,7 @@ change_ball_size(const Vertex_handle& v, const FT squared_size, const bool speci Bare_point p = cp(c3t3_.triangulation().point(v)); // intentional copy // Remove v from the set of corners - boost::optional corner_index = boost::make_optional(false, Corner_index()); + std::optional corner_index = std::make_optional(false, Corner_index()); if ( c3t3_.is_in_complex(v) ) { corner_index = c3t3_.corner_index(v); 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 4ee48c865ea..59526d1adc9 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h @@ -926,7 +926,7 @@ void Refine_cells_3:: treat_new_cell(const Cell_handle& cell) { - typedef boost::optional Subdomain; + typedef std::optional Subdomain; // treat cell const Subdomain subdomain = r_oracle_.is_in_domain_object()(r_tr_.dual(cell)); 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 ded63f9b139..1f9c064f1d8 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include #include @@ -397,7 +397,7 @@ protected: typedef typename MeshDomain::Surface_patch_index Surface_patch_index; typedef typename MeshDomain::Index Index; - typedef typename boost::optional< + typedef typename std::optional< std::tuple > Facet_properties; @@ -1624,7 +1624,7 @@ compute_facet_properties(const Facet& facet, CGAL_assertion( r_tr_.dimension() == 3 ); // types - typedef boost::optional Surface_patch; + typedef std::optional Surface_patch; typedef typename MD::Intersection Intersection; // Functor diff --git a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h index e8c2c214e48..1f420ffd432 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h +++ b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include @@ -498,7 +498,7 @@ private: /** * Returns the umbrella of internal_facets vector */ - boost::optional + std::optional get_umbrella(const Facet_vector& internal_facets, const Vertex_handle& v) const; @@ -1351,7 +1351,7 @@ get_best_weight(const Vertex_handle& v, bool *could_lock_zone) const template -boost::optional::Umbrella > +std::optional::Umbrella > Slivers_exuder:: get_umbrella(const Facet_vector& facets, // internal_facets of conflict zone const Vertex_handle& /* v, no longer used */) const @@ -1387,7 +1387,7 @@ get_umbrella(const Facet_vector& facets, // internal_facets of conflict zone { std::size_t count = (*uit).second.second; if(count == 2) //there will be more than 3 after insertion - return boost::none; //non-manifold configuration + return std::nullopt; //non-manifold configuration umbrella.insert(uit, std::make_pair(oe, @@ -1563,8 +1563,8 @@ update_mesh(const Weighted_point& new_point, Boundary_facets_from_outside boundary_facets_from_outside = get_boundary_facets_from_outside(boundary_facets); - boost::optional umbrella = get_umbrella(internal_facets, old_vertex); - if(umbrella == boost::none) + std::optional umbrella = get_umbrella(internal_facets, old_vertex); + if(umbrella == std::nullopt) return false; //abort pumping this vertex // Delete old cells from queue (they aren't in the triangulation anymore) diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h index 11319fe065d..a35b1172791 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h @@ -228,11 +228,11 @@ struct Sizing_field_with_aabb_tree } } - boost::optional + std::optional closest_point_on_surfaces(const Point_3& p, const Patches_ids& patch_ids_to_ignore) const { - boost::optional result{}; + std::optional result{}; if(d_ptr->aabb_tree.empty()) return result; for(std::size_t i = 0; i < d_ptr->kd_trees_ptrs.size(); ++i) { const auto patch_id = static_cast(i + d_ptr->min_patch_id); @@ -325,7 +325,7 @@ struct Sizing_field_with_aabb_tree const auto closest_point_and_primitive = closest_point_on_surfaces(p, ids); - if(closest_point_and_primitive != boost::none) { + if(closest_point_and_primitive != std::nullopt) { result = (std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * CGAL_NTS @@ -379,7 +379,7 @@ struct Sizing_field_with_aabb_tree if(!d_ptr->aabb_tree.empty()) { //Compute distance to surface patches const auto closest_point_and_primitive = closest_point_on_surfaces(p, ids); - if(closest_point_and_primitive == boost::none) { + if(closest_point_and_primitive == std::nullopt) { #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY std::cerr << result << " (projection not found) ids:"; for(Patch_index i : ids) { 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 d2dfef196e0..bc705dc40de 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 @@ -159,8 +159,8 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, : domain.is_in_domain_object()( seed_cell->weighted_circumcenter(tr.geom_traits())); - if ( seed_label != boost::none - && seed_cell_label != boost::none + if ( seed_label != std::nullopt + && seed_cell_label != std::nullopt && *seed_label == *seed_cell_label) continue; //this means the connected component has already been initialized diff --git a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_criteria.h b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_criteria.h index 268bffcc4c1..a3564c1b946 100644 --- a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_criteria.h +++ b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_criteria.h @@ -22,7 +22,7 @@ -#include +#include #include namespace CGAL { @@ -41,7 +41,7 @@ class Abstract_criterion public: typedef FT Quality; - typedef boost::optional Is_bad; + typedef std::optional Is_bad; typedef typename Visitor_::Handle Handle; /// Destructor @@ -81,7 +81,7 @@ protected: public: typedef std::pair Quality; - typedef boost::optional Is_bad; + typedef std::optional Is_bad; // Constructor diff --git a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h index e42bc0acff7..e9587187163 100644 --- a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h +++ b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h @@ -30,7 +30,7 @@ #include #include // for boost::prior -#include +#include #include #include @@ -452,7 +452,7 @@ polylines_to_protect InterpolationFunctor interpolate, PolylineInputIterator existing_polylines_begin, PolylineInputIterator existing_polylines_end, - boost::optional scalar_interpolation_value = boost::none, + std::optional scalar_interpolation_value = std::nullopt, int prec = 10) { typedef typename DomainFunctor::result_type Domain_type; @@ -587,7 +587,7 @@ polylines_to_protect pixel[1], pixel[2]); square[ii][jj].domain = domain_fct(square[ii][jj].word); - if(scalar_interpolation_value != boost::none) { + if(scalar_interpolation_value != std::nullopt) { square[ii][jj].word = Image_word_type(square[ii][jj].word - (*scalar_interpolation_value)); @@ -735,7 +735,7 @@ case_1_2_1: square[1][0], null); Isoline_equation equation = - (scalar_interpolation_value == boost::none) ? + (scalar_interpolation_value == std::nullopt) ? Isoline_equation(1, -1, -1, 0) : Isoline_equation(v00, v10, v01, v11); insert_curve_in_graph.insert_curve(equation, @@ -745,7 +745,7 @@ case_1_2_1: p00, p10 - p00, p01 - p00); - if(scalar_interpolation_value == boost::none) { + if(scalar_interpolation_value == std::nullopt) { equation = Isoline_equation(0, -1, -1, 1); } insert_curve_in_graph.insert_curve(equation, @@ -872,7 +872,7 @@ case_1_2_1: square[1][1], null); vertex_descriptor bottom = g_manip.split(square[0][0], square[1][0], null); - if(scalar_interpolation_value == boost::none) { + if(scalar_interpolation_value == std::nullopt) { g_manip.try_add_edge(top, bottom); } else { insert_curve_in_graph.insert_curve(Isoline_equation(v00, v10, @@ -891,7 +891,7 @@ case_1_2_1: CGAL_assertion(square[1][0].domain==square[0][1].domain); CGAL_assertion(square[0][0].domain!=square[0][1].domain); - if(scalar_interpolation_value != boost::none) { + if(scalar_interpolation_value != std::nullopt) { // Compute the squared distance between the two branches of // the hyperbola. const double discrimant = double(v00) * v11 - double(v01) * v10; @@ -964,7 +964,7 @@ case_1_2_1: square[1][1], null); Isoline_equation equation = - (scalar_interpolation_value == boost::none) ? + (scalar_interpolation_value == std::nullopt) ? Isoline_equation(1, -1, 1, 1) : Isoline_equation(v00, v10, v01, v11); diff --git a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h index 1b1e53c9305..7dc31bfbf39 100644 --- a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h +++ b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h @@ -34,7 +34,7 @@ #endif #endif -#include +#include #include #include #include diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 17e69ff984c..66178d3906f 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -519,13 +519,13 @@ public: Is_in_domain(const Polyhedral_complex_mesh_domain_3& domain) : r_domain_(domain) {} - boost::optional shoot_a_ray_1(const Ray_3 ray) const { + std::optional shoot_a_ray_1(const Ray_3 ray) const { return r_domain_.bounding_aabb_tree_ptr()-> first_intersected_primitive(ray); } #if USE_ALL_INTERSECTIONS - boost::optional shoot_a_ray_2(const Ray_3 ray) const { + std::optional shoot_a_ray_2(const Ray_3 ray) const { const Point_3& p = ray.source(); typedef typename AABB_tree:: template Intersection_and_primitive_id::Type Inter_and_prim; @@ -533,7 +533,7 @@ public: r_domain_.bounding_aabb_tree_ptr()-> all_intersections(ray, std::back_inserter(all_intersections)); if(all_intersections.empty()) - return boost::none; + return std::nullopt; else { for(const Inter_and_prim& i_p: all_intersections) { if(boost::get( &i_p.first) == 0) return AABB_primitive_id(); @@ -575,13 +575,13 @@ public: #define USE_ALL_INTERSECTIONS 0 #if USE_ALL_INTERSECTIONS - boost::optional opt = shoot_a_ray_2(ray_shot); + std::optional opt = shoot_a_ray_2(ray_shot); #else // first_intersected_primitive - boost::optional opt = shoot_a_ray_1(ray_shot); + std::optional opt = shoot_a_ray_1(ray_shot); #endif // first_intersected_primitive // for(int i = 0; i < 20; ++i) { // const Ray_3 ray_shot2 = ray(p, vector(CGAL::ORIGIN,*random_point)); - // boost::optional opt2 = shoot_a_ray_1(ray_shot2); + // std::optional opt2 = shoot_a_ray_1(ray_shot2); // if(opt != opt2) { // if(!opt && *opt2 == 0) continue; // if(!opt2 && *opt == 0) continue; diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 2d9bf625f57..5ac9a12411a 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include #include @@ -136,7 +136,7 @@ public: //------------------------------------------------------- /// Type of indexes for cells of the input complex typedef int Subdomain_index; - typedef boost::optional Subdomain; + typedef std::optional Subdomain; /// Type of indexes for surface patch of the input complex typedef typename boost::property_map::type Face_patch_id_pmap; typedef typename boost::property_traits< Face_patch_id_pmap>::value_type Surface_patch_index; - typedef boost::optional Surface_patch; + typedef std::optional Surface_patch; /// Type of indexes to characterize the lowest dimensional face of the input /// complex on which a vertex lie typedef typename Mesh_3::internal::Index_generator< @@ -388,7 +388,7 @@ public: { CGAL_MESH_3_PROFILER(std::string("Mesh_3 profiler: ") + std::string(CGAL_PRETTY_FUNCTION)); - boost::optional primitive_id = r_domain_.tree_.any_intersected_primitive(q); + std::optional primitive_id = r_domain_.tree_.any_intersected_primitive(q); if ( primitive_id ) { r_domain_.cache_primitive(q, *primitive_id); @@ -430,7 +430,7 @@ public: CGAL_MESH_3_PROFILER(std::string("Mesh_3 profiler: ") + std::string(CGAL_PRETTY_FUNCTION)); typedef typename AABB_tree_::template Intersection_and_primitive_id::Type Intersection_and_primitive_id; - typedef boost::optional AABB_intersection; + typedef std::optional AABB_intersection; typedef Point_3 Bare_point; AABB_intersection intersection; @@ -447,7 +447,7 @@ public: { #ifndef CGAL_MESH_3_NO_LONGER_CALLS_DO_INTERSECT_3 CGAL_precondition(r_domain_.do_intersect_surface_object()(q) - != boost::none); + != std::nullopt); #endif // NOT CGAL_MESH_3_NO_LONGER_CALLS_DO_INTERSECT_3 intersection = r_domain_.tree_.any_intersection(q); diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_traversal_traits_with_join.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_traversal_traits_with_join.h index d2cfbd99436..b44438f24e8 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_traversal_traits_with_join.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_traversal_traits_with_join.h @@ -17,7 +17,7 @@ #include -#include +#include namespace CGAL { @@ -69,7 +69,7 @@ class First_intersection_traits public: typedef - boost::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > + std::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > Result; public: First_intersection_traits(const AABBTraits& traits) @@ -124,7 +124,7 @@ public: void intersection(const Query& query, const Primitive& primitive) { - boost::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > + std::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > intersection = m_traits.intersection_object()(query, primitive); if(intersection) @@ -211,7 +211,7 @@ public: { if( m_traits.do_intersect_object()(query, primitive) ) { - m_result = boost::optional(primitive.id()); + m_result = std::optional(primitive.id()); m_is_found = true; } } @@ -221,12 +221,12 @@ public: return m_traits.do_intersect_object()(query, node.bbox()); } - boost::optional result() const { return m_result; } + std::optional result() const { return m_result; } bool is_intersection_found() const { return m_is_found; } private: bool m_is_found; - boost::optional m_result; + std::optional m_result; const AABBTraits& m_traits; }; diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_tree_with_join.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_tree_with_join.h index a528585c5c6..8ca02f1b229 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_tree_with_join.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_tree_with_join.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #ifdef CGAL_HAS_THREADS #include @@ -252,7 +252,7 @@ public: /// `do_intersect` predicates are defined /// in the traits class `AABBTraits`. template - boost::optional any_intersected_primitive(const Query& query) const; + std::optional any_intersected_primitive(const Query& query) const; ///@} @@ -276,7 +276,7 @@ public: /// for which `do_intersect` predicates /// and intersections are defined in the traits class AABBTraits. template - boost::optional< typename Intersection_and_primitive_id::Type > + std::optional< typename Intersection_and_primitive_id::Type > any_intersection(const Query& query) const; ///@} @@ -764,7 +764,7 @@ public: template template - boost::optional< typename AABB_tree_with_join::template Intersection_and_primitive_id::Type > + std::optional< typename AABB_tree_with_join::template Intersection_and_primitive_id::Type > AABB_tree_with_join::any_intersection(const Query& query) const { using namespace CGAL::internal::AABB_tree_with_join; @@ -776,7 +776,7 @@ public: template template - boost::optional::Primitive_id> + std::optional::Primitive_id> AABB_tree_with_join::any_intersected_primitive(const Query& query) const { using namespace CGAL::internal::AABB_tree_with_join; diff --git a/Nef_2/include/CGAL/Nef_2/HDS_items.h b/Nef_2/include/CGAL/Nef_2/HDS_items.h index e0b342e9e68..48a44c50fd7 100644 --- a/Nef_2/include/CGAL/Nef_2/HDS_items.h +++ b/Nef_2/include/CGAL/Nef_2/HDS_items.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO #include @@ -73,7 +73,7 @@ private: Halfedge_handle _h; Face_handle _f; Point _p; - boost::optional _ivit; + std::optional _ivit; Mark _m; GenPtr _i; public: @@ -127,7 +127,7 @@ public: iv_iterator ivit() const { return *_ivit; } void set_ivit(iv_iterator it) { _ivit = it; } - void reset_ivit() { _ivit = boost::none; } + void reset_ivit() { _ivit = std::nullopt; } }; @@ -162,7 +162,7 @@ protected: Halfedge_handle opp, prv, nxt; Vertex_handle _v; Face_handle _f; - boost::optional _fcit; + std::optional _fcit; Mark _m; GenPtr _i; public: @@ -223,7 +223,7 @@ public: fc_iterator fcit() const { return *_fcit; } void set_fcit(fc_iterator it) { _fcit = it; } - void reset_fcit() { _fcit = boost::none; } + void reset_fcit() { _fcit = std::nullopt; } bool is_hole_entry() const /*{\Mop returns true iff |\Mvar| is entry point into a hole face diff --git a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xy_3.h b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xy_3.h index 99b71db68a1..7b944428601 100644 --- a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xy_3.h +++ b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xy_3.h @@ -36,7 +36,7 @@ struct Exact_intersect_xy_2 typedef boost::variant variant_type; - boost::optional + std::optional operator() (const Segment_3& s3, const Segment_3& t3) { Point_2 p2, q2; Point_3 p3, q3; @@ -55,18 +55,18 @@ struct Exact_intersect_xy_2 // so all third components are faked! auto obj = intersection (s2,t2); if(! obj){ - return boost::none; + return std::nullopt; } if (const Point_2* pi = boost::get(&*obj)) { - return boost::make_optional(variant_type(Point_3(p2.x(),p2.y(),0))); + return std::make_optional(variant_type(Point_3(p2.x(),p2.y(),0))); } const Segment_2* si = boost::get(&*obj); p2 = si->source(); q2 = si->target(); - return boost::make_optional(variant_type(Segment_3(Point_3(p2.x(),p2.y(),0), + return std::make_optional(variant_type(Segment_3(Point_3(p2.x(),p2.y(),0), Point_3(q2.x(),q2.y(),0) ) )); } }; @@ -82,7 +82,7 @@ struct Exact_intersect_xy_2 typedef boost::variant variant_type; - boost::optional operator() (Segment_3 s3, Segment_3 t3) + std::optional operator() (Segment_3 s3, Segment_3 t3) { Point_2 p2, q2; Point_3 p3, q3; @@ -102,18 +102,18 @@ struct Exact_intersect_xy_2 // so all third components are faked! auto obj = intersection (s2,t2); if(! obj){ - return boost::none; + return std::nullopt; } if (const Point_2* pi = boost::get(&*obj)) { - return boost::make_optional(variant_type(Point_3(p2.hx(),p2.hy(),0,p2.hw()))); + return std::make_optional(variant_type(Point_3(p2.hx(),p2.hy(),0,p2.hw()))); } const Segment_2* si = boost::get(&*obj); p2 = si->source(); q2 = si->target(); - return boost::make_optional(variant_type(Segment_3(Point_3 (p2.hx(),p2.hy(),0,p2.hw()), + return std::make_optional(variant_type(Segment_3(Point_3 (p2.hx(),p2.hy(),0,p2.hw()), Point_3 (q2.hx(),q2.hy(),0,q2.hw())) )); } }; diff --git a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xz_3.h b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xz_3.h index 7d77eaae669..77329529249 100644 --- a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xz_3.h +++ b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xz_3.h @@ -35,7 +35,7 @@ struct Exact_intersect_xz_2 typedef boost::variant variant_type; - boost::optional + std::optional operator() (const Segment_3& s3, const Segment_3& t3) { Point_2 p2, q2; Point_3 p3, q3; @@ -54,18 +54,18 @@ struct Exact_intersect_xz_2 // so all third components are faked! auto obj = intersection (s2,t2); if(! obj){ - return boost::none; + return std::nullopt; } if (const Point_2* pi = boost::get(&*obj)) { - return boost::make_optional(variant_type(Point_3(p2.x(),0,p2.y()))); + return std::make_optional(variant_type(Point_3(p2.x(),0,p2.y()))); } const Segment_2* si = boost::get(&*obj); p2 = si->source(); q2 = si->target(); - return boost::make_optional(variant_type(Segment_3(Point_3(p2.x(),0,p2.y()), + return std::make_optional(variant_type(Segment_3(Point_3(p2.x(),0,p2.y()), Point_3(q2.x(),0,q2.y()) ) )); } }; @@ -81,7 +81,7 @@ struct Exact_intersect_xz_2 typedef boost::variant variant_type; - boost::optional operator() (Segment_3 s3, Segment_3 t3) + std::optional operator() (Segment_3 s3, Segment_3 t3) { Point_2 p2, q2; Point_3 p3, q3; @@ -101,18 +101,18 @@ struct Exact_intersect_xz_2 // so all third components are faked! auto obj = intersection (s2,t2); if(! obj){ - return boost::none; + return std::nullopt; } if (const Point_2* pi = boost::get(&*obj)) { - return boost::make_optional(variant_type(Point_3(p2.hx(),0,p2.hy(),p2.hw()))); + return std::make_optional(variant_type(Point_3(p2.hx(),0,p2.hy(),p2.hw()))); } const Segment_2* si = boost::get(&*obj); p2 = si->source(); q2 = si->target(); - return boost::make_optional(variant_type(Segment_3(Point_3 (p2.hx(),0,p2.hy(),p2.hw()), + return std::make_optional(variant_type(Segment_3(Point_3 (p2.hx(),0,p2.hy(),p2.hw()), Point_3 (q2.hx(),0,q2.hy(),q2.hw())) )); } diff --git a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_yz_3.h b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_yz_3.h index a98b74fd144..ac2007ce556 100644 --- a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_yz_3.h +++ b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_yz_3.h @@ -36,7 +36,7 @@ struct Exact_intersect_yz_2 typedef boost::variant variant_type; - boost::optional + std::optional operator() (const Segment_3& s3, const Segment_3& t3) { Point_2 p2, q2; Point_3 p3, q3; @@ -55,18 +55,18 @@ struct Exact_intersect_yz_2 // so all third components are faked! auto obj = intersection (s2,t2); if(! obj){ - return boost::none; + return std::nullopt; } if (const Point_2* pi = boost::get(&*obj)) { - return boost::make_optional(variant_type(Point_3(0,p2.x(),p2.y()))); + return std::make_optional(variant_type(Point_3(0,p2.x(),p2.y()))); } const Segment_2* si = boost::get(&*obj); p2 = si->source(); q2 = si->target(); - return boost::make_optional(variant_type(Segment_3(Point_3(0,p2.x(),p2.y()), + return std::make_optional(variant_type(Segment_3(Point_3(0,p2.x(),p2.y()), Point_3(0,q2.x(),q2.y()) ) )); } }; @@ -82,7 +82,7 @@ struct Exact_intersect_yz_2 typedef boost::variant variant_type; - boost::optional operator() (Segment_3 s3, Segment_3 t3) + std::optional operator() (Segment_3 s3, Segment_3 t3) { Point_2 p2, q2; Point_3 p3, q3; @@ -102,18 +102,18 @@ struct Exact_intersect_yz_2 // so all third components are faked! auto obj = intersection (s2,t2); if(! obj){ - return boost::none; + return std::nullopt; } if (const Point_2* pi = boost::get(&*obj)) { - return boost::make_optional(variant_type(Point_3(0,p2.hx(),p2.hy(),p2.hw()))); + return std::make_optional(variant_type(Point_3(0,p2.hx(),p2.hy(),p2.hw()))); } const Segment_2* si = boost::get(&*obj); p2 = si->source(); q2 = si->target(); - return boost::make_optional(variant_type(Segment_3(Point_3 (0,p2.hx(),p2.hy(),p2.hw()), + return std::make_optional(variant_type(Segment_3(Point_3 (0,p2.hx(),p2.hy(),p2.hw()), Point_3 (0,q2.hx(),q2.hy(),q2.hw())) )); } }; diff --git a/Nef_3/include/CGAL/Nef_3/SNC_structure.h b/Nef_3/include/CGAL/Nef_3/SNC_structure.h index 27a3c5c414d..8806122cadb 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_structure.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_structure.h @@ -34,7 +34,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -384,13 +384,13 @@ public: expensive operation.}*/ SNC_structure() : - boundary_item_(boost::none), sm_boundary_item_(boost::none), + boundary_item_(std::nullopt), sm_boundary_item_(std::nullopt), vertices_(), halfedges_(), halffacets_(), volumes_(), shalfedges_(), shalfloops_(), sfaces_() {} ~SNC_structure() { CGAL_NEF_TRACEN("~SNC_structure: clearing "< bool is_boundary_object(H h) const - { return boundary_item_[h]!=boost::none; } + { return boundary_item_[h]!=std::nullopt; } template bool is_sm_boundary_object(H h) const - { return sm_boundary_item_[h]!=boost::none; } + { return sm_boundary_item_[h]!=std::nullopt; } template Object_iterator& boundary_item(H h) @@ -462,12 +462,12 @@ public: template void undef_boundary_item(H h) - { CGAL_assertion(boundary_item_[h]!=boost::none); - boundary_item_[h] = boost::none; } + { CGAL_assertion(boundary_item_[h]!=std::nullopt); + boundary_item_[h] = std::nullopt; } template void undef_sm_boundary_item(H h) - { CGAL_assertion(sm_boundary_item_[h]!=boost::none); - sm_boundary_item_[h] = boost::none; } + { CGAL_assertion(sm_boundary_item_[h]!=std::nullopt); + sm_boundary_item_[h] = std::nullopt; } void reset_iterator_hash(Object_iterator it) { SVertex_handle sv; @@ -1035,7 +1035,7 @@ public: protected: void pointer_update(const Self& D); - typedef boost::optional Optional_object_iterator ; + typedef std::optional Optional_object_iterator ; private: Generic_handle_map boundary_item_; Generic_handle_map sm_boundary_item_; diff --git a/Nef_S2/include/CGAL/Nef_S2/Sphere_map.h b/Nef_S2/include/CGAL/Nef_S2/Sphere_map.h index 4c89dbf4ecd..aaa74f14fe4 100644 --- a/Nef_S2/include/CGAL/Nef_S2/Sphere_map.h +++ b/Nef_S2/include/CGAL/Nef_S2/Sphere_map.h @@ -30,7 +30,7 @@ #define CGAL_NEF_DEBUG 109 #include -#include +#include #include namespace CGAL { @@ -128,7 +128,7 @@ public: typedef std::list Object_list; typedef typename Object_list::iterator Object_iterator; typedef typename Object_list::const_iterator Object_const_iterator; - typedef boost::optional Optional_object_iterator ; + typedef std::optional Optional_object_iterator ; typedef Generic_handle_map Handle_to_iterator_map; typedef Sphere_map* Constructor_parameter; @@ -226,7 +226,7 @@ public: construction means cloning an isomorphic structure and is thus an expensive operation.}*/ - Sphere_map(bool = false) : boundary_item_(boost::none), + Sphere_map(bool = false) : boundary_item_(std::nullopt), svertices_(), sedges_(), sfaces_(), shalfloop_() {} ~Sphere_map() noexcept(!CGAL_ASSERTIONS_ENABLED) @@ -236,7 +236,7 @@ public: ); } - Sphere_map(const Self& D) : boundary_item_(boost::none), + Sphere_map(const Self& D) : boundary_item_(std::nullopt), svertices_(D.svertices_), sedges_(D.sedges_), sfaces_(D.sfaces_), @@ -258,7 +258,7 @@ public: void clear() { - boundary_item_.clear(boost::none); + boundary_item_.clear(std::nullopt); svertices_.destroy(); sfaces_.destroy(); while ( shalfedges_begin() != shalfedges_end() ) @@ -268,7 +268,7 @@ public: template bool is_sm_boundary_object(H h) const - { return boundary_item_[h]!=boost::none; } + { return boundary_item_[h]!=std::nullopt; } template Object_iterator& sm_boundary_item(H h) @@ -280,8 +280,8 @@ public: template void undef_sm_boundary_item(H h) - { CGAL_assertion(boundary_item_[h]!=boost::none); - boundary_item_[h] = boost::none; } + { CGAL_assertion(boundary_item_[h]!=std::nullopt); + boundary_item_[h] = std::nullopt; } void reset_sm_iterator_hash(Object_iterator it) { SVertex_handle sv; diff --git a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h index c49303dd42d..4a562530c75 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h +++ b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -92,7 +92,7 @@ template <> class Interval_optional_caching< ::CGAL::Tag_true > { protected: - typedef boost::optional< std::pair > Cached_interval; + typedef std::optional< std::pair > Cached_interval; mutable Cached_interval interval_; void invalidate_interval() {interval_=Cached_interval();} bool is_cached() const {return (interval_?true:false);} diff --git a/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_triangulation_2.h b/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_triangulation_2.h index 16fe600bb34..fecb03e33a1 100644 --- a/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_triangulation_2.h +++ b/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_triangulation_2.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include // STL #include @@ -764,7 +764,7 @@ public: // signed distance from t to the intersection of line(a,b) and line(t,s) // the pair::first is false if sign==-1 and true otherwise - std::pair > + std::pair > signed_distance_from_intersection(Vertex_handle a, Vertex_handle b, Vertex_handle t, Vertex_handle s) const { const Point& pa = a->point(); @@ -776,20 +776,20 @@ public: // signed distance from t to the intersection of line(a,b) and line(t,s) // the pair::first is false if sign==-1 and true otherwise - std::pair > + std::pair > compute_signed_distance_from_intersection( const Point& pa, const Point& pb, const Point& pt, const Point& ps) const { FT Dabt = compute_signed_distance(pa, pb, pt); if (Dabt == FT(0)) - return std::make_pair(true,boost::make_optional(FT(0))); + return std::make_pair(true,std::make_optional(FT(0))); Line lab = geom_traits().construct_line_2_object()( pa, geom_traits().construct_vector_2_object()(pa, pb)); Line lts = geom_traits().construct_line_2_object()( pt, geom_traits().construct_vector_2_object()(pt, ps)); - boost::optional Dqt; + std::optional Dqt; const auto result = intersection(lab, lts); if (result) { @@ -996,24 +996,24 @@ public: std::cout <<"( " << (edge).priority() << ") ( " << a << " , " << b << " )" << std::endl; } - bool is_p_infinity(const std::pair >& p) const + bool is_p_infinity(const std::pair >& p) const { - return p.first && p.second==boost::none; + return p.first && p.second==std::nullopt; } - bool is_m_infinity(const std::pair >& p) const + bool is_m_infinity(const std::pair >& p) const { - return !p.first && p.second==boost::none; + return !p.first && p.second==std::nullopt; } - bool is_infinity(const std::pair >& p) const + bool is_infinity(const std::pair >& p) const { - return p.second==boost::none; + return p.second==std::nullopt; } - std::pair > m_infinity() const + std::pair > m_infinity() const { - return std::pair >(false,boost::optional()); + return std::pair >(false,std::optional()); } template // value_type = Edge @@ -1028,9 +1028,9 @@ public: Edge ab = twin_edge(*it); Vertex_handle a = source_vertex(ab); Vertex_handle b = target_vertex(ab); - std::pair > D = signed_distance_from_intersection(a, b, target, source); + std::pair > D = signed_distance_from_intersection(a, b, target, source); if (!D.first ) { - CGAL_assertion(D.second!=boost::none); + CGAL_assertion(D.second!=std::nullopt); multi_ind.insert(Rec_edge_2(ab, *D.second)); } } @@ -1053,11 +1053,11 @@ public: Vertex_handle c = target_vertex(bc); Vertex_handle d = target_vertex(cd); - std::pair > Dac=m_infinity(); + std::pair > Dac=m_infinity(); if (a != c && is_triangle_ccw(a, b, c)) Dac = signed_distance_from_intersection(a, c, target, source); - std::pair > Dbd=m_infinity(); + std::pair > Dbd=m_infinity(); if (b != d && is_triangle_ccw(b, c, d)) Dbd = signed_distance_from_intersection(b, d, target, source); 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 a8936abb6ff..4a644675add 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 @@ -53,7 +53,7 @@ #ifndef CGAL_NO_ASSERTIONS # include // for float_prior #endif -#include +#include #include #include #include @@ -2479,7 +2479,7 @@ change_ball_size(Vertex_handle& v, const FT squared_size, const bool special_bal const Bare_point p = cp(c3t3_.triangulation().point(v)); // intentional copy // Remove v from the set of corners - boost::optional corner_index = boost::make_optional(false, Corner_index()); + std::optional corner_index = std::make_optional(false, Corner_index()); if(c3t3_.is_in_complex(v)) { corner_index = c3t3_.corner_index(v); diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Voronoi_covariance_3/voronoi_covariance_3.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Voronoi_covariance_3/voronoi_covariance_3.h index 93b3f93581a..ad4badb0431 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Voronoi_covariance_3/voronoi_covariance_3.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Voronoi_covariance_3/voronoi_covariance_3.h @@ -166,7 +166,7 @@ namespace CGAL { (planes.begin(), planes.end(), P, - boost::make_optional(Point(CGAL::ORIGIN))); + std::make_optional(Point(CGAL::ORIGIN))); // apply f to the triangles on the boundary of P for(typename boost::graph_traits::face_descriptor fd : faces(P)) 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 58b3cbee86d..335ba822647 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -58,8 +58,8 @@ is a vertex). The implementation follow \cgalCite{cgal:la-srpss-13}. \tparam Kernel a model of `EfficientRANSACTraits` that must provide in addition a function `Intersect_3 intersection_3_object() const` and a functor `Intersect_3` with: -- `boost::optional< boost::variant< Traits::Plane_3, Traits::Line_3 > > operator()(typename Traits::Plane_3, typename Traits::Plane_3)` -- `boost::optional< boost::variant< Traits::Line_3, Traits::Point_3 > > operator()(typename Traits::Line_3, typename Traits::Plane_3)` +- `std::optional< boost::variant< Traits::Plane_3, Traits::Line_3 > > operator()(typename Traits::Plane_3, typename Traits::Plane_3)` +- `std::optional< boost::variant< Traits::Line_3, Traits::Point_3 > > operator()(typename Traits::Line_3, typename Traits::Plane_3)` */ template diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp index ffa6f9aeb2e..9148d56bd07 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) } Mesh out_union, out_intersection; - std::array, 4> output; + std::array, 4> output; output[PMP::Corefinement::UNION] = &out_union; output[PMP::Corefinement::INTERSECTION] = &out_intersection; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index 5167a240f18..08068a664f3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -69,7 +69,7 @@ enum Boolean_operation_type {UNION = 0, INTERSECTION=1, * \ingroup PMP_corefinement_grp * * \link coref_def_subsec corefines \endlink `tm1` and `tm2` and for each triangle mesh `tm_out` passed - * as an optional in `output` different from `boost::none`, the triangulated surface mesh + * as an optional in `output` different from `std::nullopt`, the triangulated surface mesh * \link coref_def_subsec bounding \endlink the result of a particular Boolean operation * between the volumes bounded by `tm1` and `tm2` will be put in the corresponding triangle mesh. * The positions of the meshes in the array `output` are specific to the Boolean operation to compute @@ -186,7 +186,7 @@ std::array corefine_and_compute_boolean_operations( TriangleMesh& tm1, TriangleMesh& tm2, - const std::array< boost::optional,4>& output, + const std::array< std::optional,4>& output, const NamedParameters1& np1 = parameters::default_values(), const NamedParameters2& np2 = parameters::default_values(), const std::tuple VPM_out_tuple_helper; typedef std::tuple< - boost::optional< typename std::tuple_element<0, VPM_out_tuple_helper>::type::type >, - boost::optional< typename std::tuple_element<1, VPM_out_tuple_helper>::type::type >, - boost::optional< typename std::tuple_element<2, VPM_out_tuple_helper>::type::type >, - boost::optional< typename std::tuple_element<3, VPM_out_tuple_helper>::type::type > + std::optional< typename std::tuple_element<0, VPM_out_tuple_helper>::type::type >, + std::optional< typename std::tuple_element<1, VPM_out_tuple_helper>::type::type >, + std::optional< typename std::tuple_element<2, VPM_out_tuple_helper>::type::type >, + std::optional< typename std::tuple_element<3, VPM_out_tuple_helper>::type::type > > VPM_out_tuple; VPM_out_tuple vpm_out_tuple( @@ -251,24 +251,24 @@ corefine_and_compute_boolean_operations( // for now edges in a coplanar patch are not constrained so there is nothing to constrained here // \todo marked edges from input to output are not ported - if (output[Corefinement::UNION] != boost::none) + if (output[Corefinement::UNION] != std::nullopt) if (&tm1 != *output[Corefinement::UNION]) copy_face_graph(tm1, *(*output[Corefinement::UNION]), parameters::vertex_point_map(vpm1), parameters::vertex_point_map(*std::get(vpm_out_tuple))); - if (output[Corefinement::INTERSECTION] != boost::none) + if (output[Corefinement::INTERSECTION] != std::nullopt) if (&tm1 != *output[Corefinement::INTERSECTION]) copy_face_graph(tm1, *(*output[Corefinement::INTERSECTION]), parameters::vertex_point_map(vpm1), parameters::vertex_point_map(*std::get(vpm_out_tuple))); - if (output[Corefinement::TM1_MINUS_TM2] != boost::none) + if (output[Corefinement::TM1_MINUS_TM2] != std::nullopt) if (&tm1 == *output[Corefinement::TM1_MINUS_TM2]) clear(tm1); - if (output[Corefinement::TM2_MINUS_TM1] != boost::none) + if (output[Corefinement::TM2_MINUS_TM1] != std::nullopt) if (&tm1 == *output[Corefinement::TM2_MINUS_TM1]) clear(tm1); @@ -281,22 +281,22 @@ corefine_and_compute_boolean_operations( if(faces(tm2).empty()) { for (int i=0; i<4; ++i) - if (output[i] != boost::none) + if (output[i] != std::nullopt) clear(*(*output[i])); return CGAL::make_array(true, true, true, true); } // tm2 is not empty - if (output[Corefinement::UNION] != boost::none) + if (output[Corefinement::UNION] != std::nullopt) if (&tm2 != *output[Corefinement::UNION]) copy_face_graph(tm2, *(*output[Corefinement::UNION]), parameters::vertex_point_map(vpm2), parameters::vertex_point_map(*std::get(vpm_out_tuple))); - if (output[Corefinement::INTERSECTION] != boost::none) + if (output[Corefinement::INTERSECTION] != std::nullopt) clear(*(*output[Corefinement::INTERSECTION])); - if (output[Corefinement::TM1_MINUS_TM2] != boost::none) + if (output[Corefinement::TM1_MINUS_TM2] != std::nullopt) clear(*(*output[Corefinement::TM1_MINUS_TM2])); - if (output[Corefinement::TM2_MINUS_TM1] != boost::none) + if (output[Corefinement::TM2_MINUS_TM1] != std::nullopt) if (&tm2 != *output[Corefinement::TM2_MINUS_TM1]) copy_face_graph(tm2, *(*output[Corefinement::TM2_MINUS_TM1]), @@ -308,17 +308,17 @@ corefine_and_compute_boolean_operations( if (faces(tm2).empty()) { // tm1 is not empty - if (output[Corefinement::UNION] != boost::none) + if (output[Corefinement::UNION] != std::nullopt) if (&tm1 != *output[Corefinement::UNION]) copy_face_graph(tm1, *(*output[Corefinement::UNION]), parameters::vertex_point_map(vpm1), parameters::vertex_point_map(*std::get(vpm_out_tuple))); - if (output[Corefinement::INTERSECTION] != boost::none) + if (output[Corefinement::INTERSECTION] != std::nullopt) clear(*(*output[Corefinement::INTERSECTION])); - if (output[Corefinement::TM2_MINUS_TM1] != boost::none) + if (output[Corefinement::TM2_MINUS_TM1] != std::nullopt) clear(*(*output[Corefinement::TM2_MINUS_TM1])); - if (output[Corefinement::TM1_MINUS_TM2] != boost::none) + if (output[Corefinement::TM1_MINUS_TM2] != std::nullopt) if (&tm1 != *output[Corefinement::TM1_MINUS_TM2]) copy_face_graph(tm1, *(*output[Corefinement::TM1_MINUS_TM2]), @@ -394,10 +394,10 @@ corefine_and_compute_boolean_operations( // special case used for clipping open meshes if (choose_parameter(get_parameter(np1, internal_np::use_bool_op_to_clip_surface), false)) { - CGAL_assertion(output[Corefinement::INTERSECTION] != boost::none); - CGAL_assertion(output[Corefinement::UNION] == boost::none); - CGAL_assertion(output[Corefinement::TM1_MINUS_TM2] == boost::none); - CGAL_assertion(output[Corefinement::TM2_MINUS_TM1] == boost::none); + CGAL_assertion(output[Corefinement::INTERSECTION] != std::nullopt); + CGAL_assertion(output[Corefinement::UNION] == std::nullopt); + CGAL_assertion(output[Corefinement::TM1_MINUS_TM2] == std::nullopt); + CGAL_assertion(output[Corefinement::TM2_MINUS_TM1] == std::nullopt); const bool use_compact_clipper = choose_parameter(get_parameter(np1, internal_np::use_compact_clipper), true); ob.setup_for_clipping_a_surface(use_compact_clipper); @@ -523,7 +523,7 @@ corefine_and_compute_union( TriangleMesh& tm1, const NamedParametersOut& np_out = parameters::default_values()) { using namespace CGAL::parameters; - std::array< boost::optional,4> output; + std::array< std::optional,4> output; output[Corefinement::UNION]=&tm_out; return @@ -555,7 +555,7 @@ corefine_and_compute_intersection( TriangleMesh& tm1, const NamedParametersOut& np_out = parameters::default_values()) { using namespace CGAL::parameters; - std::array< boost::optional,4> output; + std::array< std::optional,4> output; output[Corefinement::INTERSECTION]=&tm_out; return @@ -588,7 +588,7 @@ corefine_and_compute_difference( TriangleMesh& tm1, { using namespace CGAL::parameters; using namespace CGAL::Polygon_mesh_processing::Corefinement; - std::array< boost::optional,4> output; + std::array< std::optional,4> output; output[TM1_MINUS_TM2]=&tm_out; return 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 89a3cd82904..3e536e1c19d 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 @@ -181,7 +181,7 @@ class Face_graph_output_builder Node_id_map vertex_to_node_id1, vertex_to_node_id2; // output meshes - const std::array, 4>& requested_output; + const std::array, 4>& requested_output; // input meshes closed ? /// \todo do we really need this? bool is_tm1_closed; @@ -411,7 +411,7 @@ public: const VpmOutTuple& output_vpms, EdgeMarkMapTuple& out_edge_mark_maps, UserVisitor& user_visitor, - const std::array, 4 >& requested_output) + const std::array, 4 >& requested_output) : tm1(tm1), tm2(tm2) , vpm1(vpm1), vpm2(vpm2) , fids1(fids1), fids2(fids2) @@ -513,10 +513,10 @@ public: const boost::dynamic_bitset<>& is_node_of_degree_one, const Mesh_to_map_node&) { - const bool used_to_classify_patches = requested_output[UNION]==boost::none && - requested_output[TM1_MINUS_TM2]==boost::none && - requested_output[TM2_MINUS_TM1]==boost::none && - requested_output[INTERSECTION]==boost::none; + const bool used_to_classify_patches = requested_output[UNION]==std::nullopt && + requested_output[TM1_MINUS_TM2]==std::nullopt && + requested_output[TM2_MINUS_TM1]==std::nullopt && + requested_output[INTERSECTION]==std::nullopt; CGAL_assertion( vertex_to_node_id1.size() <= nodes.size() ); CGAL_assertion( vertex_to_node_id2.size() <= nodes.size() ); @@ -1661,8 +1661,8 @@ public: // special code to handle non-manifold vertices on the boundary for (vertex_descriptor vd : vertices(tm1)) { - boost::optional op_h = is_border(vd, tm1); - if (op_h == boost::none) continue; + std::optional op_h = is_border(vd, tm1); + if (op_h == std::nullopt) continue; halfedge_descriptor h = *op_h; CGAL_assertion( target(h, tm1) == vd); // check if the target of h is a non-manifold vertex 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 ee3d3159491..9bc65305806 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 @@ -399,20 +399,20 @@ struct TweakedGetVertexPointMap }; template -boost::optional< typename TweakedGetVertexPointMap::type > -get_vpm(const NP& np, boost::optional opm, std::true_type) +std::optional< typename TweakedGetVertexPointMap::type > +get_vpm(const NP& np, std::optional opm, std::true_type) { - if (boost::none == opm) return boost::none; + if (std::nullopt == opm) return std::nullopt; return parameters::choose_parameter( parameters::get_parameter(np, internal_np::vertex_point), get_property_map(boost::vertex_point, *(*opm)) ); } template -boost::optional< typename TweakedGetVertexPointMap::type > -get_vpm(const NP&, boost::optional opm, std::false_type) +std::optional< typename TweakedGetVertexPointMap::type > +get_vpm(const NP&, std::optional opm, std::false_type) { - if (boost::none == opm) return boost::none; + if (std::nullopt == opm) return std::nullopt; return typename TweakedGetVertexPointMap::type(); } // diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h index 81f3ca6478d..468acfaf5b4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h @@ -266,7 +266,7 @@ public: to_exact( get(vpm, target(next(h3,tm),tm)))); const auto inter_res = exact_intersection(p1, p2, p3); - CGAL_assertion(inter_res != boost::none); + CGAL_assertion(inter_res != std::nullopt); const Exact_kernel::Point_3* pt = boost::get(&(*inter_res)); CGAL_assertion(pt!=nullptr); @@ -387,7 +387,7 @@ public: get(vpm, target(next(h3,tm),tm))); const auto inter_res = intersection(p1, p2, p3); - CGAL_assertion(inter_res != boost::none); + CGAL_assertion(inter_res != std::nullopt); const Point_3* pt = boost::get(&(*inter_res)); CGAL_assertion(pt!=nullptr); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h index 5e84ba9e694..978ca2cd4b0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h @@ -797,7 +797,7 @@ public: Triangulation tr; std::vector edge_exist; std::pair range(0, n-1); - std::tuple, bool, bool> res = construct_3D_triangulation(P, range, tr, edge_exist); + std::tuple, bool, bool> res = construct_3D_triangulation(P, range, tr, edge_exist); if(!std::get<2>(res)) { #ifdef CGAL_HOLE_FILLING_VERBOSE #ifndef CGAL_TEST_SUITE @@ -944,14 +944,14 @@ private: } // returns [h.first-h.second edge, true if all edges inside 3D triangulation, true if tr.dimension() >= 2] - std::tuple, bool, bool> + std::tuple, bool, bool> construct_3D_triangulation(const Polyline_3& P, std::pair h, Triangulation& tr, std::vector& edge_exist) const { // construct 3D tr with P[h.first], P[h.second] also assign ids from h.first to h.second - boost::optional e; + std::optional e; int n_border = h.second - h.first + 1; tr.insert(boost::make_transform_iterator(std::next(P.begin(), h.first), Auto_count(h.first)), boost::make_transform_iterator(std::next(P.begin(), h.second +1), Auto_count(h.first))); @@ -999,7 +999,7 @@ private: * + when switched to all-space, we use map based lookup tables. ************************************************************************/ Weight fill_by_incomplete_patches(Triangulation& tr, - boost::optional start_edge, + std::optional start_edge, std::vector& edge_exist, const Polyline_3& P, const Polyline_3& Q, @@ -1072,7 +1072,7 @@ private: // construct tr for next coming hole h = remaining_holes.back(); tr.clear(); - std::tuple, bool, bool> res = construct_3D_triangulation(P, h, tr, edge_exist); + std::tuple, bool, bool> res = construct_3D_triangulation(P, h, tr, edge_exist); if(!std::get<0>(res)) { #ifdef CGAL_HOLE_FILLING_VERBOSE CGAL_warning_msg(false, "Returning no output. Filling hole with incomplete patches is not successful!"); 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 9cdb76ac76b..2a8c5551e90 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 @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include @@ -1944,7 +1944,7 @@ private: bool check_normals(const HalfedgeRange& hedges) const { std::size_t nb_patches = patch_id_to_index_map.size(); - //std::vector > normal_per_patch(nb_patches,boost::none); + //std::vector > normal_per_patch(nb_patches,std::nullopt); std::vector initialized(nb_patches,false); std::vector normal_per_patch(nb_patches); @@ -1968,7 +1968,7 @@ private: return false; } } - //normal_per_patch[index] = boost::make_optional(n); + //normal_per_patch[index] = std::make_optional(n); normal_per_patch[index] = n; initialized[index] = true; } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h index 49cfea2a724..92c5871d290 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h @@ -14,7 +14,7 @@ #include #include -#include +#include #include @@ -96,7 +96,7 @@ public: const typename Traits::Construct_target_3 m_target_3; typedef boost::variant Variant_type; - typedef boost::optional< Variant_type > result_type; + typedef std::optional< Variant_type > result_type; Intersect_3(const Axis_parallel_plane_traits& traits) : m_cst_coord(traits.m_cst_coord) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Point_inside_vertical_ray_cast.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Point_inside_vertical_ray_cast.h index e282e092fa1..aabe4d20199 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Point_inside_vertical_ray_cast.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Point_inside_vertical_ray_cast.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -78,9 +78,9 @@ public: //the direction of the vertical ray depends on the position of the point in the bbox //in order to limit the expected number of nodes visited. Ray query = ray_functor(point, vector_functor(0,0,(2*point.z() < bbox.zmax()+bbox.zmin()?-1:1))); - boost::optional res = is_inside_ray_tree_traversal(query, tree); + std::optional res = is_inside_ray_tree_traversal(query, tree); - if(res == boost::none) + if(res == std::nullopt) { CGAL::Random rg(seed); // seed some value for make it easy to debug Random_points_on_sphere_3 random_point(1.,rg); @@ -88,14 +88,14 @@ public: do { //retry with a random ray query = ray_functor(point, vector_functor(CGAL::ORIGIN,*random_point++)); res = is_inside_ray_tree_traversal(query, tree); - } while (res == boost::none); + } while (res == std::nullopt); } return *res; } private: template - boost::optional + std::optional is_inside_ray_tree_traversal(const Ray& ray, const AABBTree& tree) const { std::pair @@ -114,7 +114,7 @@ private: //otherwise the point is on the facet return ON_BOUNDARY; } - return boost::optional(); // indeterminate + return std::optional(); // indeterminate } }; 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 9dea9e3b4c1..3ac7b6b08f8 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 @@ -102,7 +102,7 @@ public: constrained_flags_[get(vimap_, v)] = true; // scaling things cannot preserve the position of more than a single constrained point - if(anchor_point == boost::none) + if(anchor_point == std::nullopt) anchor_point = get(vpmap_, v); else scale_volume_after_smoothing_ = false; @@ -230,7 +230,7 @@ public: // If no vertex is constrained, then the smoothed mesh will share the same centroid as the input mesh Point pre_smooth_anchor_point; - if(anchor_point != boost::none) + if(anchor_point != std::nullopt) pre_smooth_anchor_point = *anchor_point; else pre_smooth_anchor_point = PMP::centroid(mesh_, parameters::vertex_point_map(vpmap_).geom_traits(traits_)); @@ -247,7 +247,7 @@ public: } Point post_smooth_anchor_point; - if(anchor_point != boost::none) + if(anchor_point != std::nullopt) post_smooth_anchor_point = *anchor_point; else post_smooth_anchor_point = PMP::centroid(mesh_, parameters::vertex_point_map(vpmap_).geom_traits(traits_)); @@ -364,7 +364,7 @@ private: // of the initial mesh if no vertex is constrained. If there is more than a constrained vertex, // then no scaling can be done without violating the constraint. bool scale_volume_after_smoothing_; - boost::optional anchor_point; + std::optional anchor_point; // linear system data std::vector diagonal_; // index of vector -> index of vimap_ 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 04e5cc6a144..090f0c775e2 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -1846,7 +1846,7 @@ locate_with_AABB_tree(const typename internal::Location_traits AABB_traits; typedef AABB_tree AABB_face_graph_tree; typedef typename AABB_face_graph_tree::template Intersection_and_primitive_id::Type Intersection_type; - typedef boost::optional Ray_intersection; + typedef std::optional Ray_intersection; using parameters::get_parameter; using parameters::choose_parameter; 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 798499f430b..860ba20da7a 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 @@ -197,7 +197,7 @@ bool is_collapse_geometrically_valid(typename boost::graph_traits: // @todo handle boundary edges template -boost::optional +std::optional get_collapse_volume(typename boost::graph_traits::halfedge_descriptor h, const TriangleMesh& tmesh, const VPM& vpm, @@ -244,7 +244,7 @@ get_collapse_volume(typename boost::graph_traits::halfedge_descrip Vector_3 n1 = gt.construct_cross_product_vector_3_object()(v_ar, v_ab); Vector_3 n2 = gt.construct_cross_product_vector_3_object()(v_ak, v_ab); if(gt.compute_scalar_product_3_object()(n1, n2) <= 0) - return boost::none; + return std::nullopt; delta_vol += volume(b, a, removed, origin) + volume(a, b, kept, origin); // opposite orientation } @@ -268,27 +268,27 @@ get_best_edge_orientation(typename boost::graph_traits::edge_descr halfedge_descriptor h = halfedge(e, tmesh), ho = opposite(h, tmesh); - boost::optional dv1 = get_collapse_volume(h, tmesh, vpm, gt); - boost::optional dv2 = get_collapse_volume(ho, tmesh, vpm, gt); + std::optional dv1 = get_collapse_volume(h, tmesh, vpm, gt); + std::optional dv2 = get_collapse_volume(ho, tmesh, vpm, gt); // the resulting point of the collapse of a halfedge is the target of the halfedge before collapse if(get(vcm, source(h, tmesh))) - return dv2 != boost::none ? ho + return dv2 != std::nullopt ? ho : boost::graph_traits::null_halfedge(); if(get(vcm, target(h, tmesh))) - return dv1 != boost::none ? h + return dv1 != std::nullopt ? h : boost::graph_traits::null_halfedge(); - if(dv1 != boost::none) + if(dv1 != std::nullopt) { - if(dv2 != boost::none) + if(dv2 != std::nullopt) return (*dv1 < *dv2) ? h : ho; return h; } - if(dv2 != boost::none) + if(dv2 != std::nullopt) return ho; return boost::graph_traits::null_halfedge(); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h index ff04ca9bfcc..56733b660fd 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h @@ -63,7 +63,7 @@ namespace CGAL { /// - `Point_3` /// - `Segment_3` /// - `Oriented_side_3` with `Oriented_side operator()(Plane_3, Point_3)` -/// - `Do_intersect_3` with `boost::optional operator()(Plane_3,Segment_3)` +/// - `Do_intersect_3` with `std::optional operator()(Plane_3,Segment_3)` /// - `Do_intersect_3` with `bool operator()(Plane_3, Bbox_3)` /// /// \todo If we keep the traits for plane orthogonal to a frame axis, `Traits` must also provide: @@ -277,7 +277,7 @@ class Polygon_mesh_slicer get(m_vpmap,target(ed, m_tmesh)) ); const auto inter = intersect_3(m_plane, s); - CGAL_assertion(inter != boost::none); + CGAL_assertion(inter != std::nullopt); const Point_3* pt_ptr = boost::get(&(*inter)); current_poly.push_back( *pt_ptr ); } diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index c8a311a37ae..7a377a935c9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -825,7 +825,7 @@ private: for (unsigned int i = 0; i < cutp.size(); i++){ const Plane& plane_i = prism[cutp[i]]; - boost::optional op = intersection_point_for_polyhedral_envelope(line, plane_i.eplane); + std::optional op = intersection_point_for_polyhedral_envelope(line, plane_i.eplane); if(! op){ std::cout << "there must be an intersection 2" << std::endl; } @@ -950,7 +950,7 @@ private: } for (unsigned int j = 0; j < cidl.size(); j++) { - boost::optional op = intersection_point_for_polyhedral_envelope(line, + std::optional op = intersection_point_for_polyhedral_envelope(line, halfspace[prismindex[queue[i]]][cidl[j]].eplane); const ePoint_3& ip = *op; inter = Implicit_Seg_Facet_interpoint_Out_Prism_return_local_id @@ -1142,7 +1142,7 @@ private: const Plane& plane_i = prism[cutp[i]]; const eLine_3& eline = *(seg[k]); - boost::optional op = intersection_point_for_polyhedral_envelope(eline, plane_i.eplane); + std::optional op = intersection_point_for_polyhedral_envelope(eline, plane_i.eplane); if(! op){ #ifdef CGAL_ENVELOPE_DEBUG std::cout << "there must be an intersection 6" << std::endl; @@ -1227,7 +1227,7 @@ private: } - boost::optional ipp = intersection_point_for_polyhedral_envelope(tri_eplane, prism[cutp[i]].eplane, prism[cutp[j]].eplane); + std::optional ipp = intersection_point_for_polyhedral_envelope(tri_eplane, prism[cutp[i]].eplane, prism[cutp[j]].eplane); if(ipp){ inter = is_3_triangle_cut_float_fast(etri0, etri1, etri2, n, @@ -1667,7 +1667,7 @@ private: if (!cut) continue; for (unsigned int j = 0; j < cidl.size(); j++) { - boost::optional op = intersection_point_for_polyhedral_envelope(eline, + std::optional op = intersection_point_for_polyhedral_envelope(eline, halfspace[prismindex[queue[i]]][cidl[j]].eplane); const ePoint_3& ip = *op; inter = Implicit_Seg_Facet_interpoint_Out_Prism_return_local_id(ip, idlist, jump1, check_id); @@ -1751,7 +1751,7 @@ private: } // now we know that there exists an intesection point - boost::optional op = intersection_point_for_polyhedral_envelope(eline, + std::optional op = intersection_point_for_polyhedral_envelope(eline, halfspace[filtered_intersection[queue[i]]][intersect_face[queue[i]][j]].eplane); const ePoint_3& ip = *op; @@ -1834,7 +1834,7 @@ private: // We moved the intersection here // In case there is no intersection point we continue - boost::optional + std::optional op = intersection_point_for_polyhedral_envelope(etriangle_eplane, halfspace[jump1][intersect_face[queue[i]][k]].eplane, halfspace[jump2][intersect_face[queue[j]][h]].eplane); @@ -2113,7 +2113,7 @@ private: } ePoint_3 origin(env_vertices[env_faces[i][0]].x(), env_vertices[env_faces[i][0]].y(),env_vertices[env_faces[i][0]].z()); Surface_mesh esm; - halfspace_intersection_3(eplanes.begin(),eplanes.end(),esm , boost::make_optional(origin)); + halfspace_intersection_3(eplanes.begin(),eplanes.end(),esm , std::make_optional(origin)); copy_face_graph(esm,sm); } diff --git a/Polygon_mesh_processing/include/CGAL/Side_of_triangle_mesh.h b/Polygon_mesh_processing/include/CGAL/Side_of_triangle_mesh.h index 89e28153408..eff54edea7c 100644 --- a/Polygon_mesh_processing/include/CGAL/Side_of_triangle_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Side_of_triangle_mesh.h @@ -99,7 +99,7 @@ class Side_of_triangle_mesh typename GeomTraits::Construct_ray_3 ray_functor; typename GeomTraits::Construct_vector_3 vector_functor; const TriangleMesh* tm_ptr; - boost::optional opt_vpm; + std::optional opt_vpm; bool own_tree; CGAL::Bbox_3 box; #ifdef CGAL_HAS_THREADS @@ -255,7 +255,7 @@ public: CGAL_SCOPED_LOCK(tree_mutex); tree_ptr = const_cast(atomic_tree_ptr.load(std::memory_order_relaxed)); #endif - CGAL_assertion(tm_ptr != nullptr && opt_vpm!=boost::none); + CGAL_assertion(tm_ptr != nullptr && opt_vpm!=std::nullopt); if (tree_ptr==nullptr) { tree_ptr = new AABB_tree(faces(*tm_ptr).first, @@ -297,7 +297,7 @@ public: CGAL_SCOPED_LOCK(tree_mutex); tree_ptr = const_cast(atomic_tree_ptr.load(std::memory_order_relaxed)); #endif - CGAL_assertion(tm_ptr != nullptr && opt_vpm!=boost::none); + CGAL_assertion(tm_ptr != nullptr && opt_vpm!=std::nullopt); if (tree_ptr==nullptr) { tree_ptr = new AABB_tree(faces(*tm_ptr).first, diff --git a/Polygon_mesh_processing/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h b/Polygon_mesh_processing/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h index c12178a1b9c..c171510f1f9 100644 --- a/Polygon_mesh_processing/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h +++ b/Polygon_mesh_processing/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include @@ -34,8 +34,8 @@ namespace internal { struct Dummy_filter2 { template inline - const boost::optional - operator()(const Profile&, const boost::optional& op) const + const std::optional + operator()(const Profile&, const std::optional& op) const { return op; } @@ -109,8 +109,8 @@ public: template - boost::optional - operator()(const Profile& profile, boost::optional op) const + std::optional + operator()(const Profile& profile, std::optional op) const { typedef typename Profile::Point Point; typedef typename Profile::vertex_descriptor_vector Link; @@ -127,7 +127,7 @@ public: if(! (*m_envelope)(p)){ // the new placement is outside envelope - return boost::none; + return std::nullopt; } const Link link = profile.link(); @@ -141,7 +141,7 @@ public: if(! (*m_envelope)(p, pv, pw)){ // the triangle intersects the envelope - return boost::none; + return std::nullopt; } pv = pw; 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 1eec758737e..3f3af6c44ae 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 @@ -164,11 +164,11 @@ void test_bool_op_no_copy( assert( count_constrained_edges(tm1, ecm1)==307 ); assert( count_constrained_edges(tm2, ecm2)==307 ); - typedef boost::optional OTM; + typedef std::optional OTM; Triangle_mesh *ptr = nullptr; const std::array output = - reverse ? CGAL::make_array(OTM(&tm2), OTM(&tm1), boost::make_optional(false,ptr), boost::make_optional(false,ptr)) - : CGAL::make_array(OTM(&tm1), OTM(&tm2), boost::make_optional(false,ptr), boost::make_optional(false,ptr)); + reverse ? CGAL::make_array(OTM(&tm2), OTM(&tm1), std::make_optional(false,ptr), std::make_optional(false,ptr)) + : CGAL::make_array(OTM(&tm1), OTM(&tm2), std::make_optional(false,ptr), std::make_optional(false,ptr)); PMP::corefine_and_compute_boolean_operations(tm1, tm2, output, 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 cc012385996..a0f7679dc4c 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 @@ -88,7 +88,7 @@ void run_boolean_operations( { std::cout << "Scenario #" << id << " - " << scenario << "\n"; - typedef boost::optional OSM; + typedef std::optional OSM; std::array output; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp index 8aeaab049db..17b35766008 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -393,8 +393,8 @@ void test_predicates(const G& g, CGAL::Random& rnd) loc.second[id_of_h] = FT(1); loc.second[(id_of_h+1)%3] = FT(0); loc.second[(id_of_h+2)%3] = FT(0); - boost::optional opt_hd = CGAL::is_border(source(h, g), g); - assert(PMP::is_on_mesh_border(loc, g) == (opt_hd != boost::none)); + std::optional opt_hd = CGAL::is_border(source(h, g), g); + assert(PMP::is_on_mesh_border(loc, g) == (opt_hd != std::nullopt)); loc.second[id_of_h] = FT(0.5); loc.second[(id_of_h+1)%3] = FT(0.5); diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index b797ecf7a70..fe7d8ddad06 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1267,7 +1267,7 @@ void MainWindow::open(QString filename) bool MainWindow::open(QString filename, QString loader_name) { QFileInfo fileinfo(filename); - boost::optional item_opt; + std::optional item_opt; try { item_opt = wrap_a_call_to_cpp ([this, fileinfo, loader_name]() @@ -1890,7 +1890,7 @@ void MainWindow::closeEvent(QCloseEvent *event) bool MainWindow::loadScript(QString filename) { QFileInfo fileinfo(filename); - boost::optional opt = wrap_a_call_to_cpp + std::optional opt = wrap_a_call_to_cpp ([this, fileinfo] { return loadScript(fileinfo); }, this, __FILE__, __LINE__, CGAL::Three::PARENT_CONTEXT); 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 68c3053d876..4c13bccee7c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -67,7 +67,7 @@ #include #include -#include +#include #include #include @@ -119,13 +119,13 @@ Q_SIGNALS: void x(QString); public: - void setIC(const IntConverter& x) { ic = x; fc = boost::optional(); } - void setFC(const DoubleConverter& x) { fc = x; ic = boost::optional(); } + void setIC(const IntConverter& x) { ic = x; fc = std::optional(); } + void setFC(const DoubleConverter& x) { fc = x; ic = std::optional(); } void setViewer(Viewer_interface* viewer) { this->viewer = viewer; } private: - boost::optional ic; - boost::optional fc; + std::optional ic; + std::optional fc; Viewer_interface* viewer; void getPixel(const QPoint& e) { 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 eb3ce6042ae..da298acf6ff 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -29,7 +29,7 @@ auto make_not_null(T&& t) { } #include -#include +#include #include "Scene_polylines_item.h" #ifdef CGAL_MESH_3_DEMO_ACTIVATE_IMPLICIT_FUNCTIONS @@ -130,7 +130,7 @@ public: } public Q_SLOTS: - boost::optional get_items_or_return_error_string() const; + std::optional get_items_or_return_error_string() const; void set_defaults(); void mesh_3_volume(); void mesh_3_surface(); @@ -231,7 +231,7 @@ private: IMAGE_MESH_ITEMS, IMPLICIT_MESH_ITEMS }; - mutable boost::optional> items; @@ -277,7 +277,7 @@ void Mesh_3_plugin::mesh_3_volume() mesh_3(Mesh_type::VOLUME); } -boost::optional Mesh_3_plugin::get_items_or_return_error_string() const +std::optional Mesh_3_plugin::get_items_or_return_error_string() const { using boost::get; items = {}; @@ -355,7 +355,7 @@ boost::optional Mesh_3_plugin::get_items_or_return_error_string() const //attach polylines_item to one or the other item //if it could not be done in the for loop //because of selection order - if (polylines_item != nullptr && items != boost::none) + if (polylines_item != nullptr && items != std::nullopt) { auto poly_items_ptr = get(&*items); auto image_items_ptr = get(&*items); 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 6f2e1eed542..a25fa8072f0 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include using namespace CGAL::Three; @@ -189,11 +189,11 @@ public Q_SLOTS: void on_Sample_random_points_from_bbox() { // calculate bbox of selected polyhedron items - boost::optional bbox - = boost::make_optional(false, CGAL::Three::Scene_interface::Bbox()); + std::optional bbox + = std::make_optional(false, CGAL::Three::Scene_interface::Bbox()); // Workaround a bug in g++-4.8.3: // https://stackoverflow.com/a/21755207/1728537 - // Using boost::make_optional to copy-initialize 'bbox' hides the + // Using std::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/Selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp index 5f543518f2f..f4134ecfd15 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp @@ -497,7 +497,7 @@ public Q_SLOTS: return; } - boost::optional minimum = + std::optional minimum = selection_item->select_isolated_components(ui_widget.Threshold_size_spin_box->value()); if(minimum) { ui_widget.Threshold_size_spin_box->setValue((int) *minimum); @@ -512,7 +512,7 @@ public Q_SLOTS: print_message("Error: there is no selected polyhedron selection item!"); return; } - boost::optional minimum = selection_item->get_minimum_isolated_component(); + std::optional minimum = selection_item->get_minimum_isolated_component(); if(minimum) { ui_widget.Threshold_size_spin_box->setValue((int) *minimum); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp index 9385ee2442b..724ed194fc5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp @@ -309,7 +309,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::on_Select_isolated_components_butto Scene_edit_polyhedron_item* edit_item = qobject_cast(scene->item(item_id)); if(!edit_item) return; // the selected item is not of the right type - boost::optional minimum = + std::optional minimum = edit_item->select_isolated_components(ui_widget.Threshold_size_spin_box->value()); if(minimum) { ui_widget.Threshold_size_spin_box->setValue((int) *minimum); @@ -321,7 +321,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::on_Get_minimum_button_clicked() { Scene_edit_polyhedron_item* edit_item = qobject_cast(scene->item(item_id)); if(!edit_item) return; // the selected item is not of the right type - boost::optional minimum = edit_item->get_minimum_isolated_component(); + std::optional minimum = edit_item->get_minimum_isolated_component(); if(minimum) { ui_widget.Threshold_size_spin_box->setValue((int) *minimum); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp index 28163a38043..c4a060696cd 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp @@ -1621,7 +1621,7 @@ void Scene_edit_polyhedron_item::reset_deform_object() refresh_all_group_centers(); } -boost::optional Scene_edit_polyhedron_item::get_minimum_isolated_component() { +std::optional Scene_edit_polyhedron_item::get_minimum_isolated_component() { Travel_isolated_components::Minimum_visitor visitor; Travel_isolated_components(*surface_mesh()).travel (vertices(*surface_mesh()).first, vertices(*surface_mesh()).second, @@ -1630,7 +1630,7 @@ boost::optional Scene_edit_polyhedron_item::get_minimum_isolated_co } -boost::optional Scene_edit_polyhedron_item::select_isolated_components(std::size_t threshold) { +std::optional Scene_edit_polyhedron_item::select_isolated_components(std::size_t threshold) { typedef boost::function_output_iterator > Output_iterator; Output_iterator out(d->deform_sm_mesh); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h index 3fc7b02d1dd..b78d140ffe3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h @@ -379,7 +379,7 @@ public: } }; - boost::optional get_minimum_isolated_component(); + std::optional get_minimum_isolated_component(); template struct Select_roi_output{ typedef typename CGAL::Surface_mesh_deformation select_isolated_components(std::size_t threshold) ; + std::optional select_isolated_components(std::size_t threshold) ; protected: // Deformation related functions // diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index 8164cdacf8f..15b6171cf28 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -289,14 +289,14 @@ public: { // Workaround a bug in g++-4.8.3: // https://stackoverflow.com/a/21755207/1728537 - // Using boost::make_optional to copy-initialize 'item_bbox' hides the + // Using std::make_optional to copy-initialize 'item_bbox' hides the // warning about '*item_bbox' not being initialized. // -- Laurent Rineau, 2014/10/30 constVPmap vpm = get(CGAL::vertex_point, *polyhedron()); - boost::optional item_bbox - = boost::make_optional(false, CGAL::Bbox_3()); + std::optional item_bbox + = std::make_optional(false, CGAL::Bbox_3()); for(Selection_set_vertex::const_iterator v_it = selected_vertices.begin(); @@ -488,7 +488,7 @@ public: clear(); } - boost::optional get_minimum_isolated_component() { + std::optional get_minimum_isolated_component() { switch(get_active_handle_type()) { case Active_handle::VERTEX: return get_minimum_isolated_component(); @@ -499,7 +499,7 @@ public: } } template // use fg_vertex_descriptor, fg_face_descriptor, fg_edge_descriptor - boost::optional get_minimum_isolated_component() { + std::optional get_minimum_isolated_component() { Selection_traits tr(this); Travel_isolated_components::Minimum_visitor visitor; Travel_isolated_components(*polyhedron()).travel @@ -507,7 +507,7 @@ public: return visitor.minimum; } - boost::optional select_isolated_components(std::size_t threshold) { + std::optional select_isolated_components(std::size_t threshold) { switch(get_active_handle_type()) { case Active_handle::VERTEX: return select_isolated_components(threshold); @@ -518,7 +518,7 @@ public: } } template // use fg_vertex_descriptor, fg_face_descriptor, fg_edge_descriptor - boost::optional select_isolated_components(std::size_t threshold) { + std::optional select_isolated_components(std::size_t threshold) { typedef Selection_traits Tr; Tr tr(this); typedef std::insert_iterator Output_iterator; diff --git a/Polyhedron/demo/Polyhedron/Travel_isolated_components.h b/Polyhedron/demo/Polyhedron/Travel_isolated_components.h index 5cdd2dfdeb9..c1e1124f6b2 100644 --- a/Polyhedron/demo/Polyhedron/Travel_isolated_components.h +++ b/Polyhedron/demo/Polyhedron/Travel_isolated_components.h @@ -1,7 +1,7 @@ #ifndef TRAVEL_ISOLATED_COMPONENTS_H #define TRAVEL_ISOLATED_COMPONENTS_H -#include +#include #include #include "One_ring_iterators.h" #include diff --git a/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationCostFunction.h b/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationCostFunction.h index 4722bcaa72c..b945f776017 100644 --- a/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationCostFunction.h +++ b/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationCostFunction.h @@ -27,7 +27,7 @@ Given a vertex in constraint iterator `viq` computes `vip=std::prev(viq)` and `v \param ct The underlying constrained Delaunay triangulation which embeds the polyline constraints \param viq The vertex in constraint iterator of the vertex to remove -\returns The cost for removing `*viq`. The value `boost::none` can be returned to indicate an infinite or uncomputable cost. +\returns The cost for removing `*viq`. The value `std::nullopt` can be returned to indicate an infinite or uncomputable cost. \tparam CDT must be `CGAL::Constrained_triangulation_plus_2` with a vertex type that is model of `PolylineSimplificationVertexBase_2`. `CDT::Geom_traits` must be model of @@ -35,7 +35,7 @@ the concept `ConstrainedDelaunayTriangulationTraits_2`. */ template - boost::optional + std::optional operator()(CGAL::Constrained_triangulation_plus_2 const& ct, CGAL::Constrained_triangulation_plus_2::Vertices_in_constraint_iterator viq) const;} diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Hybrid_squared_distance_cost.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Hybrid_squared_distance_cost.h index d7f169997b7..9af95a9e422 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Hybrid_squared_distance_cost.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Hybrid_squared_distance_cost.h @@ -49,7 +49,7 @@ public: /// \tparam CDT must be `CGAL::Constrained_Delaunay_triangulation_2` with a vertex type that /// is model of `PolylineSimplificationVertexBase_2`. template - boost::optional + std::optional operator()( const Constrained_triangulation_plus_2& pct , typename Constrained_triangulation_plus_2::Vertices_in_constraint_iterator vicq) const { diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Scaled_squared_distance_cost.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Scaled_squared_distance_cost.h index 53ecf34cc6f..9a5b53e4259 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Scaled_squared_distance_cost.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Scaled_squared_distance_cost.h @@ -44,7 +44,7 @@ public: /// \tparam CDT must be `CGAL::Constrained_Delaunay_triangulation_2` with a vertex type that /// is model of `PolylineSimplificationVertexBase_2`. template - boost::optional + std::optional operator()(const Constrained_triangulation_plus_2& pct , typename Constrained_triangulation_plus_2::Vertices_in_constraint_iterator vicq) const { @@ -94,8 +94,8 @@ public: }while(vc != done); return d2_uninitialized ? - boost::optional(boost::none) : - boost::optional(d1 / d2); + std::optional(std::nullopt) : + std::optional(d1 / d2); } }; diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Squared_distance_cost.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Squared_distance_cost.h index 08ca152ddd0..bf1badd8612 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Squared_distance_cost.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Squared_distance_cost.h @@ -50,7 +50,7 @@ public: /// is model of `PolylineSimplificationVertexBase_2`. template - boost::optional + std::optional operator()(const Constrained_triangulation_plus_2& pct , typename Constrained_triangulation_plus_2::Vertices_in_constraint_iterator vicq)const { diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index d5497788a02..02552570841 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -211,7 +211,7 @@ public: it != pct.vertices_in_constraint_end(cid); ++it){ if((*it)->is_removable()){ - boost::optional dist = cost(pct, it); + std::optional dist = cost(pct, it); if(dist){ (*it)->set_cost(*dist); if(! (*mpq).contains(*it)){ @@ -326,7 +326,7 @@ operator()() pct.simplify(vit); if((*u)->is_removable()){ - boost::optional dist = cost(pct, u); + std::optional dist = cost(pct, u); if(! dist){ // cost is undefined if( mpq->contains(*u) ){ @@ -344,7 +344,7 @@ operator()() } if((*w)->is_removable()){ - boost::optional dist = cost(pct, w); + std::optional dist = cost(pct, w); if(! dist){ // cost is undefined if( mpq->contains(*w) ){ diff --git a/STL_Extension/doc/STL_Extension/CGAL/Object.h b/STL_Extension/doc/STL_Extension/CGAL/Object.h index c75541b0ae9..ddf919ef64a 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Object.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Object.h @@ -117,9 +117,9 @@ Object(boost::variant); /*! Implicit converting constructor for compatibility with -`boost::optional` and `boost::variant`. +`std::optional` and `boost::variant`. */ -Object(boost::optional< boost::variant >); +Object(std::optional< boost::variant >); /// @} diff --git a/STL_Extension/doc/STL_Extension/CGAL/iterator.h b/STL_Extension/doc/STL_Extension/CGAL/iterator.h index fdc82bb1ffd..5e1e1acce56 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/iterator.h +++ b/STL_Extension/doc/STL_Extension/CGAL/iterator.h @@ -107,9 +107,9 @@ The class `Dispatch_or_drop_output_iterator` defines an dispatches among those based on the type of the value type which is put in it. Besides defining assignment for all parameters of `V` and for a tuple of type `V`, it is also defined for the types `boost::variant` and -`boost::optional >`, where `T...` +`std::optional >`, where `T...` must be a subset of the parameters of `V`. Should the -`boost::optional` be empty, it will be discarded. +`std::optional` be empty, it will be discarded. \cgalHeading{Parameters} @@ -195,7 +195,7 @@ put in it. Other types are also accepted, and the object is discarded in this case. Besides defining assignment for all parameters of `V` and for a tuple of type `V`, it is also defined for the types `boost::variant` and -`boost::optional >`, where `T...` +`std::optional >`, where `T...` can be a list of arbitrary types. It also inherits from `O`, which makes it easy to treat like a diff --git a/STL_Extension/examples/STL_Extension/Dispatch_output_iterator.cpp b/STL_Extension/examples/STL_Extension/Dispatch_output_iterator.cpp index f55d06db392..44ff692c788 100644 --- a/STL_Extension/examples/STL_Extension/Dispatch_output_iterator.cpp +++ b/STL_Extension/examples/STL_Extension/Dispatch_output_iterator.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include int main() { diff --git a/STL_Extension/include/CGAL/Modifiable_priority_queue.h b/STL_Extension/include/CGAL/Modifiable_priority_queue.h index 2f24c67cd77..e4fe97cda41 100644 --- a/STL_Extension/include/CGAL/Modifiable_priority_queue.h +++ b/STL_Extension/include/CGAL/Modifiable_priority_queue.h @@ -12,7 +12,7 @@ #define CGAL_MODIFIABLE_PRIORITY_QUEUE_H #include // Needed by the following Boost header for CHAR_BIT. -#include +#include #include #include @@ -66,14 +66,14 @@ public: bool contains ( value_type const& v ) { return mHeap.contains(v) ; } - boost::optional extract_top() + std::optional extract_top() { - boost::optional r ; + std::optional r ; if ( !empty() ) { value_type v = top(); pop(); - r = boost::optional(v) ; + r = std::optional(v) ; } return r ; } @@ -238,14 +238,14 @@ public: return (mHandles[vid] != handle_type()); } - boost::optional extract_top() + std::optional extract_top() { - boost::optional r; + std::optional r; if(!empty()) { value_type v = top(); pop(); - r = boost::optional(v); + r = std::optional(v); } return r; diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index fdfd59bd514..33a01aac875 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -65,7 +65,7 @@ class Object // implicit constructor from optionals containing variants template - Object(const boost::optional< boost::variant >& t) + Object(const std::optional< boost::variant >& t) : obj( t ? boost::apply_visitor(Any_from_variant(), *t) : nullptr) { } // implicit constructor from variants 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 a02a831f044..96f9f2aa08c 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 @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include // for CHAR_BIT #include @@ -79,13 +79,13 @@ private: /** The value associated with this group. This value is only valid * when @c kind!=largest_key (which indicates a deleted - * element). Note that the use of boost::optional increases the + * element). Note that the use of std::optional increases the * memory requirements slightly but does not result in extraneous * memory allocations or deallocations. The optional could be * eliminated when @c value_type is a model of * DefaultConstructible. */ - ::boost::optional< value_type > value; + ::std::optional< value_type > value; /** * The kind of key stored at this group. This may be @c @@ -205,14 +205,14 @@ public: value_type& top() { find_smallest(); - CGAL_assertion(smallest_value->value != boost::none); + CGAL_assertion(smallest_value->value != std::nullopt); return *smallest_value->value; } const value_type& top() const { find_smallest(); - CGAL_assertion(smallest_value->value != boost::none); + CGAL_assertion(smallest_value->value != std::nullopt); return *smallest_value->value; } @@ -238,7 +238,7 @@ public: rank_type r = x->rank; group* p = x->parent; { - CGAL_assertion(x->value != boost::none); + CGAL_assertion(x->value != std::nullopt); // Find x's group size_type start = get(id, *x->value) - get(id, *x->value) % log_n; @@ -727,7 +727,7 @@ private: * are each log_n long, with the last group potentially being * smaller. */ - std::vector< ::boost::optional< value_type > > groups; + std::vector< ::std::optional< value_type > > groups; /** The list of active groups, indexed by rank. When A[r] is null, * there is no active group of rank r. Otherwise, A[r] is the active diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index 956cc88a8c2..4928d3d519f 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -1388,7 +1388,7 @@ public: } template - Self& operator=(const boost::optional< boost::variant >& t) { + Self& operator=(const std::optional< boost::variant >& t) { internal::Output_visitor visitor(this); if(t) boost::apply_visitor(visitor, *t); return *this; diff --git a/STL_Extension/test/STL_Extension/test_Object.cpp b/STL_Extension/test/STL_Extension/test_Object.cpp index 705779bee86..36cacb0f334 100644 --- a/STL_Extension/test/STL_Extension/test_Object.cpp +++ b/STL_Extension/test/STL_Extension/test_Object.cpp @@ -4,14 +4,14 @@ #include #include -#include +#include #include void from_opt_var() { int i = 0; double j = 0.0; - boost::optional< boost::variant > v(23); + std::optional< boost::variant > v(23); CGAL::Object o = v; assert(!o.empty()); assert(CGAL::assign(i, o)); @@ -23,7 +23,7 @@ void from_opt_var() { assert(CGAL::assign(j, o)); assert(j == 2.0); //empty optional - boost::optional< boost::variant > v2; + std::optional< boost::variant > v2; CGAL::Object o2 = v2; assert(o2.empty()); } diff --git a/STL_Extension/test/STL_Extension/test_dispatch_output.cpp b/STL_Extension/test/STL_Extension/test_dispatch_output.cpp index 9dffd636b51..b4340772add 100644 --- a/STL_Extension/test/STL_Extension/test_dispatch_output.cpp +++ b/STL_Extension/test/STL_Extension/test_dispatch_output.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include struct A{}; struct B{}; @@ -92,7 +92,7 @@ void complete_test(std::vector data1,std::list data2){ void variant_test() { typedef boost::variant var; - typedef boost::optional< var > ovar; + typedef std::optional< var > ovar; std::vector a; std::vector b; std::vector c; diff --git a/Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree.h b/Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree.h index b36cc8fb973..0d6141ea2f0 100644 --- a/Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree.h +++ b/Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree.h @@ -188,7 +188,7 @@ The types `FuzzyQueryItem::Point_d` and `Point_d` must be equivalent. To use this function `Traits` must be a model of the concept `RangeSearchTraits`. */ template -boost::optional search_any_point(FuzzyQueryItem q) const; +std::optional search_any_point(FuzzyQueryItem q) const; /*! Reports the points that are approximately contained by `q`. diff --git a/Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree_node.h b/Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree_node.h index 8d7d50f373e..3d92ae2dc36 100644 --- a/Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree_node.h +++ b/Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree_node.h @@ -45,7 +45,7 @@ OutputIterator search(OutputIterator it, FuzzyQueryItem q) const; Reports any point from the subtree of the node, that is approximately contained by `q`. */ template -boost::optional search_any_point(OutputIterator it, FuzzyQueryItem q) const; +std::optional search_any_point(OutputIterator it, FuzzyQueryItem q) const; /*! Reports all the points contained by the subtree of the node. diff --git a/Spatial_searching/examples/Spatial_searching/searching_with_circular_query.cpp b/Spatial_searching/examples/Spatial_searching/searching_with_circular_query.cpp index 3f08f1278a4..de8f75f57db 100644 --- a/Spatial_searching/examples/Spatial_searching/searching_with_circular_query.cpp +++ b/Spatial_searching/examples/Spatial_searching/searching_with_circular_query.cpp @@ -30,7 +30,7 @@ int main() Point center(0.2, 0.2); Fuzzy_circle default_range(center, 0.2); - boost::optional any = tree.search_any_point(default_range); + std::optional any = tree.search_any_point(default_range); if(any) std::cout << *any << " is in the query circle\n"; else diff --git a/Spatial_searching/include/CGAL/Kd_tree.h b/Spatial_searching/include/CGAL/Kd_tree.h index 317f6a78bad..54a344f3705 100644 --- a/Spatial_searching/include/CGAL/Kd_tree.h +++ b/Spatial_searching/include/CGAL/Kd_tree.h @@ -31,7 +31,7 @@ #include #include -#include +#include #ifdef CGAL_HAS_THREADS #include @@ -594,7 +594,7 @@ public: template - boost::optional + std::optional search_any_point(const FuzzyQueryItem& q) const { if(! pts.empty()){ @@ -605,7 +605,7 @@ public: Kd_tree_rectangle b(*bbox); return tree_root->search_any_point(q,b,begin(),cache_begin(),dim_); } - return boost::none; + return std::nullopt; } diff --git a/Spatial_searching/include/CGAL/Kd_tree_node.h b/Spatial_searching/include/CGAL/Kd_tree_node.h index 02af0663d6a..8eb6602f17b 100644 --- a/Spatial_searching/include/CGAL/Kd_tree_node.h +++ b/Spatial_searching/include/CGAL/Kd_tree_node.h @@ -175,14 +175,14 @@ namespace CGAL { } - boost::optional + std::optional any_tree_item() const { - boost::optional result = boost::none; + std::optional result = std::nullopt; if (is_leaf()) { Leaf_node_const_handle node = static_cast(this); if (node->size()>0){ - return boost::make_optional(*(node->begin())); + return std::make_optional(*(node->begin())); } } else { @@ -273,14 +273,14 @@ namespace CGAL { template - boost::optional + std::optional search_any_point(const FuzzyQueryItem& q, Kd_tree_rectangle& b, typename Kdt::const_iterator tree_points_begin, typename std::vector::const_iterator cache_begin, int dim) const { - boost::optional result = boost::none; + std::optional result = std::nullopt; if (is_leaf()) { Leaf_node_const_handle node = static_cast(this); @@ -376,7 +376,7 @@ namespace CGAL { // With cache template - boost::optional search_any_point_in_leaf( + std::optional search_any_point_in_leaf( Leaf_node_const_handle node, const FuzzyQueryItem &q, typename Kdt::const_iterator tree_points_begin, @@ -384,7 +384,7 @@ namespace CGAL { int dim, Tag_true /*has_points_cache*/) const { - boost::optional result = boost::none; + std::optional result = std::nullopt; typename Kdt::iterator it_node_point = node->begin(), it_node_point_end = node->end(); typename std::vector::const_iterator cache_point_it = cache_begin + dim*(it_node_point - tree_points_begin); for (; it_node_point != it_node_point_end; ++it_node_point, cache_point_it += dim) @@ -401,7 +401,7 @@ namespace CGAL { // Without cache template - boost::optional search_any_point_in_leaf( + std::optional search_any_point_in_leaf( Leaf_node_const_handle node, const FuzzyQueryItem &q, typename Kdt::const_iterator /*tree_points_begin*/, @@ -409,7 +409,7 @@ namespace CGAL { int /*dim*/, Tag_false /*has_points_cache*/) const { - boost::optional result = boost::none; + std::optional result = std::nullopt; for (iterator i = node->begin(); i != node->end(); ++i) { if (q.contains(*i)) diff --git a/Spatial_searching/include/CGAL/Point_container.h b/Spatial_searching/include/CGAL/Point_container.h index eb96024348e..4c2b180b6ba 100644 --- a/Spatial_searching/include/CGAL/Point_container.h +++ b/Spatial_searching/include/CGAL/Point_container.h @@ -25,7 +25,7 @@ #include #include -#include +#include namespace CGAL { @@ -45,8 +45,8 @@ public: private: Traits traits; // the iterator range of the Point_container - boost::optional m_b ; - boost::optional m_e ; + std::optional m_b ; + std::optional m_e ; int built_coord; // a coordinate for which the pointer list is built Kd_tree_rectangle bbox; // bounding box, i.e. rectangle of node diff --git a/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton_tweaking_skeleton.cpp b/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton_tweaking_skeleton.cpp index 438017f36f6..be86a93b4dd 100644 --- a/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton_tweaking_skeleton.cpp +++ b/Straight_skeleton_2/benchmark/Straight_skeleton_2/create_exterior_skeleton_tweaking_skeleton.cpp @@ -54,7 +54,7 @@ int main() if ( i->opposite()->vertex()->has_infinite_time() ) { - boost::optional op= + std::optional op= builder.Construct_offset_point(offset , i->opposite()); if(!op) continue; p=*op; @@ -64,7 +64,7 @@ int main() if( i->vertex()->has_infinite_time() ) { - boost::optional op= + std::optional op= builder.Construct_offset_point(offset , i); if(!op) continue; q=*op; diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h index 1c0c422aa36..0dced9ac3f5 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h @@ -154,7 +154,7 @@ typedef Traits::Point_2 Point_2; /*! constructs the builder class. */ -Straight_skeleton_builder_2(boost::optional max_time = boost::none, +Straight_skeleton_builder_2(std::optional max_time = std::nullopt, const Traits& traits = Traits(), const Visitor& visitor = Visitor()); diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/compute_outer_frame_margin.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/compute_outer_frame_margin.h index 050c6dfba90..7db792ad14e 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/compute_outer_frame_margin.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/compute_outer_frame_margin.h @@ -47,7 +47,7 @@ the kernel in which the type `InputIterator::value_type` is defined. \sa `CGAL::Polygon_offset_builder_traits_2` */ template -boost::optional< typename Traits::FT > +std::optional< typename Traits::FT > compute_outer_frame_margin( InputIterator first, InputIterator beyond, typename Traits::FT offset, const Traits& traits = Default_traits ); diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/PolygonOffsetBuilderTraits_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/PolygonOffsetBuilderTraits_2.h index cc2cf00a120..2f65f3507bd 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/PolygonOffsetBuilderTraits_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/PolygonOffsetBuilderTraits_2.h @@ -33,7 +33,7 @@ typedef unspecified_type Compare_offset_against_event_time_2; /*! A construction object type. -Must provide `boost::optional operator()(const FT& t, const Segment_2& e0, Segment_2_with_ID const& e1, const Trisegment_2_ptr& et) const`, +Must provide `std::optional operator()(const FT& t, const Segment_2& e0, Segment_2_with_ID const& e1, const Trisegment_2_ptr& et) const`, which constructs the point of intersection of the lines obtained by offsetting the oriented lines given by `e0` and `e0` an Euclidean distance `t`. diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonBuilderTraits_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonBuilderTraits_2.h index f4fd0166ebb..4da7ab2118f 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonBuilderTraits_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonBuilderTraits_2.h @@ -62,7 +62,7 @@ typedef boost::intrusive_ptr Trisegment_2_ptr; /*! A predicate object type. -Must provide `bool operator()( const Trisegment_2_ptr& tri_segment, boost::optional max_time ) const`, +Must provide `bool operator()( const Trisegment_2_ptr& tri_segment, std::optional max_time ) const`, which determines if, given the three oriented lines defined by the three input edges, there exists an Euclidean distance `t >= 0` and `t <= max_time` for which the corresponding three offset lines at `t` (parallel lines at an Euclidean distance of `t`) intersect in a single point. @@ -100,7 +100,7 @@ typedef unspecified_type Are_ss_events_simultaneous_2; /*! A construction object type. -Must provide `boost::optional< boost::tuple > operator()( const Trisegment_2_ptr& e)`, +Must provide `std::optional< boost::tuple > operator()( const Trisegment_2_ptr& e)`, which returns the Euclidean distance `t >= 0` and the intersection point at which the corresponding three offset lines at `t` intersect if they do. diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Low_level_API.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Low_level_API.cpp index 52e405a4dd3..71e66194c6c 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Low_level_API.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Low_level_API.cpp @@ -66,7 +66,7 @@ int main() // First we need to determine the proper separation between the polygon and the frame. // We use this helper function provided in the package. - boost::optional margin = CGAL::compute_outer_frame_margin(star.begin(),star.end(),offset); + std::optional margin = CGAL::compute_outer_frame_margin(star.begin(),star.end(),offset); // Proceed only if the margin was computed (an extremely sharp corner might cause overflow) if ( margin ) diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp index d2da4691924..18b4e900b57 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp @@ -31,7 +31,7 @@ exterior_offset_of_disjoint_polygons_with_holes(double lOffset, const std::vecto outer_vertices.insert(outer_vertices.end(), pwh.outer_boundary().container().begin(), pwh.outer_boundary().container().end()); - boost::optional margin = compute_outer_frame_margin(outer_vertices.begin(), + std::optional margin = compute_outer_frame_margin(outer_vertices.begin(), outer_vertices.end(), lOffset); diff --git a/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_2.h b/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_2.h index 3ddac56aa28..2eae95de48a 100644 --- a/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_2.h +++ b/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_2.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -69,7 +69,7 @@ public : typedef typename Traits::FT FT ; typedef typename Traits::Point_2 Point_2 ; - typedef boost::optional OptionalPoint_2 ; + typedef std::optional OptionalPoint_2 ; typedef std::shared_ptr ContainerPtr ; @@ -149,7 +149,7 @@ private: return r ; } public: - boost::optional Construct_offset_point( FT aT, Halfedge_const_handle aBisector ) const + std::optional Construct_offset_point( FT aT, Halfedge_const_handle aBisector ) const { CGAL_assertion(aBisector->is_bisector()); CGAL_assertion(handle_assigned(aBisector->opposite())); diff --git a/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_traits_2.h b/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_traits_2.h index 558a0a6fccb..d8d12c90320 100644 --- a/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_traits_2.h +++ b/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_traits_2.h @@ -18,7 +18,7 @@ #include #include -#include +#include namespace CGAL { @@ -51,7 +51,7 @@ struct Construct_offset_point_2 : Functor_base_2 typedef typename Base::Segment_2_with_ID Segment_2_with_ID ; typedef typename Base::Trisegment_2_ptr Trisegment_2_ptr ; - typedef boost::optional result_type ; + typedef std::optional result_type ; result_type operator() ( FT const& aT @@ -60,7 +60,7 @@ struct Construct_offset_point_2 : Functor_base_2 , Trisegment_2_ptr const& aNode ) const { - typedef boost::optional< Line_2 > Optional_line; + typedef std::optional< Line_2 > Optional_line; No_cache lCoeff_cache; result_type p = construct_offset_pointC2(aT,aE0,aE1,aNode,lCoeff_cache); diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_offset_builder_2_impl.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_offset_builder_2_impl.h index 95fe522f3b3..471ed51ffac 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_offset_builder_2_impl.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_offset_builder_2_impl.h @@ -312,7 +312,7 @@ OutputIterator Polygon_offset_builder_2::construct_offset_co mVisitor.on_construction_started(aTime); - mLastPoint = boost::none ; + mLastPoint = std::nullopt ; ResetBisectorData(); diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h index 8a2ad91ab86..2d2741edde4 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h index f36c3d6d179..47da401bc32 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h @@ -32,7 +32,7 @@ namespace CGAL { template -Straight_skeleton_builder_2::Straight_skeleton_builder_2 ( boost::optional aMaxTime, Traits const& aTraits, Visitor const& aVisitor ) +Straight_skeleton_builder_2::Straight_skeleton_builder_2 ( std::optional aMaxTime, Traits const& aTraits, Visitor const& aVisitor ) : mTraits(aTraits) ,mVisitor(aVisitor) diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_traits_2_aux.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_traits_2_aux.h index 7744f44d377..519085bf934 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_traits_2_aux.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_traits_2_aux.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -42,7 +42,7 @@ namespace CGAL { namespace CGAL_SS_i { template -T const& validate ( boost::optional const& o ) +T const& validate ( std::optional const& o ) { if ( !o ) throw std::overflow_error("Arithmetic overflow"); @@ -57,17 +57,17 @@ NT const& validate( NT const& n ) return n ; } -// boost::make_optional is provided in Boost >= 1.34, but not before, so we define our own versions here. +// std::make_optional is provided in Boost >= 1.34, but not before, so we define our own versions here. template -boost::optional cgal_make_optional( T const& v ) +std::optional cgal_make_optional( T const& v ) { - return boost::optional(v) ; + return std::optional(v) ; } template -boost::optional cgal_make_optional( bool cond, T const& v ) +std::optional cgal_make_optional( bool cond, T const& v ) { - return cond ? boost::optional(v) : boost::optional() ; + return cond ? std::optional(v) : std::optional() ; } template @@ -210,7 +210,7 @@ template struct FPU_checker; template -struct FPU_checker > > +struct FPU_checker > > { static bool is_valid() { @@ -220,7 +220,7 @@ struct FPU_checker > > }; template -struct FPU_checker > > +struct FPU_checker > > { static bool is_valid() { @@ -269,10 +269,10 @@ struct Info_cache }; template -using Time_cache = Info_cache< boost::optional< CGAL_SS_i::Rational< typename K::FT > > > ; +using Time_cache = Info_cache< std::optional< CGAL_SS_i::Rational< typename K::FT > > > ; template -using Coeff_cache = Info_cache< boost::optional< Line_2 > > ; +using Coeff_cache = Info_cache< std::optional< Line_2 > > ; template struct Functor_base_2 @@ -315,17 +315,17 @@ struct SS_converter : Converter typedef boost::tuple Source_time_and_point_2 ; typedef boost::tuple Target_time_and_point_2 ; - typedef boost::optional Source_opt_FT ; - typedef boost::optional Target_opt_FT ; + typedef std::optional Source_opt_FT ; + typedef std::optional Target_opt_FT ; - typedef boost::optional Source_opt_point_2 ; - typedef boost::optional Target_opt_point_2 ; + typedef std::optional Source_opt_point_2 ; + typedef std::optional Target_opt_point_2 ; - typedef boost::optional Source_opt_time_and_point_2 ; - typedef boost::optional Target_opt_time_and_point_2 ; + typedef std::optional Source_opt_time_and_point_2 ; + typedef std::optional Target_opt_time_and_point_2 ; - typedef boost::optional Source_opt_segment_2 ; - typedef boost::optional Target_opt_segment_2 ; + typedef std::optional Source_opt_segment_2 ; + typedef std::optional Target_opt_segment_2 ; typedef typename Source_trisegment_2::Self_ptr Source_trisegment_2_ptr ; typedef typename Target_trisegment_2::Self_ptr Target_trisegment_2_ptr ; diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/debug.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/debug.h index 72887141335..b54af3973aa 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/debug.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/debug.h @@ -42,11 +42,11 @@ bool sEnableTrace = true ; Straight_skeleton_external_trace(s); \ } -#include +#include #include template -inline std::string o2str( boost::optional const& o ) +inline std::string o2str( std::optional const& o ) { std::ostringstream ss ; ss << std::setprecision(19) ; if ( o ) diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h index c7e3f77fbd7..6fcb719b795 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h @@ -218,7 +218,7 @@ private : public: - Straight_skeleton_builder_2 ( boost::optional aMaxTime = boost::none, Traits const& = Traits(), Visitor const& aVisitor = Visitor() ) ; + Straight_skeleton_builder_2 ( std::optional aMaxTime = std::nullopt, Traits const& = Traits(), Visitor const& aVisitor = Visitor() ) ; SSkelPtr construct_skeleton( bool aNull_if_failed = true ) ; @@ -1011,7 +1011,7 @@ private : boost::tuple ConstructEventTimeAndPoint( Trisegment_2_ptr const& aS ) const { - boost::optional< boost::tuple > r = Construct_ss_event_time_and_point_2(mTraits)(aS); + std::optional< boost::tuple > r = Construct_ss_event_time_and_point_2(mTraits)(aS); CGAL_postcondition_msg(!!r, "Unable to compute skeleton node coordinates"); return *r ; } @@ -1179,7 +1179,7 @@ private: int mEventID ; int mStepID ; - boost::optional mMaxTime ; + std::optional mMaxTime ; PQ mPQ ; diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_traits_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_traits_2.h index a2537158295..22da0b8fe35 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_traits_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_traits_2.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -69,7 +69,7 @@ struct Do_ss_event_exist_2 : Functor_base_2 : mTime_cache(aTime_cache), mCoeff_cache(aCoeff_cache) {} - Uncertain operator() ( Trisegment_2_ptr const& aTrisegment, boost::optional aMaxTime ) const + Uncertain operator() ( Trisegment_2_ptr const& aTrisegment, std::optional aMaxTime ) const { Uncertain rResult = exist_offset_lines_isec2(aTrisegment,aMaxTime,mTime_cache,mCoeff_cache) ; @@ -276,7 +276,7 @@ struct Construct_ss_event_time_and_point_2 : Functor_base_2 typedef boost::tuple rtype ; - typedef boost::optional result_type ; + typedef std::optional result_type ; Construct_ss_event_time_and_point_2(Time_cache& aTime_cache, Coeff_cache& aCoeff_cache) : mTime_cache(aTime_cache), mCoeff_cache(aCoeff_cache) @@ -289,13 +289,13 @@ struct Construct_ss_event_time_and_point_2 : Functor_base_2 FT t(0) ; Point_2 i = ORIGIN ; - boost::optional< Rational > ot = compute_offset_lines_isec_timeC2(aTrisegment,mTime_cache,mCoeff_cache); + std::optional< Rational > ot = compute_offset_lines_isec_timeC2(aTrisegment,mTime_cache,mCoeff_cache); if ( !!ot && certainly( CGAL_NTS certified_is_not_zero(ot->d()) ) ) { t = ot->n() / ot->d(); - boost::optional oi = construct_offset_lines_isecC2(aTrisegment,mCoeff_cache); + std::optional oi = construct_offset_lines_isecC2(aTrisegment,mCoeff_cache); if ( oi ) { i = *oi ; @@ -509,7 +509,7 @@ public: if ( mCoeff_cache.Get( aOtherID ) ) mCoeff_cache.Set( aID, CGAL_SS_i::cgal_make_optional(*(mCoeff_cache.Get(aOtherID))) ) ; else - mCoeff_cache.Set( aID, boost::none ) ; + mCoeff_cache.Set( aID, std::nullopt ) ; } // functions and tag for filtering split events @@ -523,7 +523,7 @@ public: return false; typename Base::Trisegment_2_ptr tri = lEvent->trisegment() ; - boost::optional > lOptTime = + std::optional > lOptTime = CGAL_SS_i::compute_offset_lines_isec_timeC2(tri, mTime_cache, mCoeff_cache); if ( lOptTime && lOptTime->to_nt() > *mFilteringBound ) @@ -542,7 +542,7 @@ public: Halfedge_handle_vector_iterator contour_halfedges_begin, Halfedge_handle_vector_iterator contour_halfedges_end) const { - mFilteringBound = boost::none; + mFilteringBound = std::nullopt; if ( ! aNode->is_contour() ) return ; @@ -556,8 +556,8 @@ public: Segment_2 s2(aNode->point(), lNext->point()); // @todo? These are not input segments, but it might still worth caching (just gotta assign them an ID) - boost::optional< Line_2 > l1 = CGAL_SS_i::compute_normalized_line_ceoffC2(s1); - boost::optional< Line_2 > l2 = CGAL_SS_i::compute_normalized_line_ceoffC2(s2); + std::optional< Line_2 > l1 = CGAL_SS_i::compute_normalized_line_ceoffC2(s1); + std::optional< Line_2 > l2 = CGAL_SS_i::compute_normalized_line_ceoffC2(s2); Vector_2 lV1(l1->a(), l1->b()) ; Vector_2 lV2(l2->a(), l2->b()) ; @@ -581,7 +581,7 @@ public: continue; // Note that we don't need the normalization - boost::optional< Line_2 > lh = CGAL_SS_i::compute_normalized_line_ceoffC2(s_h); + std::optional< Line_2 > lh = CGAL_SS_i::compute_normalized_line_ceoffC2(s_h); typename K::FT lBound = ( - lh->c() - lh->a()*aNode->point().x() - lh->b()*aNode->point().y() ) / ( lh->a()*lV12.x() + lh->b()*lV12.y() ); @@ -598,7 +598,7 @@ public: mutable std::size_t mTrisegment_ID = 0 ; mutable CGAL_SS_i::Time_cache mTime_cache ; mutable CGAL_SS_i::Coeff_cache mCoeff_cache ; - mutable boost::optional< typename K::FT > mFilteringBound ; + mutable std::optional< typename K::FT > mFilteringBound ; } ; template @@ -817,7 +817,7 @@ public: try { - boost::optional > lOptTime = + std::optional > lOptTime = CGAL_SS_i::compute_offset_lines_isec_timeC2( tri, mApproximate_traits.mTime_cache, mApproximate_traits.mCoeff_cache); @@ -840,7 +840,7 @@ public: Halfedge_handle_vector_iterator contour_halfedges_begin, Halfedge_handle_vector_iterator contour_halfedges_end) const { - mApproximate_traits.mFilteringBound = boost::none; + mApproximate_traits.mFilteringBound = std::nullopt; if ( ! aNode->is_contour() ) return ; @@ -860,8 +860,8 @@ public: Target_Segment_2 s2(laP, to_FK(lNext->point())); // @todo? These are not input segments, but it might still worth caching (just gotta assign them an ID) - boost::optional< Target_Line_2 > l1 = CGAL_SS_i::compute_normalized_line_ceoffC2(s1); - boost::optional< Target_Line_2 > l2 = CGAL_SS_i::compute_normalized_line_ceoffC2(s2); + std::optional< Target_Line_2 > l1 = CGAL_SS_i::compute_normalized_line_ceoffC2(s1); + std::optional< Target_Line_2 > l2 = CGAL_SS_i::compute_normalized_line_ceoffC2(s2); Target_Vector_2 lV1(l1->a(), l1->b()) ; Target_Vector_2 lV2(l2->a(), l2->b()) ; @@ -887,7 +887,7 @@ public: continue; // Note that we don't need the normalization - boost::optional< Target_Line_2 > lh = CGAL_SS_i::compute_normalized_line_ceoffC2(s_h); + std::optional< Target_Line_2 > lh = CGAL_SS_i::compute_normalized_line_ceoffC2(s_h); typename FK::FT lBound = ( - lh->c() - lh->a()*laP.x() - lh->b()*laP.y() ) / ( lh->a()*lV12.x() + lh->b()*lV12.y() ); diff --git a/Straight_skeleton_2/include/CGAL/compute_outer_frame_margin.h b/Straight_skeleton_2/include/CGAL/compute_outer_frame_margin.h index dc80fb74313..564bc5adbe7 100644 --- a/Straight_skeleton_2/include/CGAL/compute_outer_frame_margin.h +++ b/Straight_skeleton_2/include/CGAL/compute_outer_frame_margin.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -25,7 +25,7 @@ namespace CGAL { template -boost::optional< typename Traits::FT > compute_outer_frame_margin ( ForwardPointIterator aBegin +std::optional< typename Traits::FT > compute_outer_frame_margin ( ForwardPointIterator aBegin , ForwardPointIterator aEnd , typename Traits::FT aOffset , Traits const& aTraits @@ -44,7 +44,7 @@ boost::optional< typename Traits::FT > compute_outer_frame_margin ( ForwardPoint typename Kernel::Compute_squared_distance_2 squared_distance = kernel.compute_squared_distance_2_object(); typename Kernel::Construct_segment_2 construct_segment = kernel.construct_segment_2_object(); - typedef boost::optional OptionalPoint_2 ; + typedef std::optional OptionalPoint_2 ; FT lMaxSDist(0) ; @@ -89,15 +89,15 @@ boost::optional< typename Traits::FT > compute_outer_frame_margin ( ForwardPoint { FT lDist = CGAL_SS_i::inexact_sqrt(lMaxSDist) ; - return boost::optional( lDist + ( aOffset * FT(1.05) ) ) ; // Add a %5 gap + return std::optional( lDist + ( aOffset * FT(1.05) ) ) ; // Add a %5 gap } else - return boost::optional(); + return std::optional(); } template -boost::optional compute_outer_frame_margin ( ForwardPointIterator aBegin, ForwardPointIterator aEnd, +std::optional compute_outer_frame_margin ( ForwardPointIterator aBegin, ForwardPointIterator aEnd, FT aOffset ) { typedef typename std::iterator_traits::value_type Point_2 ; diff --git a/Straight_skeleton_2/include/CGAL/constructions/Polygon_offset_cons_ftC2.h b/Straight_skeleton_2/include/CGAL/constructions/Polygon_offset_cons_ftC2.h index 03b25b3352d..5b6e79f6f14 100644 --- a/Straight_skeleton_2/include/CGAL/constructions/Polygon_offset_cons_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/constructions/Polygon_offset_cons_ftC2.h @@ -15,7 +15,7 @@ #include -#include +#include #include namespace CGAL { @@ -32,7 +32,7 @@ namespace CGAL_SS_i { // POSTCONDITION: In case of overflow an empty optional is returned. // template -boost::optional< Point_2 > construct_offset_pointC2 ( typename K::FT const& t, +std::optional< Point_2 > construct_offset_pointC2 ( typename K::FT const& t, Segment_2_with_ID const& e0, Segment_2_with_ID const& e1, boost::intrusive_ptr< Trisegment_2 > > const& tri, @@ -43,8 +43,8 @@ boost::optional< Point_2 > construct_offset_pointC2 ( typename K::FT const& t typedef Point_2 Point_2 ; typedef Line_2 Line_2 ; - typedef boost::optional Optional_point_2 ; - typedef boost::optional Optional_line_2 ; + typedef std::optional Optional_point_2 ; + typedef std::optional Optional_line_2 ; FT x(0.0),y(0.0) ; diff --git a/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h b/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h index 1076f7ae680..414de78d51b 100644 --- a/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -112,7 +112,7 @@ inline Lazy_exact_nt inexact_sqrt( Lazy_exact_nt const& lz) // POSTCONDITION: [a,b] is the leftward normal _unit_ (a²+b²=1) vector. // POSTCONDITION: In case of overflow, an empty optional<> is returned. template -boost::optional< Line_2 > compute_normalized_line_ceoffC2( Segment_2 const& e ) +std::optional< Line_2 > compute_normalized_line_ceoffC2( Segment_2 const& e ) { bool finite = true ; @@ -201,13 +201,13 @@ boost::optional< Line_2 > compute_normalized_line_ceoffC2( Segment_2 const } template -boost::optional< Line_2 > compute_normalized_line_ceoffC2( Segment_2_with_ID const& e, +std::optional< Line_2 > compute_normalized_line_ceoffC2( Segment_2_with_ID const& e, CoeffCache& aCoeff_cache ) { if ( aCoeff_cache.IsCached(e.mID) ) return aCoeff_cache.Get(e.mID) ; - boost::optional< Line_2 > rRes = compute_normalized_line_ceoffC2 ( static_cast const&>(e) ) ; + std::optional< Line_2 > rRes = compute_normalized_line_ceoffC2 ( static_cast const&>(e) ) ; aCoeff_cache.Set(e.mID, rRes) ; @@ -266,7 +266,7 @@ construct_trisegment ( Segment_2_with_ID const& e0, // NOTE: The segments (e0,e1,e2) are stored in the argument as the trisegment st.event() // template -boost::optional< Rational< typename K::FT> > +std::optional< Rational< typename K::FT> > compute_normal_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, CoeffCache& aCoeff_cache ) { @@ -274,7 +274,7 @@ compute_normal_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2 Line_2 ; - typedef boost::optional Optional_line_2 ; + typedef std::optional Optional_line_2 ; CGAL_STSKEL_TRAITS_TRACE("Computing normal offset lines isec time for: " << tri ) ; @@ -332,7 +332,7 @@ compute_normal_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2 -boost::optional< Point_2 > compute_oriented_midpoint ( Segment_2_with_ID const& e0, +std::optional< Point_2 > compute_oriented_midpoint ( Segment_2_with_ID const& e0, Segment_2_with_ID const& e1 ) { bool ok = false ; @@ -391,12 +391,12 @@ boost::optional< Point_2 > compute_oriented_midpoint ( Segment_2_with_ID c // If you request the point of such degenerate pseudo seed the oriented midpoint between e0 and e2 is returned. // template -boost::optional< Point_2 > +std::optional< Point_2 > compute_seed_pointC2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, typename Trisegment_2 >::SEED_ID sid, CoeffCache& aCoeff_cache) { - boost::optional< Point_2 > p ; + std::optional< Point_2 > p ; typedef Trisegment_2 > Trisegment_2 ; @@ -430,7 +430,7 @@ compute_seed_pointC2 ( boost::intrusive_ptr< Trisegment_2 -boost::optional< Point_2 > +std::optional< Point_2 > compute_degenerate_seed_pointC2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, CoeffCache& aCoeff_cache ) { @@ -448,7 +448,7 @@ compute_degenerate_seed_pointC2 ( boost::intrusive_ptr< Trisegment_2 -boost::optional< Rational< typename K::FT> > +std::optional< Rational< typename K::FT> > compute_degenerate_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, CoeffCache& aCoeff_cache ) { @@ -457,8 +457,8 @@ compute_degenerate_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2 typedef Point_2 Point_2 ; typedef Line_2 Line_2 ; - typedef boost::optional Optional_point_2 ; - typedef boost::optional Optional_line_2 ; + typedef std::optional Optional_point_2 ; + typedef std::optional Optional_line_2 ; CGAL_STSKEL_TRAITS_TRACE("Computing degenerate offset lines isec time for: " << tri ) ; @@ -540,7 +540,7 @@ compute_degenerate_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2 // Calls the appropriate function depending on the collinearity of the edges. // template -boost::optional< Rational< typename K::FT > > +std::optional< Rational< typename K::FT > > compute_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, TimeCache& aTime_cache, CoeffCache& aCoeff_cache) @@ -550,7 +550,7 @@ compute_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2collinearity() != TRISEGMENT_COLLINEARITY_ALL ) ; - boost::optional< Rational< typename K::FT > > rRes = + std::optional< Rational< typename K::FT > > rRes = tri->collinearity() == TRISEGMENT_COLLINEARITY_NONE ? compute_normal_offset_lines_isec_timeC2 (tri, aCoeff_cache) : compute_degenerate_offset_lines_isec_timeC2(tri, aCoeff_cache); @@ -571,7 +571,7 @@ compute_offset_lines_isec_timeC2 ( boost::intrusive_ptr< Trisegment_2 -boost::optional< Point_2 > +std::optional< Point_2 > construct_normal_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, CoeffCache& aCoeff_cache) { @@ -579,7 +579,7 @@ construct_normal_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2 Line_2 ; - typedef boost::optional Optional_line_2 ; + typedef std::optional Optional_line_2 ; CGAL_STSKEL_TRAITS_TRACE("Computing normal offset lines isec point for: " << tri ) ; @@ -632,7 +632,7 @@ construct_normal_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2 -boost::optional< Point_2 > +std::optional< Point_2 > construct_degenerate_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, CoeffCache& aCoeff_cache) { @@ -641,8 +641,8 @@ construct_degenerate_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2 Point_2 ; typedef Line_2 Line_2 ; - typedef boost::optional Optional_point_2 ; - typedef boost::optional Optional_line_2 ; + typedef std::optional Optional_point_2 ; + typedef std::optional Optional_line_2 ; CGAL_STSKEL_TRAITS_TRACE("Computing degenerate offset lines isec point for: " << tri ) ; @@ -694,7 +694,7 @@ construct_degenerate_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2 -boost::optional< Point_2 > +std::optional< Point_2 > construct_offset_lines_isecC2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, CoeffCache& aCoeff_cache) { diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h index 9a8a97012cb..e0bfb7bdce0 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -126,7 +126,7 @@ create_partial_interior_straight_skeleton_2 ( FT const& aMaxTime Cartesian_converter conv ; typename InputKernel::FT lMaxTime = aMaxTime; - boost::optional lOptMaxTime(conv(lMaxTime)) ; + std::optional lOptMaxTime(conv(lMaxTime)) ; SsBuilder ssb( lOptMaxTime ) ; @@ -160,7 +160,7 @@ create_partial_exterior_straight_skeleton_2 ( FT const& aMaxOffset // @todo This likely should be done in the kernel K rather than the input kernel (i.e. the same // converter stuff that is done in `create_partial_exterior_straight_skeleton_2`?). - boost::optional margin = compute_outer_frame_margin(aVerticesBegin, + std::optional margin = compute_outer_frame_margin(aVerticesBegin, aVerticesEnd, lOffset); diff --git a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h index d88fb85ac50..967c89f1bf0 100644 --- a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include @@ -159,7 +159,7 @@ create_exterior_straight_skeleton_2 ( FT const& aMaxOffset // @todo This likely should be done in the kernel K rather than the input kernel (i.e. the same // converter stuff that is done in `create_partial_exterior_straight_skeleton_2`?). - boost::optional margin = compute_outer_frame_margin( aVerticesBegin, + std::optional margin = compute_outer_frame_margin( aVerticesBegin, aVerticesEnd, lOffset ); diff --git a/Straight_skeleton_2/include/CGAL/predicates/Polygon_offset_pred_ftC2.h b/Straight_skeleton_2/include/CGAL/predicates/Polygon_offset_pred_ftC2.h index 88edb2da5fd..51488b83873 100644 --- a/Straight_skeleton_2/include/CGAL/predicates/Polygon_offset_pred_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/predicates/Polygon_offset_pred_ftC2.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -38,12 +38,12 @@ compare_offset_against_isec_timeC2 ( typename K::FT const& t, typedef Rational Rational ; typedef Quotient Quotient ; - typedef boost::optional Optional_rational ; + typedef std::optional Optional_rational ; Uncertain rResult = Uncertain::indeterminate(); - No_cache > > lTime_cache ; - No_cache > > lCoeff_cache ; + No_cache > > lTime_cache ; + No_cache > > lCoeff_cache ; Optional_rational et_ = compute_offset_lines_isec_timeC2(tri, lTime_cache, lCoeff_cache); if ( et_ ) diff --git a/Straight_skeleton_2/include/CGAL/predicates/Straight_skeleton_pred_ftC2.h b/Straight_skeleton_2/include/CGAL/predicates/Straight_skeleton_pred_ftC2.h index 16ee90a800f..c3bdaedf2f3 100644 --- a/Straight_skeleton_2/include/CGAL/predicates/Straight_skeleton_pred_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/predicates/Straight_skeleton_pred_ftC2.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -176,13 +176,13 @@ Uncertain certified_trisegment_collinearity ( Segment_2 // template Uncertain exist_offset_lines_isec2 ( boost::intrusive_ptr< Trisegment_2 > > const& tri, - boost::optional const& aMaxTime, + std::optional const& aMaxTime, TimeCache& aTime_cache, CoeffCache& aCoeff_cache ) { typedef Rational Rational ; - typedef boost::optional Optional_rational ; + typedef std::optional Optional_rational ; typedef Quotient Quotient ; Uncertain rResult = Uncertain::indeterminate(); @@ -247,7 +247,7 @@ compare_offset_lines_isec_timesC2 ( boost::intrusive_ptr< Trisegment_2 Rational ; typedef Quotient Quotient ; - typedef boost::optional Optional_rational ; + typedef std::optional Optional_rational ; Uncertain rResult = Uncertain::indeterminate(); @@ -301,7 +301,7 @@ Uncertain compare_isec_anglesC2 ( Vector_2 const& aBV1 // Returns true if the point aP is on the positive side of the line supporting the edge // template -Uncertain is_edge_facing_pointC2 ( boost::optional< Point_2 > const& aP, +Uncertain is_edge_facing_pointC2 ( std::optional< Point_2 > const& aP, Segment_2_with_ID const& aEdge ) { typedef typename K::FT FT ; @@ -527,8 +527,8 @@ Uncertain are_events_simultaneousC2 ( boost::intrusive_ptr< Trisegment_2 Rational ; typedef Quotient Quotient ; - typedef boost::optional Optional_rational ; - typedef boost::optional Optional_point_2 ; + typedef std::optional Optional_rational ; + typedef std::optional Optional_point_2 ; Uncertain rResult = Uncertain::indeterminate(); diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_traits_aux.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_traits_aux.cpp index 9569d50c9f5..3726a9500cd 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_traits_aux.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_traits_aux.cpp @@ -36,7 +36,7 @@ void report( int idx, bool ok, std::string const& info = std::string("") ) bool exist_event( Traits const& aTraits, triple const& aTriple ) { - boost::optional lMaxTime ; + std::optional lMaxTime ; return CGAL::Do_ss_event_exist_2(aTraits)(aTriple.trisegment(), lMaxTime ); } diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp index 709158ffbc2..186d7408b43 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp @@ -315,7 +315,7 @@ IRegionPtr load_region( string file, int aShift, int& rStatus ) return rRegion ; } -void update_bbox ( IRegionPtr const& aRegion, boost::optional& rBBox ) +void update_bbox ( IRegionPtr const& aRegion, std::optional& rBBox ) { if ( aRegion ) { @@ -396,7 +396,7 @@ string change_extension ( string aFilename, string aNewExt ) void dump_to_eps ( TestCase const& aCase ) { - boost::optional lBBox ; + std::optional lBBox ; update_bbox(aCase.Inner.Input, lBBox ) ; update_bbox(aCase.Outer.Input, lBBox ) ; @@ -577,7 +577,7 @@ IPolygonPtr create_outer_frame ( IPolygon const& aOuter ) IFT lOffset = s * 0.3 ; - boost::optional lOptMargin = compute_outer_frame_margin(aOuter.begin(),aOuter.end(),lOffset) ; + std::optional lOptMargin = compute_outer_frame_margin(aOuter.begin(),aOuter.end(),lOffset) ; if ( lOptMargin ) { @@ -667,7 +667,7 @@ bool is_skeleton_valid( IRegion const& aRegion, ISls const& aSkeleton, bool is_p } -int create_skeleton ( Zone& rZone, boost::optional const& aMaxTime = boost::optional() ) +int create_skeleton ( Zone& rZone, std::optional const& aMaxTime = std::optional() ) { int rStatus = cUnknown ; @@ -742,7 +742,7 @@ int test_zone ( Zone& rZone ) if ( sMaxTime > 0 ) { - boost::optional lMaxTime = static_cast(sMaxTime) ; + std::optional lMaxTime = static_cast(sMaxTime) ; rStatus = create_skeleton(rZone,lMaxTime) ; } else 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 db7ec3b1622..3480435ec81 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 @@ -517,7 +517,7 @@ void test_offset_multiple_CCs() std::vector input(pts, pts+12); const FT offset = 50; - boost::optional margin = CGAL::compute_outer_frame_margin(input.begin(), input.end(), offset); + std::optional margin = CGAL::compute_outer_frame_margin(input.begin(), input.end(), offset); assert(margin); // Get the bbox of the polygon diff --git a/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp b/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp index 6fe14b01e7a..60174dc2fc4 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp @@ -16,8 +16,8 @@ typedef CGAL::Surface_mesh Mesh; typedef CGAL::AABB_face_graph_triangle_primitive Primitive; typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; -typedef boost::optional< Tree::Intersection_and_primitive_id::Type > Segment_intersection; -typedef boost::optional< Tree::Intersection_and_primitive_id::Type > Plane_intersection; +typedef std::optional< Tree::Intersection_and_primitive_id::Type > Segment_intersection; +typedef std::optional< Tree::Intersection_and_primitive_id::Type > Plane_intersection; typedef Tree::Primitive_id Primitive_id; int main() diff --git a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h index 566aec602d7..71608d8d80e 100644 --- a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include @@ -581,9 +581,9 @@ public: return num_teleported; // find the best merge pair - boost::optional< std::pair > best_proxies = + std::optional< std::pair > best_proxies = find_best_merge(!no_threshold_test); - if (best_proxies==boost::none) + if (best_proxies==std::nullopt) return num_teleported; if (px_worst == best_proxies->first || px_worst == best_proxies->second) return num_teleported; @@ -662,7 +662,7 @@ public: * it is returned only if the error change after the merge is lower than the half of the maximum proxy error. * @return if the best merge pair is found the optional returned contains the proxy indices, and is empty otherwise. */ - boost::optional< std::pair > + std::optional< std::pair > find_best_merge(const bool use_threshold_test) { typedef std::pair Proxy_pair; typedef std::set Pair_set; @@ -705,7 +705,7 @@ public: } if (merged_set.empty()) - return boost::none; + return std::nullopt; // test if merge worth it if (use_threshold_test) { @@ -715,7 +715,7 @@ public: max_error = m_proxies[i].err; } if (min_error_change > max_error / FT(2.0)) - return boost::none; + return std::nullopt; } return std::make_pair(px0, px1); diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_correctness_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_correctness_test.cpp index 40e6885e5ec..4e671737489 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_correctness_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_correctness_test.cpp @@ -69,8 +69,8 @@ bool test_shape(const Mesh &mesh, const std::size_t target_num_proxies) approx.run(num_iterations); // eliminate redundant area (local minima) by merging - boost::optional > best_pair = boost::none; - while ((best_pair = approx.find_best_merge(true)) != boost::none) { + std::optional > best_pair = std::nullopt; + while ((best_pair = approx.find_best_merge(true)) != std::nullopt) { approx.merge(best_pair->first, best_pair->second); approx.run(num_iterations); } diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp index 2ea7139f548..13a43f96557 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp @@ -153,7 +153,7 @@ int main() } // force teleportation test - if ( approx.find_best_merge(true) != boost::none ) + if ( approx.find_best_merge(true) != std::nullopt ) { std::cout << "Failed: should be no possible merge with test." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/Surface_mesh_deformation_test_commons.h b/Surface_mesh_deformation/test/Surface_mesh_deformation/Surface_mesh_deformation_test_commons.h index a10cdd1f09c..bdc14cee74e 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/Surface_mesh_deformation_test_commons.h +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/Surface_mesh_deformation_test_commons.h @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/AABB_traversal_traits.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/AABB_traversal_traits.h index 18a7c1f2fa7..13216a31fdc 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/AABB_traversal_traits.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/AABB_traversal_traits.h @@ -54,7 +54,7 @@ public: if ( GeomTraits().do_intersect_3_object()(query, primitive.datum(m_traits.shared_data())) ) { - boost::optional intersection + std::optional intersection = m_traits.intersection_object()(query, primitive); if(intersection) { *m_out_it++ = *intersection; diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Filters.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Filters.h index 2f361642acf..7afb29eecf2 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Filters.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Filters.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include @@ -63,8 +63,8 @@ public: void operator()(const Polyhedron& mesh, std::size_t window_size, ValuePropertyMap values, - boost::optional spatial_parameter = boost::optional(), - boost::optional range_parameter = boost::optional() + std::optional spatial_parameter = std::optional(), + std::optional range_parameter = std::optional() ) const { typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename boost::graph_traits::face_iterator face_iterator; diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h index 9ccde9421a5..f221ee28c45 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h @@ -26,7 +26,7 @@ #include #include -#include +#include #define CGAL_NUMBER_OF_MAD 1.5 @@ -200,7 +200,7 @@ public: disk_sampler(number_of_rays, std::back_inserter(disk_samples)); for( ; facet_begin != facet_end; ++facet_begin) { - boost::optional sdf_value = calculate_sdf_value_of_facet(*facet_begin, + std::optional sdf_value = calculate_sdf_value_of_facet(*facet_begin, cone_angle, true, disk_samples); if(sdf_value) { @@ -233,7 +233,7 @@ public: * \note: normal should have unit length */ template - boost::optional calculate_sdf_value_of_point( + std::optional calculate_sdf_value_of_point( Point center, Vector normal, SkipPrimitiveFunctor skip, @@ -250,7 +250,7 @@ public: * Overload for taking DiskSampling as template parameter */ template - boost::optional calculate_sdf_value_of_point( + std::optional calculate_sdf_value_of_point( Point center, Vector normal, SkipPrimitiveFunctor skip, @@ -270,7 +270,7 @@ public: * Overload for directly taking sampled points from disk as parameter */ template - boost::optional calculate_sdf_value_of_point( + std::optional calculate_sdf_value_of_point( const Point& center, const Vector& normal, SkipPrimitiveFunctor skip, @@ -346,10 +346,10 @@ public: } if(ray_distances.empty()) { - return boost::none; + return std::nullopt; } - return boost::optional(remove_outliers_and_calculate_sdf_value( + return std::optional(remove_outliers_and_calculate_sdf_value( ray_distances)); } @@ -369,7 +369,7 @@ private: * @param samples sampled points from a unit-disk which are corresponds to rays picked from cone * @return calculated SDF value */ - boost::optional calculate_sdf_value_of_facet( + std::optional calculate_sdf_value_of_facet( face_handle facet, double cone_angle, bool accept_if_acute, @@ -379,11 +379,11 @@ private: const Point p2 = get(vertex_point_map,target(next(halfedge(facet,mesh),mesh),mesh)); const Point p3 = get(vertex_point_map,target(prev(halfedge(facet,mesh),mesh),mesh)); const Point center = centroid_functor(p1, p2, p3); - if (collinear_functor(p1, p2, p3)) return boost::none; + if (collinear_functor(p1, p2, p3)) return std::nullopt; Vector normal = normal_functor(p2, p1, p3); normal=scale_functor(normal, FT(1.0/std::sqrt(to_double(normal.squared_length())))); - if (normal!=normal) return boost::none; + if (normal!=normal) return std::nullopt; CGAL::internal::SkipPrimitiveFunctor skip(facet); CGAL::internal::FirstIntersectionVisitor @@ -478,7 +478,7 @@ private: boost::tuple ray_casting( const Ray& query, SkipFunctor s, bool accept_if_acute) const { - const boost::optional< typename Tree::template Intersection_and_primitive_id::Type > + const std::optional< typename Tree::template Intersection_and_primitive_id::Type > min_intersection = tree.first_intersection(query, s); if(!min_intersection) return boost::make_tuple(false, false, 0.0, Primitive_id()); diff --git a/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/Concepts/SurfaceMeshShortestPathTraits.h b/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/Concepts/SurfaceMeshShortestPathTraits.h index 652c3457496..e44cd401304 100644 --- a/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/Concepts/SurfaceMeshShortestPathTraits.h +++ b/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/Concepts/SurfaceMeshShortestPathTraits.h @@ -152,7 +152,7 @@ public: /*! Function object type. Must provide - `boost::optional< boost::variant< T... > > operator()(A obj1, B obj2)` + `std::optional< boost::variant< T... > > operator()(A obj1, B obj2)` to compute the intersection between `obj1` and `obj2`, where `A` and `B` can be any type amongst `Line_2`, `Ray_2`, `Segment_2`. */ diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h index 0b94bf1d71c..241c9647350 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h @@ -3049,7 +3049,7 @@ public: typename Traits::Construct_barycentric_coordinates cbc(traits.construct_barycentric_coordinates_object()); typename Traits::Compute_squared_distance_3 csd3(traits.compute_squared_distance_3_object()); typedef typename AABB_face_graph_tree::template Intersection_and_primitive_id::Type Intersection_type; - typedef boost::optional Ray_intersection; + typedef std::optional Ray_intersection; std::vector intersections; diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h index 5fa7e3c3395..9e62e74917f 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h @@ -46,7 +46,7 @@ public: // Returns the placement computed by `base_placement`, provided the distance between the input // and this placement is smaller than `d`. Otherwise, nothing is returned. - boost::optional operator()(const Edge_profile& profile) const; + std::optional operator()(const Edge_profile& profile) const; // @} }; diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h index 53cfb706bd6..adc991a675e 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h @@ -44,8 +44,8 @@ public: returns the placement, if it does not get filtered by the wrapped filter and if no triangle in the profile has its normal changed by more than 90 degrees. */ - boost::optional operator()(const Edge_profile& profile, - boost::optional op) const; + std::optional operator()(const Edge_profile& profile, + std::optional op) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h index 8f08e9a071c..90e68a5320d 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h @@ -46,7 +46,7 @@ public: Returns the placement computed by `get_placement`, if no triangle in the profile has its normal changed by more than 90 degree. */ - boost::optional operator()(const Edge_profile& profile) const; + std::optional operator()(const Edge_profile& profile) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h index f9b904bfb3f..814c64f2793 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h @@ -32,7 +32,7 @@ public: const Get_placement_& get_placement = Get_placement_()); /// @} - boost::optional operator()(const Edge_profile& profile) const + std::optional operator()(const Edge_profile& profile) const }; diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h index 52c7c54dee8..8c908055492 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h @@ -36,8 +36,8 @@ public: The argument `placement` is unused. */ - boost::optional operator()(const Edge_profile& profile, - const boost::optional& placement) const; + std::optional operator()(const Edge_profile& profile, + const std::optional& placement) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h index 36e68f95263..433a8a64755 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h @@ -36,9 +36,9 @@ LindstromTurk_cost(const FT factor = FT(0.5)); Returns the cost of collapsing the edge (represented by its profile) considering the new `placement` computed for it. */ -boost::optional +std::optional operator()(const Edge_profile& edge_profile, - const boost::optional& placement) const; + const std::optional& placement) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h index 20ae3890439..8471efae84d 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h @@ -38,7 +38,7 @@ public: Returns the new position for the remaining vertex after collapsing the edge (represented by its profile). */ - boost::optional + std::optional operator()(const Edge_profile& profile) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h index 2cd81de679e..11fda0b9f25 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h @@ -36,7 +36,7 @@ public: the points of the source and target vertices (`profile.p0()` and `profile.p1()`) */ - boost::optional operator()(const Edge_profile& profile) const; + std::optional operator()(const Edge_profile& profile) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h index dadccaa8e4d..61440bec09e 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h @@ -50,8 +50,8 @@ public: returns the placement, if it does not get filtered by the wrapped filter, and if all triangles in the profile are inside the polyhedral envelope. */ - boost::optional operator()(const Edge_profile& profile, - boost::optional op) const; + std::optional operator()(const Edge_profile& profile, + std::optional op) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/EdgeCollapseSimplificationVisitor.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/EdgeCollapseSimplificationVisitor.h index 264f56319c7..0bbb8e88078 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/EdgeCollapseSimplificationVisitor.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/EdgeCollapseSimplificationVisitor.h @@ -47,7 +47,7 @@ for each edge collected. */ void OnCollected(const Edge_profile& profile, - boost::optional cost); + std::optional cost); /*! Called during the processing phase (when edges are collapsed), @@ -63,7 +63,7 @@ the edge will not be collapsed. */ void OnSelected(const Edge_profile& profile, - boost::optional cost, + std::optional cost, const Edge_profile::edges_size_type initial_edge_count, const Edge_profile::edges_size_type current_edge_count); @@ -76,7 +76,7 @@ the edge will not be collapsed. */ void OnCollapsing(const Edge_profile& profile, - boost::optional placement); + std::optional placement); /*! Called when an edge has been collapsed and replaced by the vertex `vd` diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/GetCost.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/GetCost.h index 24a05f636c2..d07a362bb19 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/GetCost.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/GetCost.h @@ -5,7 +5,7 @@ The concept `GetCost` describes the requirements for the policy function object which gets the collapse cost of an edge. -The cost returned is a `boost::optional` value (i.e.\ it can be absent). +The cost returned is a `std::optional` value (i.e.\ it can be absent). An absent cost indicates that the edge should not be collapsed. This could be the result of a computational limitation (such as an overflow), or can be intentionally returned to prevent the edge from being collapsed. @@ -31,8 +31,8 @@ public: Computes and returns the cost of collapsing the edge (represented by its profile), using the calculated placement. */ - boost::optional operator()(const Edge_profile& edge_profile, - const boost::optional& placement) const; + std::optional operator()(const Edge_profile& edge_profile, + const std::optional& placement) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/GetPlacement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/GetPlacement.h index e576472cb34..fa9347cdd28 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/GetPlacement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/GetPlacement.h @@ -7,7 +7,7 @@ function object
    which gets the collapse placement of an edge, that is, the new position of the vertex that remains after a halfedge-collapse operation. -The placement returned is a `boost::optional` value (i.e., it can +The placement returned is a `std::optional` value (i.e., it can be absent). An absent result indicates that the edge should not be collapsed. This could be the result of a computational limitation (such as an overflow), or can be intentionally returned to prevent the edge from being collapsed. @@ -36,7 +36,7 @@ public: Computes and returns the placement, that is, the position of the vertex which replaces the collapsing edge (represented by its profile). */ - boost::optionaloperator()(const Edge_profile& profile) const; + std::optionaloperator()(const Edge_profile& profile) const; /// @} diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/PlacementFilter.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/PlacementFilter.h index 324c87f45ee..a2a493e904d 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/PlacementFilter.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/PlacementFilter.h @@ -9,8 +9,8 @@ an edge is taken from the priority queue in order to get collapsed, and neither when the edge is inserted nor when it is updated in the priority queue. -The placement returned is a `boost::optional` value (i.e., it can -be absent). The value `boost::none` indicates that the edge should not be collapsed. +The placement returned is a `std::optional` value (i.e., it can +be absent). The value `std::nullopt` indicates that the edge should not be collapsed. \cgalRefines{DefaultConstructible,CopyConstructible} @@ -33,7 +33,7 @@ public: filters the placement. */ - boost::optional operator()(const Edge_profile& profile, boost::optional placement) const; + std::optional operator()(const Edge_profile& profile, std::optional placement) const; /// @} 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 31c3939c926..4dcf3ccfb12 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 @@ -369,7 +369,7 @@ Simple mesh before and after the collapse of edge `v-w` into vertex `w`. While t The class `Surface_mesh_simplification::Bounded_normal_change_filter` checks if a placement would invert the normal of a face around the stars of the two vertices of an edge that is candidate for an edge collapse. It then -rejects this placement by returning `boost::none`. +rejects this placement by returning `std::nullopt`. \note This filter class replaces the usage of the class `Surface_mesh_simplification::Bounded_normal_change_placement`. Using the filter is faster as it is only performed on the edge to be collapsed next, 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 bc89a3b77aa..04561d2239c 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 @@ -19,13 +19,13 @@ namespace SMS = CGAL::Surface_mesh_simplification; struct Dummy_placement { template - boost::optional operator()(const Profile&) const + std::optional operator()(const Profile&) const { - return boost::none; + return std::nullopt; } template - boost::optional operator()(const Profile&, const boost::optional& op) const + std::optional operator()(const Profile&, const std::optional& op) const { return op; } 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 16427c55226..ec9993b87dd 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 @@ -44,7 +44,7 @@ struct My_visitor : SMS::Edge_collapse_visitor_base My_visitor(Stats* s) : stats(s) {} // Called during the collecting phase for each edge collected. - void OnCollected(const Profile&, const boost::optional&) + void OnCollected(const Profile&, const std::optional&) { ++(stats->collected); std::cerr << "\rEdges collected: " << stats->collected << std::flush; @@ -53,7 +53,7 @@ struct My_visitor : SMS::Edge_collapse_visitor_base // Called during the processing phase for each edge selected. // If cost is absent the edge won't be collapsed. void OnSelected(const Profile&, - boost::optional cost, + std::optional cost, std::size_t initial, std::size_t current) { @@ -69,7 +69,7 @@ struct My_visitor : SMS::Edge_collapse_visitor_base // Called during the processing phase for each edge being collapsed. // If placement is absent the edge is left uncollapsed. void OnCollapsing(const Profile&, - boost::optional placement) + std::optional placement) { if(!placement) ++(stats->placement_uncomputable); diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h index 34a14497364..7cc2858020b 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h @@ -18,7 +18,7 @@ #include #include -#include +#include namespace CGAL { @@ -200,11 +200,11 @@ MatrixC33 adjoint_matrix(const MatrixC33& m) } template -boost::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) +std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) { typedef typename R::RT RT; typedef MatrixC33 Matrix; - typedef boost::optional result_type; + typedef std::optional result_type; result_type rInverse; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Edge_collapse_visitor_base.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Edge_collapse_visitor_base.h index 94870fb968c..87d24f3dd88 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Edge_collapse_visitor_base.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Edge_collapse_visitor_base.h @@ -46,9 +46,9 @@ struct Edge_collapse_visitor_base void OnStarted(Triangle_mesh&) {} void OnFinished(Triangle_mesh&) {} void OnStopConditionReached(const Profile&) {} - void OnCollected(const Profile&, const boost::optional&) {} - void OnSelected(const Profile&, const boost::optional&, size_type, size_type) {} - void OnCollapsing(const Profile&, const boost::optional&) {} + void OnCollected(const Profile&, const std::optional&) {} + void OnSelected(const Profile&, const std::optional&, size_type, size_type) {} + void OnCollapsing(const Profile&, const std::optional&) {} void OnCollapsed(const Profile&, const vertex_descriptor&) {} void OnNonCollapsable(const Profile&) {} }; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h index 36f2f855312..103eec6878b 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -93,12 +93,12 @@ public: } template - boost::optional + std::optional operator()(const Profile& profile) const { typedef typename Profile::Point Point; - boost::optional op = m_base_placement(profile); + std::optional op = m_base_placement(profile); if(op) { if(m_tree_ptr == nullptr) @@ -121,7 +121,7 @@ public: m_tree_ptr->do_intersect(CGAL::Sphere_3(p, m_sq_threshold_dist))) return op; - return boost::optional(); + return std::optional(); } return op; @@ -153,13 +153,13 @@ public: { } template - boost::optional + std::optional operator()(const Profile& profile) const { typedef typename Profile::Geom_traits Geom_traits; typedef typename Profile::Point Point; - boost::optional op = m_base_placement(profile); + std::optional op = m_base_placement(profile); if(op) { CGAL_assertion(m_tree_ptr != nullptr); @@ -173,7 +173,7 @@ public: m_tree_ptr->do_intersect(CGAL::Sphere_3(p, m_sq_threshold_dist))) return op; - return boost::optional(); + return std::optional(); } return op; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h index 41e8af44337..036d5bb9b44 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h @@ -15,7 +15,7 @@ #include #include -#include +#include namespace CGAL { namespace Surface_mesh_simplification { @@ -31,8 +31,8 @@ public: template - boost::optional - operator()(const Profile& profile, boost::optional op) const + std::optional + operator()(const Profile& profile, std::optional op) const { typedef typename Profile::VertexPointMap Vertex_point_map; @@ -78,7 +78,7 @@ public: Vector n2 = gt.construct_cross_product_vector_3_object()(eq2p, eq2r); if(!is_positive(gt.compute_scalar_product_3_object()(n1, n2))) - return boost::optional(); + return std::optional(); ++it; } diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h index 379847d3ffe..1a1b9aafd12 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h @@ -15,7 +15,7 @@ #include -#include +#include namespace CGAL { namespace Surface_mesh_simplification { @@ -29,7 +29,7 @@ public: {} template - boost::optional + std::optional operator()(const Profile& profile) const { typedef typename Profile::VertexPointMap Vertex_point_map; @@ -43,7 +43,7 @@ public: const Geom_traits& gt = profile.geom_traits(); const Vertex_point_map& vpm = profile.vertex_point_map(); - boost::optional op = m_get_placement(profile); + std::optional op = m_get_placement(profile); if(op) { // triangles returns the triangles of the star of the vertices of the edge to collapse @@ -76,7 +76,7 @@ public: Vector n2 = gt.construct_cross_product_vector_3_object()(eq2p, eq2r); if(!is_positive(gt.compute_scalar_product_3_object()(n1, n2))) - return boost::optional(); + return std::optional(); ++it; } diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h index 07749bdc643..38f4b478ad3 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h @@ -31,7 +31,7 @@ public: {} template - boost::optional operator()(const Profile& profile) const + std::optional operator()(const Profile& profile) const { typedef typename Profile::TM TM; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h index 079f480076e..7b5cab2ba26 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h @@ -27,9 +27,9 @@ public: Edge_length_cost() {} template - boost::optional operator()(const Profile& profile, const T& /*placement*/) const + std::optional operator()(const Profile& profile, const T& /*placement*/) const { - typedef boost::optional result_type; + typedef std::optional result_type; return result_type(profile.geom_traits().compute_squared_distance_3_object()(profile.p0(), profile.p1())); } }; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/FastEnvelope_filter.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/FastEnvelope_filter.h index 2f0abb38789..bd576f56530 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/FastEnvelope_filter.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/FastEnvelope_filter.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -97,8 +97,8 @@ public: template - boost::optional - operator()(const Profile& profile, boost::optional op) const + std::optional + operator()(const Profile& profile, std::optional op) const { typedef typename Profile::Point Point; typedef typename Profile::vertex_descriptor_vector Link; @@ -116,7 +116,7 @@ public: if(m_fast_envelope->is_outside(vecp)){ // the new placement is outside envelope - return boost::none; + return std::nullopt; } const Link link = profile.link(); @@ -134,7 +134,7 @@ public: if(m_fast_envelope->is_outside(triangle)){ // the triangle intersects the envelope - return boost::none; + return std::nullopt; } vecv = vecw; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h index 8a3a11a1213..b1421d750fa 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h @@ -32,9 +32,9 @@ public: {} template - boost::optional + std::optional operator()(const Profile& profile, - const boost::optional& placement) const + const std::optional& placement) const { return internal::LindstromTurkCore(m_LT_params, profile).compute_cost(placement); } diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h index 9dc14adcf94..82bf9cc33ef 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h @@ -31,7 +31,7 @@ public: {} template - boost::optional operator()(const Profile& profile) const + std::optional operator()(const Profile& profile) const { return internal::LindstromTurkCore(m_LT_params, profile).compute_placement(); } diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h index 7429f670b5c..c76fb670318 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h @@ -29,9 +29,9 @@ public: Midpoint_placement() {} template - boost::optional operator()(const Profile& profile) const + std::optional operator()(const Profile& profile) const { - typedef boost::optional result_type; + typedef std::optional result_type; return result_type(profile.geom_traits().construct_midpoint_3_object()(profile.p0(), profile.p1())); } }; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_policy_base.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_policy_base.h index d669e44f317..590747a252b 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_policy_base.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_policy_base.h @@ -22,7 +22,7 @@ #include -#include +#include namespace CGAL { namespace Surface_mesh_simplification { @@ -199,14 +199,14 @@ public: public: // Cost template - boost::optional + std::optional operator()(const Profile& profile, - const boost::optional& placement) const + const std::optional& placement) const { - typedef boost::optional Optional_FT; + typedef std::optional Optional_FT; if(!placement) - return boost::optional(); + return std::optional(); CGAL_precondition(!get(vcm(), profile.v0()).isZero(0)); CGAL_precondition(!get(vcm(), profile.v1()).isZero(0)); @@ -222,7 +222,7 @@ public: public: // Placement template - boost::optional operator()(const Profile& profile) const + std::optional operator()(const Profile& profile) const { CGAL_precondition(!get(vcm(), profile.v0()).isZero(0)); CGAL_precondition(!get(vcm(), profile.v1()).isZero(0)); @@ -236,7 +236,7 @@ public: const Col_4 opt = construct_optimum(combined_matrix, p0, p1); - boost::optional pt = typename Profile::Point(opt(0) / opt(3), + std::optional pt = typename Profile::Point(opt(0) / opt(3), opt(1) / opt(3), opt(2) / opt(3)); diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index b0fce64b6d9..59002f63681 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -55,9 +55,9 @@ public: typedef typename Geom_traits::FT FT; typedef typename Geom_traits::Vector_3 Vector; - typedef boost::optional Optional_FT; - typedef boost::optional Optional_point; - typedef boost::optional Optional_vector; + typedef std::optional Optional_FT; + typedef std::optional Optional_point; + typedef std::optional Optional_vector; typedef MatrixC33 Matrix; @@ -152,7 +152,7 @@ private : static bool is_finite(const Matrix& m) { return is_finite(m.r0()) && is_finite(m.r1()) && is_finite(m.r2()); } template - static boost::optional filter_infinity(const T& n) { return is_finite(n) ? boost::optional(n) : boost::optional(); } + static std::optional filter_infinity(const T& n) { return is_finite(n) ? std::optional(n) : std::optional(); } private: @@ -298,7 +298,7 @@ compute_placement() if(mConstraints_n == 3) { // If the matrix is singular it's inverse cannot be computed so an 'absent' value is returned. - boost::optional lOptional_Ai = inverse_matrix(mConstraints_A); + std::optional lOptional_Ai = inverse_matrix(mConstraints_A); if(lOptional_Ai) { const Matrix& lAi = *lOptional_Ai; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h index a11066435a3..4ed45a02d1e 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include @@ -40,8 +40,8 @@ namespace internal { struct Dummy_filter { template inline - const boost::optional - operator()(const Profile&, const boost::optional& op) const + const std::optional + operator()(const Profile&, const std::optional& op) const { return op; } @@ -94,7 +94,7 @@ inline std::string matrix_to_string(const Matrix& m) { } template -inline std::string optional_to_string(const boost::optional& o) { +inline std::string optional_to_string(const std::optional& o) { if(o) return boost::str(boost::format("%1%") % *o); else return std::string("NONE"); diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h index a662b4c24c0..0e45e5353ca 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h @@ -127,8 +127,8 @@ public: typedef typename Geom_traits::Vector_3 Vector; typedef typename Geom_traits::Equal_3 Equal_3; - typedef boost::optional Cost_type; - typedef boost::optional Placement_type; + typedef std::optional Cost_type; + typedef std::optional Placement_type; struct Compare_id { @@ -149,7 +149,7 @@ public: bool operator()(const halfedge_descriptor a, const halfedge_descriptor b) const { - // NOTE: A cost is a boost::optional<> value. + // NOTE: A cost is a std::optional<> value. // Absent optionals are ordered first; that is, "none < T" and "T > none" for any defined T != none. // In consequence, edges with undefined costs will be promoted to the top of the priority queue and popped out first. return m_algorithm->get_data(a).cost() < m_algorithm->get_data(b).cost(); @@ -333,9 +333,9 @@ private: CGAL_expensive_assertion(!mPQ->contains(h)); } - boost::optional pop_from_PQ() + std::optional pop_from_PQ() { - boost::optional opt_h = mPQ->extract_top(); + std::optional opt_h = mPQ->extract_top(); if(opt_h) { CGAL_assertion(is_primary_edge(*opt_h)); @@ -592,7 +592,7 @@ loop() // Pops and processes each edge from the PQ - boost::optional opt_h; + std::optional opt_h; #ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING int i_rm = 0; @@ -630,7 +630,7 @@ loop() std::cout << "step " << i_rm << " " << get(m_vpm, source(*h, m_tm)) << " " << get(m_vpm, target(*h, m_tm)) << "\n"; #endif - if(m_should_ignore(profile, placement)!= boost::none){ + if(m_should_ignore(profile, placement)!= std::nullopt){ collapse(profile, placement); } else 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 0f5c8e99109..f24432ba3ad 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 @@ -46,7 +46,7 @@ struct My_visitor : SMS::Edge_collapse_visitor_base My_visitor(Stats* s) : stats(s) {} // Called during the collecting phase for each edge collected. - void OnCollected(const Profile&, const boost::optional&) + void OnCollected(const Profile&, const std::optional&) { ++(stats->collected); std::cerr << "\rEdges collected: " << stats->collected << std::endl; @@ -55,7 +55,7 @@ struct My_visitor : SMS::Edge_collapse_visitor_base // Called during the processing phase for each edge selected. // If cost is absent the edge won't be collapsed. void OnSelected(const Profile&, - boost::optional cost, + std::optional cost, std::size_t /* initial */, std::size_t /* current */) { @@ -67,7 +67,7 @@ struct My_visitor : SMS::Edge_collapse_visitor_base // Called during the processing phase for each edge being collapsed. // If placement is absent the edge is left uncollapsed. void OnCollapsing(const Profile&, - boost::optional placement) + std::optional placement) { if(!placement) ++(stats->placement_uncomputable); 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 e1b27a66d55..00e6cf68501 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 @@ -198,7 +198,7 @@ void write (SurfaceSP aSurface, string aName) } template -string opt2str (const boost::optional& o) +string opt2str (const std::optional& o) { ostringstream ss; if(o) @@ -222,7 +222,7 @@ string point2str (const P& p) } template -string optpoint2str (const boost::optional

    & p) +string optpoint2str (const std::optional

    & p) { ostringstream ss; if(p) @@ -232,7 +232,7 @@ string optpoint2str (const boost::optional

    & p) return ss.str(); } template -string optfloat2str (const boost::optional& n) +string optfloat2str (const std::optional& n) { ostringstream ss; if(n) @@ -258,7 +258,7 @@ string edge2str (const E& e) return ss.str(); } -template ostream& operator << (ostream& os, const boost::optional& o) { return os << opt2str(o); } +template ostream& operator << (ostream& os, const std::optional& o) { return os << opt2str(o); } string normalize_EOL (string line) { @@ -304,12 +304,12 @@ public : CHECK(aSurface.is_valid()); } - virtual void OnCollected(const Profile& aProfile, const boost::optional& aCost) const + virtual void OnCollected(const Profile& aProfile, const std::optional& aCost) const { TEST_TRACE(str (boost::format("Collecting %1% : cost=%2%") % edge2str(aProfile.v0_v1()) % optfloat2str(aCost))); } - virtual void OnCollapsing(const Profile& aProfile, const boost::optional& aP) const + virtual void OnCollapsing(const Profile& aProfile, const std::optional& aP) const { TEST_TRACE(str (boost::format("S %1% - Collapsing %2% : placement=%3%") % mStep % edge2str(aProfile.v0_v1()) % optpoint2str(aP))); diff --git a/Surface_mesher/include/CGAL/AABB_polyhedral_oracle.h b/Surface_mesher/include/CGAL/AABB_polyhedral_oracle.h index a57dc122563..d03fe0b0fe5 100644 --- a/Surface_mesher/include/CGAL/AABB_polyhedral_oracle.h +++ b/Surface_mesher/include/CGAL/AABB_polyhedral_oracle.h @@ -84,7 +84,7 @@ namespace CGAL { Object operator()(const Surface_3& surface, const Segment_3& segment) const { - boost::optional< typename AABB_traits::template Intersection_and_primitive_id::Type > + std::optional< typename AABB_traits::template Intersection_and_primitive_id::Type > intersection = surface.tree()->any_intersection(segment); if ( intersection ) @@ -95,7 +95,7 @@ namespace CGAL { Object operator()(const Surface_3& surface, const Line_3& line) const { - boost::optional< typename AABB_traits::template Intersection_and_primitive_id::Type > + std::optional< typename AABB_traits::template Intersection_and_primitive_id::Type > intersection = surface.tree()->any_intersection(line); if ( intersection ) @@ -105,7 +105,7 @@ namespace CGAL { } Object operator()(const Surface_3& surface, const Ray_3& ray) const { - boost::optional< typename AABB_traits::template Intersection_and_primitive_id::Type > + std::optional< typename AABB_traits::template Intersection_and_primitive_id::Type > intersection = surface.tree()->any_intersection(ray); if ( intersection ) 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 4fbe1180756..17b2c7edd35 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/flip_edges.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/flip_edges.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -317,7 +317,7 @@ Sliver_removal_result flip_3_to_2(typename C3t3::Edge& edge, } ch->vertex(v)->set_cell(ch); - inc_cells[ch->vertex(v)] = boost::none; + inc_cells[ch->vertex(v)] = std::nullopt; ch->reset_cache_validity(); } } @@ -596,8 +596,8 @@ void find_best_flip_to_improve_dh(C3t3& c3t3, if(tr.is_infinite(vh)) continue; - boost::optional>& o_inc_vh = inc_cells[vh]; - if (o_inc_vh == boost::none) + std::optional>& o_inc_vh = inc_cells[vh]; + if (o_inc_vh == std::nullopt) { boost::container::small_vector inc_vec; tr.incident_cells(vh, std::back_inserter(inc_vec)); @@ -761,8 +761,8 @@ Sliver_removal_result flip_n_to_m(C3t3& c3t3, facet_circulator++; facet_circulator++; - boost::optional>& o_inc_vh = inc_cells[vh]; - if (o_inc_vh == boost::none) + std::optional>& o_inc_vh = inc_cells[vh]; + if (o_inc_vh == std::nullopt) { boost::container::small_vector inc_vec; tr.incident_cells(vh, std::back_inserter(inc_vec)); @@ -948,7 +948,7 @@ Sliver_removal_result flip_n_to_m(C3t3& c3t3, } ch->vertex(v)->set_cell(ch); - inc_cells[ch->vertex(v)] = boost::none; + inc_cells[ch->vertex(v)] = std::nullopt; ch->reset_cache_validity(); } } @@ -1186,14 +1186,14 @@ std::size_t flip_all_edges(const std::vector& edges, Tr& tr = c3t3.triangulation(); std::unordered_map > > inc_cells; + std::optional > > inc_cells; std::size_t count = 0; for (const VertexPair& vp : edges) { - boost::optional>& + std::optional>& o_inc_vh = inc_cells[vp.first]; - if (o_inc_vh == boost::none) + if (o_inc_vh == std::nullopt) { boost::container::small_vector inc_vec; tr.incident_cells(vp.first, std::back_inserter(inc_vec)); 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 24874936248..7628e653699 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include @@ -91,7 +91,7 @@ private: } template - boost::optional + std::optional find_adjacent_facet_on_surface(const Facet& f, const Edge& edge, const C3t3& c3t3, @@ -211,7 +211,7 @@ private: for (const std::array& ei : edges) { Edge edge(ch, ei[0], ei[1]); - if (boost::optional neighbor + if (std::optional neighbor = find_adjacent_facet_on_surface(f, edge, c3t3, cell_selector)) { const Facet neigh = *neighbor; //already a canonical_facet @@ -307,7 +307,7 @@ private: #endif } - boost::optional project(const Surface_patch_index& si, + std::optional project(const Surface_patch_index& si, const Vector_3& gi) { CGAL_assertion(subdomain_FMLS_indices.find(si) != subdomain_FMLS_indices.end()); @@ -537,7 +537,7 @@ public: = project_on_tangent_plane(smoothed_position, current_pos, vertices_normals[v][si]); //Check if the mls surface exists to avoid degenerated cases - if (boost::optional mls_projection = project(si, normal_projection)) { + if (std::optional mls_projection = project(si, normal_projection)) { final_position = final_position + *mls_projection; } else { @@ -574,7 +574,7 @@ public: { //Check if the mls surface exists to avoid degenerated cases - if (boost::optional mls_projection = project(si, current_pos)) { + if (std::optional mls_projection = project(si, current_pos)) { final_position = final_position + *mls_projection; } else { @@ -660,7 +660,7 @@ public: current_pos, vertices_normals[v][si]); - if (boost::optional mls_projection = project(si, normal_projection)) + if (std::optional mls_projection = project(si, normal_projection)) final_position = final_position + *mls_projection; else final_position = smoothed_position; @@ -682,7 +682,7 @@ public: const Vector_3 current_pos(CGAL::ORIGIN, point(v->point())); - if (boost::optional mls_projection = project(si, current_pos)) + if (std::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)){ 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 4c8fac7609c..b9147708c01 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 @@ -30,7 +30,7 @@ #include #include -#include +#include namespace CGAL { @@ -321,15 +321,15 @@ public: Cell_handle c = c_i.first; const std::array& f_on_surface = c_i.second; - boost::optional patch; + std::optional patch; for (int i = 0; i < 4; ++i) { if (f_on_surface[i]) { Surface_patch_index spi = m_c3t3.surface_patch_index(c, i); - if (patch != boost::none && patch != spi) + if (patch != std::nullopt && patch != spi) { - patch = boost::none; + patch = std::nullopt; break; } else @@ -338,7 +338,7 @@ public: } } } - if(patch == boost::none) + if(patch == std::nullopt) continue; for (int i = 0; i < 4; ++i) diff --git a/Three/include/CGAL/Three/exceptions.h b/Three/include/CGAL/Three/exceptions.h index cf3640d5b46..dd923aa5b2b 100644 --- a/Three/include/CGAL/Three/exceptions.h +++ b/Three/include/CGAL/Three/exceptions.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include namespace CGAL{ @@ -44,7 +44,7 @@ public: template struct Optional_or_bool { - typedef boost::optional type; + typedef std::optional type; template static type invoke(Callable f) { return type(f()); } diff --git a/Triangulation/include/CGAL/Delaunay_triangulation.h b/Triangulation/include/CGAL/Delaunay_triangulation.h index 262f451fdc1..1dd1929cb68 100644 --- a/Triangulation/include/CGAL/Delaunay_triangulation.h +++ b/Triangulation/include/CGAL/Delaunay_triangulation.h @@ -130,12 +130,12 @@ private: // Wrapper struct Side_of_oriented_subsphere_d { - boost::optional* fop; + std::optional* fop; Construct_flat_orientation_d cfo; In_flat_side_of_oriented_sphere_d ifsoos; Side_of_oriented_subsphere_d( - boost::optional& x, + std::optional& x, Construct_flat_orientation_d const&y, In_flat_side_of_oriented_sphere_d const&z) : fop(&x), cfo(y), ifsoos(z) {} diff --git a/Triangulation/include/CGAL/Regular_triangulation.h b/Triangulation/include/CGAL/Regular_triangulation.h index 2d63893e38a..8294cb65598 100644 --- a/Triangulation/include/CGAL/Regular_triangulation.h +++ b/Triangulation/include/CGAL/Regular_triangulation.h @@ -129,12 +129,12 @@ private: // Wrapper struct Power_side_of_power_sphere_for_non_maximal_dim_d { - boost::optional* fop; + std::optional* fop; Construct_flat_orientation_d cfo; In_flat_power_side_of_power_sphere_d ifpt; Power_side_of_power_sphere_for_non_maximal_dim_d( - boost::optional& x, + std::optional& x, Construct_flat_orientation_d const&y, In_flat_power_side_of_power_sphere_d const&z) : fop(&x), cfo(y), ifpt(z) {} diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index 55a118a7b69..1dc8e1a3459 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -88,12 +88,12 @@ protected: // Wrapper struct Coaffine_orientation_d { - boost::optional* fop; + std::optional* fop; Construct_flat_orientation_d cfo; In_flat_orientation_d ifo; Coaffine_orientation_d( - boost::optional& x, + std::optional& x, Construct_flat_orientation_d const&y, In_flat_orientation_d const&z) : fop(&x), cfo(y), ifo(z) {} @@ -117,7 +117,7 @@ protected: flat_orientation_ = *preset_flat_orientation_.second; } else - flat_orientation_ = boost::none; + flat_orientation_ = std::nullopt; } typedef typename TriangulationTraits::Orientation_d @@ -188,7 +188,7 @@ protected: // DATA MEMBERS Triangulation_ds tds_; const Geom_traits kernel_; Vertex_handle infinity_; - mutable boost::optional flat_orientation_; + mutable std::optional flat_orientation_; // The user can specify a Flat_orientation_d object to be used for // orienting simplices of a specific dimension // (= preset_flat_orientation_.first) diff --git a/Triangulation_2/doc/Triangulation_2/Concepts/ConstrainedTriangulationTraits_2.h b/Triangulation_2/doc/Triangulation_2/Concepts/ConstrainedTriangulationTraits_2.h index 6f7a9e5ea85..652cb033ab8 100644 --- a/Triangulation_2/doc/Triangulation_2/Concepts/ConstrainedTriangulationTraits_2.h +++ b/Triangulation_2/doc/Triangulation_2/Concepts/ConstrainedTriangulationTraits_2.h @@ -40,7 +40,7 @@ public: /*! A function object whose `operator()` computes the intersection of two segments. -`boost::optional > operator()(Segment_2 s1, Segment_2 s2);` +`std::optional > operator()(Segment_2 s1, Segment_2 s2);` Returns the intersection of `s1` and `s2`. */ typedef unspecified_type Intersect_2; From 557b64e4a67febfe1e8940b21adc8267206aa17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 28 Apr 2023 20:54:15 +0200 Subject: [PATCH 056/156] boost::any ==> std::any --- .../Option_parser.cpp | 12 +++++----- .../Option_parser.hpp | 2 +- .../include/CGAL/sibson_gradient_fitting.h | 10 ++++----- .../Intersections_2/variant_any_object.cpp | 16 +++++++------- Nef_2/include/CGAL/Nef_2/HDS_items.h | 8 +++---- Nef_2/include/CGAL/Nef_2/PM_const_decorator.h | 4 ++-- Nef_2/include/CGAL/Nef_2/PM_decorator.h | 2 +- Nef_2/include/CGAL/Nef_2/PM_overlayer.h | 22 +++++++++---------- Nef_2/include/CGAL/Nef_2/PM_point_locator.h | 16 +++++++------- Nef_2/include/CGAL/Nef_2/gen_point_location.h | 16 +++++++------- Nef_2/include/CGAL/Nef_2/geninfo.h | 2 +- Nef_3/include/CGAL/Nef_3/Halfedge.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SFace.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SHalfedge.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h | 6 ++--- Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h | 2 +- .../include/CGAL/Nef_3/SNC_const_decorator.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SNC_decorator.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SNC_io_parser.h | 4 ++-- Nef_3/include/CGAL/Nef_3/Vertex.h | 4 ++-- .../include/CGAL/Nef_S2/SM_const_decorator.h | 4 ++-- Nef_S2/include/CGAL/Nef_S2/SM_decorator.h | 4 ++-- Nef_S2/include/CGAL/Nef_S2/SM_items.h | 10 ++++----- Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h | 22 +++++++++---------- Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h | 2 +- Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h | 14 ++++++------ .../CGAL/Polygon_mesh_processing/distance.h | 16 +++++++------- .../Polyhedron/Plugins/Mesh_3/Mesh_function.h | 8 +++---- STL_Extension/doc/STL_Extension/CGAL/Object.h | 2 +- .../doc/STL_Extension/STL_Extension.txt | 2 +- STL_Extension/include/CGAL/Object.h | 20 ++++++++--------- 31 files changed, 125 insertions(+), 125 deletions(-) diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp index 8a2bb5dd03c..a1032551da2 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp @@ -18,7 +18,7 @@ char * Option_parser::s_strategy_opts[] = { }; template -void Option_parser::my_validate(boost::any & v, +void Option_parser::my_validate(std::any & v, const std::vector & values) { typedef std::vector Vector_id; @@ -28,11 +28,11 @@ void Option_parser::my_validate(boost::any & v, if (v.empty()) { Vector_id vec; vec.push_back(MyId(i)); - v = boost::any(vec); + v = std::any(vec); } else { - Vector_id vec = boost::any_cast(v); + Vector_id vec = std::any_cast(v); vec.push_back(MyId(i)); - v = boost::any(vec); + v = std::any(vec); } return; } @@ -41,14 +41,14 @@ void Option_parser::my_validate(boost::any & v, } /* Overload the 'validate' function for the user-defined class */ -void validate(boost::any & v, const std::vector & values, +void validate(std::any & v, const std::vector & values, Option_parser::Vector_type_id * target_type, int) { Option_parser::my_validate(v, values); } /* Overload the 'validate' function for the user-defined class */ -void validate(boost::any & v, const std::vector & values, +void validate(std::any & v, const std::vector & values, Option_parser::Vector_strategy_id * target_type, int) { Option_parser::my_validate(v, values); diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp index 4fcfc0aafd6..a20f3b804c2 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp @@ -124,7 +124,7 @@ public: unsigned int get_height() const { return m_win_height; } template - static void my_validate(boost::any & v, + static void my_validate(std::any & v, const std::vector & values); protected: diff --git a/Interpolation/include/CGAL/sibson_gradient_fitting.h b/Interpolation/include/CGAL/sibson_gradient_fitting.h index 074ca037afb..f08600a4603 100644 --- a/Interpolation/include/CGAL/sibson_gradient_fitting.h +++ b/Interpolation/include/CGAL/sibson_gradient_fitting.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -229,7 +229,7 @@ sibson_gradient_fitting_nn_2(const Dt& dt, // of the value functor is 'DT::Point' or 'DT::Vertex_handle' std::enable_if_t< std::is_constructible< - std::function, + std::function, ValueFunctor >::value>* = nullptr) { @@ -255,7 +255,7 @@ sibson_gradient_fitting_nn_2(const Dt& dt, const Traits& traits, std::enable_if_t< std::is_constructible< - std::function, + std::function, ValueFunctor >::value>* = nullptr) { @@ -299,7 +299,7 @@ sibson_gradient_fitting_rn_2(const Rt& rt, // of the value functor is 'Rt::Point' (weighted point) or 'Rt::Vertex_handle' std::enable_if_t< std::is_constructible< - std::function, + std::function, ValueFunctor >::value>* = nullptr) { @@ -325,7 +325,7 @@ sibson_gradient_fitting_rn_2(const Rt& rt, const Traits& traits, std::enable_if_t< std::is_constructible< - std::function, + std::function, ValueFunctor >::value>* = nullptr) { diff --git a/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp b/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp index a7765e4b3c1..c5176eda212 100644 --- a/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp +++ b/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -78,7 +78,7 @@ intersection_variant(const typename K::Segment_2 &seg1, } template -boost::any intersection_any(const typename K::Segment_2 &seg1, +std::any intersection_any(const typename K::Segment_2 &seg1, const typename K::Segment_2 &seg2, const K&) { @@ -88,11 +88,11 @@ boost::any intersection_any(const typename K::Segment_2 &seg1, switch (ispair.intersection_type()) { case is_t::NO_INTERSECTION: default: - return boost::any(); + return std::any(); case is_t::POINT: - return boost::any(ispair.intersection_point()); + return std::any(ispair.intersection_point()); case is_t::SEGMENT: - return boost::any(ispair.intersection_segment()); + return std::any(ispair.intersection_segment()); } } @@ -165,10 +165,10 @@ struct Any_f : Vec_holder { Vec_holder(p, s) { } void operator()(const Segment& s1, const Segment& s2) { - boost::any obj = intersection_any(s1, s2, K()); - if (const Point * point = boost::any_cast(&obj)) { + std::any obj = intersection_any(s1, s2, K()); + if (const Point * point = std::any_cast(&obj)) { p->push_back(*point); - } else if (const Segment * segment = boost::any_cast(&obj)) { + } else if (const Segment * segment = std::any_cast(&obj)) { s->push_back(*segment); } } diff --git a/Nef_2/include/CGAL/Nef_2/HDS_items.h b/Nef_2/include/CGAL/Nef_2/HDS_items.h index 48a44c50fd7..12e1d32d873 100644 --- a/Nef_2/include/CGAL/Nef_2/HDS_items.h +++ b/Nef_2/include/CGAL/Nef_2/HDS_items.h @@ -22,7 +22,7 @@ #include #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -62,7 +62,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Traits::Point Point; // geometric embedding @@ -151,7 +151,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename std::list::iterator fc_iterator; @@ -248,7 +248,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Traits::Mark Mark; // mark information 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 7748f4b1f61..5a685f9e310 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -28,7 +28,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif #include @@ -137,7 +137,7 @@ typedef size_t Size_type; /*{\Mtypemember The size type.}*/ typedef void* GenPtr; #else -typedef boost::any GenPtr; +typedef std::any GenPtr; #endif diff --git a/Nef_2/include/CGAL/Nef_2/PM_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_decorator.h index 914a6a58d6a..6cc528c7dab 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_decorator.h @@ -19,7 +19,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include diff --git a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h index 5ce03215db3..882a349c9c9 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h +++ b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h @@ -23,7 +23,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 13 @@ -92,7 +92,7 @@ struct PMO_from_segs { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::access(G.info(v)) = e; #else - *boost::any_cast(&G.info(v)) = e; + *std::any_cast(&G.info(v)) = e; #endif } @@ -102,7 +102,7 @@ struct PMO_from_segs { return geninfo::access(G.info(v)); #else return - boost::any_cast(G.info(v)); + std::any_cast(G.info(v)); #endif } @@ -112,7 +112,7 @@ struct PMO_from_segs { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); #else - G.info(v)=boost::any(); + G.info(v)=std::any(); #endif } @@ -674,7 +674,7 @@ void discard_info(Vertex_handle v) const #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(v)); #else - info(v)=boost::any(); + info(v)=std::any(); #endif } @@ -684,7 +684,7 @@ vertex_info& ginfo(Vertex_handle v) const return geninfo::access(info(v)); #else return - *boost::any_cast(&info(v)); + *std::any_cast(&info(v)); #endif } @@ -729,8 +729,8 @@ void discard_info(Halfedge_handle e) const geninfo::clear(info(e)); geninfo::clear(info(twin(e))); #else - info(e)=boost::any(); - info(twin(e))=boost::any(); + info(e)=std::any(); + info(twin(e))=std::any(); #endif } @@ -740,7 +740,7 @@ halfedge_info& ginfo(Halfedge_handle e) const return geninfo::access(info(e)); #else return - *boost::any_cast(&info(e)); + *std::any_cast(&info(e)); #endif } @@ -782,7 +782,7 @@ void discard_info(Face_handle f) const #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(f)); #else - info(f)=boost::any(); + info(f)=std::any(); #endif } @@ -792,7 +792,7 @@ face_info& ginfo(Face_handle f) const return geninfo::access(info(f)); #else return - *boost::any_cast(&info(f)); + *std::any_cast(&info(f)); #endif } 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 ede8d2b033a..12a4a081267 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -28,7 +28,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #ifdef CGAL_USE_LEDA_LIBRARY @@ -497,7 +497,7 @@ protected: return geninfo::const_access(CT.info(v)).first; #else return - boost::any_cast(CT.info(v)).first; + std::any_cast(CT.info(v)).first; #endif } @@ -507,7 +507,7 @@ protected: return geninfo::const_access(CT.info(e)).first; #else return - boost::any_cast(CT.info(e)).first; + std::any_cast(CT.info(e)).first; #endif } @@ -517,7 +517,7 @@ protected: return geninfo::const_access(CT.info(e)).second; #else return - boost::any_cast(CT.info(e)).second; + std::any_cast(CT.info(e)).second; #endif } @@ -584,10 +584,10 @@ protected: f = geninfo::access(info(e_from)).second; #else f = - boost::any_cast(info(source(e))).second; + std::any_cast(info(source(e))).second; else f = - boost::any_cast(info(e_from)).second; + std::any_cast(info(e_from)).second; #endif mark(e) = _DP.mark(f); #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO @@ -968,7 +968,7 @@ PM_point_locator:: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(CT.info(vit)); #else - CT.info(vit)=boost::any(); + CT.info(vit)=std::any(); #endif } Halfedge_iterator eit, eend = CT.halfedges_end(); @@ -976,7 +976,7 @@ PM_point_locator:: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(CT.info(eit)); #else - CT.info(eit)=boost::any(); + CT.info(eit)=std::any(); #endif } CT.clear(); diff --git a/Nef_2/include/CGAL/Nef_2/gen_point_location.h b/Nef_2/include/CGAL/Nef_2/gen_point_location.h index c479a9af62a..1430b785ae0 100644 --- a/Nef_2/include/CGAL/Nef_2/gen_point_location.h +++ b/Nef_2/include/CGAL/Nef_2/gen_point_location.h @@ -27,7 +27,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif @@ -55,7 +55,7 @@ class GenericLocation { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif public: /*{\Mtypes}*/ @@ -89,7 +89,7 @@ public: return geninfo::const_access(value); #else return - *boost::any_cast(&value); + *std::any_cast(&value); #endif } /*{\Mconversion converts |\Mvar| into a node.\\ @@ -105,7 +105,7 @@ public: return geninfo::const_access(value); #else return - *boost::any_cast(&value); + *std::any_cast(&value); #endif } /*{\Mconversion converts |\Mvar| into an edge.\\ @@ -159,8 +159,8 @@ public: case NODE: geninfo::clear(value); break; case EDGE: geninfo::clear(value); break; #else - case NODE: value=boost::any(); break; - case EDGE: value=boost::any(); break; + case NODE: value=std::any(); break; + case EDGE: value=std::any(); break; #endif case NIL: break; } @@ -174,14 +174,14 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::access(value) = geninfo::const_access(L.value); #else - *boost_any_cast(&value) = boost::any_cast(L.value); + *boost_any_cast(&value) = std::any_cast(L.value); #endif break; case EDGE: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::access(value) = geninfo::const_access(L.value); #else - *boost::any_cast(&value) = boost::any_cast(L.value); + *std::any_cast(&value) = std::any_cast(L.value); #endif break; case NIL: break; diff --git a/Nef_2/include/CGAL/Nef_2/geninfo.h b/Nef_2/include/CGAL/Nef_2/geninfo.h index 08273c2e23e..41fab418e91 100644 --- a/Nef_2/include/CGAL/Nef_2/geninfo.h +++ b/Nef_2/include/CGAL/Nef_2/geninfo.h @@ -17,7 +17,7 @@ #define CGAL_DEPRECATED_HEADER "" #define CGAL_DEPRECATED_MESSAGE_DETAILS \ - "Something like boost::any or boost::variant should be used instead." + "Something like std::any or boost::variant should be used instead." #include #include diff --git a/Nef_3/include/CGAL/Nef_3/Halfedge.h b/Nef_3/include/CGAL/Nef_3/Halfedge.h index b4fc7065740..01c8df55785 100644 --- a/Nef_3/include/CGAL/Nef_3/Halfedge.h +++ b/Nef_3/include/CGAL/Nef_3/Halfedge.h @@ -31,7 +31,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -42,7 +42,7 @@ class Halfedge_base #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Vector_3 Vector_3; diff --git a/Nef_3/include/CGAL/Nef_3/SFace.h b/Nef_3/include/CGAL/Nef_3/SFace.h index 3ee882271d6..c723b2cd4d0 100644 --- a/Nef_3/include/CGAL/Nef_3/SFace.h +++ b/Nef_3/include/CGAL/Nef_3/SFace.h @@ -29,7 +29,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -39,7 +39,7 @@ class SFace_base { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Vertex_handle Vertex_handle; diff --git a/Nef_3/include/CGAL/Nef_3/SHalfedge.h b/Nef_3/include/CGAL/Nef_3/SHalfedge.h index 19339312f20..2191e73bbe6 100644 --- a/Nef_3/include/CGAL/Nef_3/SHalfedge.h +++ b/Nef_3/include/CGAL/Nef_3/SHalfedge.h @@ -30,7 +30,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -40,7 +40,7 @@ class SHalfedge_base { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; diff --git a/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h index 6f60c188570..6cbc6be0ed8 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h @@ -18,7 +18,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include @@ -413,7 +413,7 @@ protected: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO Edge_of[geninfo::access(info(e_min->twin()->source()->twin()->source()))]; #else - Edge_of[ boost::any_cast(info(e_min->twin()->source()->twin()->source())) ]; + Edge_of[ std::any_cast(info(e_min->twin()->source()->twin()->source())) ]; #endif CGAL_assertion( e_below != SHalfedge_handle() ); CGAL_NEF_TRACEN(" edge below " << debug(e_below)); @@ -652,7 +652,7 @@ create_facet_objects(const Plane_3& plane_supporting_facet, #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO Edge_of[geninfo::access(info(l->incident_sface()->center_vertex()))]; #else - Edge_of[ boost::any_cast(info(l->incident_sface()->center_vertex())) ]; + Edge_of[ std::any_cast(info(l->incident_sface()->center_vertex())) ]; #endif CGAL_assertion( e_below != SHalfedge_handle() ); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h index 8c45ba71566..2c29bca697c 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h @@ -23,7 +23,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index 83f89e413b3..47e85c817ae 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -32,7 +32,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -118,7 +118,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif SNC_const_decorator() : sncp_(0) {} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h index 61dcbb983ef..281fb0d0dcd 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h @@ -36,7 +36,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -157,7 +157,7 @@ class SNC_decorator : public SNC_const_decorator { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif SNC_decorator() : Base(), sncp_() {} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h index 9aa445f38a1..c546843ffc5 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h @@ -37,7 +37,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif #include @@ -963,7 +963,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif using Base::visit_shell_objects; diff --git a/Nef_3/include/CGAL/Nef_3/Vertex.h b/Nef_3/include/CGAL/Nef_3/Vertex.h index 0a1d7bc280e..fdccc06bd03 100644 --- a/Nef_3/include/CGAL/Nef_3/Vertex.h +++ b/Nef_3/include/CGAL/Nef_3/Vertex.h @@ -30,7 +30,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -41,7 +41,7 @@ class Vertex_base { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Point_3 Point_3; 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 e1e1762dc8f..eb83d34928f 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h @@ -32,7 +32,7 @@ #define CGAL_NEF_DEBUG 67 #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -75,7 +75,7 @@ typedef size_t Size_type; #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else -typedef boost::any GenPtr; +typedef std::any GenPtr; #endif diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h b/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h index 4328b38f44c..8576d4488c8 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h @@ -31,7 +31,7 @@ #include #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -84,7 +84,7 @@ typedef typename Sphere_kernel::Aff_transformation_3 Aff_transformation_3; #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else -typedef boost::any GenPtr; +typedef std::any GenPtr; #endif typedef typename Map::SVertex SVertex; typedef typename Map::SVertex_handle SVertex_handle; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_items.h b/Nef_S2/include/CGAL/Nef_S2/SM_items.h index d1141a21311..4508f4cc115 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_items.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_items.h @@ -27,7 +27,7 @@ #include #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -45,7 +45,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_point Sphere_point; @@ -127,7 +127,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; @@ -228,7 +228,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; @@ -306,7 +306,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Object_handle Object_handle; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h index 52c94bad708..24496cae987 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h @@ -23,7 +23,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include @@ -106,7 +106,7 @@ struct SMO_from_segs { return geninfo::access(G.info(v)); #else return - boost::any_cast( G.info(v) ); + std::any_cast( G.info(v) ); #endif } @@ -122,7 +122,7 @@ struct SMO_from_segs { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); #else - G.info(v)=boost::any(); + G.info(v)=std::any(); #endif } @@ -141,7 +141,7 @@ struct SMO_from_segs { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); #else - G.info(v)=boost::any(); + G.info(v)=std::any(); #endif } @@ -564,7 +564,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(v)); #else - info(v)=boost::any(); + info(v)=std::any(); #endif } @@ -574,7 +574,7 @@ public: return geninfo::access(info(v)); #else return - *boost::any_cast(&info(v)); + *std::any_cast(&info(v)); #endif } @@ -618,8 +618,8 @@ public: geninfo::clear(info(e)); geninfo::clear(info(e->twin())); #else - info(e)=boost::any(); - info(e->twin())=boost::any(); + info(e)=std::any(); + info(e->twin())=std::any(); #endif } @@ -629,7 +629,7 @@ public: return geninfo::access(info(e)); #else return - *boost::any_cast(&info(e)); + *std::any_cast(&info(e)); #endif } @@ -671,7 +671,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(f)); #else - info(f)=boost::any(); + info(f)=std::any(); #endif } @@ -681,7 +681,7 @@ public: return geninfo::access(info(f)); #else return - *boost::any_cast(&info(f)); + *std::any_cast(&info(f)); #endif } diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h b/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h index 8dbce0ced5e..ef9d45a7a6d 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h @@ -21,7 +21,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h index af50600aa4a..8c33ff31cc7 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h @@ -22,7 +22,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include @@ -213,7 +213,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(v)); #else - info(v)=boost::any(); + info(v)=std::any(); #endif } @@ -223,7 +223,7 @@ public: return geninfo::access(info(v)); #else return - *boost::any_cast(&info(v)); + *std::any_cast(&info(v)); #endif } @@ -258,8 +258,8 @@ public: geninfo::clear(info(e)); geninfo::clear(info(e->twin())); #else - info(e)=boost::any(); - info(e->twin())=boost::any(); + info(e)=std::any(); + info(e->twin())=std::any(); #endif } @@ -269,7 +269,7 @@ public: return geninfo::access(info(e)); #else return - *boost::any_cast(&info(e)); + *std::any_cast(&info(e)); #endif } @@ -288,7 +288,7 @@ public: return geninfo::const_access(info(e)); #else return - *boost::any_cast(&info(e)); + *std::any_cast(&info(e)); #endif } const Mark& incident_mark(SHalfedge_const_handle e) const 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 6d221c77bb9..28b6195b540 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -43,7 +43,7 @@ #include #endif // CGAL_LINKED_WITH_TBB -#include +#include #include #include @@ -1818,10 +1818,10 @@ struct Bounded_error_preprocessing #ifdef CGAL_HAUSDORFF_DEBUG using Timer = CGAL::Real_timer; #endif - std::vector& tm_wrappers; + std::vector& tm_wrappers; // Constructor. - Bounded_error_preprocessing(std::vector& tm_wrappers) + Bounded_error_preprocessing(std::vector& tm_wrappers) : tm_wrappers(tm_wrappers) { } @@ -1830,8 +1830,8 @@ struct Bounded_error_preprocessing : tm_wrappers(s.tm_wrappers) { } - bool is_tm1_wrapper(const boost::any& operand) const { return operand.type() == typeid(TM1Wrapper); } - bool is_tm2_wrapper(const boost::any& operand) const { return operand.type() == typeid(TM2Wrapper); } + bool is_tm1_wrapper(const std::any& operand) const { return operand.type() == typeid(TM1Wrapper); } + bool is_tm2_wrapper(const std::any& operand) const { return operand.type() == typeid(TM2Wrapper); } // TODO: make AABB tree build parallel! void operator()(const tbb::blocked_range& range) @@ -1849,12 +1849,12 @@ struct Bounded_error_preprocessing auto& tm_wrapper = tm_wrappers[i]; if(is_tm1_wrapper(tm_wrapper)) { - TM1Wrapper& object = boost::any_cast(tm_wrapper); + TM1Wrapper& object = std::any_cast(tm_wrapper); object.build_tree(); } else if(is_tm2_wrapper(tm_wrapper)) { - TM2Wrapper& object = boost::any_cast(tm_wrapper); + TM2Wrapper& object = std::any_cast(tm_wrapper); object.build_tree(); } else @@ -2031,7 +2031,7 @@ bounded_error_squared_one_sided_Hausdorff_distance_impl(const TriangleMesh1& tm1 std::vector tm1_parts; std::vector tm1_trees; - std::vector tm_wrappers; + std::vector tm_wrappers; #endif // defined(CGAL_LINKED_WITH_TBB) && defined(CGAL_METIS_ENABLED) #ifdef CGAL_HAUSDORFF_DEBUG diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h index db87cc01bfd..c7fa41d15d5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h @@ -34,7 +34,7 @@ #include // for C3t3_initializer #include -#include +#include namespace CGAL { class Image_3; @@ -114,7 +114,7 @@ private: void tweak_criteria(Mesh_criteria&, Mesh_fnt::Domain_tag) {} void tweak_criteria(Mesh_criteria&, Mesh_fnt::Polyhedral_domain_tag); private: - boost::any object_to_destroy; + std::any object_to_destroy; C3t3& c3t3_; Domain* const domain_; Mesh_parameters const p_; @@ -268,10 +268,10 @@ edge_criteria(double edge_size, Mesh_fnt::Polyhedral_domain_tag) domain_->aabb_tree(), *domain_); // The sizing field object, as well as the `patch_ids_vector` are - // allocated on the heap, and the following `boost::any` object, + // allocated on the heap, and the following `std::any` object, // containing two shared pointers, is used to make the allocated // objects be destroyed at the destruction of the thread object, using - // type erasure (`boost::any`). + // type erasure (`std::any`). object_to_destroy = std::make_pair(QSharedPointer(sizing_field_ptr), QSharedPointer(patches_ids_vector_p)); diff --git a/STL_Extension/doc/STL_Extension/CGAL/Object.h b/STL_Extension/doc/STL_Extension/CGAL/Object.h index ddf919ef64a..7a329af795f 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Object.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Object.h @@ -19,7 +19,7 @@ this is done with the global function `make_object()`. This encapsulation mechanism requires the use of `assign` or `object_cast` to use the functionality of the encapsulated class. -This class is similar in spirit to `boost::any`. +This class is similar in spirit to `std::any`. \cgalHeading{Example} diff --git a/STL_Extension/doc/STL_Extension/STL_Extension.txt b/STL_Extension/doc/STL_Extension/STL_Extension.txt index b793a86550a..b37ecb282e8 100644 --- a/STL_Extension/doc/STL_Extension/STL_Extension.txt +++ b/STL_Extension/doc/STL_Extension/STL_Extension.txt @@ -142,7 +142,7 @@ For handles and indices of vertices, halfedges, faces, etc., we provide speciali The class `Object` can store an object of whatever other type. It can be used by a function to return objects of different types. A mechanism to extract the stored object based on its type is also provided. -This class is similar to `boost::any`. +This class is similar to `std::any`. \section stl_uncertainty Uncertainty Management diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index 33a01aac875..24d6ecc1b12 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -29,20 +29,20 @@ #include #include -#include +#include #include namespace CGAL { class Object { - std::shared_ptr obj; + std::shared_ptr obj; // returns an any pointer from a variant - struct Any_from_variant : public boost::static_visitor { + struct Any_from_variant : public boost::static_visitor { template - boost::any* operator()(const T& t) const { - return new boost::any(t); + std::any* operator()(const T& t) const { + return new std::any(t); } }; @@ -61,7 +61,7 @@ class Object Object() : obj() { } template - Object(T && t, private_tag) : obj(new boost::any(std::forward(t))) { } + Object(T && t, private_tag) : obj(new std::any(std::forward(t))) { } // implicit constructor from optionals containing variants template @@ -76,7 +76,7 @@ class Object template bool assign(T &t) const { - const T* res = boost::any_cast(obj.get()); + const T* res = std::any_cast(obj.get()); if (!res) return false; t = *res; return true; @@ -105,7 +105,7 @@ class Object template bool is() const { - return obj && boost::any_cast(obj.get()); + return obj && std::any_cast(obj.get()); } const std::type_info & type() const @@ -159,14 +159,14 @@ template inline const T * object_cast(const Object * o) { - return boost::any_cast((o->obj).get()); + return std::any_cast((o->obj).get()); } template inline T object_cast(const Object & o) { - const T * result = boost::any_cast((o.obj).get()); + const T * result = std::any_cast((o.obj).get()); if (!result) throw Bad_object_cast(); return *result; From 9a0bdb5d96ce92734cb9dd7dd26b4a53ba8c6f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 28 Apr 2023 21:36:57 +0200 Subject: [PATCH 057/156] boost::variant ---> std::variant --- .../doc/AABB_tree/Concepts/AABBGeomTraits.h | 2 +- ..._polyhedron_facet_intersection_example.cpp | 4 +- .../AABB_tree/AABB_ray_shooting_example.cpp | 4 +- .../internal/AABB_ray_intersection.h | 7 +- .../AABB_tree/aabb_test_ray_intersection.cpp | 2 +- .../Arrangement_on_surface_2.txt | 16 +- .../CGAL/Arr_circular_line_arc_traits_2.h | 2 +- .../CGAL/Arr_point_location_result.h | 4 +- .../Concepts/ArrTraits--Intersect_2.h | 2 +- .../Concepts/ArrTraits--MakeXMonotone_2.h | 2 +- .../algebraic_segments.cpp | 4 +- .../circular_line_arcs.cpp | 8 +- .../edge_manipulation_curve_history.cpp | 2 +- .../incremental_insertion.cpp | 2 +- .../point_location_utils.h | 12 +- .../polycurve_bezier.cpp | 4 +- .../sgm_point_location.cpp | 6 +- .../unb_planar_vertical_decomposition.cpp | 10 +- .../include/CGAL/Arr_Bezier_curve_traits_2.h | 2 +- .../include/CGAL/Arr_accessor.h | 6 +- .../CGAL/Arr_algebraic_segment_traits_2.h | 16 +- .../include/CGAL/Arr_batched_point_location.h | 2 +- .../Arr_bounded_planar_topology_traits_2.h | 8 +- .../CGAL/Arr_circle_segment_traits_2.h | 2 +- .../include/CGAL/Arr_circular_arc_traits_2.h | 2 +- .../CGAL/Arr_circular_line_arc_traits_2.h | 97 +++--- .../include/CGAL/Arr_conic_traits_2.h | 2 +- .../include/CGAL/Arr_curve_data_traits_2.h | 18 +- .../Arr_geodesic_arc_on_sphere_traits_2.h | 8 +- .../CGAL/Arr_geometry_traits/Arr_plane_3.h | 4 +- .../Bezier_bounding_rational_traits.h | 8 +- .../Arr_geometry_traits/Bezier_x_monotone_2.h | 2 +- .../Arr_geometry_traits/Circle_segment_2.h | 2 +- .../Conic_x_monotone_arc_2.h | 4 +- .../include/CGAL/Arr_line_arc_traits_2.h | 2 +- .../include/CGAL/Arr_linear_traits_2.h | 8 +- .../CGAL/Arr_non_caching_segment_traits_2.h | 10 +- .../Arr_lm_nearest_neighbor.h | 2 +- .../Arr_trapezoid_ric_pl_impl.h | 26 +- .../CGAL/Arr_point_location/Td_X_trapezoid.h | 54 +-- .../CGAL/Arr_point_location/Td_active_edge.h | 2 +- .../Td_active_fictitious_vertex.h | 2 +- .../Arr_point_location/Td_active_trapezoid.h | 6 +- .../Arr_point_location/Td_active_vertex.h | 2 +- .../CGAL/Arr_point_location/Td_dag_node.h | 6 +- .../Arr_point_location/Td_inactive_edge.h | 2 +- .../Td_inactive_fictitious_vertex.h | 2 +- .../Td_inactive_trapezoid.h | 2 +- .../Arr_point_location/Td_inactive_vertex.h | 2 +- .../CGAL/Arr_point_location/Td_traits.h | 14 +- .../Trapezoidal_decomposition_2.h | 116 +++---- .../Trapezoidal_decomposition_2_impl.h | 318 +++++++++--------- .../include/CGAL/Arr_point_location_result.h | 10 +- .../include/CGAL/Arr_polycurve_traits_2.h | 32 +- .../CGAL/Arr_rat_arc/Rational_arc_d_1.h | 2 +- .../CGAL/Arr_rational_function_traits_2.h | 2 +- .../include/CGAL/Arr_segment_traits_2.h | 8 +- .../Arr_spherical_gaussian_map_3.h | 28 +- .../Arr_transform_on_sphere.h | 6 +- .../CGAL/Arr_spherical_topology_traits_2.h | 4 +- .../Arr_bounded_planar_vert_decomp_helper.h | 2 +- .../Arr_spherical_topology_traits_2_impl.h | 8 +- .../Arr_spherical_vert_decomp_helper.h | 2 +- .../Arr_unb_planar_topology_traits_2_impl.h | 8 +- .../Arr_unb_planar_vert_decomp_helper.h | 2 +- .../include/CGAL/Arr_tracing_traits_2.h | 14 +- .../CGAL/Arr_unb_planar_topology_traits_2.h | 4 +- .../Arrangement_2/Arr_compute_zone_visitor.h | 8 +- .../CGAL/Arrangement_2/Arr_traits_adaptor_2.h | 6 +- .../Arrangement_on_surface_2_global.h | 38 +-- .../Arrangement_on_surface_2_impl.h | 6 +- .../Arrangement_2/Arrangement_zone_2_impl.h | 24 +- .../include/CGAL/Arrangement_zone_2.h | 2 +- .../Curved_kernel_via_analysis_2_functors.h | 6 +- .../Make_x_monotone_2.h | 8 +- .../Sweep_curves_adapter_2.h | 6 +- .../Surface_sweep_2/Arr_insertion_traits_2.h | 8 +- .../Surface_sweep_2/Arr_overlay_ss_visitor.h | 19 +- .../Surface_sweep_2/Arr_overlay_traits_2.h | 18 +- .../Arr_vert_decomp_ss_visitor.h | 4 +- .../Batched_point_location_test.h | 32 +- .../Arrangement_on_surface_2/IO_base_test.h | 12 +- .../Point_location_test.h | 38 +-- .../Arrangement_on_surface_2/Traits_test.h | 12 +- .../Vertical_decomposition_test.h | 36 +- .../test_arc_polycurve.cpp | 24 +- .../test_bezier_polycurve.cpp | 6 +- .../test_circular_arc_polycurve.cpp | 2 +- .../test_conic_polycurve.cpp | 4 +- .../test_vert_ray_shoot_vert_segments.cpp | 6 +- .../Arrangement_on_surface_2/test_zone.cpp | 2 +- BGL/examples/BGL_triangulation_2/dijkstra.cpp | 4 +- .../ArrDirectionalTraits--Intersect_2.h | 2 +- .../Gps_agg_meta_traits.h | 8 +- .../Gps_simplifier_traits.h | 8 +- .../Polygon_conversions.h | 4 +- .../test_general_polygon_constructions.cpp | 6 +- CGAL_ImageIO/include/CGAL/SEP_header.h | 6 +- .../include/CGAL/Cartesian_converter.h | 22 +- .../benchmark/DxfArrayBenchmarks/benchmark.h | 2 +- .../benchmarks_arrangement.cpp | 4 +- .../benchmark/arrangement_traits/benchmark.h | 2 +- .../benchmarks_arrangement.cpp | 2 +- Circular_kernel_2/benchmark/benchmark.h | 2 +- Circular_kernel_2/benchmark/benchmark_CK2.cpp | 4 +- .../benchmark/benchmarks_arrangement.cpp | 4 +- .../benchmark/bff_reader/Breader.cpp | 2 +- .../benchmark/dxf_to_bff/dxf_converter.h | 2 +- .../incremental_insertion/benchmark.h | 2 +- .../benchmarks_arrangement.cpp | 2 +- .../Circular_kernel_2/Intersection_traits.h | 18 +- .../internal_functions_on_line_arc_2.h | 12 +- .../include/CGAL/IO/Dxf_variant_reader.h | 4 +- .../CGAL/Circular_kernel_3/Circular_arc_3.h | 8 +- .../Circular_kernel_3/Circular_arc_point_3.h | 24 +- .../Circular_kernel_3/Intersection_traits.h | 20 +- .../CGAL/Circular_kernel_3/Line_arc_3.h | 12 +- .../internal_functions_on_sphere_3.h | 16 +- .../dual/halfspace_intersection_3.h | 6 +- .../Cartesian_coordinate_iterator_2.h | 10 +- .../Cartesian_coordinate_iterator_3.h | 10 +- Filtered_kernel/include/CGAL/Lazy.h | 38 +-- .../test_lazy_vector_objects.cpp | 4 +- .../internal/Qt/HyperbolicPainterOstream.h | 4 +- .../internal/Qt/HyperbolicPainterOstreamCK.h | 4 +- ...bolic_Delaunay_triangulation_CK_traits_2.h | 2 +- ...perbolic_Delaunay_triangulation_traits_2.h | 2 +- ...bolic_Delaunay_triangulation_CK_traits_2.h | 22 +- ...perbolic_Delaunay_triangulation_traits_2.h | 34 +- Installation/CHANGES.md | 1 + .../Intersections_2/variant_any_object.cpp | 14 +- .../include/CGAL/Intersection_traits.h | 18 +- .../include/CGAL/Intersection_traits_2.h | 18 +- .../CGAL/Intersections_2/Bbox_2_Bbox_2.h | 4 +- .../Intersections_2/test_intersections_2.cpp | 2 +- .../include/CGAL/Intersection_traits_3.h | 72 ++-- .../CGAL/Intersections_3/Bbox_3_Bbox_3.h | 6 +- .../internal/Bbox_3_Segment_3_intersection.h | 6 +- .../Iso_cuboid_3_Triangle_3_intersection.h | 4 +- .../Plane_3_Plane_3_Plane_3_intersection.h | 6 +- .../Segment_3_Segment_3_intersection.h | 4 +- .../Triangle_3_Triangle_3_intersection.h | 2 +- .../tetrahedron_lines_intersections_3.h | 4 +- .../intersection_test_helper.h | 4 +- .../test_intersections_Iso_cuboid_3.cpp | 18 +- .../test_intersections_Plane_3.cpp | 2 +- .../test_intersections_Tetrahedron_3.cpp | 14 +- .../Kernel_23/CGAL/Projection_traits_xy_3.h | 2 +- .../CGAL/Spherical_kernel_intersections.h | 2 +- Kernel_23/doc/Kernel_23/CGAL/intersections.h | 16 +- Kernel_23/doc/Kernel_23/Kernel_23.txt | 6 +- .../Kernel_23/cartesian_converter.cpp | 2 +- .../examples/Kernel_23/intersection_get.cpp | 4 +- .../Kernel_23/intersection_visitor.cpp | 2 +- Kernel_23/include/CGAL/Kernel/Type_mapper.h | 16 +- .../include/CGAL/Kernel/function_objects.h | 10 +- .../Kernel_23/internal/Projection_traits_3.h | 8 +- .../internal/Projection_traits_base_3.h | 10 +- .../test/Kernel_23/include/CGAL/_test_depth.h | 2 +- Kernel_d/doc/Kernel_d/CGAL/intersections_d.h | 6 +- Kernel_d/doc/Kernel_d/Kernel_d.txt | 6 +- .../include/CGAL/Kernel_d/function_objects.h | 18 +- Mesh_3/benchmark/Mesh_3/StdAfx.h | 2 +- .../Concepts/IntersectionGeometricTraits_3.h | 4 +- .../Concepts/MeshTriangulationTraits_3.h | 6 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 8 +- .../Sizing_field_with_aabb_tree.h | 2 +- .../Mesh_domain_with_polyline_features_3.h | 10 +- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 6 +- .../include/CGAL/Polyhedral_mesh_domain_3.h | 12 +- .../Mesh_3/test_labeled_mesh_domain_3.cpp | 12 +- .../Minkowski_sum_2/Arr_labeled_traits_2.h | 8 +- Nef_2/include/CGAL/Nef_2/geninfo.h | 2 +- ...xact_triangulation_euclidean_traits_xy_3.h | 12 +- ...xact_triangulation_euclidean_traits_xz_3.h | 12 +- ...xact_triangulation_euclidean_traits_yz_3.h | 12 +- .../CGAL/NewKernel_d/KernelD_converter.h | 2 +- .../OTR_2/Reconstruction_triangulation_2.h | 2 +- .../Protect_edges_sizing_field.h | 14 +- .../include/CGAL/refine_periodic_3_mesh_3.h | 2 +- .../internal/Qt/HyperbolicPainterOstream.h | 4 +- .../hyperbolic_free_motion_animation.h | 6 +- ...perbolic_Delaunay_triangulation_traits_2.h | 24 +- .../include/CGAL/structure_point_set.h | 14 +- .../Corefinement/intersection_nodes.h | 4 +- .../Axis_parallel_plane_traits.h | 4 +- .../CGAL/Polygon_mesh_processing/locate.h | 30 +- .../include/CGAL/Polygon_mesh_slicer.h | 22 +- .../test_pmp_locate.cpp | 6 +- .../Plugins/Mesh_3/C3t3_io_plugin.cpp | 6 +- .../Plugins/Mesh_3/Mesh_3_plugin.cpp | 2 +- .../PMP/Surface_intersection_plugin.cpp | 8 +- Polyhedron/demo/Polyhedron/Scene.h | 2 +- .../Polyhedron/Scene_surface_mesh_item.cpp | 8 +- .../demo/Polyhedron/include/id_printing.h | 4 +- SMDS_3/include/CGAL/IO/output_to_vtu.h | 16 +- .../internal/Handle_IO_for_pair_of_int.h | 10 +- .../CGAL/SMDS_3/internal/indices_management.h | 23 +- SMDS_3/include/CGAL/SMDS_3/io_signature.h | 14 +- .../CGAL/Simplicial_mesh_vertex_base_3.h | 4 +- SMDS_3/test/SMDS_3/data/c3t3_io-hetero.cgal | 2 +- SMDS_3/test/SMDS_3/test_c3t3_io.cpp | 6 +- STL_Extension/doc/STL_Extension/CGAL/Object.h | 8 +- .../doc/STL_Extension/CGAL/iterator.h | 8 +- .../Dispatch_output_iterator.cpp | 4 +- STL_Extension/include/CGAL/Object.h | 16 +- STL_Extension/include/CGAL/iterator.h | 16 +- .../test/STL_Extension/test_Object.cpp | 8 +- .../STL_Extension/test_dispatch_output.cpp | 4 +- .../internal/Contour_base_2.h | 4 +- .../examples/Surface_mesh/sm_aabbtree.cpp | 8 +- .../internal/SDF_calculation.h | 4 +- .../Concepts/SurfaceMeshShortestPathTraits.h | 2 +- .../shortest_path_sequence.cpp | 11 +- .../Surface_mesh_shortest_path.h | 12 +- .../function_objects.h | 4 +- .../include/CGAL/Surface_sweep_2.h | 2 +- .../Surface_sweep_2/Surface_sweep_2_impl.h | 14 +- .../Surface_sweep_2/Surface_sweep_2_utils.h | 6 +- .../internal/tetrahedral_remeshing_helpers.h | 2 +- .../ConstrainedTriangulationTraits_2.h | 2 +- .../CGAL/Constrained_triangulation_2.h | 6 +- .../simple_polygon_visibility_2.cpp | 2 +- .../CGAL/Simple_polygon_visibility_2.h | 4 +- .../CGAL/Voronoi_diagram_2.h | 2 +- .../Concepts/AdaptationTraits_2.h | 2 +- .../Voronoi_diagram_2/vd_2_point_location.cpp | 6 +- .../vd_2_point_location_sdg_linf.cpp | 6 +- .../include/CGAL/Voronoi_diagram_2.h | 10 +- .../Apollonius_graph_nearest_site_2.h | 4 +- .../Delaunay_triangulation_nearest_site_2.h | 4 +- .../Regular_triangulation_nearest_site_2.h | 4 +- .../Segment_Delaunay_graph_nearest_site_2.h | 4 +- .../include/vda_test_concept.h | 8 +- .../include/vda_test_locate.h | 14 +- .../Voronoi_diagram_2/include/vda_test_vda.h | 6 +- 236 files changed, 1249 insertions(+), 1273 deletions(-) diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h index e6d51ffdb75..5c7a45edb67 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h @@ -47,7 +47,7 @@ Provides the operator: `return_type operator()(const Query& q, const Primitive::Datum& d)`, which computes the intersection between `q` and `d`. The type of the returned object -must be a `std::optional` of a `boost::variant` of the possible intersection types. +must be a `std::optional` of a `std::variant` of the possible intersection types. */ typedef unspecified_type Intersect_3; diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp index e01e49c0b6e..6ced34c0234 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp @@ -57,7 +57,7 @@ int main() if(intersection) { // gets intersection object - const Point* p = boost::get(&(intersection->first)); + const Point* p = std::get_if(&(intersection->first)); if(p) std::cout << "intersection object is a point " << *p << std::endl; @@ -81,7 +81,7 @@ int main() if(plane_intersection) { - if(boost::get(&(plane_intersection->first))) + if(std::get_if(&(plane_intersection->first))) std::cout << "intersection object is a segment" << std::endl; } diff --git a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp index fc450abd5a8..e9ed0fe87c5 100644 --- a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp @@ -70,8 +70,8 @@ int main(int argc, char* argv[]) Ray_intersection intersection = tree.first_intersection(ray, skip); if(intersection) { - if(boost::get(&(intersection->first))){ - const Point* p = boost::get(&(intersection->first) ); + if(std::get_if(&(intersection->first))){ + const Point* p = std::get_if(&(intersection->first) ); std::cout << *p << std::endl; } } diff --git a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h index 1bc03ff4cf4..075d48ffda3 100644 --- a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h @@ -20,7 +20,6 @@ #include #include #include -#include # if defined(BOOST_MSVC) # pragma warning(push) # pragma warning(disable: 4996) @@ -84,7 +83,7 @@ public: if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) { intersection = intersection_obj(query, current.node->left_data()); if(intersection) { - FT ray_distance = boost::apply_visitor(param_visitor, intersection->first); + FT ray_distance = std::visit(param_visitor, intersection->first); if(ray_distance < t) { t = ray_distance; p = intersection; @@ -96,7 +95,7 @@ public: if(!skip(current.node->right_data().id()) /* && do_intersect_obj(query, current.node->right_data()) */) { intersection = intersection_obj(query, current.node->right_data()); if(intersection) { - FT ray_distance = boost::apply_visitor(param_visitor, intersection->first); + FT ray_distance = std::visit(param_visitor, intersection->first); if(ray_distance < t) { t = ray_distance; p = intersection; @@ -111,7 +110,7 @@ public: if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) { intersection = intersection_obj(query, current.node->left_data()); if(intersection) { - FT ray_distance = boost::apply_visitor(param_visitor, intersection->first); + FT ray_distance = std::visit(param_visitor, intersection->first); if(ray_distance < t) { t = ray_distance; p = intersection; diff --git a/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp b/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp index cbe92baaf70..da3b5436edd 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp @@ -51,7 +51,7 @@ min_intersection(const Tree& tree, const Ray& ray) { > mini = std::nullopt; for(IntersectionVector::iterator it2 = all_intersections.begin(); it2 != all_intersections.end(); ++it2) { - if(Point* point = boost::get(&(it2->first))) { + if(Point* point = std::get_if(&(it2->first))) { Vector i_ray(*point, ray.source()); Tree::FT new_distance = i_ray.squared_length(); if(new_distance < min_distance) { 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 2050328161b..bd0c7339172 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 @@ -1320,7 +1320,7 @@ Arrangement_on_surface_2::Face_const_handle `Face_const_handle`\endlink. Depending on whether the query point is located inside a face, lies on an edge, or coincides with a vertex, the appropriate handle can be obtained with value retrieval -by `boost::get` as demonstrated in the example below. +by `std::get` as demonstrated in the example below. Note that the handles returned by the \link ArrangementPointLocation_2::locate() `locate()`\endlink functions are @@ -1361,7 +1361,7 @@ The function template `locate_point()` calls an instance of the function template `print_point_location()`, which inserts the result of the query into the standard output-stream. It is listed below, and defined in the header file `point_location_utils.h`. -Observe how the function `boost::get()` is used to cast the +Observe how the function `std::get()` is used to cast the resulting object into a handle to an arrangement feature. The point-location object `pl` is assumed to be already attached to an arrangement. @@ -1383,13 +1383,13 @@ void print_point_location const Face_const_handle* f; std::cout << "The point (" << q << ") is located "; - if (f = boost::get(&obj)) // located inside a face + if (f = std::get_if(&obj)) // located inside a face std::cout << "inside " << (((*f)->is_unbounded()) ? "the unbounded" : "a bounded") << " face.\n"; - else if (e = boost::get(&obj)) // located on an edge + else if (e = std::get_if(&obj)) // located on an edge std::cout << "on an edge: " << (*e)->curve() << std::endl; - else if (v = boost::get(&obj)) // located on a vertex + else if (v = std::get_if(&obj)) // located on a vertex std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; else CGAL_error_msg("Invalid object."); @@ -1603,12 +1603,12 @@ void shoot_vertical_ray(const RayShoot& vrs, const Face_const_handle* f; std::cout << "Shooting up from (" << q << ") : "; - if (v = boost::get(&obj)) // we hit a vertex + if (v = std::get_if(&obj)) // we hit a vertex std::cout << "hit " << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; - else if (e = boost::get(&obj)) // we hit an edge + else if (e = std::get_if(&obj)) // we hit an edge std::cout << "hit an edge: " << (*e)->curve() << std::endl; - else if (f = boost::get(&obj)) { // we hit nothing + else if (f = std::get_if(&obj)) { // we hit nothing CGAL_assertion((*f)->is_unbounded()); std::cout << "hit nothing.\n"; } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h index b12a51541cf..90abb7e19e2 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h @@ -10,7 +10,7 @@ of both types `CGAL::Line_arc_2` or `CGAL::Circular_arc_2`. -It uses the boost::variant. +It uses the std::variant. \cgalModels `ArrangementTraits_2` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h index 20a6787d7e5..32b4e443326 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h @@ -11,7 +11,7 @@ is included. - `CGAL_ARR_POINT_LOCATION_VERSION` == 1, the result type is set to be `CGAL::Object`. - `CGAL_ARR_POINT_LOCATION_VERSION` == 2, the result type is set to be -`boost::variant`, where `Vertex_const_handle`, `Halfedge_const_handle`, and +`std::variant`, where `Vertex_const_handle`, `Halfedge_const_handle`, and `Face_const_handle` are the corresponding nested types in a `CGAL::Arrangement_2` instance. @@ -44,7 +44,7 @@ struct Arr_point_location_result { /*! The type of the arrangement feature that is the result of a * point-location query or a vertical ray-shoot query, namely, - * `boost::variant` + * `std::variant` * if `::CGAL_ARR_POINT_LOCATION_VERSION` == 2, which is the default, otherwise * `CGAL::Object`. */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h index 0350b6ce654..a4bfaebef7a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h @@ -17,7 +17,7 @@ public: /*! computes the intersections of `xc1` and `xc2` and writes them in an * ascending lexicographic \f$xy\f$-order into a range beginning at * `oi`. The type `OutputIterator` must dereference a polymorphic object of - * type `boost::variant` that wraps objects of type either type + * type `std::variant` that wraps objects of type either type * `pair` or * `ArrTraits::X_monotone_curve_2`. An object of the former type represents an * intersection point with its multiplicity (in case the multiplicity is diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h index db0df3c8cc8..32c5efccb0b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h @@ -16,7 +16,7 @@ public: /*! subdivides the input curve `c` into \f$x\f$-monotone subcurves and * isolated points, and inserts the results into a range beginning at the given * output iterator `oi`. The type `OutputIterator` dereferences a - * `boost::variant` that wraps either an `ArrTraits::Point_2` object or an + * `std::variant` that wraps either an `ArrTraits::Point_2` object or an * `ArrTraits::X_monotone_curve_2` object. The operator returns a past-the-end * iterator for the output sequence. */ diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp index 95eb729bb66..c1bc7c4779d 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp @@ -29,7 +29,7 @@ typedef Traits::Algebraic_real_1 Algebraic_real; typedef Traits::X_monotone_curve_2 X_monotone_curve; typedef Traits::Point_2 Point; -typedef boost::variant Make_x_monotone_result; +typedef std::variant Make_x_monotone_result; int main() { Traits traits; @@ -52,7 +52,7 @@ int main() { // but not in this case). std::vector segs; for(size_t i = 0; i < pre_segs.size(); ++i) { - auto* curr_p = boost::get(&pre_segs[i]); + auto* curr_p = std::get(&pre_segs[i]); assert(curr_p); segs.push_back(*curr_p); } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp index 1e7854b7482..73540335257 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include @@ -25,7 +25,7 @@ typedef Circular_k::Circle_2 Circle_2; typedef Circular_k::Circular_arc_2 Circular_arc_2; typedef Circular_k::Line_arc_2 Line_arc_2; -typedef boost::variant< Circular_arc_2, Line_arc_2> Arc_2; +typedef std::variant< Circular_arc_2, Line_arc_2> Arc_2; typedef std::vector< Arc_2> ArcContainer; typedef CGAL::Arr_circular_line_arc_traits_2 Traits; @@ -52,7 +52,7 @@ int main() { } while((x1 == x2) && (y1 == y2)); std::cout << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl; - boost::variant< Circular_arc_2, Line_arc_2 > v = + std::variant< Circular_arc_2, Line_arc_2 > v = Line_arc_2(Point_2(x1,y1), Point_2(x2,y2)); ac.push_back( v); } @@ -63,7 +63,7 @@ int main() { y1 = theRandom.get_int(random_min,random_max); } while(x1==0 && y1==0); - boost::variant< Circular_arc_2, Line_arc_2 > v = + std::variant< Circular_arc_2, Line_arc_2 > v = Circle_2( Point_2(x1,y1), x1*x1 + y1*y1); ac.push_back(v); } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp index e89d8b57d89..c1ee293fd27 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp @@ -45,7 +45,7 @@ int main() { Point_location pl(arr); const Point q{_7_halves, 7}; Point_location::result_type obj = pl.locate(q); - auto* e = boost::get(&obj); + auto* e = std::get(&obj); // Split the edge e to two edges e1 and e2; auto e1 = arr.split_edge(arr.non_const_handle(*e), q); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp index 51112be6c50..425b187d17e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp @@ -32,7 +32,7 @@ int main() { // the boundary of the face that contains it. Point q(4, 1); auto obj = pl.locate(q); - auto* f = boost::get(&obj); + auto* f = std::get(&obj); std::cout << "The query point (" << q << ") is located in: "; print_face(*f); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h index 70bc38bce3f..f50236bb3e5 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h @@ -46,13 +46,13 @@ void print_point_location const Face_const_handle* f; std::cout << "The point (" << q << ") is located "; - if ((f = boost::get(&obj))) // inside a face + if ((f = std::get(&obj))) // inside a face std::cout << "inside " << (((*f)->is_unbounded()) ? "the unbounded" : "a bounded") << " face." << std::endl; - else if ((e = boost::get(&obj))) // on an edge + else if ((e = std::get(&obj))) // on an edge std::cout << "on an edge: " << (*e)->curve() << std::endl; - else if ((v = boost::get(&obj))) // on a vertex + else if ((v = std::get(&obj))) // on a vertex std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; else CGAL_error_msg("Invalid object."); @@ -101,12 +101,12 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs, std::cout << "Shooting up from (" << q << ") : hit "; - if ((v = boost::get(&obj))) // hit a vertex + if ((v = std::get(&obj))) // hit a vertex std::cout << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; - else if ((e = boost::get(&obj)) ) // hit an edge + else if ((e = std::get(&obj)) ) // hit an edge std::cout << "an edge: " << (*e)->curve() << std::endl; - else if ((f = boost::get(&obj))) { // hit nothing + else if ((f = std::get(&obj))) { // hit nothing assert((*f)->is_unbounded()); std::cout << "nothing." << std::endl; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp index 287fd51786a..bc4168f2da0 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp @@ -24,7 +24,7 @@ typedef Polycurve_bezier_traits::Point_2 Point; typedef Polycurve_bezier_traits::X_monotone_curve_2 X_mono_polycurve; typedef CGAL::Arrangement_2 Arrangement_2; -typedef boost::variant Make_x_monotone_result; +typedef std::variant Make_x_monotone_result; int main() { Polycurve_bezier_traits pc_traits; @@ -58,7 +58,7 @@ int main() { // convert it into x-monotone bezier curve. std::vector obj_vector; bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(obj_vector)); - auto* x_seg_p = boost::get(&obj_vector[0]); + auto* x_seg_p = std::get(&obj_vector[0]); x_curves.push_back(*x_seg_p); } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp index 1ba6d9b5232..5cd1a8367c2 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp @@ -99,15 +99,15 @@ protected: for (auto it = results.begin(); it != results.end(); ++it) { std::cout << "The point (" << it->first << ") is located "; if (const Face_const_handle* f = - boost::get(&(it->second))) // inside a face + std::get(&(it->second))) // inside a face std::cout << "inside " << (((*f)->is_unbounded()) ? "the unbounded" : "a bounded") << " face.\n"; else if (const Halfedge_const_handle* e = - boost::get(&(it->second))) // on an edge + std::get(&(it->second))) // on an edge std::cout << "on an edge: " << (*e)->curve() << std::endl; else if (const Vertex_const_handle* v = - boost::get(&(it->second))) // on a vertex + std::get(&(it->second))) // on a vertex std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp index 95bdc262b29..d51f4fae389 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp @@ -8,7 +8,7 @@ #include "arr_linear.h" -typedef boost::variant Cell_type; typedef std::optional Vert_decomp_type; typedef std::pair Vert_decomp_pair; @@ -41,10 +41,10 @@ int main() { std::cout << " feature below: "; if (! curr.first) std::cout << "EMPTY"; else { - auto* vh = boost::get(&*(curr.first));; + auto* vh = std::get(&*(curr.first));; if (vh) std::cout << '(' << (*vh)->point() << ')'; else { - auto* hh = boost::get(&*(curr.first)); + auto* hh = std::get(&*(curr.first)); if (! (*hh)->is_fictitious()) std::cout << '[' << (*hh)->curve() << ']'; else std::cout << "NONE"; @@ -54,10 +54,10 @@ int main() { std::cout << " feature above: "; if (! curr.second) std::cout << "EMPTY\n"; else { - auto* vh = boost::get(&*(curr.second));; + auto* vh = std::get(&*(curr.second));; if (vh) std::cout << '(' << (*vh)->point() << ")\n"; else { - auto* hh = boost::get(&*(curr.second)); + auto* hh = std::get(&*(curr.second)); if (! (*hh)->is_fictitious()) std::cout << '[' << (*hh)->curve() << "]\n"; else std::cout << "NONE\n"; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_Bezier_curve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_Bezier_curve_traits_2.h index 7aedff1530d..461cadf34a1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_Bezier_curve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_Bezier_curve_traits_2.h @@ -499,7 +499,7 @@ public: template OutputIterator operator() (const Curve_2& B, OutputIterator oi) const { - typedef boost::variant + typedef std::variant Make_x_monotone_result; typedef typename Bounding_traits::Vertical_tangency_point Vertical_tangency_point; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h b/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h index 90ae69d90ca..202ca448b5e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h @@ -114,13 +114,13 @@ public: auto obj = p_arr->topology_traits()->locate_curve_end(cv, ind, ps_x, ps_y); // Return a handle to the DCEL feature. - DFace** f_p = boost::get(&obj); + DFace** f_p = std::get(&obj); if (f_p) return (Pl_result::make_result(p_arr->_const_handle_for(*f_p))); - DHalfedge** he_p = boost::get(&obj); + DHalfedge** he_p = std::get(&obj); if (he_p) return (Pl_result::make_result(p_arr->_const_handle_for(*he_p))); - DVertex** v_p = boost::get(&obj); + DVertex** v_p = std::get(&obj); if (v_p) return (Pl_result::make_result(p_arr->_const_handle_for(*v_p))); // We should never reach here: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index 02e44f64cef..b1678fe4acd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -271,7 +271,7 @@ public: std::optional end, OutputIterator out) const { - typedef boost::variant + typedef std::variant Make_x_monotone_result; //CGAL_assertion(is_one_one(cv,p)); @@ -286,11 +286,11 @@ public: this->_ckva()->make_x_monotone_2_object()(cv, std::back_inserter(arcs)); auto it = arcs.begin(); auto helper = it; - const auto* it_seg_p = boost::get(&(*it)); + const auto* it_seg_p = std::get(&(*it)); while (it != arcs.end()) { if ( on_arc(p, *it_seg_p) ) break; it++; - it_seg_p = boost::get(&(*it)); + it_seg_p = std::get(&(*it)); } bool left_on_arc = start && on_arc(start.get(), *it_seg_p); @@ -348,11 +348,11 @@ public: } CGAL_assertion(it != arcs.begin()); it--; - it_seg_p = boost::get(&(*it)); + it_seg_p = std::get(&(*it)); while (! on_arc(point_it, *it_seg_p)) { CGAL_assertion(it != arcs.begin()); it--; - it_seg_p = boost::get(&(*it)); + it_seg_p = std::get(&(*it)); } if (start && on_arc(start.get(),*it_seg_p)) { segs.push_front(it_seg_p->trim(start.get(), right(*it_seg_p))); @@ -365,7 +365,7 @@ public: } if (! right_on_arc) { it = helper; // reset - it_seg_p = boost::get(&(*it)); + it_seg_p = std::get(&(*it)); Point_2 point_it; while (true) { if (it_seg_p->is_finite(CGAL::ARR_MAX_END) && @@ -378,11 +378,11 @@ public: } it++; CGAL_assertion(it != arcs.end()); - it_seg_p = boost::get(&(*it)); + it_seg_p = std::get(&(*it)); while(! on_arc(point_it, *it_seg_p)) { it++; CGAL_assertion(it != arcs.end()); - it_seg_p = boost::get(&(*it)); + it_seg_p = std::get(&(*it)); } if(end && on_arc(end.get(),*it_seg_p)) { segs.push_back(it_seg_p->trim(left(*it_seg_p),end.get())); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h index 81fec7a3785..e1f9ad986a3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h @@ -41,7 +41,7 @@ namespace Ss2 = Surface_sweep_2; * \param oi Output: An output iterator for the query results. * \pre The value-type of PointsIterator is Arrangement::Point_2, * and the value-type of OutputIterator is is pair, - * where Result is std::optional >. * It represents the arrangement feature containing the point. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h index e7aea3a8d19..8f1339b6a22 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h @@ -14,7 +14,7 @@ #ifndef CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_H #define CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_H -#include +#include #include @@ -305,7 +305,7 @@ public: * \pre The curve has a boundary condition in either x or y. * \return An object that wraps the curve end. */ - std::optional > + std::optional > place_boundary_vertex(Face*, const X_monotone_curve_2&, Arr_curve_end, @@ -347,13 +347,13 @@ public: * \pre The curve end is incident to the boundary. * \return An object that contains the curve end. */ - boost::variant + std::variant locate_curve_end(const X_monotone_curve_2&, Arr_curve_end, Arr_parameter_space /* ps_x */, Arr_parameter_space /* ps_y */) { - typedef boost::variant Result; + typedef std::variant Result; // This function should never be called: CGAL_error(); Vertex* v(nullptr); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h index 3dabf797184..7eb42ef7084 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h @@ -404,7 +404,7 @@ public: template OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { - typedef boost::variant + typedef std::variant Make_x_monotone_result; // Increment the serial number of the curve cv, which will serve as its diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h index 6827889a4f1..f790bcac246 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h @@ -178,7 +178,7 @@ public: template OutputIterator operator()(const Curve_2& arc, OutputIterator oi) const { - typedef boost::variant + typedef std::variant Make_x_monotone_result; std::vector objs; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h index e913bc9f7db..4efc598b81d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -35,7 +35,7 @@ #include -#include +#include #include #include @@ -51,17 +51,17 @@ namespace CGAL { OutputIterator res2) { typedef typename CK::Circular_arc_point_2 Point_2; - typedef boost::variant X_monotone_curve_2; - typedef boost::variant + typedef std::variant X_monotone_curve_2; + typedef std::variant Make_x_monotone_result; for (auto it = res1.begin(); it != res1.end(); ++it) { if (const Arc1* arc = CGAL::object_cast(&*it)) { - boost::variant v = *arc; + std::variant v = *arc; *res2++ = Make_x_monotone_result(v); } else if (const Arc2* line = CGAL::object_cast(&*it)) { - boost::variant v = *line; + std::variant v = *line; *res2++ = Make_x_monotone_result(v); } else if (const Point_2* p = CGAL::object_cast(&*it)) { @@ -81,27 +81,27 @@ namespace CGAL { Circular_arc_point_2; result_type - operator()(const boost::variant< Arc1, Arc2 > &a1, - const boost::variant< Arc1, Arc2 > &a2, + operator()(const std::variant< Arc1, Arc2 > &a1, + const std::variant< Arc1, Arc2 > &a2, const Circular_arc_point_2 &p) const { - if ( const Arc1* arc1 = boost::get( &a1 ) ){ - if ( const Arc1* arc2 = boost::get( &a2 ) ){ + if ( const Arc1* arc1 = std::get( &a1 ) ){ + if ( const Arc1* arc2 = std::get( &a2 ) ){ return CircularKernel() .compare_y_to_right_2_object()(*arc1, *arc2, p); } else { - const Arc2* arc2e = boost::get( &a2 ); + const Arc2* arc2e = std::get( &a2 ); return CircularKernel() .compare_y_to_right_2_object()(*arc1, *arc2e, p); } } - const Arc2* arc1 = boost::get( &a1 ); - if ( const Arc1* arc2 = boost::get( &a2 ) ){ + const Arc2* arc1 = std::get( &a1 ); + if ( const Arc1* arc2 = std::get( &a2 ) ){ return CircularKernel() .compare_y_to_right_2_object()(*arc1, *arc2, p); } - const Arc2* arc2e = boost::get( &a2 ); + const Arc2* arc2e = std::get( &a2 ); return CircularKernel() .compare_y_to_right_2_object()(*arc1, *arc2e, p); } @@ -110,7 +110,6 @@ namespace CGAL { template class Variant_Equal_2 - : public boost::static_visitor { public : @@ -136,7 +135,7 @@ namespace CGAL { : public CircularKernel::Equal_2 { public: - typedef boost::variant< Arc1, Arc2 > Curve_2; + typedef std::variant< Arc1, Arc2 > Curve_2; typedef bool result_type; using CircularKernel::Equal_2::operator(); typedef typename CircularKernel::Circular_arc_point_2 @@ -169,7 +168,7 @@ namespace CGAL { result_type operator()(const Curve_2 &a0, const Curve_2 &a1) const { - return boost::apply_visitor + return std::visit ( Variant_Equal_2(), a0, a1 ); } @@ -188,20 +187,20 @@ namespace CGAL { result_type operator() (const Circular_arc_point_2 &p, - const boost::variant< Arc1, Arc2 > &A1) const + const std::variant< Arc1, Arc2 > &A1) const { - if ( const Arc1* arc1 = boost::get( &A1 ) ){ + if ( const Arc1* arc1 = std::get( &A1 ) ){ return CircularKernel().compare_y_at_x_2_object()(p, *arc1); } else { - const Arc2* arc2 = boost::get( &A1 ); + const Arc2* arc2 = std::get( &A1 ); return CircularKernel().compare_y_at_x_2_object()(p, *arc2); } } }; template - class Variant_Do_overlap_2 : public boost::static_visitor + class Variant_Do_overlap_2 { public: template < typename T > @@ -229,10 +228,10 @@ namespace CGAL { typedef bool result_type; result_type - operator()(const boost::variant< Arc1, Arc2 > &A0, - const boost::variant< Arc1, Arc2 > &A1) const + operator()(const std::variant< Arc1, Arc2 > &A0, + const std::variant< Arc1, Arc2 > &A1) const { - return boost::apply_visitor + return std::visit ( Variant_Do_overlap_2(), A0, A1 ); } }; @@ -248,10 +247,10 @@ namespace CGAL { template < class OutputIterator,class Not_X_Monotone > OutputIterator - operator()(const boost::variant &A, + operator()(const std::variant &A, OutputIterator res) const { - if ( const Arc1* arc1 = boost::get( &A ) ) { + if ( const Arc1* arc1 = std::get( &A ) ) { std::vector container; CircularKernel(). make_x_monotone_2_object()(*arc1,std::back_inserter(container)); @@ -259,7 +258,7 @@ namespace CGAL { (container, res); } else { - const Arc2* arc2 = boost::get( &A ); + const Arc2* arc2 = std::get( &A ); std::vector container; CircularKernel(). make_x_monotone_2_object()(*arc2,std::back_inserter(container)); @@ -278,23 +277,23 @@ namespace CGAL { template < class OutputIterator > OutputIterator - operator()(const boost::variant< Arc1, Arc2 > &c1, - const boost::variant< Arc1, Arc2 > &c2, + operator()(const std::variant< Arc1, Arc2 > &c1, + const std::variant< Arc1, Arc2 > &c2, OutputIterator oi) const { - if ( const Arc1* arc1 = boost::get( &c1 ) ){ - if ( const Arc1* arc2 = boost::get( &c2 ) ){ + if ( const Arc1* arc1 = std::get( &c1 ) ){ + if ( const Arc1* arc2 = std::get( &c2 ) ){ return CircularKernel().intersect_2_object()(*arc1, *arc2, oi); } - const Arc2* arc2 = boost::get( &c2 ); + const Arc2* arc2 = std::get( &c2 ); return CircularKernel().intersect_2_object()(*arc1, *arc2, oi); } - const Arc2* arc1e = boost::get( &c1 ); - if ( const Arc1* arc2 = boost::get( &c2 ) ){ + const Arc2* arc1e = std::get( &c1 ); + if ( const Arc1* arc2 = std::get( &c2 ) ){ return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi); } - const Arc2* arc2 = boost::get( &c2 ); + const Arc2* arc2 = std::get( &c2 ); return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi); } @@ -309,13 +308,13 @@ namespace CGAL { Circular_arc_point_2; typedef void result_type; result_type - operator()(const boost::variant< Arc1, Arc2 > &A, + operator()(const std::variant< Arc1, Arc2 > &A, const Circular_arc_point_2 &p, - boost::variant< Arc1, Arc2 > &ca1, - boost::variant< Arc1, Arc2 > &ca2) const + std::variant< Arc1, Arc2 > &ca1, + std::variant< Arc1, Arc2 > &ca2) const { // TODO : optimize by extracting the references from the variants ? - if ( const Arc1* arc1 = boost::get( &A ) ){ + if ( const Arc1* arc1 = std::get( &A ) ){ Arc1 carc1; Arc1 carc2; CircularKernel().split_2_object()(*arc1, p, carc1, carc2); @@ -325,7 +324,7 @@ namespace CGAL { } else{ - const Arc2* arc2 = boost::get( &A ); + const Arc2* arc2 = std::get( &A ); Arc2 cline1; Arc2 cline2; CircularKernel().split_2_object()(*arc2, p, cline1, cline2); @@ -340,7 +339,6 @@ namespace CGAL { template class Variant_Construct_min_vertex_2 - : public boost::static_visitor { typedef typename CircularKernel::Circular_arc_point_2 @@ -372,9 +370,9 @@ namespace CGAL { //typename boost::remove_reference::type result_type - operator() (const boost::variant< Arc1, Arc2 > & cv) const + operator() (const std::variant< Arc1, Arc2 > & cv) const { - return boost::apply_visitor + return std::visit ( Variant_Construct_min_vertex_2(), cv ); } }; @@ -385,8 +383,6 @@ namespace CGAL { template class Variant_Construct_max_vertex_2 - : public boost::static_visitor { typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; @@ -422,16 +418,15 @@ namespace CGAL { //typename boost::remove_reference::type result_type - operator() (const boost::variant< Arc1, Arc2 > & cv) const + operator() (const std::variant< Arc1, Arc2 > & cv) const { - return boost::apply_visitor + return std::visit ( Variant_Construct_max_vertex_2(), cv ); } }; template class Variant_Is_vertical_2 - : public boost::static_visitor { public : @@ -449,9 +444,9 @@ namespace CGAL { public: typedef bool result_type; - bool operator() (const boost::variant< Arc1, Arc2 >& cv) const + bool operator() (const std::variant< Arc1, Arc2 >& cv) const { - return boost::apply_visitor + return std::visit ( Variant_Is_vertical_2(), cv ); } }; @@ -499,8 +494,8 @@ namespace CGAL { typedef internal_Argt_traits::Not_X_Monotone Not_X_Monotone; - typedef boost::variant< Arc1, Arc2, Not_X_Monotone > Curve_2; - typedef boost::variant< Arc1, Arc2 > X_monotone_curve_2; + typedef std::variant< Arc1, Arc2, Not_X_Monotone > Curve_2; + typedef std::variant< Arc1, Arc2 > X_monotone_curve_2; private: CircularKernel ck; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h index 8c3e7f6533e..19b2ade6c27 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h @@ -469,7 +469,7 @@ public: template OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { - typedef boost::variant + typedef std::variant Make_x_monotone_result; // Increment the serial number of the curve cv, which will serve as its diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h index 1455a276f6d..f487c055221 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h @@ -23,7 +23,7 @@ #include -#include +#include #include #include @@ -126,9 +126,9 @@ public: template OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { - typedef boost::variant + typedef std::variant Base_make_x_monotone_result; - typedef boost::variant + typedef std::variant Make_x_monotone_result; // Make the original curve x-monotone. @@ -138,12 +138,12 @@ public: // Attach the data to each of the resulting x-monotone curves. X_monotone_curve_data xdata = Convert()(cv.data()); for (const auto& base_obj : base_objects) { - if (const auto* bxcv = boost::get(&base_obj)) { + if (const auto* bxcv = std::get(&base_obj)) { *oi++ = Make_x_monotone_result(X_monotone_curve_2(*bxcv, xdata)); continue; } // Current object is an isolated point: Leave it as is. - const auto* bp = boost::get(&base_obj); + const auto* bp = std::get(&base_obj); CGAL_assertion(bp); *oi++ = Make_x_monotone_result(*bp); } @@ -208,9 +208,9 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; - typedef boost::variant + typedef std::variant Intersection_base_result; // Use the base functor to obtain all intersection objects. @@ -223,7 +223,7 @@ public: // Go over all intersection objects and prepare the output. for (const auto& item : base_objects) { const Base_x_monotone_curve_2* base_cv = - boost::get(&item); + std::get(&item); if (base_cv != nullptr) { // The current intersection object is an overlapping x-monotone // curve: Merge the data fields of both intersecting curves and @@ -234,7 +234,7 @@ public: } // The current intersection object is an intersection point: // Copy it as is. - const Intersection_point* ip = boost::get(&item); + const Intersection_point* ip = std::get(&item); *oi++ = Intersection_result(*ip); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h index 1468d38bc67..3d4634ee665 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h @@ -26,7 +26,7 @@ #include -#include +#include #include #include @@ -2062,7 +2062,7 @@ public: */ template OutputIterator operator()(const Curve_2& c, OutputIterator oi) const { - typedef boost::variant + typedef std::variant Make_x_monotone_result; // std::cout << "full: " << c.is_full() << std::endl; // std::cout << "vert: " << c.is_vertical() << std::endl; @@ -2320,7 +2320,7 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; const Kernel& kernel = m_traits; typename Kernel::Equal_2 equal = kernel.equal_2_object(); @@ -2559,7 +2559,7 @@ public: typedef typename Kernel::Equal_3 Equal_3; typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; const Kernel& kernel = m_traits; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h index ba37b21f187..d966a52b41a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h @@ -201,7 +201,7 @@ public: * intersection or a plane in case plane1 and plane2 coincide. */ template -boost::variant > +std::variant > intersect(const Arr_plane_3 & plane1, const Arr_plane_3 & plane2) { @@ -209,7 +209,7 @@ intersect(const Arr_plane_3 & plane1, typedef typename Kernel::Direction_3 Direction_3; typedef typename Kernel::Line_3 Line_3; typedef typename Kernel::FT FT; - typedef boost::variant > Intersection_result; + typedef std::variant > Intersection_result; // We know that the plane goes through the origin const FT& a1 = plane1.a(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h index e287978f9e3..8b3abe1f57f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h @@ -1264,22 +1264,22 @@ private: Control_points aux_vec; auto res1 = f_intersect(skew1a, skew2a); - const Point_2* p1 = boost::get(&*res1); + const Point_2* p1 = std::get(&*res1); if (! p1) CGAL_error(); aux_vec.push_back(*p1); auto res2 = f_intersect(skew1a, skew2b); - const Point_2* p2 = boost::get(&*res2); + const Point_2* p2 = std::get(&*res2); if (! p2) CGAL_error(); aux_vec.push_back(*p2); auto res3 = f_intersect(skew1b, skew2a); - const Point_2* p3 = boost::get(&*res3); + const Point_2* p3 = std::get(&*res3); if (! p3) CGAL_error(); aux_vec.push_back(*p3); auto res4 = f_intersect (skew1b, skew2b); - const Point_2* p4 = boost::get(&*res4); + const Point_2* p4 = std::get(&*res4); if (! p4) CGAL_error(); aux_vec.push_back(*p4); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h index cf7d00135b0..12f3f3a7c66 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h @@ -318,7 +318,7 @@ public: Bezier_cache& cache, OutputIterator oi) const { - typedef boost::variant Intersection_result; + typedef std::variant Intersection_result; // In case we have two x-monotone subcurves of the same Bezier curve, // check if they have a common left endpoint. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h index c6f11cc8a34..051390155d5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h @@ -996,7 +996,7 @@ public: Intersection_map* inter_map = nullptr) const { typedef std::pair Intersection_point; - typedef boost::variant Intersection_result; + typedef std::variant Intersection_result; // First check whether the two arcs have the same supporting curve. if (has_same_supporting_curve(cv)) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h index 7579788a8a4..57352a12ece 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include @@ -813,7 +813,7 @@ public: Intersection_map& inter_map, OutputIterator oi) const { - typedef boost::variant Intersection_result; + typedef std::variant Intersection_result; if (_has_same_supporting_conic(arc)) { // Check for overlaps between the two arcs. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_line_arc_traits_2.h index 20ccbe9c758..9c0cda934db 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_line_arc_traits_2.h @@ -125,7 +125,7 @@ public: template OutputIterator operator()(const Curve_2& line, OutputIterator oi) const { - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; *oi++ = Make_x_monotone_result(line); return oi; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h index b2354fe9895..079f5534e83 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h @@ -26,7 +26,7 @@ #include -#include +#include #include #include @@ -1249,7 +1249,7 @@ public: OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { // Wrap the segment with a variant. - typedef boost::variant + typedef std::variant Make_x_monotone_result; *oi++ = Make_x_monotone_result(cv); return oi; @@ -1326,7 +1326,7 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; CGAL_precondition(! cv1.is_degenerate()); @@ -1340,7 +1340,7 @@ public: if (! res) return oi; // Check whether we have a single intersection point. - const Point_2* ip = boost::get(&*res); + const Point_2* ip = std::get(&*res); if (ip != nullptr) { // Check whether the intersection point ip lies on both segments. const bool ip_on_cv1 = cv1.is_vertical() ? diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h index 42d0457c32b..636d669eb36 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h @@ -27,7 +27,7 @@ * functors required by the concept it models. */ -#include +#include #include #include @@ -131,7 +131,7 @@ public: OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { // Wrap the segment with a variant. - typedef boost::variant + typedef std::variant Make_x_monotone_result; *oi++ = Make_x_monotone_result(cv); return oi; @@ -224,7 +224,7 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; const Kernel& kernel = m_traits; @@ -234,7 +234,7 @@ public: if (! res) return oi; // Check if the intersection is a point: - const Point_2* p_p = boost::get(&*res); + const Point_2* p_p = std::get(&*res); if (p_p != nullptr) { // Create a pair representing the point with its multiplicity, // which is always 1 for line segments for all practical purposes. @@ -246,7 +246,7 @@ public: } // The intersection is a segment. - const X_monotone_curve_2* cv_p = boost::get(&*res); + const X_monotone_curve_2* cv_p = std::get(&*res); CGAL_assertion(cv_p != nullptr); Comparison_result cmp1 = m_traits.compare_endpoints_xy_2_object()(cv1); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h index e7c4a5b1dd5..61fe87106b5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include namespace CGAL { 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 8f28269f199..a52086ce117 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 @@ -75,7 +75,7 @@ Arr_trapezoid_ric_point_location::locate(const Point_2& p) const case TD::POINT: { //p is interior so it should fall on Td_active_vertex - Td_active_vertex& v (boost::get(tr)); + Td_active_vertex& v (std::get(tr)); CGAL_TRAP_PRINT_DEBUG("POINT"); CGAL_assertion(!v.vertex()->is_at_open_boundary()); return make_result(v.vertex()); @@ -84,7 +84,7 @@ Arr_trapezoid_ric_point_location::locate(const Point_2& p) const case TD::CURVE: { - Td_active_edge& e (boost::get(tr)); + Td_active_edge& e (std::get(tr)); Halfedge_const_handle h = e.halfedge(); CGAL_TRAP_PRINT_DEBUG("CURVE"); if ( m_traits->is_in_x_range_2_object()(h->curve(),p) && @@ -100,7 +100,7 @@ Arr_trapezoid_ric_point_location::locate(const Point_2& p) const case TD::TRAPEZOID: { - Td_active_trapezoid t (boost::get(tr)); + Td_active_trapezoid t (std::get(tr)); Halfedge_const_handle h = t.top(); CGAL_TRAP_PRINT_DEBUG("TRAPEZOID"); bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) @@ -160,7 +160,7 @@ Arr_trapezoid_ric_point_location:: _get_unbounded_face(const Td_map_item& item,const Point_2& p, Arr_not_all_sides_oblivious_tag) const { - Td_active_trapezoid tr (boost::get(item)); + Td_active_trapezoid tr (std::get(item)); // Halfedge_const_handle h = tr.top(); if (!tr.is_on_top_boundary() || !tr.is_on_bottom_boundary()) { //if one of top or bottom edges is defined @@ -184,13 +184,13 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, Td_map_item& left_v_item = td.locate(tr.left(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; - if (boost::get(&left_v_item) != nullptr) { - Td_active_vertex v(boost::get(left_v_item)); + if (std::get(&left_v_item) != nullptr) { + Td_active_vertex v(std::get(left_v_item)); he = v.cw_he(); } else { Td_active_fictitious_vertex - v(boost::get(left_v_item)); + v(std::get(left_v_item)); he = v.cw_he(); } //cw_he() holds the "smallest" curve clockwise starting from 12 o'clock @@ -216,13 +216,13 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, Td_map_item& right_v_item = td.locate(tr.right(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; - if (boost::get(&right_v_item)!= nullptr) { - Td_active_vertex v(boost::get(right_v_item)); + if (std::get(&right_v_item)!= nullptr) { + Td_active_vertex v(std::get(right_v_item)); he = v.cw_he(); } else { Td_active_fictitious_vertex - v(boost::get(right_v_item)); + v(std::get(right_v_item)); he = v.cw_he(); } //its cw_he() holds the "smallest" curve clockwise starting from @@ -270,13 +270,13 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const case TD::POINT: { //p fell on Td_active_vertex - Td_active_vertex& v (boost::get(item)); + Td_active_vertex& v (std::get(item)); return (make_result(v.vertex())); } break; case TD::CURVE: { - Td_active_edge& e (boost::get(item)); + Td_active_edge& e (std::get(item)); Halfedge_const_handle h = e.halfedge(); if ((shoot_up && h->direction() == ARR_LEFT_TO_RIGHT) || @@ -289,7 +289,7 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const break; case TD::TRAPEZOID: { - Td_active_trapezoid trpz (boost::get(item)); + Td_active_trapezoid trpz (std::get(item)); Halfedge_const_handle h = (shoot_up) ? trpz.top() : trpz.bottom(); bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h index 169864e1de1..9904b170542 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h @@ -22,7 +22,7 @@ */ #include -#include +#include #include @@ -92,9 +92,9 @@ public: // type flag + on boundaries flags, // left-bottom neighbor trapezoid, left-top neighbor trapezoid, // right-bottom neighbor trapezoid, right-top neighbor trapezoid - typedef Td_ninetuple, - boost::variant, - boost::variant, + std::variant, + std::variant >, Halfedge_const_handle, unsigned char, @@ -239,7 +239,7 @@ public: Curve_end v_ce(left()->curve_end()); ptr()->e2 = (std::shared_ptr)(new X_monotone_curve_2(v_ce.cv())); - //CGAL_assertion(boost::get>( &(ptr()->e2)) != nullptr); + //CGAL_assertion(std::get>( &(ptr()->e2)) != nullptr); ptr()->e1 = (v_ce.ce() == ARR_MIN_END ) ? CGAL_TD_CV_MIN_END : CGAL_TD_CV_MAX_END; @@ -443,8 +443,8 @@ public: CGAL_TD_INLINE Vertex_const_handle left_unsafe() const { CGAL_precondition(is_active()); - CGAL_assertion(boost::get(&(ptr()->e0)) != nullptr); - return boost::get(ptr()->e0); + CGAL_assertion(std::get(&(ptr()->e0)) != nullptr); + return std::get(ptr()->e0); } /*! Access trapezoid left. @@ -466,8 +466,8 @@ public: CGAL_TD_INLINE Vertex_const_handle right_unsafe() const { CGAL_precondition(is_active()); - CGAL_assertion(boost::get(&(ptr()->e1)) != nullptr); - return boost::get(ptr()->e1); + CGAL_assertion(std::get(&(ptr()->e1)) != nullptr); + return std::get(ptr()->e1); } /*! Access trapezoid right. @@ -489,8 +489,8 @@ public: CGAL_TD_INLINE Halfedge_const_handle bottom_unsafe () const { CGAL_precondition(is_active()); - CGAL_assertion(boost::get(&(ptr()->e2)) != nullptr); - return boost::get(ptr()->e2); + CGAL_assertion(std::get(&(ptr()->e2)) != nullptr); + return std::get(ptr()->e2); } /*! Access trapezoid bottom. @@ -526,8 +526,8 @@ public: CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(!is_on_boundaries()); - CGAL_assertion(boost::get( &(ptr()->e0)) != nullptr); - return boost::get( ptr()->e0 ); + CGAL_assertion(std::get( &(ptr()->e0)) != nullptr); + return std::get( ptr()->e0 ); } CGAL_TD_INLINE std::pair curve_end_pair_for_boundary_rem_vtx() const @@ -536,13 +536,13 @@ public: CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(is_on_boundaries()); - CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); - CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); - X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(std::get( &(ptr()->e1)) != nullptr); + CGAL_assertion(std::get >(&(ptr()->e2)) != nullptr); + X_monotone_curve_2* cv_ptr = (std::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = - (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? + (std::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? ARR_MIN_END : ARR_MAX_END; return std::make_pair(cv_ptr, ce); @@ -554,13 +554,13 @@ public: CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(is_on_boundaries()); - CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); - CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); - X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(std::get( &(ptr()->e1)) != nullptr); + CGAL_assertion(std::get >(&(ptr()->e2)) != nullptr); + X_monotone_curve_2* cv_ptr = (std::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = - (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? + (std::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? ARR_MIN_END : ARR_MAX_END; return Curve_end(*cv_ptr, ce); @@ -571,13 +571,13 @@ public: CGAL_precondition(!is_active()); CGAL_precondition(type() == TD_VERTEX); - CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); - CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); - X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(std::get( &(ptr()->e1)) != nullptr); + CGAL_assertion(std::get >(&(ptr()->e2)) != nullptr); + X_monotone_curve_2* cv_ptr = (std::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = - (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? + (std::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? ARR_MIN_END : ARR_MAX_END; return Curve_end(*cv_ptr, ce); @@ -587,8 +587,8 @@ public: { CGAL_precondition(!is_active() && type() == TD_EDGE); - CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); - X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(std::get >(&(ptr()->e2)) != nullptr); + X_monotone_curve_2* cv_ptr = (std::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); return *cv_ptr; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h index eb161a353c5..b026673d4a6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h @@ -21,7 +21,7 @@ */ #include -#include +#include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h index 06e13b29c24..f709a463bc1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h @@ -21,7 +21,7 @@ */ #include -#include +#include #include #ifdef CGAL_TD_DEBUG diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h index 2872d256310..44834852a2b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -461,12 +461,12 @@ private: if (ptr()->rb.which() != 0) { - Self tr(boost::get(rb())); + Self tr(std::get(rb())); tr.set_lb(item); } if (ptr()->rt.which() != 0) { - Self tr(boost::get(rt())); + Self tr(std::get(rt())); tr.set_lt(item); } CGAL_assertion(is_on_right_boundary() == right.is_on_right_boundary()); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h index 514686d303d..23cbc480c9b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h @@ -21,7 +21,7 @@ */ #include -#include +#include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h index 72fd48526c8..340bb0b6d7a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h @@ -28,7 +28,7 @@ #include #include -#include +#include namespace CGAL { @@ -112,7 +112,7 @@ protected: public: - class clear_neighbors_visitor : public boost::static_visitor< void > + class clear_neighbors_visitor { public: void operator()(Td_active_trapezoid& t) const @@ -142,7 +142,7 @@ protected: //d'tor ~Node() { - boost::apply_visitor(clear_neighbors_visitor(), m_data); + std::visit(clear_neighbors_visitor(), m_data); } bool is_inner_node() const //MICHAL: a node with only left child (like removed node) will be considered as a leaf diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h index 55c8e5a457b..97de5cae60a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h @@ -21,7 +21,7 @@ */ #include -#include +#include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h index db3019d46b7..eea96c8327f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h @@ -21,7 +21,7 @@ */ #include -#include +#include #ifdef CGAL_TD_DEBUG diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h index 908be87c078..312d7d8c506 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h @@ -21,7 +21,7 @@ */ #include -#include +#include #ifdef CGAL_TD_DEBUG diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h index e9cad94daf8..76640144604 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h @@ -21,7 +21,7 @@ */ #include -#include +#include #ifdef CGAL_TD_DEBUG diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h index 45ba665a1d5..59a3dd7f6b6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h @@ -113,7 +113,7 @@ public: Td_inactive_fictitious_vertex; //! type of td map item (Td_halfedge, Td_vertex or Td_trapezoid) - typedef boost::variant< Td_nothing, + typedef std::variant< Td_nothing, Td_active_trapezoid, Td_inactive_trapezoid, Td_active_edge, Td_inactive_edge, Td_active_vertex, Td_active_fictitious_vertex, @@ -895,8 +895,8 @@ public: CGAL_precondition(is_active(left_item) && is_active(right_item)); CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(right_item)); - Td_active_trapezoid left (boost::get(left_item)); - Td_active_trapezoid right(boost::get(right_item)); + Td_active_trapezoid left (std::get(left_item)); + Td_active_trapezoid right(std::get(right_item)); if (left.is_on_bottom_boundary()) return (right.is_on_bottom_boundary()); @@ -915,8 +915,8 @@ public: CGAL_precondition(is_active(left_item) && is_active(right_item)); CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(right_item)); - Td_active_trapezoid left (boost::get(left_item)); - Td_active_trapezoid right(boost::get(right_item)); + Td_active_trapezoid left (std::get(left_item)); + Td_active_trapezoid right(std::get(right_item)); if (left.is_on_top_boundary()) return (right.is_on_top_boundary()); @@ -1049,7 +1049,7 @@ public: CGAL_precondition(is_active(item)); //MICHAL: assumes item is of active edge item - also fails in case of a vertical asymptote //MICHAL: check when this is used exactly - Td_active_edge& e (boost::get(item)); + Td_active_edge& e (std::get(item)); Halfedge_const_handle he = e.halfedge(); return (this->compare_curve_end_x_2_object() (Curve_end(he,ARR_MIN_END), Curve_end(he,ARR_MAX_END))== EQUAL); @@ -1061,7 +1061,7 @@ public: { CGAL_precondition( is_active(item) ); CGAL_precondition( is_td_trapezoid(item) ); - Td_active_trapezoid tr (boost::get(item)); + Td_active_trapezoid tr (std::get(item)); return ( tr.is_on_left_boundary() || diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index 7b3b224a223..be7d7ac72b3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -93,16 +93,16 @@ struct Non_recursive_td_map_item_destructor void operator()(Td_active_trapezoid& item) { - boost::apply_visitor(m_child_visitor, item.lb()); - boost::apply_visitor(m_child_visitor, item.lt()); - boost::apply_visitor(m_child_visitor, item.rb()); - boost::apply_visitor(m_child_visitor, item.rt()); + std::visit(m_child_visitor, item.lb()); + std::visit(m_child_visitor, item.lt()); + std::visit(m_child_visitor, item.rb()); + std::visit(m_child_visitor, item.rt()); item.clear_neighbors(); } void operator()(Td_active_edge& item) { - boost::apply_visitor(m_child_visitor, item.next()); + std::visit(m_child_visitor, item.next()); item.set_next(Td_map_item(0)); } @@ -124,7 +124,7 @@ struct Non_recursive_td_map_item_destructor { Td_map_item item = queue.back(); queue.pop_back(); - boost::apply_visitor(item_visitor, item); + std::visit(item_visitor, item); } } @@ -138,7 +138,7 @@ struct Non_recursive_td_map_item_destructor { Td_map_item item = queue.back(); queue.pop_back(); - boost::apply_visitor(item_visitor, item); + std::visit(item_visitor, item); } } }; @@ -384,7 +384,7 @@ public: if (traits->is_td_trapezoid(m_cur_item)) { //if the map item is a trapezoid - Td_active_trapezoid tr (boost::get(m_cur_item)); + Td_active_trapezoid tr (std::get(m_cur_item)); #ifndef CGAL_TD_DEBUG CGAL_warning_code(Dag_node* tt = tr.dag_node();) @@ -436,7 +436,7 @@ public: { //if the map item is an edge - Td_active_edge e (boost::get(m_cur_item)); + Td_active_edge e (std::get(m_cur_item)); CGAL_assertion_code(Dag_node* tt = e.dag_node();) CGAL_assertion(tt != nullptr); CGAL_assertion(tt->is_inner_node()); @@ -453,7 +453,7 @@ public: while(traits->is_td_vertex(m_cur_item)) { Dag_node* node = - boost::apply_visitor(dag_node_visitor(),m_cur_item); + std::visit(dag_node_visitor(),m_cur_item); m_cur_item = node->left_child().get_data(); } @@ -481,7 +481,7 @@ public: CGAL_precondition (!traits->is_empty_item(m_cur_item)); CGAL_precondition (traits->is_active(m_cur_item) && traits->is_td_trapezoid(m_cur_item)); - return boost::get(m_cur_item); + return std::get(m_cur_item); } Td_active_edge& e() @@ -489,13 +489,13 @@ public: CGAL_precondition (!traits->is_empty_item(m_cur_item)); CGAL_precondition (traits->is_active(m_cur_item) && traits->is_td_edge(m_cur_item)); - return boost::get(m_cur_item); + return std::get(m_cur_item); } }; /*! Visitors for accessing td map items methods */ - class rb_visitor : public boost::static_visitor + class rb_visitor { public: Td_map_item operator()(Td_active_trapezoid& t) const @@ -511,7 +511,7 @@ public: } }; - class set_rb_visitor : public boost::static_visitor + class set_rb_visitor { public: set_rb_visitor (const Td_map_item& rb) : m_rb(rb) {} @@ -532,7 +532,7 @@ public: const Td_map_item& m_rb; }; - class rt_visitor : public boost::static_visitor + class rt_visitor { public: Td_map_item operator()(Td_active_trapezoid& t) const @@ -548,7 +548,7 @@ public: } }; - class set_rt_visitor : public boost::static_visitor + class set_rt_visitor { public: set_rt_visitor (const Td_map_item& rt) : m_rt(rt) {} @@ -568,7 +568,7 @@ public: const Td_map_item& m_rt; }; - class lb_visitor : public boost::static_visitor + class lb_visitor { public: Td_map_item operator()(Td_active_trapezoid& t) const @@ -584,7 +584,7 @@ public: } }; - class set_lb_visitor : public boost::static_visitor + class set_lb_visitor { public: set_lb_visitor (const Td_map_item& lb) : m_lb(lb) {} @@ -604,7 +604,7 @@ public: const Td_map_item& m_lb; }; - class set_lt_visitor : public boost::static_visitor + class set_lt_visitor { public: set_lt_visitor (const Td_map_item& lt) : m_lt(lt) {} @@ -624,7 +624,7 @@ public: const Td_map_item& m_lt; }; - class bottom_he_visitor : public boost::static_visitor + class bottom_he_visitor { public: Halfedge_const_handle operator()(Td_active_trapezoid& t) const @@ -640,7 +640,7 @@ public: } }; - class set_bottom_he_visitor : public boost::static_visitor< void > + class set_bottom_he_visitor { public: set_bottom_he_visitor (Halfedge_const_handle he) : m_bottom_he(he) {} @@ -659,7 +659,7 @@ public: Halfedge_const_handle m_bottom_he; }; - class top_he_visitor : public boost::static_visitor + class top_he_visitor { public: Halfedge_const_handle operator()(Td_active_trapezoid& t) const @@ -675,7 +675,7 @@ public: } }; - class set_top_he_visitor : public boost::static_visitor + class set_top_he_visitor { public: set_top_he_visitor (Halfedge_const_handle he) : m_top_he(he) {} @@ -694,7 +694,7 @@ public: Halfedge_const_handle m_top_he; }; - class cw_he_visitor : public boost::static_visitor< Halfedge_const_handle > + class cw_he_visitor { public: Halfedge_const_handle operator()(Td_active_vertex& t) const @@ -716,7 +716,7 @@ public: /*! A visitor to set the cw halfedge of a vertex node. */ - class set_cw_he_visitor : public boost::static_visitor { + class set_cw_he_visitor public: set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {} @@ -734,7 +734,7 @@ public: /*! A visitor to reset the cw halfedge of a vertex node. */ - class reset_cw_he_visitor : public boost::static_visitor { + class reset_cw_he_visitor public: void operator()(Td_active_vertex& t) const { t.reset_cw_he(); } @@ -744,7 +744,7 @@ public: void operator()(T& /*t*/) const { CGAL_assertion(false); } }; - class dag_node_visitor : public boost::static_visitor + class dag_node_visitor { public: Dag_node* operator()(Td_nothing& /* t */) const @@ -765,7 +765,7 @@ public: } }; - class set_dag_node_visitor : public boost::static_visitor + class set_dag_node_visitor { public: set_dag_node_visitor(Dag_node* node):m_node(node) {} @@ -789,8 +789,7 @@ public: Dag_node* m_node; }; - class curve_end_for_fict_vertex_visitor : - public boost::static_visitor > + class curve_end_for_fict_vertex_visitor { public: std::optional operator()(Td_active_fictitious_vertex& t) const @@ -812,7 +811,7 @@ public: } }; - class point_for_vertex_visitor : public boost::static_visitor< Point > + class point_for_vertex_visitor { public: Point operator()(Td_active_vertex& t) const @@ -833,8 +832,7 @@ public: } }; - class curve_end_for_active_vertex_visitor : - public boost::static_visitor > + class curve_end_for_active_vertex_visitor { public: std::optional operator()(Td_active_vertex& t) const @@ -855,8 +853,7 @@ public: } }; - class vertex_for_active_vertex_visitor : - public boost::static_visitor + class vertex_for_active_vertex_visitor { public: Vertex_const_handle operator()(Td_active_vertex& t) const @@ -877,8 +874,7 @@ public: } }; - class cv_for_edge_visitor : - public boost::static_visitor > + class cv_for_edge_visitor { public: std::optional @@ -998,11 +994,11 @@ protected: bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); if (is_fict_vtx) { return (compare(t, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + *(std::visit(curve_end_for_fict_vertex_visitor(), vtx_item))) == SMALLER); } else { - return (compare(t, boost::apply_visitor(point_for_vertex_visitor(), + return (compare(t, std::visit(point_for_vertex_visitor(), vtx_item)) == SMALLER); } } @@ -1039,12 +1035,12 @@ protected: bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); if (is_fict_vtx) { return (compare(t, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + *(std::visit(curve_end_for_fict_vertex_visitor(), vtx_item))) == LARGER); } else { return (compare(t, - boost::apply_visitor(point_for_vertex_visitor(), + std::visit(point_for_vertex_visitor(), vtx_item)) == LARGER); } } @@ -1058,12 +1054,12 @@ protected: bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); if (is_fict_vtx) { return equal(t, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + *(std::visit(curve_end_for_fict_vertex_visitor(), vtx_item))); } else { return equal(t, - boost::apply_visitor(point_for_vertex_visitor(), + std::visit(point_for_vertex_visitor(), vtx_item)); } } @@ -1090,24 +1086,24 @@ protected: //if ( traits->is_fictitious_vertex(item) ) //{ // CGAL_precondition(traits->equal_curve_end_2_object() - // (Curve_end(cv,ARR_MIN_END), *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item)))); + // (Curve_end(cv,ARR_MIN_END), *(std::visit(curve_end_for_fict_vertex_visitor(),item)))); //} //else //{ // CGAL_precondition(traits->equal_curve_end_2_object() - // (Curve_end(cv,ARR_MIN_END), boost::apply_visitor(point_for_vertex_visitor(), item))); + // (Curve_end(cv,ARR_MIN_END), std::visit(point_for_vertex_visitor(), item))); //} //find the node of the curve's leftmost trapezoid Dag_node cv_leftmost_node(left_cv_end_node.right_child()); if (traits->is_fictitious_vertex(item) ) { - Curve_end ce( *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + Curve_end ce( *(std::visit(curve_end_for_fict_vertex_visitor(), item))); search_using_dag_with_cv(cv_leftmost_node, traits, ce, &cv, cres); } else { - Point p( boost::apply_visitor(point_for_vertex_visitor(), item)); + Point p( std::visit(point_for_vertex_visitor(), item)); search_using_dag_with_cv(cv_leftmost_node, traits, p, &cv, cres); } return cv_leftmost_node; @@ -1159,8 +1155,8 @@ protected: if (traits->is_empty_item(left_item) || traits->is_empty_item(right_item)) return false; - Td_active_trapezoid& left (boost::get(left_item)); - Td_active_trapezoid& right (boost::get(right_item)); + Td_active_trapezoid& left (std::get(left_item)); + Td_active_trapezoid& right (std::get(right_item)); if (traits->is_trapezoids_top_equal(left,right) && traits->is_trapezoids_bottom_equal(left,right) && @@ -1966,7 +1962,7 @@ public: for (typename std::list::iterator it = representatives.begin(); it != representatives.end(); ++it) { - Td_active_edge e(boost::get(*it)); + Td_active_edge e(std::get(*it)); container.push_back(e.halfedge()); //it represents an active trapezoid } } @@ -2152,7 +2148,7 @@ private: // traits may be initialized later m_dag_root = new Dag_node(Td_active_trapezoid()); //(*m_dag_root)->set_dag_node(m_dag_root); - boost::apply_visitor(set_dag_node_visitor(m_dag_root), + std::visit(set_dag_node_visitor(m_dag_root), m_dag_root->get_data()); m_number_of_curves = 0; @@ -2200,11 +2196,11 @@ private: //{ // if ( traits->is_fictitious_vertex(item) ) // { - // res = traits->equal_curve_end_2_object()(ce, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item))); + // res = traits->equal_curve_end_2_object()(ce, *(std::visit(curve_end_for_fict_vertex_visitor(),item))); // } // else // { - // res = traits->equal_curve_end_2_object()(ce, boost::apply_visitor(point_for_vertex_visitor(), item)); + // res = traits->equal_curve_end_2_object()(ce, std::visit(point_for_vertex_visitor(), item)); // } //} if (traits->is_td_trapezoid(item)) @@ -2218,11 +2214,11 @@ private: //{ // if ( traits->is_fictitious_vertex(item) ) // { - // res = traits->equal_curve_end_2_object()(ce, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item))); + // res = traits->equal_curve_end_2_object()(ce, *(std::visit(curve_end_for_fict_vertex_visitor(),item))); // } // else // { - // res = traits->equal_curve_end_2_object()(ce, boost::apply_visitor(point_for_vertex_visitor(), item)); + // res = traits->equal_curve_end_2_object()(ce, std::visit(point_for_vertex_visitor(), item)); // } //} if (traits->is_td_trapezoid(item)) @@ -2234,7 +2230,7 @@ private: lt=POINT; else { - Td_active_trapezoid tr (boost::get(item)); + Td_active_trapezoid tr (std::get(item)); lt = tr.is_on_boundaries()? UNBOUNDED_TRAPEZOID : TRAPEZOID; } } @@ -2343,12 +2339,12 @@ private: // if the map item represents a fictitious vertex if (traits->is_fictitious_vertex(item)) { - const Curve_end left_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item))); + const Curve_end left_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),item))); print_ce_data(left_ce.cv(), left_ce.ce(), out); } else // if the map item represents a vertex { - Point p = boost::apply_visitor(point_for_vertex_visitor(),item); + Point p = std::visit(point_for_vertex_visitor(),item); print_point_data(p, out); } out << " (void *)left_child: " << (void*)(&(curr.left_child())) @@ -2363,7 +2359,7 @@ private: { // bool is_active = traits->is_active(item); // if the map item represents an edge - const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), item)); + const X_monotone_curve_2& he_cv = *(std::visit(cv_for_edge_visitor(), item)); // so top() is a real Halfedge with a curve() if curr is active // or curr holds the curve if curr is not active diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h index b912b9facc7..7da418861f0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h @@ -52,7 +52,7 @@ split_trapezoid_by_vertex(Dag_node& split_node, Dag_node left_node, right_node; if (traits->is_td_trapezoid(curr_item)) { - Td_active_trapezoid& tr(boost::get(curr_item)); + Td_active_trapezoid& tr(std::get(curr_item)); CGAL_warning(traits->is_in_closure(tr, traits->vtx_to_ce(v))); @@ -63,9 +63,9 @@ split_trapezoid_by_vertex(Dag_node& split_node, (v, tr.right(), tr.bottom(), tr.top())); Td_active_trapezoid& - left_tr(boost::get(left_node.get_data())); + left_tr(std::get(left_node.get_data())); Td_active_trapezoid& - right_tr(boost::get(right_node.get_data())); + right_tr(std::get(right_node.get_data())); CGAL_warning(traits->is_trapezoids_top_equal(left_tr,right_tr)); CGAL_warning(traits->is_trapezoids_bottom_equal(left_tr,right_tr)); @@ -77,25 +77,25 @@ split_trapezoid_by_vertex(Dag_node& split_node, right_tr.init_neighbors(left_node.get_data(), left_node.get_data(), tr.rb(), tr.rt()); if (!traits->is_empty_item(tr.lb())) { - Td_active_trapezoid& lb(boost::get(tr.lb())); + Td_active_trapezoid& lb(std::get(tr.lb())); lb.set_rb(left_node.get_data()); } if (!traits->is_empty_item(tr.lt())) { - Td_active_trapezoid& lt(boost::get(tr.lt())); + Td_active_trapezoid& lt(std::get(tr.lt())); lt.set_rt(left_node.get_data()); } if (!traits->is_empty_item(tr.rb())) { - Td_active_trapezoid& rb(boost::get(tr.rb())); + Td_active_trapezoid& rb(std::get(tr.rb())); rb.set_lb(right_node.get_data()); } if (!traits->is_empty_item(tr.rt())) { - Td_active_trapezoid& rt(boost::get(tr.rt())); + Td_active_trapezoid& rt(std::get(tr.rt())); rt.set_lt(right_node.get_data()); } } else { // the curr_item is an edge - Td_active_edge& e(boost::get(curr_item)); + Td_active_edge& e(std::get(curr_item)); CGAL_warning(traits->is_in_closure(e, traits->vtx_to_ce(v))); @@ -103,8 +103,8 @@ split_trapezoid_by_vertex(Dag_node& split_node, right_node.set_data(Td_active_edge(e.halfedge())); - Td_active_edge& left_e(boost::get(left_node.get_data())); - Td_active_edge& right_e(boost::get(right_node.get_data())); + Td_active_edge& left_e(std::get(left_node.get_data())); + Td_active_edge& right_e(std::get(right_node.get_data())); //CGAL_warning(left_e.is_on_left_boundary() == e.is_on_left_boundary()); //CGAL_warning(right_e.is_on_right_boundary() == e.is_on_right_boundary()); @@ -132,10 +132,10 @@ split_trapezoid_by_vertex(Dag_node& split_node, const Dag_node* left_ptr = &split_node.left_child(); const Dag_node* right_ptr = &split_node.right_child(); - boost::apply_visitor(set_dag_node_visitor((Dag_node*)left_ptr), + std::visit(set_dag_node_visitor((Dag_node*)left_ptr), left_ptr->get_data()); //(*left_ptr)->set_dag_node((Dag_node*)left_ptr); - boost::apply_visitor(set_dag_node_visitor((Dag_node*)right_ptr), + std::visit(set_dag_node_visitor((Dag_node*)right_ptr), right_ptr->get_data()); //(*right_ptr)->set_dag_node((Dag_node*)right_ptr); @@ -219,7 +219,7 @@ deactivate_trapezoid(Dag_node& trpz_node, Dag_node* active_node) const CGAL_precondition(traits->is_active(trpz_node.get_data())); CGAL_precondition(traits->is_td_trapezoid(trpz_node.get_data())); if (Td_active_trapezoid* trap = - boost::get(&trpz_node.get_data())) + std::get(&trpz_node.get_data())) trap->non_recursive_clear_neighbors(); trpz_node.set_data(Td_inactive_trapezoid()); if (active_node) trpz_node.set_left_child(*active_node); @@ -233,11 +233,11 @@ deactivate_vertex(Dag_node& vtx_node) const CGAL_precondition(traits->is_td_vertex(vtx_node.get_data())); if (traits->is_fictitious_vertex(vtx_node.get_data())) { Td_active_fictitious_vertex& - v(boost::get(vtx_node.get_data())); + v(std::get(vtx_node.get_data())); vtx_node.set_data(Td_inactive_fictitious_vertex(v.vertex(), &vtx_node)); } else { - Td_active_vertex& v(boost::get(vtx_node.get_data())); + Td_active_vertex& v(std::get(vtx_node.get_data())); vtx_node.set_data(Td_inactive_vertex(v.vertex(), &vtx_node)); } } @@ -274,7 +274,7 @@ split_trapezoid_by_halfedge(Dag_node& split_node, CGAL_precondition(traits->is_td_trapezoid(split_node.get_data())); Td_map_item curr_item(split_node.get_data()); - Td_active_trapezoid& split_tr = boost::get(curr_item); + Td_active_trapezoid& split_tr = std::get(curr_item); // sets left and right according to td_edge's source and target positions // sets bottom and top to Halfedge itself @@ -303,9 +303,9 @@ split_trapezoid_by_halfedge(Dag_node& split_node, // CGAL_TD_ON_BOTTOM_BOUNDARY ))); Td_active_trapezoid& bottom = - boost::get(bottom_node.get_data()); + std::get(bottom_node.get_data()); Td_active_trapezoid& top = - boost::get(top_node.get_data()); + std::get(top_node.get_data()); top.init_neighbors(prev_top_tr, split_tr.lt(), std::nullopt , split_tr.rt()); bottom.init_neighbors(split_tr.lb(), prev_bottom_tr, split_tr.rb(), @@ -313,27 +313,27 @@ split_trapezoid_by_halfedge(Dag_node& split_node, if (!traits->is_empty_item(prev_bottom_tr)) { Td_active_trapezoid& - prev_btm(boost::get(prev_bottom_tr)); + prev_btm(std::get(prev_bottom_tr)); prev_btm.set_rt(bottom_node.get_data()); } if (!traits->is_empty_item(prev_top_tr)) { - Td_active_trapezoid& prev_top(boost::get(prev_top_tr)); + Td_active_trapezoid& prev_top(std::get(prev_top_tr)); prev_top.set_rb(top_node.get_data()); } if (!traits->is_empty_item(split_tr.lb())) { - Td_active_trapezoid& lb(boost::get(split_tr.lb())); + Td_active_trapezoid& lb(std::get(split_tr.lb())); lb.set_rb(bottom_node.get_data()); } if (!traits->is_empty_item(split_tr.lt())) { - Td_active_trapezoid& lt(boost::get(split_tr.lt())); + Td_active_trapezoid& lt(std::get(split_tr.lt())); lt.set_rt(top_node.get_data()); } if (!traits->is_empty_item(split_tr.rb())) { - Td_active_trapezoid& rb(boost::get(split_tr.rb())); + Td_active_trapezoid& rb(std::get(split_tr.rb())); rb.set_lb(bottom_node.get_data()); } if (!traits->is_empty_item(split_tr.rt())) { - Td_active_trapezoid& rt(boost::get(split_tr.rt())); + Td_active_trapezoid& rt(std::get(split_tr.rt())); rt.set_lt(top_node.get_data()); } split_node.replace(sep,bottom_node,top_node); //nodes depth are updated here @@ -348,14 +348,14 @@ split_trapezoid_by_halfedge(Dag_node& split_node, const Dag_node* bottomPtr = &split_node.left_child(); const Dag_node* topPtr = &split_node.right_child(); - boost::apply_visitor(set_dag_node_visitor((Dag_node*)bottomPtr), + std::visit(set_dag_node_visitor((Dag_node*)bottomPtr), bottomPtr->get_data()); - boost::apply_visitor(set_dag_node_visitor((Dag_node*)topPtr), + std::visit(set_dag_node_visitor((Dag_node*)topPtr), topPtr->get_data()); - // Td_active_edge& new_e = boost::get(split_node.get_data()); + // Td_active_edge& new_e = std::get(split_node.get_data()); if (!traits->is_empty_item(prev_e)) { - Td_active_edge& e( boost::get(prev_e)); + Td_active_edge& e( std::get(prev_e)); e.set_next(split_node.get_data()); } //update these trapezoids pointers. @@ -404,14 +404,14 @@ update_vtx_with_new_edge(Halfedge_const_handle he, //set cw to hold the halfedge whose source is p, // which is clockwise "smallest" starting from top (12 o'clock) - Halfedge_const_handle cw_he(boost::apply_visitor(cw_he_visitor(), vtx_item)); + Halfedge_const_handle cw_he(std::visit(cw_he_visitor(), vtx_item)); if (traits->compare_cw_around_point_2_object()(he->curve(), is_edge_to_right(he,p), cw_he->curve(), is_edge_to_right(cw_he,p), p) == SMALLER) { - boost::apply_visitor(set_cw_he_visitor(he),vtx_item);//v_tr->set_top(he); + std::visit(set_cw_he_visitor(he),vtx_item);//v_tr->set_top(he); } return vtx_item; @@ -430,7 +430,7 @@ insert_curve_at_vtx_using_dag(Halfedge_const_handle he, { CGAL_precondition(lt==TRAPEZOID || lt==UNBOUNDED_TRAPEZOID); - Dag_node* node = boost::apply_visitor(dag_node_visitor(), item); + Dag_node* node = std::visit(dag_node_visitor(), item); CGAL_assertion(node != nullptr); CGAL_assertion(he != m_empty_he_handle); @@ -458,13 +458,13 @@ insert_curve_at_vtx_using_dag(Halfedge_const_handle he, // CGAL_precondition(traits->is_td_vertex(vtx_item)); // CGAL_precondition(traits->is_active(vtx_item)); // -// Halfedge_const_handle cw_he (boost::apply_visitor(cw_he_visitor(), vtx_item)); +// Halfedge_const_handle cw_he (std::visit(cw_he_visitor(), vtx_item)); // // //make sure the cw_he is added in same direction as before // // such that vtx_item is the source (done inside the set methods) // if (cw_he == old_he || cw_he->twin() == old_he) // { -// boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item); +// std::visit(set_cw_he_visitor(new_he), vtx_item); // } //} @@ -479,12 +479,12 @@ update_vtx_cw_he_after_merge(const X_monotone_curve_2& old_cv, CGAL_precondition(traits->is_td_vertex(vtx_item)); CGAL_precondition(traits->is_active(vtx_item)); - Halfedge_const_handle cw_he(boost::apply_visitor(cw_he_visitor(), vtx_item)); + Halfedge_const_handle cw_he(std::visit(cw_he_visitor(), vtx_item)); //make sure the cw_he is added in same direction as before // such that v_tr is the source (done inside the set methods) if (traits->equal_2_object()(cw_he->curve(), old_cv)) - boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item); + std::visit(set_cw_he_visitor(new_he), vtx_item); } //----------------------------------------------------------------------------- @@ -499,12 +499,12 @@ update_vtx_cw_he_after_remove(Halfedge_const_handle old_he, CGAL_precondition(traits->is_td_vertex(vtx_item)); CGAL_precondition(traits->is_active(vtx_item)); - Halfedge_const_handle cw_he(boost::apply_visitor(cw_he_visitor(), vtx_item)); + Halfedge_const_handle cw_he(std::visit(cw_he_visitor(), vtx_item)); if ((old_he == cw_he) || (old_he->twin() == cw_he)) { Halfedge_const_handle new_he = cw_he->twin()->next(); if (new_he != cw_he) - boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item); - else boost::apply_visitor(reset_cw_he_visitor(), vtx_item); // dangling edge removed + std::visit(set_cw_he_visitor(new_he), vtx_item); + else std::visit(reset_cw_he_visitor(), vtx_item); // dangling edge removed } } @@ -520,20 +520,20 @@ update_vtx_cw_he_after_remove(Halfedge_const_handle old_he, // CGAL_precondition(traits->is_td_vertex(vtx_item)); // CGAL_precondition(traits->is_active(vtx_item)); // -// Halfedge_const_handle top_he (boost::apply_visitor(top_he_visitor(), vtx_item)); -// Halfedge_const_handle bottom_he (boost::apply_visitor(bottom_he_visitor(), vtx_item)); +// Halfedge_const_handle top_he (std::visit(top_he_visitor(), vtx_item)); +// Halfedge_const_handle bottom_he (std::visit(bottom_he_visitor(), vtx_item)); // // //make sure the top & bottom are added in same direction as before // // such that sep is the source (done inside the set methods) // if ((top_he == he1) || (top_he == he1->twin()) || // (top_he == he2) || (top_he == he2->twin()) ) // { -// boost::apply_visitor(set_top_he_visitor(new_he), vtx_item); //v_tr.set_top(new_he); +// std::visit(set_top_he_visitor(new_he), vtx_item); //v_tr.set_top(new_he); // } // if ((bottom_he == he1) || (bottom_he == he1->twin()) || // (bottom_he == he2) || (bottom_he == he2->twin()) ) // { -// boost::apply_visitor(set_bottom_he_visitor(new_he), vtx_item); //v_tr.set_bottom(new_he); +// std::visit(set_bottom_he_visitor(new_he), vtx_item); //v_tr.set_bottom(new_he); // } //} @@ -561,22 +561,22 @@ update_map_items_after_merge(In_face_iterator& it, CGAL_assertion(traits->is_active(curr_item)); if (traits->is_td_edge(curr_item)) { - Td_active_edge& e(boost::get(curr_item)); + Td_active_edge& e(std::get(curr_item)); if (e.halfedge() == old_he || e.halfedge() == old_he->twin()) e.set_halfedge(new_he); } else if (traits->is_td_trapezoid(curr_item)) { - Td_active_trapezoid& tr(boost::get(curr_item)); + Td_active_trapezoid& tr(std::get(curr_item)); if (tr.bottom() == old_he || tr.bottom() == old_he->twin()) tr.set_bottom(new_he); if (tr.top() == old_he || tr.top() == old_he->twin()) tr.set_top(new_he); } else { //if is_td_vertex - Halfedge_const_handle cw_he(boost::apply_visitor(cw_he_visitor(), + Halfedge_const_handle cw_he(std::visit(cw_he_visitor(), curr_item)); if (cw_he == old_he || cw_he == old_he->twin()) - boost::apply_visitor(set_cw_he_visitor(new_he), curr_item); + std::visit(set_cw_he_visitor(new_he), curr_item); } last_item = *it; @@ -615,20 +615,20 @@ search_using_dag(Dag_node& curr_node, if (traits->is_td_vertex(curr_item)) { // the curr_item represents a vertex //bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); - //if ((is_fict_vtx && is_end_point_left_low(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) || - // (!is_fict_vtx && is_end_point_left_low(p, boost::apply_visitor(point_for_vertex_visitor(), curr_item))) ) + //if ((is_fict_vtx && is_end_point_left_low(p, *(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)))) || + // (!is_fict_vtx && is_end_point_left_low(p, std::visit(point_for_vertex_visitor(), curr_item))) ) if (is_end_point_left_low(p, curr_node)) { curr_node = curr_node.left_child(); continue; } - //else if ((is_fict_vtx && is_end_point_right_top(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) || - // (!is_fict_vtx && is_end_point_right_top(p, boost::apply_visitor(point_for_vertex_visitor(), curr_item))) ) + //else if ((is_fict_vtx && is_end_point_right_top(p, *(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)))) || + // (!is_fict_vtx && is_end_point_right_top(p, std::visit(point_for_vertex_visitor(), curr_item))) ) else if (is_end_point_right_top(p, curr_node)) { curr_node = curr_node.right_child(); continue; } - //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || - // (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) ) + //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || + // (!is_fict_vtx && traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item), p)) ) else if (are_equal_end_points(p, curr_node)) { if (he == m_empty_he_handle) { // he is the empty handle @@ -663,13 +663,13 @@ search_using_dag(Dag_node& curr_node, are_equal_end_points(p,curr_node)); //(is_fict_vtx && - // (is_end_point_left_low(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || - // is_end_point_right_top(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || - // traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),p))) || + // (is_end_point_left_low(p,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) || + // is_end_point_right_top(p,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) || + // traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),p))) || // (!is_fict_vtx && - // (is_end_point_left_low(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || - // is_end_point_right_top(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || - // traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),p)))); + // (is_end_point_left_low(p,std::visit(point_for_vertex_visitor(), curr_item)) || + // is_end_point_right_top(p,std::visit(point_for_vertex_visitor(), curr_item)) || + // traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item),p)))); return Locate_type(); } @@ -678,7 +678,7 @@ search_using_dag(Dag_node& curr_node, // curr_item represents an edge, // so top() is a real Halfedge with a curve() if curr_item is active // or curr_item holds the curve if it is not active - const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), curr_item)); + const X_monotone_curve_2& he_cv = *(std::visit(cv_for_edge_visitor(), curr_item)); Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv); if (cres == SMALLER) { @@ -753,7 +753,7 @@ search_using_dag(Dag_node& curr_node, else { // if is_degenerate() == 0, meaning: curr_item is a real trapezoid if (traits->is_active(curr_item)) { - Td_active_trapezoid& tr = boost::get(curr_item); + Td_active_trapezoid& tr = std::get(curr_item); return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID; } curr_node = curr_node.left_child(); @@ -810,30 +810,30 @@ search_using_dag(Dag_node& curr_node, // bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); // if (is_fict_vtx) // { -// Curve_end vtx_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))); +// Curve_end vtx_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))); // print_ce_data(vtx_ce.cv(), vtx_ce.ce(), out); // } // else // { -// print_point_data(boost::apply_visitor(point_for_vertex_visitor(),curr_item), out); +// print_point_data(std::visit(point_for_vertex_visitor(),curr_item), out); // } // -// if ((is_fict_vtx && is_end_point_left_low(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) || -// (!is_fict_vtx && is_end_point_left_low(p, boost::apply_visitor(point_for_vertex_visitor(),curr_item))) ) +// if ((is_fict_vtx && is_end_point_left_low(p, *(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)))) || +// (!is_fict_vtx && is_end_point_left_low(p, std::visit(point_for_vertex_visitor(),curr_item))) ) // { // out << " Going left " << std::endl; // curr_node = curr_node.left_child(); // continue; // } -// else if ((is_fict_vtx && is_end_point_right_top(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) || -// (!is_fict_vtx && is_end_point_right_top(p, boost::apply_visitor(point_for_vertex_visitor(),curr_item))) ) +// else if ((is_fict_vtx && is_end_point_right_top(p, *(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)))) || +// (!is_fict_vtx && is_end_point_right_top(p, std::visit(point_for_vertex_visitor(),curr_item))) ) // { // out << " Going right " << std::endl; // curr_node = curr_node.right_child(); // continue; // } -// else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || -// (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(),curr_item), p)) ) +// else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || +// (!is_fict_vtx && traits->equal_2_object()(std::visit(point_for_vertex_visitor(),curr_item), p)) ) // { // out << " Equal to query " << std::endl; // if (he == m_empty_he_handle) //if he is the empty handle @@ -876,7 +876,7 @@ search_using_dag(Dag_node& curr_node, // // if curr_item represents an edge, // // so top() is a real Halfedge with a curve() if curr_item is active // // or curr_item holds the curve if it is not active -// const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), curr_item)); +// const X_monotone_curve_2& he_cv = *(std::visit(cv_for_edge_visitor(), curr_item)); // // out << " EDGE : " ; // if (traits->is_active(curr_item)) @@ -951,7 +951,7 @@ search_using_dag(Dag_node& curr_node, // if (traits->is_active(curr_item)) // { // out << " (active) "; -// Td_active_trapezoid tr = boost::get(curr_item); +// Td_active_trapezoid tr = std::get(curr_item); // if (tr.is_on_boundaries()) // out << " UNBOUNDED! "; // else @@ -1023,20 +1023,20 @@ search_using_dag_with_cv(Dag_node& curr_node, if (traits->is_td_vertex(curr_item)) { // the curr_item represents a vertex //bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); - //if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || - // (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) ) + //if ((is_fict_vtx && is_end_point_right_top(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || + // (!is_fict_vtx && is_end_point_right_top(std::visit(point_for_vertex_visitor(), curr_item), ce)) ) if (is_end_point_left_low(ce, curr_node)) { curr_node = curr_node.left_child(); continue; } - //else if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || - // (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) ) + //else if ((is_fict_vtx && is_end_point_left_low(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || + // (!is_fict_vtx && is_end_point_left_low(std::visit(point_for_vertex_visitor(), curr_item), ce)) ) else if (is_end_point_right_top(ce, curr_node)) { curr_node = curr_node.right_child(); continue; } - //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || - // (!is_fict_vtx && traits->equal_curve_end_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) ) + //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || + // (!is_fict_vtx && traits->equal_curve_end_2_object()(std::visit(point_for_vertex_visitor(), curr_item), ce)) ) else if (are_equal_end_points(ce, curr_node)) { if (!p_cv) { // p_cv was not given @@ -1070,13 +1070,13 @@ search_using_dag_with_cv(Dag_node& curr_node, is_end_point_right_top(ce, curr_node) || are_equal_end_points(ce, curr_node)); //(is_fict_vtx && - // (is_end_point_left_low(ce,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || - // is_end_point_right_top(ce,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || - // traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),ce))) || + // (is_end_point_left_low(ce,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) || + // is_end_point_right_top(ce,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) || + // traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),ce))) || // (!is_fict_vtx && - // (is_end_point_left_low(ce,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || - // is_end_point_right_top(ce,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || - // traits->equal_curve_end_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),ce)))); + // (is_end_point_left_low(ce,std::visit(point_for_vertex_visitor(), curr_item)) || + // is_end_point_right_top(ce,std::visit(point_for_vertex_visitor(), curr_item)) || + // traits->equal_curve_end_2_object()(std::visit(point_for_vertex_visitor(), curr_item),ce)))); return Locate_type(); } } @@ -1086,7 +1086,7 @@ search_using_dag_with_cv(Dag_node& curr_node, // or curr_item holds the curve if it is not active const X_monotone_curve_2& he_cv = - *(boost::apply_visitor(cv_for_edge_visitor(), curr_item)); + *(std::visit(cv_for_edge_visitor(), curr_item)); Comparison_result cres = traits->compare_curve_end_y_at_x_2_object()(ce, he_cv); if (cres == SMALLER) { @@ -1174,7 +1174,7 @@ search_using_dag_with_cv(Dag_node& curr_node, else { // if is_degenerate() == 0, meaning: curr_item is a real trapezoid if (traits->is_active(curr_item)) { - Td_active_trapezoid& tr = boost::get(curr_item); + Td_active_trapezoid& tr = std::get(curr_item); return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID; } curr_node = curr_node.left_child(); @@ -1213,20 +1213,20 @@ search_using_dag_with_cv(Dag_node& curr_node, if (traits->is_td_vertex(curr_item)) { // the curr_item represents a vertex //bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); - //if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || - // (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) ) + //if ((is_fict_vtx && is_end_point_right_top(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || + // (!is_fict_vtx && is_end_point_right_top(std::visit(point_for_vertex_visitor(), curr_item), p)) ) if (is_end_point_left_low(p, curr_node)) { curr_node = curr_node.left_child(); continue; } - //else if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || - // (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) ) + //else if ((is_fict_vtx && is_end_point_left_low(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || + // (!is_fict_vtx && is_end_point_left_low(std::visit(point_for_vertex_visitor(), curr_item), p)) ) else if (is_end_point_right_top(p, curr_node)) { curr_node = curr_node.right_child(); continue; } - //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || - // (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) ) + //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || + // (!is_fict_vtx && traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item), p)) ) else if (are_equal_end_points(p, curr_node)) { if (!p_cv) { // p_cv was not given @@ -1260,13 +1260,13 @@ search_using_dag_with_cv(Dag_node& curr_node, is_end_point_right_top(p, curr_node) || are_equal_end_points(p, curr_node)); //CGAL_assertion((is_fict_vtx && - // (is_end_point_left_low(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || - // is_end_point_right_top(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || - // traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),p))) || + // (is_end_point_left_low(p,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) || + // is_end_point_right_top(p,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) || + // traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),p))) || // (!is_fict_vtx && - // (is_end_point_left_low(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || - // is_end_point_right_top(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || - // traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),p)))); + // (is_end_point_left_low(p,std::visit(point_for_vertex_visitor(), curr_item)) || + // is_end_point_right_top(p,std::visit(point_for_vertex_visitor(), curr_item)) || + // traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item),p)))); return Locate_type(); } } @@ -1275,7 +1275,7 @@ search_using_dag_with_cv(Dag_node& curr_node, // so top() is a real Halfedge with a curve() if curr_item is active // or curr_item holds the curve if it is not active const X_monotone_curve_2& he_cv = - *(boost::apply_visitor(cv_for_edge_visitor(), curr_item)); + *(std::visit(cv_for_edge_visitor(), curr_item)); Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv); if (cres == SMALLER) { curr_node = curr_node.left_child(); @@ -1351,7 +1351,7 @@ search_using_dag_with_cv(Dag_node& curr_node, else { // is_degenerate() == 0, meaning: curr_item is a real trapezoid if (traits->is_active(curr_item)) { - Td_active_trapezoid& tr = boost::get(curr_item); + Td_active_trapezoid& tr = std::get(curr_item); return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID; } curr_node = curr_node.left_child(); @@ -1377,7 +1377,7 @@ container2dag(Nodes_map& ar, int left, int right, int& num_of_new_nodes) const CGAL_assertion(traits->is_active(item)); CGAL_assertion(traits->is_td_trapezoid(item)); Dag_node& tr_node( ar.find(d)->second); - Td_active_trapezoid& tr(boost::get(tr_node.get_data())); + Td_active_trapezoid& tr(std::get(tr_node.get_data())); Vertex_const_handle v = tr.right(); Curve_end ce(traits->vtx_to_ce(v)); @@ -1397,15 +1397,15 @@ container2dag(Nodes_map& ar, int left, int right, int& num_of_new_nodes) const } num_of_new_nodes++; - boost::apply_visitor(set_dag_node_visitor((Dag_node*)&(curr_node.left_child())), curr_node.left_child().get_data()); - boost::apply_visitor(set_dag_node_visitor((Dag_node*)&(curr_node.right_child())), curr_node.right_child().get_data()); - boost::apply_visitor(set_dag_node_visitor((Dag_node*)&curr_node), + std::visit(set_dag_node_visitor((Dag_node*)&(curr_node.left_child())), curr_node.left_child().get_data()); + std::visit(set_dag_node_visitor((Dag_node*)&(curr_node.right_child())), curr_node.right_child().get_data()); + std::visit(set_dag_node_visitor((Dag_node*)&curr_node), curr_node.get_data()); //curr_node.left_child()->set_dag_node(&curr_node.left_child()); //curr_node.right_child()->set_dag_node(&curr_node.right_child()); //curr_node->set_dag_node(&curr_node);// fake temporary node deactivate_vertex(curr_node); //curr_node->remove(); // mark as deleted - boost::apply_visitor(set_dag_node_visitor((Dag_node*)nullptr), + std::visit(set_dag_node_visitor((Dag_node*)nullptr), curr_node.get_data());//curr_node->set_dag_node(0); return curr_node; @@ -1423,7 +1423,7 @@ is_last_edge(Halfedge_const_handle /* he */ , Td_map_item& vtx_item) CGAL_precondition(traits->is_active(vtx_item)); Vertex_const_handle - v(boost::apply_visitor(vertex_for_active_vertex_visitor(), vtx_item)); + v(std::visit(vertex_for_active_vertex_visitor(), vtx_item)); typename Arrangement_on_surface_2::Halfedge_around_vertex_const_circulator first, second; @@ -1518,8 +1518,8 @@ Trapezoidal_decomposition_2::insert(Halfedge_const_handle he) // locate and insert end points of the input halfedge to the Td_map_item // Dag if needed - Dag_node p1_node(*(boost::apply_visitor(dag_node_visitor(), p1_item))); - //Dag_node p2_node(*(boost::apply_visitor(dag_node_visitor(), p2_item)));// Not in use + Dag_node p1_node(*(std::visit(dag_node_visitor(), p1_item))); + //Dag_node p2_node(*(std::visit(dag_node_visitor(), p2_item)));// Not in use // create the Td_map_item iterator for traveling along the Trapezoids that // intersect the input Halfedge, using left-low to right-high order @@ -1568,7 +1568,7 @@ Trapezoidal_decomposition_2::insert(Halfedge_const_handle he) traits->is_active(new_btm_item)); if (merge_if_possible(prev_bottom_tr, new_btm_item)) { Dag_node* left_child_node = - boost::apply_visitor(dag_node_visitor(),prev_bottom_tr); + std::visit(dag_node_visitor(),prev_bottom_tr); node->set_left_child(*left_child_node); old_bottom_tr = prev_bottom_tr; m_number_of_dag_nodes--; //update number of nodes in the DAG after merge @@ -1581,7 +1581,7 @@ Trapezoidal_decomposition_2::insert(Halfedge_const_handle he) CGAL_assertion(traits->is_td_trapezoid(new_top_item) && traits->is_active(new_top_item)); if (merge_if_possible(prev_top_tr, new_top_item)) { - Dag_node* right_child_node = boost::apply_visitor(dag_node_visitor(), + Dag_node* right_child_node = std::visit(dag_node_visitor(), prev_top_tr); node->set_right_child(*right_child_node); old_top_tr = prev_top_tr; @@ -1654,12 +1654,12 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) if (lt1 != POINT || lt2 != POINT) return; - CGAL_warning(boost::apply_visitor(dag_node_visitor(), p1_item) != nullptr); - CGAL_warning(boost::apply_visitor(dag_node_visitor(), p2_item) != nullptr); + CGAL_warning(std::visit(dag_node_visitor(), p1_item) != nullptr); + CGAL_warning(std::visit(dag_node_visitor(), p2_item) != nullptr); //retrieve the Dag_nodes of the two point-degenerate trapezoid - Dag_node& p1_node = *(boost::apply_visitor(dag_node_visitor(), p1_item)); - Dag_node& p2_node = *(boost::apply_visitor(dag_node_visitor(), p2_item)); + Dag_node& p1_node = *(std::visit(dag_node_visitor(), p1_item)); + Dag_node& p2_node = *(std::visit(dag_node_visitor(), p2_item)); //calculate the immediate lower, central and upper neighborhood of // the curve in the data structure @@ -1725,7 +1725,7 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) //copy trapezoid data from btm and top trapezoids Dag_node& new_node = (new_array.find(sz))->second; ++sz; - Td_active_trapezoid& tr(boost::get(new_node.get_data())); + Td_active_trapezoid& tr(std::get(new_node.get_data())); tr.set_dag_node(&new_node); tr.set_lb(btm_it_tr.lb()); tr.set_lt(top_it_tr.lt()); @@ -1741,13 +1741,13 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) } if (!traits->is_empty_item(tr.lb())) { Td_map_item lb_item = tr.lb(); - Td_active_trapezoid& lb_tr(boost::get(lb_item)); + Td_active_trapezoid& lb_tr(std::get(lb_item)); lb_tr.set_rb(new_node.get_data()); } if (!traits->is_empty_item(tr.lt())) { Td_map_item lt_item = tr.lt(); - Td_active_trapezoid& lt_tr(boost::get(lt_item)); + Td_active_trapezoid& lt_tr(std::get(lt_item)); lt_tr.set_rt(new_node.get_data()); } @@ -1769,23 +1769,23 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) if (!btm_it || (inc_btm && !traits->is_trpz_bottom_equal(old_tr_item, *curr_it))) { - Td_map_item rb(boost::apply_visitor(rb_visitor(), old_tr_item)); + Td_map_item rb(std::visit(rb_visitor(), old_tr_item)); if (!traits->is_empty_item(rb)) { - boost::apply_visitor(set_lb_visitor(last_new_tr_item), rb); + std::visit(set_lb_visitor(last_new_tr_item), rb); //rb->set_lb(last_new_tr); - boost::apply_visitor(set_rb_visitor(rb), last_new_tr_item); + std::visit(set_rb_visitor(rb), last_new_tr_item); //last_new_tr->set_rb(rb); } } if (!top_it || (!inc_btm && !traits->is_trpz_top_equal(old_tr_item,*curr_it))) { - Td_map_item rt(boost::apply_visitor(rt_visitor(), old_tr_item)); + Td_map_item rt(std::visit(rt_visitor(), old_tr_item)); if (!traits->is_empty_item(rt)) { - boost::apply_visitor(set_lt_visitor(last_new_tr_item), rt); + std::visit(set_lt_visitor(last_new_tr_item), rt); //rt->set_lt(last_new_tr); - boost::apply_visitor(set_rt_visitor(rt), last_new_tr_item); + std::visit(set_rt_visitor(rt), last_new_tr_item); //last_new_tr->set_rt(rt); } } @@ -1793,7 +1793,7 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) //set the no longer relevant trapezoids as removed and add the new nodes // as their replacement - Dag_node* last_tr_node(boost::apply_visitor(dag_node_visitor(), + Dag_node* last_tr_node(std::visit(dag_node_visitor(), last_tr_item)); if (prev_inc_btm != inc_btm) { @@ -1827,7 +1827,7 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) // update the dag node pointer in the trapezoid const Dag_node* real = &last_tr_node->left_child(); - boost::apply_visitor(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real); + std::visit(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real); } while(!end_reached); @@ -1853,18 +1853,18 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) m_number_of_dag_nodes += num_of_new_nodes; //new node (tmp) was added const Dag_node* real = &tr.dag_node()->left_child(); - boost::apply_visitor(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real); + std::visit(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real); if (!traits->is_empty_item(rb)) { - boost::apply_visitor(set_rb_visitor(rb),last_new_tr_item); + std::visit(set_rb_visitor(rb),last_new_tr_item); //last_new_tr->set_rb(rb); - boost::apply_visitor(set_lb_visitor(last_new_tr_item),rb); + std::visit(set_lb_visitor(last_new_tr_item),rb); //rb->set_lb(last_new_tr); } if (!traits->is_empty_item(rt)) { - boost::apply_visitor(set_rt_visitor(rt),last_new_tr_item); + std::visit(set_rt_visitor(rt),last_new_tr_item); //last_new_tr->set_rt(rt); - boost::apply_visitor(set_lt_visitor(last_new_tr_item),rt); + std::visit(set_lt_visitor(last_new_tr_item),rt); //rt->set_lt(last_new_tr); } @@ -1876,7 +1876,7 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) //Base_trapezoid_iterator last_mid = mid_it; Dag_node* e_node = nullptr; while (!!++mid_it) { - e_node = boost::apply_visitor(dag_node_visitor(),*last_edge_fragment_it); + e_node = std::visit(dag_node_visitor(),*last_edge_fragment_it); deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove(); last_edge_fragment_it = mid_it; } @@ -1885,7 +1885,7 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) //4. remove adjacency at right end point //remove the final trapezoid representing the removed halfedge - e_node = boost::apply_visitor(dag_node_visitor(),*last_edge_fragment_it); + e_node = std::visit(dag_node_visitor(),*last_edge_fragment_it); deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove(); //----------------------------------- @@ -1945,7 +1945,7 @@ vertical_ray_shoot(const Point & p,Locate_type & lt, p x------x */ - Td_active_trapezoid& tr(boost::get(item)); + Td_active_trapezoid& tr(std::get(item)); if ((up_direction && !tr.is_on_right_boundary() && (traits->compare_curve_end_x_2_object() @@ -2637,9 +2637,9 @@ merge_edge(Halfedge_const_handle he1, Td_map_item mrgp_item = locate(ce, lt); //varifying that all trapezoids are not nullptr and are of type POINT - CGAL_warning(boost::apply_visitor(dag_node_visitor(), leftp_item) != nullptr); - CGAL_warning(boost::apply_visitor(dag_node_visitor(), rightp_item)!= nullptr); - CGAL_warning(boost::apply_visitor(dag_node_visitor(), mrgp_item) != nullptr); + CGAL_warning(std::visit(dag_node_visitor(), leftp_item) != nullptr); + CGAL_warning(std::visit(dag_node_visitor(), rightp_item)!= nullptr); + CGAL_warning(std::visit(dag_node_visitor(), mrgp_item) != nullptr); //define the left curve and the right curve, according // to the common point (that is merged) @@ -2679,8 +2679,8 @@ merge_edge(Halfedge_const_handle he1, #endif //get the nodes of leftmost point and merge point - Dag_node& leftp_node = *(boost::apply_visitor(dag_node_visitor(), leftp_item)); - Dag_node& mrgp_node = *(boost::apply_visitor(dag_node_visitor(), mrgp_item)); + Dag_node& leftp_node = *(std::visit(dag_node_visitor(), leftp_item)); + Dag_node& mrgp_node = *(std::visit(dag_node_visitor(), mrgp_item)); //set iterators for below left curve, on left curve & above left curve In_face_iterator @@ -2760,15 +2760,15 @@ merge_edge(Halfedge_const_handle he1, merge_if_possible(below_cv_left, below_cv_right); // mark older trapezoids as inactive - nodes depth are updated here - Dag_node* above_cv_right_node(boost::apply_visitor(dag_node_visitor(), + Dag_node* above_cv_right_node(std::visit(dag_node_visitor(), above_cv_right)); - Dag_node* above_cv_left_node(boost::apply_visitor(dag_node_visitor(), + Dag_node* above_cv_left_node(std::visit(dag_node_visitor(), above_cv_left)); deactivate_trapezoid( *above_cv_right_node, above_cv_left_node); //above_cv_right->remove(above_cv_left->dag_node()); - Dag_node* below_cv_right_node(boost::apply_visitor(dag_node_visitor(), + Dag_node* below_cv_right_node(std::visit(dag_node_visitor(), below_cv_right)); - Dag_node* below_cv_left_node(boost::apply_visitor(dag_node_visitor(), + Dag_node* below_cv_left_node(std::visit(dag_node_visitor(), below_cv_left)); deactivate_trapezoid( *below_cv_right_node, below_cv_left_node); //below_cv_right->remove(below_cv_left->dag_node()); @@ -2788,7 +2788,7 @@ merge_edge(Halfedge_const_handle he1, CGAL_assertion(traits->is_td_edge(on_cv_left) && traits->is_active(on_cv_left)); - Td_active_edge& e_left(boost::get(on_cv_left)); + Td_active_edge& e_left(std::get(on_cv_left)); e_left.set_next(on_cv_right); CGAL_assertion(traits->is_td_edge(on_cv_right) && @@ -2830,17 +2830,17 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node, if (!minus_inf && !plus_inf) { Td_map_item min_node_item(min_node.get_data()); if (traits->is_fictitious_vertex(min_node_item)) { - const Curve_end min_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),min_node_item))); + const Curve_end min_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),min_node_item))); Td_map_item max_node_item(max_node.get_data()); if (traits->is_fictitious_vertex(max_node_item)) { - const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item))); + const Curve_end max_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),max_node_item))); //min-fict, max-fict if (!is_end_point_left_low(min_ce, max_ce)) return 0; } else { - const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(), + const Point& max_p(std::visit(point_for_vertex_visitor(), max_node_item)); //min-fict, max-pt @@ -2849,18 +2849,18 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node, } } else { - const Point& min_p(boost::apply_visitor(point_for_vertex_visitor(), + const Point& min_p(std::visit(point_for_vertex_visitor(), min_node_item)); Td_map_item max_node_item(max_node.get_data()); if (traits->is_fictitious_vertex(max_node_item)) { - const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item))); + const Curve_end max_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),max_node_item))); //min-pt, max-fict if (!is_end_point_left_low(min_p, max_ce)) return 0; } else { - const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(), + const Point& max_p(std::visit(point_for_vertex_visitor(), max_node_item)); //min-pt, max-pt @@ -2893,19 +2893,19 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node, if (!minus_inf) { Td_map_item min_node_item(min_node.get_data()); if (traits->is_fictitious_vertex(min_node_item)) { - const Curve_end min_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),min_node_item))); + const Curve_end min_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),min_node_item))); //if smaller than the point represented by min_node - //if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), min_ce)) || - // (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), min_ce) )) + //if ((is_fict_vtx && is_end_point_left_low(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), min_ce)) || + // (!is_fict_vtx && is_end_point_left_low(std::visit(point_for_vertex_visitor(), curr_item), min_ce) )) if (is_end_point_right_top(min_ce, node)) { new_min_node = min_node; } } else { - const Point& min_p(boost::apply_visitor(point_for_vertex_visitor(),min_node_item)); + const Point& min_p(std::visit(point_for_vertex_visitor(),min_node_item)); //if smaller than the point represented by min_node - //if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), min_p)) || - // (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), min_p) )) + //if ((is_fict_vtx && is_end_point_left_low(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), min_p)) || + // (!is_fict_vtx && is_end_point_left_low(std::visit(point_for_vertex_visitor(), curr_item), min_p) )) if (is_end_point_right_top(min_p, node)) { new_min_node = min_node; } @@ -2917,21 +2917,21 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node, if (!plus_inf) { Td_map_item max_node_item(max_node.get_data()); if (traits->is_fictitious_vertex(max_node_item)) { - const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item))); + const Curve_end max_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),max_node_item))); //if larger than the point represented by max_node - //if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), max_ce)) || - // (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), max_ce) )) + //if ((is_fict_vtx && is_end_point_right_top(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), max_ce)) || + // (!is_fict_vtx && is_end_point_right_top(std::visit(point_for_vertex_visitor(), curr_item), max_ce) )) if (is_end_point_left_low(max_ce, node)) { new_max_node = max_node; } } else { - const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(), + const Point& max_p(std::visit(point_for_vertex_visitor(), max_node_item)); //if smaller than the point represented by min_node - //if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), max_p)) || - // (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), max_p) )) + //if ((is_fict_vtx && is_end_point_right_top(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), max_p)) || + // (!is_fict_vtx && is_end_point_right_top(std::visit(point_for_vertex_visitor(), curr_item), max_p) )) if (is_end_point_left_low(max_p, node)) { new_max_node = max_node; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h index db555da63f4..8516cc85be2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h @@ -19,7 +19,7 @@ // The macro CGAL_ARR_POINT_LOCATION_VERSION controls which version of the // point location is used. Currently two values are supported: // 1. Point location with CGAL::Object -// 2. Point location with std::optional > +// 2. Point location with std::optional > // The default value is 2. #if !defined(CGAL_ARR_POINT_LOCATION_VERSION) @@ -29,7 +29,7 @@ #include #include -#include +#include #ifdef CGAL_CFG_BOOST_VARIANT_SWAP_BUG #if CGAL_ARR_POINT_LOCATION_VERSION > 1 @@ -64,7 +64,7 @@ struct Arr_point_location_result { #if CGAL_ARR_POINT_LOCATION_VERSION < 2 typedef CGAL::Object Type; #else - typedef typename boost::variant Type; #endif @@ -73,7 +73,7 @@ struct Arr_point_location_result { // This function returns either make_object() or a result_type constructor // to generate return values. The Object version takes a dummy template // argument, which is needed for the return of the other option, e.g., - // std::optional >. + // std::optional >. // In theory a one parameter variant could be returned, but this _could_ // lead to conversion overhead, and so we rather go for the real type. // Overloads for empty returns are also provided. @@ -99,7 +99,7 @@ struct Arr_point_location_result { template static - inline const T* assign(const Type* obj) { return boost::get(obj); } + inline const T* assign(const Type* obj) { return std::get(obj); } #endif // CGAL_ARR_POINT_LOCATION_VERSION < 2 //this one is only to remove warnings in functions diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h index db9b12395f9..4998f53d646 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -185,9 +185,9 @@ public: OutputIterator operator_impl(const Curve_2& cv, OutputIterator oi, Arr_all_sides_oblivious_tag) const { - typedef boost::variant + typedef std::variant Make_x_monotone_subresult; - typedef boost::variant + typedef std::variant Make_x_monotone_result; // If the polycurve is empty, return. @@ -212,7 +212,7 @@ public: for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its) make_seg_x_monotone(*its, std::back_inserter(x_seg_objects)); auto it = x_seg_objects.begin(); - const auto* x_seg_p = boost::get(&(*it)); + const auto* x_seg_p = std::get(&(*it)); #if ! defined (CGAL_NO_ASSERTIONS) CGAL_assertion(x_seg_p != nullptr); #endif @@ -260,7 +260,7 @@ public: #endif for (++it; it != x_seg_objects.end(); ++it) { - const auto* x_seg_p = boost::get(&(*it)); + const auto* x_seg_p = std::get(&(*it)); #if ! defined (CGAL_NO_ASSERTIONS) CGAL_assertion(x_seg_p != nullptr); #endif @@ -318,9 +318,9 @@ public: OutputIterator operator_impl(const Curve_2& cv, OutputIterator oi, Arr_not_all_sides_oblivious_tag) const { - typedef boost::variant + typedef std::variant Make_x_monotone_subresult; - typedef boost::variant + typedef std::variant Make_x_monotone_result; // If the polycurve is empty, return. @@ -350,7 +350,7 @@ public: for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its) make_seg_x_monotone(*its, std::back_inserter(x_seg_objects)); auto it = x_seg_objects.begin(); - const auto* x_seg_p = boost::get(&(*it)); + const auto* x_seg_p = std::get(&(*it)); #if ! defined (CGAL_NO_ASSERTIONS) CGAL_assertion(x_seg_p != nullptr); #endif @@ -398,7 +398,7 @@ public: #endif for (++it; it != x_seg_objects.end(); ++it) { - const auto* x_seg_p = boost::get(&(*it)); + const auto* x_seg_p = std::get(&(*it)); #if ! defined (CGAL_NO_ASSERTIONS) CGAL_assertion(x_seg_p != nullptr); #endif @@ -696,9 +696,9 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_base_result; - typedef boost::variant + typedef std::variant Intersection_result; const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2(); @@ -824,7 +824,7 @@ public: intersect(cv1[i1], cv2[i2], std::back_inserter(xections)); for (const auto& xection : xections) { const X_monotone_subcurve_2* subcv_p = - boost::get(&xection); + std::get(&xection); if (subcv_p != nullptr) { ocv.push_back(*subcv_p); oi = output_ocv (ocv, invert_ocv, oi); @@ -832,7 +832,7 @@ public: } const Intersection_point* p_p = - boost::get(&xection); + std::get(&xection); if (p_p != nullptr) *oi++ = Intersection_result(*p_p); } } @@ -846,7 +846,7 @@ public: for (const auto& item : sub_xections) { const X_monotone_subcurve_2* x_seg = - boost::get(&item); + std::get(&item); if (x_seg != nullptr) { X_monotone_subcurve_2 seg = *x_seg; // We maintain the variant that if the input curves have opposite @@ -863,7 +863,7 @@ public: } const Intersection_point* p_ptr = - boost::get(&item); + std::get(&item); if (p_ptr != nullptr) { // Any point that is not equal to the max_vertex of the // subcurve should be inserted into oi. @@ -990,7 +990,7 @@ public: (std::vector& ocv, bool invert_ocv, OutputIterator oi) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; X_monotone_curve_2 curve; if (invert_ocv) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h index da8875c4768..bb418c5d87b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h @@ -2038,7 +2038,7 @@ public: OutputIterator intersect(const Self& arc, OutputIterator oi, const Cache& cache) const { - typedef boost::variant Intersection_result; + typedef std::variant Intersection_result; CGAL_precondition(this->is_valid()); CGAL_precondition(this->is_continuous()); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h index 6e775b4917f..f908224fe26 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h @@ -827,7 +827,7 @@ public: template OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { - typedef boost::variant + typedef std::variant Make_x_monotone_result; // Make the rational arc continuous. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h index 1e3b908faa6..b34649af583 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h @@ -25,7 +25,7 @@ #include -#include +#include #include #include @@ -565,7 +565,7 @@ public: OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { // Wrap the segment with a variant. - typedef boost::variant + typedef std::variant Make_x_monotone_result; *oi++ = Make_x_monotone_result(cv); return oi; @@ -705,7 +705,7 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; // Early ending with Bbox overlapping test @@ -723,7 +723,7 @@ public: CGAL_assertion(bool(res)); // Check if we have a single intersection point. - const Point_2* ip = boost::get(&*res); + const Point_2* ip = std::get(&*res); if (ip != nullptr) { CGAL_assertion(cv1.is_vertical() ? m_traits.is_in_y_range_2_object()(cv1, *ip) : diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h index 54264ab18e6..a042f80a584 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h @@ -154,14 +154,14 @@ public: OutputIterator insert(const Vector_3 & normal1, const Vector_3 & normal2, OutputIterator oi) { - typedef boost::variant + typedef std::variant Make_x_monotone_result; std::list x_objects; make_x_monotone(normal1, normal2, std::back_inserter(x_objects)); auto it = x_objects.begin(); - const auto* xc = boost::get(&(*it)); + const auto* xc = std::get(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "1.a. insert_in_face_interior(" << *xc << ")" << std::endl; #endif @@ -172,7 +172,7 @@ public: ++it; if (it == x_objects.end()) return oi; - xc = boost::get(&(*it)); + xc = std::get(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "1.b. insert_from_vertex(" << *xc << ")" << std::endl; #endif @@ -195,14 +195,14 @@ public: const Vector_3 & normal2, OutputIterator oi) { - typedef boost::variant + typedef std::variant Make_x_monotone_result; std::list x_objects; make_x_monotone(normal1, normal2, std::back_inserter(x_objects)); auto it = x_objects.begin(); - const auto* xc = boost::get(&(*it)); + const auto* xc = std::get(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "2.a. insert_from_vertex(" << *xc << ", " << vertex1->point() << ")" << std::endl; @@ -216,7 +216,7 @@ public: ++it; if (it == x_objects.end()) return oi; - xc = boost::get(&(*it)); + xc = std::get(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "2.b. insert_from_vertex(" << *xc << ")" << std::endl; #endif @@ -239,7 +239,7 @@ public: const Vector_3 & normal2, Vertex_handle vertex2, OutputIterator oi) { - typedef boost::variant + typedef std::variant Make_x_monotone_result; std::list x_objects; @@ -247,7 +247,7 @@ public: auto it = x_objects.begin(); if (x_objects.size() == 1) { - const auto* xc = boost::get(&(*it)); + const auto* xc = std::get(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "3. insert_from_vertex(" << *xc << ")" << std::endl; #endif @@ -258,8 +258,8 @@ public: return oi; } - const X_monotone_curve_2* xc1 = boost::get(&(*it++)); - const X_monotone_curve_2* xc2 = boost::get(&(*it)); + const X_monotone_curve_2* xc1 = std::get(&(*it++)); + const X_monotone_curve_2* xc2 = std::get(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "3.a. insert_from_vertex(" << *xc2 << ")" << std::endl; @@ -294,13 +294,13 @@ public: const Vector_3 & normal2, Vertex_handle vertex2, OutputIterator oi) { - typedef boost::variant + typedef std::variant Make_x_monotone_result; std::list x_objects; make_x_monotone(normal1, normal2, std::back_inserter(x_objects)); auto it = x_objects.begin(); if (x_objects.size() == 1) { - const auto* xc = boost::get(&(*it)); + const auto* xc = std::get(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "4. insert_at_vertices(" << *xc << ")" << std::endl; #endif @@ -308,8 +308,8 @@ public: return oi; } - const X_monotone_curve_2 * xc1 = boost::get(&(*it++)); - const X_monotone_curve_2 * xc2 = boost::get(&(*it)); + const X_monotone_curve_2 * xc1 = std::get(&(*it++)); + const X_monotone_curve_2 * xc2 = std::get(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "4.a. insert_from_vertex(" << *xc1 diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h index 5116ef4ca45..78eb6bc2f47 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h @@ -46,7 +46,7 @@ void Arr_transform_on_sphere(Arrangement & arr, typedef typename Arrangement::Halfedge_around_vertex_circulator Halfedge_around_vertex_circulator; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; const Geometry_traits_2 * geom_traits = arr.geometry_traits(); Topology_traits * topol_traits = arr.topology_traits(); @@ -156,10 +156,10 @@ void Arr_transform_on_sphere(Arrangement & arr, auto it = objects.begin(); // The curve that its left vertex lies on the identification curve - const auto* sub_cv1 = boost::get(&(*it)); + const auto* sub_cv1 = std::get(&(*it)); ++it; //The curve that its right vertex lies on the identification curve - const auto* sub_cv2 = boost::get(&(*it)); + const auto* sub_cv2 = std::get(&(*it)); bool eq1 = (*sub_cv1).source() == hei1->source()->point(); bool eq2 = (*sub_cv2).target() == hei1->target()->point(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h index 97e451bda5f..edb2a63f995 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h @@ -506,7 +506,7 @@ public: * \pre The curve has a boundary condition in either x or y. * \return An object that contains the curve end. */ - std::optional > + std::optional > place_boundary_vertex(Face* f, const X_monotone_curve_2& xc, Arr_curve_end ind, @@ -538,7 +538,7 @@ public: * \pre The curve end is incident to the boundary. * \return An object that contains the curve end. */ - boost::variant + std::variant locate_curve_end(const X_monotone_curve_2& xc, Arr_curve_end ce, Arr_parameter_space ps_x, Arr_parameter_space ps_y); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_vert_decomp_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_vert_decomp_helper.h index b9f94fd92fc..ba76651f9d7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_vert_decomp_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_vert_decomp_helper.h @@ -47,7 +47,7 @@ public: typedef typename Arrangement_2::Face_const_handle Face_const_handle; typedef typename Arrangement_2::Topology_traits Topology_traits; - typedef boost::variant Cell_type; typedef std::optional Vert_type; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h index ef4da091be7..34149d15af3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h @@ -572,7 +572,7 @@ let_me_decide_the_outer_ccb(std::pair< CGAL::Sign, CGAL::Sign> signs1, */ template std::optional - ::Vertex*, typename Arr_spherical_topology_traits_2::Halfedge*> > Arr_spherical_topology_traits_2:: @@ -585,7 +585,7 @@ place_boundary_vertex(Face* /* f */, , Arr_parameter_space ps_y) { - typedef boost::variant Non_optional_result; + typedef std::variant Non_optional_result; typedef std::optional Result; // std::cout << "place_boundary_vertex()" << std::endl; @@ -647,7 +647,7 @@ locate_around_boundary_vertex(Vertex* v, /*! \brief locates a DCEL feature that contains a given curve end. */ template -boost::variant +std::variant ::Vertex*, typename Arr_spherical_topology_traits_2::Halfedge*, typename Arr_spherical_topology_traits_2::Face*> @@ -660,7 +660,7 @@ locate_curve_end(const X_monotone_curve_2& xc, Arr_curve_end ind, , Arr_parameter_space ps_y) { - typedef boost::variant Result; + typedef std::variant Result; // Act according to the boundary conditions. if (ps_y == ARR_TOP_BOUNDARY) { // In case the curve end coincides with the north pole, return the vertex diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h index f83aab57b85..931359c3f11 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h @@ -48,7 +48,7 @@ public: typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Face_const_handle Face_const_handle; - typedef boost::variant Cell_type; typedef std::optional Vert_type; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h index f9c7f957c34..2736919a601 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h @@ -297,7 +297,7 @@ are_equal(const Vertex *v, // template std::optional - ::Vertex*, typename Arr_unb_planar_topology_traits_2::Halfedge*> > Arr_unb_planar_topology_traits_2:: @@ -305,7 +305,7 @@ place_boundary_vertex(Face* f, const X_monotone_curve_2& cv, Arr_curve_end ind, Arr_parameter_space ps_x, Arr_parameter_space ps_y) { - typedef boost::variant Non_optional_result; + typedef std::variant Non_optional_result; typedef std::optional Result; // Get a halfedge on the outer CCB of f and start traversing the CCB. @@ -338,7 +338,7 @@ place_boundary_vertex(Face* f, // Locate a DCEL feature that contains the given unbounded curve end. // template -boost::variant +std::variant ::Vertex*, typename Arr_unb_planar_topology_traits_2::Halfedge*, typename Arr_unb_planar_topology_traits_2::Face*> @@ -346,7 +346,7 @@ Arr_unb_planar_topology_traits_2:: locate_curve_end (const X_monotone_curve_2& cv, Arr_curve_end ind, Arr_parameter_space ps_x, Arr_parameter_space ps_y) { - typedef boost::variant Result; + typedef std::variant Result; // Start traversing the inner CCB of the fictitious face and try to locate // a feature that contains the curve end. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h index befc27bb89f..2b0abaceb4b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h @@ -46,7 +46,7 @@ public: typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Face_const_handle Face_const_handle; - typedef boost::variant Cell_type; typedef std::optional Vert_type; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h index f631bef376a..06f095fb54c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -531,7 +531,7 @@ public: std::cout << "make_x_monotone" << std::endl << " cv: " << cv << std::endl; - typedef boost::variant + typedef std::variant Make_x_monotone_result; std::list container; @@ -540,12 +540,12 @@ public: size_t i = 0; for (auto it = container.begin(); it != container.end(); ++it) { - if (const auto* xcv = boost::get(&*it)) { + if (const auto* xcv = std::get(&*it)) { std::cout << " result[" << i++ << "]: xcv: " << *xcv << std::endl; continue; } - if (const auto* p = boost::get(&*it)) { + if (const auto* p = std::get(&*it)) { std::cout << " result[" << i++ << "]: p: " << *p << std::endl; continue; } @@ -618,7 +618,7 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; if (! m_enabled) return m_object(xcv1, xcv2, oi); @@ -632,13 +632,13 @@ public: unsigned int i = 0; for (const auto& item : container) { - const X_monotone_curve_2* xcv = boost::get(&item); + const X_monotone_curve_2* xcv = std::get(&item); if (xcv != nullptr) { std::cout << " result[" << i++ << "]: xcv: " << *xcv << std::endl; continue; } - const Intersection_point* ip = boost::get(&item); + const Intersection_point* ip = std::get(&item); if (ip != nullptr) { std::cout << " result[" << i++ << "]: p: " << ip->first << ", multiplicity: " << ip->second << std::endl; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h index 86df601c06a..cfe427625df 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h @@ -291,7 +291,7 @@ public: * \return An object that contains the curve end. * In our case this object always wraps a fictitious edge. */ - std::optional > + std::optional > place_boundary_vertex(Face* f, const X_monotone_curve_2& cv, Arr_curve_end ind, @@ -330,7 +330,7 @@ public: * In our case this object may either wrap an unbounded face, * or an edge with an end-vertex at infinity (in case of an overlap). */ - boost::variant + std::variant locate_curve_end(const X_monotone_curve_2& cv, Arr_curve_end ind, Arr_parameter_space ps_x, diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_compute_zone_visitor.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_compute_zone_visitor.h index 27f1a980deb..2abcd426bf4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_compute_zone_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_compute_zone_visitor.h @@ -20,7 +20,7 @@ * Definition of the Arr_compute_zone_visitor class. */ -#include +#include namespace CGAL { @@ -55,7 +55,7 @@ private: const Vertex_handle invalid_v; // Invalid vertex. OutputIterator& out_iter; // for outputting the zone objects. - // Its value type is boost::variant. + // Its value type is std::variant. bool output_left; // Determines whether we should // output the left end point of a // subcurve (to avoid outputting @@ -97,7 +97,7 @@ public: Vertex_handle left_v, Halfedge_handle left_he, Vertex_handle right_v, Halfedge_handle right_he) { - typedef boost::variant + typedef std::variant Zone_result; if (output_left) { @@ -138,7 +138,7 @@ public: Halfedge_handle he, Vertex_handle left_v, Vertex_handle right_v) { - typedef boost::variant + typedef std::variant Zone_result; if (output_left) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h index d98f1c1307c..9c74e4ef9d7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h @@ -643,7 +643,7 @@ public: Tag_false) const { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; std::list intersections; m_self->intersect_2_object()(xcv1, xcv2, back_inserter(intersections)); @@ -3370,7 +3370,7 @@ public: */ class Compare_xy_2 { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; public: @@ -3580,7 +3580,7 @@ public: // Verify the first intersection is an overlap, remove it, and // recursively call. const X_monotone_curve_2* xcv = - boost::get(&(intersections.front())); + std::get(&(intersections.front())); if (! xcv) { CGAL_error_msg("The first intersection is not an overlap!"); return SMALLER; diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h index c39c34099a5..0338b67e73e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h @@ -83,7 +83,7 @@ void insert(Arrangement_on_surface_2& arr, typedef typename Gt2::Point_2 Point_2; typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; // Obtain an arrangement accessor. Arr_accessor arr_access(arr); @@ -100,7 +100,7 @@ void insert(Arrangement_on_surface_2& arr, // Insert each x-monotone curve into the arrangement. for (const auto& x_obj : x_objects) { // Act according to the type of the current object. - const auto* x_curve = boost::get(&x_obj); + const auto* x_curve = std::get(&x_obj); if (x_curve != nullptr) { // Inserting an x-monotone curve: // Initialize the zone-computation object with the given curve. @@ -118,7 +118,7 @@ void insert(Arrangement_on_surface_2& arr, arr_access.notify_after_global_change(); continue; } - const auto* iso_p = boost::get(&x_obj); + const auto* iso_p = std::get(&x_obj); CGAL_assertion(iso_p != nullptr); // Inserting a point into the arrangement: @@ -683,7 +683,7 @@ insert_non_intersecting_curve // The endpoint must not lie on an existing edge, but may coincide with // and existing vertex vh1. - CGAL_precondition_msg(boost::get(&obj1) == nullptr, + CGAL_precondition_msg(std::get(&obj1) == nullptr, "The curve must not intersect an existing edge."); } @@ -691,7 +691,7 @@ insert_non_intersecting_curve // We have a left end with boundary conditions. Use the accessor to locate // the feature that contains it. obj1 = arr_access.locate_curve_end(c, ARR_MIN_END, bx1, by1); - CGAL_precondition_msg(boost::get(&obj1) == nullptr, + CGAL_precondition_msg(std::get(&obj1) == nullptr, "The curve must not overlap an existing edge."); } vh1 = Pl_result::template assign(&obj1); @@ -710,7 +710,7 @@ insert_non_intersecting_curve // The endpoint must not lie on an existing edge, but may coincide with // and existing vertex vh2. - CGAL_precondition_msg(boost::get(&obj2) == nullptr, + CGAL_precondition_msg(std::get(&obj2) == nullptr, "The curve must not intersect an existing edge."); } else { @@ -721,7 +721,7 @@ insert_non_intersecting_curve // << ", by2: " << by2 // << std::endl; obj2 = arr_access.locate_curve_end(c, ARR_MAX_END, bx2, by2); - CGAL_precondition_msg(boost::get(&obj2) == nullptr, + CGAL_precondition_msg(std::get(&obj2) == nullptr, "The curve must not overlap an existing edge."); } vh2 = Pl_result::template assign(&obj2); @@ -766,8 +766,8 @@ insert_non_intersecting_curve // we must insert the curve in the interior of a face. // In this case insert_in_face_interior() already returns a halfedge // directed from left to right. - const Face_const_handle* fh1 = boost::get(&obj1); - const Face_const_handle* fh2 = boost::get(&obj2); + const Face_const_handle* fh1 = std::get(&obj1); + const Face_const_handle* fh2 = std::get(&obj2); // std::cout << arr << std::endl; // std::cout << "(*fh1)->number_of_outer_ccbs(): " @@ -1144,14 +1144,14 @@ insert_point(Arrangement_on_surface_2& arr, arr_access.notify_before_global_change(); - const Face_const_handle* fh = boost::get(&obj); + const Face_const_handle* fh = std::get(&obj); if (fh != nullptr) { // p lies inside a face: Insert it as an isolated vertex it the interior of // this face. vh_for_p = arr.insert_in_face_interior(p, arr.non_const_handle(*fh)); } else { - const Halfedge_const_handle* hh = boost::get(&obj); + const Halfedge_const_handle* hh = std::get(&obj); if (hh != nullptr) { // p lies in the interior of an edge: Split this edge to create a new // vertex associated with p. @@ -1167,7 +1167,7 @@ insert_point(Arrangement_on_surface_2& arr, } else { // p lies on an existing vertex, so we just update this vertex. - const Vertex_const_handle* vh = boost::get(&obj); + const Vertex_const_handle* vh = std::get(&obj); CGAL_assertion(vh != nullptr); vh_for_p = arr.modify_vertex (arr.non_const_handle (*vh), p); } @@ -1381,14 +1381,14 @@ is_valid(const Arrangement_on_surface_2& arr) auto obj = def_pl.ray_shoot_down(curr_v->point()); // if (CGAL::assign(he_below, obj)) { - if (auto* he_below_p = boost::get(&obj)) { + if (auto* he_below_p = std::get(&obj)) { // Hit an edge; take the incident face of the halfedge directed to the // right. auto he_below = *he_below_p; in_face = (he_below->direction() == ARR_RIGHT_TO_LEFT) ? he_below->twin()->face() : he_below->face(); } - else if (auto* v_below_p = boost::get(&obj)) { + else if (auto* v_below_p = std::get(&obj)) { auto v_below = *v_below_p; // Hit a vertex. if (v_below->is_isolated()) in_face = v_below->face(); @@ -1446,7 +1446,7 @@ is_valid(const Arrangement_on_surface_2& arr) } } else { - auto* in_face_p = boost::get(&obj); + auto* in_face_p = std::get(&obj); CGAL_assertion(in_face_p); in_face = *in_face_p; // Hit nothing (an unbounded face is returned). @@ -1584,7 +1584,7 @@ do_intersect(Arrangement_on_surface_2& arr, typedef typename Gt2::Point_2 Point_2; typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; typedef typename Arr::Face_const_handle Face_const_handle; const Traits_adaptor_2* traits = @@ -1596,20 +1596,20 @@ do_intersect(Arrangement_on_surface_2& arr, // Insert each x-monotone curve into the arrangement. for (const auto& x_obj : x_objects) { // Act according to the type of the current object. - const X_monotone_curve_2* x_curve = boost::get(&x_obj); + const X_monotone_curve_2* x_curve = std::get(&x_obj); if (x_curve != nullptr) { // Check if the x-monotone subcurve intersects the arrangement. if (do_intersect(arr, *x_curve, pl) == true) return true; continue; } - const Point_2* iso_p = boost::get(&x_obj); + const Point_2* iso_p = std::get(&x_obj); CGAL_assertion(iso_p != nullptr); // Check whether the isolated point lies inside a face (otherwise, // it coincides with a vertex or an edge). auto obj = pl.locate(*iso_p); - if (boost::get(&x_obj) != nullptr) return true; + if (std::get(&x_obj) != nullptr) return true; } // If we reached here, the curve does not intersect the arrangement. diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h index 78e0850352d..cbadba8f07a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h @@ -31,7 +31,7 @@ * class-template. */ -#include +#include #include #include @@ -2253,7 +2253,7 @@ _place_and_set_curve_end(DFace* f, return v; } - DHalfedge** fict_he_p = boost::get(&*obj); + DHalfedge** fict_he_p = std::get(&*obj); if (fict_he_p != nullptr) { DHalfedge* fict_he = *fict_he_p; CGAL_assertion(fict_he != nullptr); @@ -2273,7 +2273,7 @@ _place_and_set_curve_end(DFace* f, Halfedge_handle((*p_pred)->next())); return v; } - DVertex** v_p = boost::get(&*obj); + DVertex** v_p = std::get(&*obj); CGAL_assertion(v_p != nullptr); DVertex* v = *v_p; CGAL_assertion(v != nullptr); diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h index feb429273ee..484f2a46efe 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h @@ -103,7 +103,7 @@ void Arrangement_zone_2::compute_zone() const Vertex_const_handle* vh; const Halfedge_const_handle* hh; - if ((vh = boost::get(&m_obj)) != nullptr) { + if ((vh = std::get(&m_obj)) != nullptr) { CGAL_assertion(m_has_left_pt); // The left endpoint coincides with an existing vertex: @@ -125,7 +125,7 @@ void Arrangement_zone_2::compute_zone() #endif } - else if ((hh = boost::get(&m_obj)) != nullptr) { + else if ((hh = std::get(&m_obj)) != nullptr) { if (m_has_left_pt) { // Obtain the right halfedge from the halfedge-pair containing m_left_pt // in their interior. @@ -139,7 +139,7 @@ void Arrangement_zone_2::compute_zone() // Compute the overlapping subcurve. bool dummy; auto obj = _compute_next_intersection(m_intersect_he, false, dummy); - m_overlap_cv = boost::get(*obj); + m_overlap_cv = std::get(*obj); // Remove the overlap from the map. _remove_next_intersection(m_intersect_he); @@ -155,7 +155,7 @@ void Arrangement_zone_2::compute_zone() bool dummy; auto obj = _compute_next_intersection(m_intersect_he, false, dummy); - m_overlap_cv = boost::get(*obj); + m_overlap_cv = std::get(*obj); // Remove the overlap from the map. _remove_next_intersection(m_intersect_he); @@ -166,7 +166,7 @@ void Arrangement_zone_2::compute_zone() } else { // The left endpoint lies inside a face. - const Face_const_handle* fh = boost::get(&m_obj); + const Face_const_handle* fh = std::get(&m_obj); CGAL_assertion_msg(fh != nullptr, "Invalid object returned by the point-location query."); @@ -213,7 +213,7 @@ void Arrangement_zone_2::compute_zone() // Compute the overlapping subcurve to the right of curr_v. bool dummy; auto obj = _compute_next_intersection(m_intersect_he, false, dummy); - m_overlap_cv = boost::get(*obj); + m_overlap_cv = std::get(*obj); // Remove the overlap from the map. _remove_next_intersection(m_intersect_he); @@ -546,7 +546,7 @@ _compute_next_intersection(Halfedge_handle he, // (if the left point exists). while (! inter_list.empty()) { // Compare that current object with m_left_pt (if exists). - ip = boost::get(&(inter_list.front())); + ip = std::get(&(inter_list.front())); if (ip != nullptr) { // We have an intersection point if (m_left_on_boundary) { @@ -570,7 +570,7 @@ _compute_next_intersection(Halfedge_handle he, } else { // We have an overlapping subcurve. - icv = boost::get(&(inter_list.front())); + icv = std::get(&(inter_list.front())); CGAL_assertion(icv != nullptr); if (is_closed(*icv, ARR_MIN_END)) { @@ -608,7 +608,7 @@ _compute_next_intersection(Halfedge_handle he, // Discard all intersection lying to the left of m_left_pt (if exists). while (! inter_list.empty()) { // Compare that current object with m_left_pt (if exists). - ip = boost::get(&(inter_list.front())); + ip = std::get(&(inter_list.front())); if (ip != nullptr) { // We have an intersection point - @@ -638,7 +638,7 @@ _compute_next_intersection(Halfedge_handle he, } else { // We have an overlapping subcurve. - icv = boost::get(&(inter_list.front())); + icv = std::get(&(inter_list.front())); CGAL_assertion(icv != nullptr); if (is_closed(*icv, ARR_MIN_END)) { @@ -832,7 +832,7 @@ _leftmost_intersection(Ccb_halfedge_circulator he_curr, bool on_boundary, if (iobj) { // We have found an intersection (either a simple point or an // overlapping x-monotone curve). - const Intersection_point* int_p = boost::get(&*iobj); + const Intersection_point* int_p = std::get(&*iobj); if (int_p != nullptr) { Point_2 ip = int_p->first; @@ -854,7 +854,7 @@ _leftmost_intersection(Ccb_halfedge_circulator he_curr, bool on_boundary, else { // We have located an overlapping curve. Assign ip as its left // endpoint. - const X_monotone_curve_2* icv = boost::get(&*iobj); + const X_monotone_curve_2* icv = std::get(&*iobj); CGAL_assertion(icv != nullptr); Point_2 ip = min_vertex(*icv); diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h index 71fbfd48f9f..b8acaece4aa 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h @@ -101,7 +101,7 @@ protected: // Types used for caching intersection points: typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; typedef std::optional Optional_intersection; typedef std::list Intersect_list; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h index 89c4b6595f8..a26e51a1e4b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h @@ -1426,7 +1426,7 @@ public: typedef unsigned int Multiplicity; typedef std::pair Intersection_point; - typedef boost::variant Intersection_result; + typedef std::variant Intersection_result; //! the result type typedef CGAL::cpp98::iterator @@ -1905,7 +1905,7 @@ public: { typedef typename Curved_kernel_via_analysis_2::Point_2 Point_2; typedef typename Curved_kernel_via_analysis_2::Arc_2 Arc_2; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; *oi++ = Make_x_monotone_result(cv); return oi; } @@ -1945,7 +1945,7 @@ public: typedef typename Curved_kernel_via_analysis_2::Arc_2 Arc_2; typedef typename Curved_kernel_via_analysis_2::Non_x_monotone_arc_2 Non_x_monotone_arc_2; - typedef boost::variant + typedef std::variant Make_x_monotone_result; Curve_analysis_2 curve; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h index 69f9db2015e..aae3aea01e9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h @@ -54,11 +54,11 @@ struct Make_x_monotone_2 : public CGAL::cpp98::binary_function< typename CurvedKernelViaAnalysis_2::Curve_2, CGAL::cpp98::iterator >, CGAL::cpp98::iterator > > { @@ -132,7 +132,7 @@ struct Make_x_monotone_2 : template OutputIterator operator()(Curve_analysis_2 curve, OutputIterator oi) { - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; Construct_arc_2 construct_arc_2 = _m_curved_kernel->construct_arc_2_object(); @@ -290,7 +290,7 @@ private: Coordinate_1 x, std::vector pts, OutputIterator oi) const { - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; Construct_arc_2 construct_arc_2 = _m_curved_kernel->construct_arc_2_object(); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h index 03d6fcadfbe..018992c467b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h @@ -726,7 +726,7 @@ public: typedef typename SweepCurvesAdapter_2::Native_arc_2 Native_arc_2; typedef typename SweepCurvesAdapter_2::Native_point_2 Native_point_2; typedef typename SweepCurvesAdapter_2::Generic_point_2 Generic_point_2; - typedef boost::variant + typedef std::variant Make_x_monotone_result; std::vector objs; @@ -734,11 +734,11 @@ public: make_x_monotone(cv, std::back_inserter(objs)); // sort out normal and degenerate arcs for (auto& obj : objs) { - if (auto* arc = boost::get(&obj)) { + if (auto* arc = std::get(&obj)) { *oi++ = Generic_arc_2(*arc); continue; } - auto* pt = boost::get(&obj); + auto* pt = std::get(&obj); CGAL_assertion(pt); *oi++ = Generic_arc_2(Generic_point_2(*pt)); } diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h index f3de33d7fe7..b7c2907bf58 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h @@ -98,9 +98,9 @@ public: OutputIterator oi) { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; - typedef boost::variant + typedef std::variant Intersection_base_result; Halfedge_handle invalid_he; @@ -120,13 +120,13 @@ public: // X_monotone_curve_2 for (const auto& xection : xections) { const Intersection_point* - p_p = boost::get(&xection); + p_p = std::get(&xection); if (p_p != nullptr) { *oi++ = Intersection_result(xection); continue; } const Base_x_monotone_curve_2* base_cv_p = - boost::get(&xection); + std::get(&xection); CGAL_assertion(base_cv_p); // Add halfedge handles to the resulting curve. diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h index 7a011211706..e0b85f39390 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h @@ -22,9 +22,8 @@ * Definition of the Arr_overlay_ss_visitor class-template. */ -#include +#include #include -#include #include @@ -344,7 +343,7 @@ protected: //@} /*! A visitor class to facilitate the call to create_vertex(). */ - class Create_vertex_visitor : public boost::static_visitor<> { + class Create_vertex_visitor { private: Overlay_traits* m_overlay_traits; Vertex_handle m_vertex_handle; @@ -563,7 +562,7 @@ void Arr_overlay_ss_visitor::after_sweep() const Cell_handle_blue& blue_handle = info.second; Vertex_handle v = (*it).first; Create_vertex_visitor visitor(m_overlay_traits, v); - boost::apply_visitor(visitor, red_handle, blue_handle); + std::visit(visitor, red_handle, blue_handle); } // When the sweep-line process is over, the remaining arrangement face @@ -938,8 +937,8 @@ _map_boundary_vertices(Event* event, Vertex_handle v, boost::mpl::bool_) const Cell_handle_red* red_handle_p = pt.red_cell_handle(); if (red_handle_p) info.first = *red_handle_p; - if (!boost::get(&(info.first)) && - !boost::get(&(info.second))) + if (!std::get(&(info.first)) && + !std::get(&(info.second))) { // If both, the red and blue, variants do not represent face handles, // they must represt either vertex or edge handles. In this case it is @@ -949,7 +948,7 @@ _map_boundary_vertices(Event* event, Vertex_handle v, boost::mpl::bool_) const Cell_handle_blue& blue_handle = info.second; Vertex_handle v = (*it).first; Create_vertex_visitor visitor(m_overlay_traits, v); - boost::apply_visitor(visitor, red_handle, blue_handle); + std::visit(visitor, red_handle, blue_handle); m_vertices_map.erase(it); } } @@ -1035,7 +1034,7 @@ _create_vertex(Event* event, CGAL_assertion(blue_handle != nullptr); const Vertex_handle_blue& blue_v = - boost::get(*blue_handle); + std::get(*blue_handle); m_overlay_traits->create_vertex(red_f, blue_v, new_v); return; } @@ -1049,13 +1048,13 @@ _create_vertex(Event* event, CGAL_assertion(red_handle != nullptr); const Vertex_handle_red& red_v = - boost::get(*red_handle); + std::get(*red_handle); m_overlay_traits->create_vertex(red_v, blue_f, new_v); return; } Create_vertex_visitor visitor(m_overlay_traits, new_v); - boost::apply_visitor(visitor, *red_handle, *blue_handle); + std::visit(visitor, *red_handle, *blue_handle); } //----------------------------------------------------------------------------- diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h index 717b31a0d37..e981e532658 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h @@ -22,7 +22,7 @@ * Definition of the Arr_overlay_traits_2 class-template. */ -#include +#include #include #include @@ -105,11 +105,11 @@ public: RB_OVERLAP // Red-blue overlap. }; - typedef boost::variant Cell_handle_red; typedef std::optional Optional_cell_red; - typedef boost::variant Cell_handle_blue; typedef std::optional Optional_cell_blue; @@ -323,14 +323,14 @@ public: /*! Obtain the red vertex handle or nullptr if it doesn't exist. */ const Vertex_handle_red* red_vertex_handle() const { - return m_red_cell ? boost::get(&(*m_red_cell)) : nullptr; + return m_red_cell ? std::get(&(*m_red_cell)) : nullptr; } /*! Obtain the blue vertex handle or nullptr if it doesn't exist. */ const Vertex_handle_blue* blue_vertex_handle() const { return - m_blue_cell ? boost::get(&(*m_blue_cell)) : nullptr; + m_blue_cell ? std::get(&(*m_blue_cell)) : nullptr; } }; @@ -371,10 +371,10 @@ public: OutputIterator oi) { typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; typedef std::pair Intersection_base_point; - typedef boost::variant + typedef std::variant Intersection_base_result; // In case the curves originate from the same arrangement, they are @@ -440,7 +440,7 @@ public: // the extended X_monotone_curve_2. for (const auto& xection : xections) { const Intersection_base_point* base_ipt = - boost::get(&xection); + std::get(&xection); if (base_ipt != nullptr) { // We have a red-blue intersection point, so we attach the // intersecting red and blue halfedges to it. @@ -470,7 +470,7 @@ public: } const Base_x_monotone_curve_2* overlap_xcv = - boost::get(&xection); + std::get(&xection); CGAL_assertion(overlap_xcv != nullptr); // We have a red-blue overlap, so we mark the curve accordingly. diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h index 952bf00e183..cf26fa9a773 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h @@ -20,7 +20,7 @@ * Definition of the Arr_vert_decomp_ss_visitor class-template. */ -#include +#include namespace CGAL { @@ -66,7 +66,7 @@ public: typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Face_const_handle Face_const_handle; - typedef boost::variant Cell_type; typedef std::optional Vert_type; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Batched_point_location_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Batched_point_location_test.h index 256d101a386..f84aee4da6d 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Batched_point_location_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Batched_point_location_test.h @@ -45,7 +45,7 @@ public: typedef typename Points_vector::iterator Point_iterator; - typedef typename boost::variant Cell_handle; @@ -226,10 +226,10 @@ compare(const Cell_handle& expected, const Cell_handle& actual) { // Assign object to a face const Face_const_handle* fh_expected = - boost::get(&(expected)); + std::get_if(&(expected)); if (fh_expected) { const Face_const_handle* fh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (fh_actual) { if ((*fh_actual) == (*fh_expected)) return true; @@ -241,13 +241,13 @@ compare(const Cell_handle& expected, const Cell_handle& actual) std::cout << "Error: batched point location!" << std::endl; std::cout << "Expected a face." << std::endl; const Halfedge_const_handle* hh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (hh_actual) { std::cout << "Actual: a halfedge." << std::endl; return false; } const Vertex_const_handle* vh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (vh_actual) { std::cout << "Actual: a vertex." << std::endl; return false; @@ -258,10 +258,10 @@ compare(const Cell_handle& expected, const Cell_handle& actual) // Assign object to a halfedge const Halfedge_const_handle* hh_expected = - boost::get(&(expected)); + std::get_if(&(expected)); if (hh_expected) { const Halfedge_const_handle* hh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (hh_actual) { if (((*hh_actual) == (*hh_expected)) || ((*hh_actual)->twin() == (*hh_expected))) @@ -279,13 +279,13 @@ compare(const Cell_handle& expected, const Cell_handle& actual) std::cout << "Expected: a halfedge, " << (*hh_expected)->curve() << std::endl; const Face_const_handle* fh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (fh_actual) { std::cout << "Actual: a face." << std::endl; return false; } const Vertex_const_handle* vh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (vh_actual) { std::cout << "Actual: a vertex." << std::endl; return false; @@ -296,10 +296,10 @@ compare(const Cell_handle& expected, const Cell_handle& actual) // Assign object to a vertex const Vertex_const_handle* vh_expected = - boost::get(&(expected)); + std::get_if(&(expected)); if (vh_expected) { const Vertex_const_handle* vh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (vh_actual) { if ((*vh_actual) == (*vh_expected)) return true; @@ -313,13 +313,13 @@ compare(const Cell_handle& expected, const Cell_handle& actual) std::cout << "Error: batched point location!"; std::cout << "Expected: a vertex, "<< (*vh_expected)->point() << std::endl; const Face_const_handle* fh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (fh_actual) { std::cout << "Actual: a face" << std::endl; return false; } const Halfedge_const_handle* hh_actual = - boost::get(&(actual)); + std::get_if(&(actual)); if (hh_actual) { std::cout << "Actual: a halfedge." << std::endl; return false; @@ -436,15 +436,15 @@ print(const std::pair& res) // Print the results. std::cout << "The point (" << res.first << ") is located "; if (const Face_const_handle* f = - boost::get(&(res.second))) // inside a face + std::get_if(&(res.second))) // inside a face std::cout << "inside " << (((*f)->is_unbounded()) ? "the unbounded" : "a bounded") << " face." << std::endl; else if (const Halfedge_const_handle* e = - boost::get(&(res.second))) // on an edge + std::get_if(&(res.second))) // on an edge std::cout << "on an edge: " << (*e)->curve() << std::endl; else if (const Vertex_const_handle* v = - boost::get(&(res.second))) // on a vertex + std::get_if(&(res.second))) // on a vertex std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h index 9065587101e..c7fdc1eab1e 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h @@ -693,11 +693,11 @@ bool IO_base_test::read_xsegment(InputStream_& is, Subcurve_2 seg(point_vector.begin(), point_vector.end()); //convert it into x-monotone bezier segment. - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; std::vector objs; bezier_traits.make_x_monotone_2_object()(seg, std::back_inserter(objs)); assert(! objs.empty()); - const auto* x_seg_p = boost::get(&(objs[0])); + const auto* x_seg_p = std::get_if(&(objs[0])); assert(x_seg_p); xseg = *x_seg_p; @@ -720,7 +720,7 @@ bool IO_base_test::read_xcurve(InputStream_& is, unsigned int number_of_segments; is >> number_of_segments; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; auto make_x_monotone = bezier_traits.make_x_monotone_2_object(); if ((type == 'x') || (type == 'X')) { for (unsigned int i=0; i::read_xcurve(InputStream_& is, std::vector objs; make_x_monotone(seg, std::back_inserter(objs)); assert(! objs.empty()); - const auto* x_seg_p = boost::get(&(objs[0])); + const auto* x_seg_p = std::get_if(&(objs[0])); assert(x_seg_p); x_segments.push_back(*x_seg_p); @@ -1470,7 +1470,7 @@ bool IO_base_test::read_xcurve(InputStream_& is, X_monotone_curve_2& xcv) { std::cout << std::endl; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; std::list x_objs; Curve_2 tmp_cv; is >> tmp_cv; @@ -1488,7 +1488,7 @@ bool IO_base_test::read_xcurve(InputStream_& is, size_t id(0); if (! is.eof()) is >> id; std::advance(xoit, id); - const auto* xcv_p = boost::get(&*xoit); + const auto* xcv_p = std::get_if(&*xoit); assert(xcv_p); xcv = *xcv_p; return false; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h index f4b717db180..6b7628a0519 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h @@ -70,7 +70,7 @@ public: typedef std::vector Objects_vector; typedef Objects_vector::iterator Object_iterator; - typedef typename boost::variant Cell_handle; typedef std::vector Variants_vector; @@ -148,7 +148,7 @@ protected: NUM_PL_STRATEGIES }; - typedef boost::variant void deallocate_pl() { - Strategy* strategy = boost::get(m_locators[id].m_variant); + Strategy* strategy = std::get(m_locators[id].m_variant); if (strategy) { delete strategy; m_locators[id].m_variant = static_cast(nullptr); @@ -302,7 +302,7 @@ private: void attach_pl() { if (! m_locators[id].m_active) return; - Strategy* strategy = boost::get(m_locators[id].m_variant); + Strategy* strategy = std::get(m_locators[id].m_variant); strategy->attach(*m_arr); } @@ -311,7 +311,7 @@ private: void attach_pl(Generator* generator) { if (! m_locators[id].m_active) return; - Strategy* strategy = boost::get(m_locators[id].m_variant); + Strategy* strategy = std::get(m_locators[id].m_variant); strategy->attach(*m_arr, generator); } @@ -321,7 +321,7 @@ private: { if (! m_locators[id].m_active) return; const std::string& name = m_locators[id].m_name; - Strategy* strategy = boost::get(m_locators[id].m_variant); + Strategy* strategy = std::get(m_locators[id].m_variant); query(*strategy, name.c_str(), m_query_points.begin(), m_query_points.end(), std::back_inserter(objs)); } @@ -625,7 +625,7 @@ private: #define ATTACH_PL_TRAPEZOID_RIC_NO_GUARANTEE() \ Pl_variant& var = m_locators[TRAPEZOID_RIC_NO_GUARANTEE_PL].m_variant; \ - Trapezoid_ric_pl* strategy = boost::get(var); \ + Trapezoid_ric_pl* strategy = std::get(var); \ strategy->with_guarantees(false); \ attach_pl() @@ -1088,11 +1088,11 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) // Assign and check results for (size_t qi = 0; qi < size; ++qi) { // Assign object to a face - Face_const_handle* fh_ref = boost::get(&(objs[0][qi])); + Face_const_handle* fh_ref = std::get_ifFace_const_handle>(&(objs[0][qi])); if (fh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { Face_const_handle* fh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifFace_const_handle>(&(objs[pl][qi])); if (fh_cur) { if ((*fh_cur) != (*fh_ref)) { std::cout << "Error: point location number " << pl << std::endl; @@ -1107,13 +1107,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) std::cout << "Expected: a face." << std::endl; result += -1; Halfedge_const_handle* hh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifHalfedge_const_handle>(&(objs[pl][qi])); if (hh_cur) { std::cout << "Actual: a halfedge." << std::endl; continue; } Vertex_const_handle* vh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifVertex_const_handle>(&(objs[pl][qi])); if (vh_cur) { std::cout << "Actual: a vertex." << std::endl; continue; @@ -1129,11 +1129,11 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) // Assign object to a halfedge Halfedge_const_handle* hh_ref = - boost::get(&(objs[0][qi])); + std::get_ifHalfedge_const_handle>(&(objs[0][qi])); if (hh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { Halfedge_const_handle* hh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifHalfedge_const_handle>(&(objs[pl][qi])); if (hh_cur) { if (((*hh_cur) != (*hh_ref)) && ((*hh_cur)->twin() != (*hh_ref))) { std::cout << "Error: point location number " << pl << std::endl; @@ -1150,13 +1150,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) << std::endl; result += -1; Face_const_handle* fh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifFace_const_handle>(&(objs[pl][qi])); if (fh_cur) { std::cout << "Actual: a face." << std::endl; continue; } Vertex_const_handle* vh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifVertex_const_handle>(&(objs[pl][qi])); if (vh_cur) { std::cout << "Actual: a vertex." << std::endl; continue; @@ -1168,11 +1168,11 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) // Assign object to a vertex Vertex_const_handle* vh_ref = - boost::get(&(objs[0][qi])); + std::get_ifVertex_const_handle>(&(objs[0][qi])); if (vh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { Vertex_const_handle* vh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifVertex_const_handle>(&(objs[pl][qi])); if (vh_cur) { if ((*vh_cur) != (*vh_ref)) { std::cout << "Error: point location number " << pl << std::endl; @@ -1188,13 +1188,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) std::cout << "Expected: a vertex: "<< (*vh_ref)->point() << std::endl; result += -1; Face_const_handle* fh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifFace_const_handle>(&(objs[pl][qi])); if (fh_cur) { std::cout << "Actual: a face." << std::endl; continue; } Halfedge_const_handle* hh_cur = - boost::get(&(objs[pl][qi])); + std::get_ifHalfedge_const_handle>(&(objs[pl][qi])); if (hh_cur) { std::cout << "Actual: a halfedge." << std::endl; continue; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h index 680ae201d40..fb912860f59 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h @@ -913,7 +913,7 @@ make_x_monotone_wrapper(std::istringstream& str_stream) typedef Geom_traits_T Traits; typedef typename Traits::Point_2 Point_2; typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; CGAL_USE_TYPE(typename Traits::Curve_2); unsigned int id; @@ -934,14 +934,14 @@ make_x_monotone_wrapper(std::istringstream& str_stream) unsigned int id; // The id of the point or x-monotone str_stream >> id; // ... curve respectively - const auto* xcv_ptr = boost::get(&(objs[i])); + const auto* xcv_ptr = std::get_if(&(objs[i])); if (xcv_ptr != nullptr) { if (!this->compare(type, 1u, "type")) return false; if (!this->compare_curves(this->m_xcurves[id], *xcv_ptr)) return false; continue; } - const auto* pt_ptr = boost::get(&(objs[i])); + const auto* pt_ptr = std::get_if(&(objs[i])); assert(pt_ptr != nullptr); if (!this->compare(type, 0u, "type")) return false; if (!this->compare_points(this->m_points[id], *pt_ptr)) return false; @@ -969,7 +969,7 @@ intersect_wrapper(std::istringstream& str_stream) typedef typename Traits::Multiplicity Multiplicity; typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; unsigned int id1, id2; @@ -995,7 +995,7 @@ intersect_wrapper(std::istringstream& str_stream) unsigned int exp_type = 1; const X_monotone_curve_2* cv_p = - boost::get(&(xections[i])); + std::get_if(&(xections[i])); if (cv_p != nullptr) { if (! this->compare(type, exp_type, "type")) return false; @@ -1005,7 +1005,7 @@ intersect_wrapper(std::istringstream& str_stream) exp_type = 0; const Intersection_point* p_p = - boost::get(&(xections[i])); + std::get_if(&(xections[i])); assert(p_p != nullptr); if (! this->compare(type, exp_type, "type")) return false; if (! this->compare_points(this->m_points[id], p_p->first)) return false; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Vertical_decomposition_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Vertical_decomposition_test.h index 881c939b5ff..1fd487652e8 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Vertical_decomposition_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Vertical_decomposition_test.h @@ -44,7 +44,7 @@ public: typedef typename Arrangement::Edge_const_iterator Edge_const_iterator; typedef typename Arrangement::Vertex_const_iterator Vertex_const_iterator; - typedef boost::variant Cell_type; typedef std::optional Vert_type; typedef typename std::pair Vert_pair; @@ -196,14 +196,14 @@ compare(const Result_type& expected, Vert_type actual) auto obj = *actual; // Assign object to a face. - if (const auto* fh_expected = boost::get(&(expected))) { - if (boost::get(&obj)) { + if (const auto* fh_expected = std::get_if(&(expected))) { + if (std::get_if(&obj)) { std::cout << "Error: vertical decomposition!" << std::endl; std::cout << "Expected: a face." << std::endl; std::cout << "Actual: a vertex." << std::endl; return false; } - if (boost::get(&obj)) { + if (std::get_if(&obj)) { std::cout << "Error: vertical decomposition!" << std::endl; std::cout << "Expected: a face." << std::endl; std::cout << "Actual: a halfedge." << std::endl; @@ -213,9 +213,9 @@ compare(const Result_type& expected, Vert_type actual) } // Assign object to a halfedge. - const auto* hh_expected = boost::get(&(expected)); + const auto* hh_expected = std::get_if(&(expected)); if (hh_expected) { - if (const auto* hh_actual = boost::get(&obj)) { + if (const auto* hh_actual = std::get_if(&obj)) { if (*hh_expected == *hh_actual) return true; std::cout << "Error: vertical decomposition!" << std::endl; @@ -230,13 +230,13 @@ compare(const Result_type& expected, Vert_type actual) std::cout << "Expected: a halfedge, " << (*hh_expected)->curve() << std::endl; - if (const auto* vh_actual = boost::get(&obj)) { + if (const auto* vh_actual = std::get_if(&obj)) { std::cout << "Actual: a vertex, " << (*vh_actual)->point() << std::endl; return false; } Face_const_handle fh_actual; - if (boost::get(&obj)) { + if (std::get_if(&obj)) { std::cout << "Actual: a face." << std::endl; return false; } @@ -245,9 +245,9 @@ compare(const Result_type& expected, Vert_type actual) } // Assign object to a vertex. - const auto* vh_expected = boost::get(&(expected)); + const auto* vh_expected = std::get_if(&(expected)); if (vh_expected) { - if (const auto* vh_actual = boost::get(&obj)) { + if (const auto* vh_actual = std::get_if(&obj)) { if (*vh_expected == *vh_actual) return true; std::cout << "Error: vertical decomposition!" << std::endl; @@ -261,12 +261,12 @@ compare(const Result_type& expected, Vert_type actual) std::cout << "Error: vertical decomposition!" << std::endl; std::cout << "Expected: a vertex, " << (*vh_expected)->point() << std::endl; - if (const auto* hh_actual = boost::get(&obj)) { + if (const auto* hh_actual = std::get_if(&obj)) { std::cout << "Actual: a halfedge, " << (*hh_actual)->curve() << std::endl; return false; } - if (boost::get(&obj)) { + if (std::get_if(&obj)) { std::cout << "Actual: a face." << std::endl; return false; } @@ -291,22 +291,22 @@ print(const Vert_decomp_entry& result) assert(obj_below); auto obj = *obj_below; std::cout << " feature below: "; - if (const auto* hh = boost::get(&obj)) + if (const auto* hh = std::get_if(&obj)) std::cout << '[' << (*hh)->curve() << ']'; - else if (const auto* vh = boost::get(&obj)) + else if (const auto* vh = std::get_if(&obj)) std::cout << '(' << (*vh)->point() << ')'; - else if (const auto* fh = boost::get(&obj)) + else if (const auto* fh = std::get_if(&obj)) std::cout << "NONE"; else std::cout << "EMPTY"; assert(obj_above); obj = *obj_above; std::cout << " feature above: "; - if (const auto* hh = boost::get(&obj)) + if (const auto* hh = std::get_if(&obj)) std::cout << '[' << (*hh)->curve() << ']'; - else if (const auto* vh = boost::get(&obj)) + else if (const auto* vh = std::get_if(&obj)) std::cout << '(' << (*vh)->point() << ')'; - else if (const auto* vh = boost::get(&obj)) + else if (const auto* vh = std::get_if(&obj)) std::cout << "NONE"; else std::cout << "EMPTY"; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_arc_polycurve.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_arc_polycurve.cpp index 2856f82b076..ff71cbf9ac9 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_arc_polycurve.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_arc_polycurve.cpp @@ -19,7 +19,7 @@ typedef Sub_traits_2::CoordNT CoordNT; typedef Sub_traits_2::Point_2 Point_2; typedef Sub_traits_2::Curve_2 Subcurve_2; typedef Sub_traits_2::X_monotone_curve_2 Subcurve_x_monotone_2; -typedef boost::variant +typedef std::variant Make_sub_x_monotone_result; void check_equal() @@ -81,8 +81,8 @@ void check_intersect(Traits_2::Make_x_monotone_2 make_x_monotone_2(curve1, std::back_inserter(x_monotone_curves)); make_x_monotone_2(curve2, std::back_inserter(x_monotone_curves)); - const auto* x_curve1 = boost::get(curves[0]); - const auto* x_curve2 = boost::get(curves[1]); + const auto* x_curve1 = std::get(curves[0]); + const auto* x_curve2 = std::get(curves[1]); std::vector Points_of_intersection; @@ -100,7 +100,7 @@ void check_intersect(Traits_2::Make_x_monotone_2 curve3 = Subcurve_2(c6, 1, CGAL::CLOCKWISE, s6, t6); make_x_monotone_2(curve3, std::back_inserter(x_curves)); - const auto* x_curve2 = boost::get<>(&x_curves[2]); + const auto* x_curve2 = std::get<>(&x_curves[2]); Points_of_intersection.clear(); //intersect_2(X_monotone_curve1, X_monotone_curve2, @@ -131,8 +131,8 @@ check_compare_end_points_xy_2(Traits_2::Compare_endpoints_xy_2 std::vector x_curves; make_x_monotone_2(curve1, std::back_inserter(x_curves)); - const auto* x_curve1 = boost::get(&x_curves[0]); - const auto* x_curve2 = boost::get(&x_curves[1]); + const auto* x_curve1 = std::get_if(&x_curves[0]); + const auto* x_curve2 = std::get_if(&x_curves[1]); auto res = compare_endpoints_xy_2(x_curve1); std::cout<< "The first result is: " << res << std::endl; @@ -143,7 +143,7 @@ check_compare_end_points_xy_2(Traits_2::Compare_endpoints_xy_2 Point_2 s2 = Point_2(one_plus_sqrt_3, CoordNT(1)); curve2 = Subcurve_2(circ2, s1, t1); make_x_monotone_2(curve2, std::back_inserter(x_curves)); - const auto* x_curve2 = boost::get(&x_curves[1]); + const auto* x_curve2 = std::get_if(&x_curves[1]); res = compare_endpoints_xy_2(x_curve2); @@ -170,7 +170,7 @@ void check_split(Traits_2::Split_2 split_2, //make x_monotone std::vector x_curves; make_x_monotone_2(curve, std::back_inserter(x_curves)); - const auto* x_curve1 = boost::get(&x_curves[0]); + const auto* x_curve1 = std::get_if(&x_curves[0]); // Subcurve_x_monotone_2 split_x_monotone_curve1, split_x_monotone_curve2 ; //split_2(X_monotone_curve, Kernel::Point_2::Kernel::Point_2(1, 4), @@ -200,8 +200,8 @@ void check_is_vertical(Traits_2::Make_x_monotone_2 //std::vector x_monotone_polycurves; - const auto* x_polycurve1 = boost::get(&x_curves[0]); - const auto* x_polycurve2 = boost::get(&x_curves[1]); + const auto* x_polycurve1 = std::get_if(&x_curves[0]); + const auto* x_polycurve2 = std::get_if(&x_curves[1]); bool res = is_vertical(x_polycurve1); std::cout << "Is_verticle:: The xmonotone curve (quarter circle) is : " @@ -232,8 +232,8 @@ void check_compare_y_at_x_2(Traits_2::Make_x_monotone_2 make_x_monotone_2, for (const auto& cv : curves) make_x_monotone_2(cv, std::back_inserter(x_curves)); - const auto* x_polycurve1 = boost::get(&x_curves[0]); - const auto* x_polycurve2 = boost::get(&x_curves[1]); + const auto* x_polycurve1 = std::get_if(&x_curves[0]); + const auto* x_polycurve2 = std::get_if(&x_curves[1]); Kernel::Point_2 p_test = Kernel::Point_2(3, 1); diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_bezier_polycurve.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_bezier_polycurve.cpp index 9936d4648ec..f36f4cc5b2a 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_bezier_polycurve.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_bezier_polycurve.cpp @@ -34,7 +34,7 @@ typedef CGAL::Arr_polyline_traits_2 Bezier_polycurve_traits; typedef Bezier_polycurve_traits::Curve_2 Polycurve_bezier; typedef Bezier_polycurve_traits::X_monotone_curve_2 X_polycurve_bezier; -typedef boost::variant +typedef std::variant Make_x_monotone_result; int main (int argc, char *argv[]) @@ -60,7 +60,7 @@ int main (int argc, char *argv[]) //creating x-mono bezier bezier_traits.make_x_monotone_2_object()(curve_1, std::back_inserter(objs)); //std::cout << "number of x_curves: " << obj_vector.size() << std::endl; - const auto* x_curve_1 = boost::get(&(obj_vector[0])); + const auto* x_curve_1 = std::get_if(&(obj_vector[0])); assert(x_curve_1); //std::cout << x_curve << std::endl; @@ -74,7 +74,7 @@ int main (int argc, char *argv[]) //creating x-monotne obj_vector.clear(); bezier_traits.make_x_monotone_2_object()( curve_2, std::back_inserter(objs)); - const auto* x_curve_2 = boost::get(&(obj_vector[0])); + const auto* x_curve_2 = std::get_if(&(obj_vector[0])); //push curves into polyline vectors curves_vector.push_back(curve_1); diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_circular_arc_polycurve.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_circular_arc_polycurve.cpp index 32395799ae5..9c65e0f3ca9 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_circular_arc_polycurve.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_circular_arc_polycurve.cpp @@ -92,7 +92,7 @@ void check_make_x_monotone(typename GeometryTraits::Curve_2 cv, typedef typename Geometry_traits_2::Point_2 Point_2; typedef typename Geometry_traits_2::X_monotone_traits_2 X_monotone_traits_2; - typedef boost::variant + typedef std::variant Make_x_monotone_result; std::vector objs; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_conic_polycurve.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_conic_polycurve.cpp index 02f85dc22e7..0ef7631c479 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_conic_polycurve.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_conic_polycurve.cpp @@ -110,7 +110,7 @@ void check_equal() typedef typename Traits::Point_2 Point_2; typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; std::vector intersection_points; @@ -644,7 +644,7 @@ void check_make_x_monotne_curve(const typename GeometryTraits::Curve_2& c1) { typename GeometryTraits::Point_2 Point_2; typename GeometryTraits::X_monotone_curve_2 X_monotone_curve_2; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; Polycurve_conic_traits_2 traits; std::vector objs; traits.make_x_monotone_2_object()(c1, std::back_inserter(objs)); diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp index 07cfc97e199..3dd0399d9dd 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp @@ -22,17 +22,17 @@ void vertical_ray_shooting_query if (shoot_up) std::cout << " Shooting up from (" << q << ") : "; else std::cout << " Shooting down from (" << q << ") : "; - if (auto* e_p = boost::get(&obj)) { + if (auto* e_p = std::get_if(&obj)) { // We hit an edge: std::cout << "hit an edge: " << (*e_p)->curve() << std::endl; } - else if (auto* v_p = boost::get(&obj)) { + else if (auto* v_p = std::get_if(&obj)) { // We hit a vertex: if ((*v_p)->is_isolated()) std::cout << "hit an isolated vertex: " << (*v_p)->point() << std::endl; else std::cout << "hit a vertex: " << (*v_p)->point() << std::endl; } - else if (auto* f_p = boost::get(&obj)) { + else if (auto* f_p = std::get_if(&obj)) { // We did not hit anything: assert((*f_p)->is_unbounded()); diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_zone.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_zone.cpp index 54291b4bf5a..78b9cbadd4d 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_zone.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_zone.cpp @@ -17,7 +17,7 @@ typedef CGAL::Arrangement_2 Arrangement_2; typedef Arrangement_2::Vertex_handle Vertex_handle; typedef Arrangement_2::Halfedge_handle Halfedge_handle; typedef Arrangement_2::Face_handle Face_handle; -typedef boost::variant +typedef std::variant Zone_result; #define N_SEGMENTS 3 diff --git a/BGL/examples/BGL_triangulation_2/dijkstra.cpp b/BGL/examples/BGL_triangulation_2/dijkstra.cpp index 3a1b061eb9e..87c308e18bb 100644 --- a/BGL/examples/BGL_triangulation_2/dijkstra.cpp +++ b/BGL/examples/BGL_triangulation_2/dijkstra.cpp @@ -60,9 +60,9 @@ int main(int argc,char* argv[]) for(vertex_descriptor vd : vertices(tr)) { std::cout << vd->point() << " [" << vertex_id_map[vd] << "] "; - std::cout << " has distance = " << boost::get(distance_pmap,vd) + std::cout << " has distance = " << std::get(distance_pmap,vd) << " and predecessor "; - vd = boost::get(predecessor_pmap,vd); + vd = std::get(predecessor_pmap,vd); std::cout << vd->point() << " [" << vertex_id_map[vd] << "]\n "; } diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h index 0d90fbacb2f..0ceae84b195 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h @@ -18,7 +18,7 @@ public: /*! computes the intersections of `xc1` and `xc2` and inserts them in an * ascending lexicographic \f$ xy\f$-order into a range beginning at - * `oi`. The type `OutputIterator` dereferences a `boost::variant` of either the + * `oi`. The type `OutputIterator` dereferences a `std::variant` of either the * type `pair` or the type * `ArrDirectionalTraits::X_monotone_curve_2`. An object of the former type diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h index ef8cc06083f..d5372d0be79 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h @@ -160,10 +160,10 @@ public: typedef const std::pair Intersection_base_point; - typedef boost::variant + typedef std::variant Intersection_base_result; typedef const std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; const auto* base_traits = m_traits.m_base_traits; @@ -183,7 +183,7 @@ public: // the extenede X_monotone_curve_2 for (const auto& xection : xections) { const Intersection_base_point* base_pt = - boost::get(&xection); + std::get_if(&xection); if (base_pt != nullptr) { Point_2 point_plus(base_pt->first); // the extended point *oi++ = @@ -192,7 +192,7 @@ public: } const Base_x_monotone_curve_2* overlap_cv = - boost::get(&xection); + std::get_if(&xection); CGAL_assertion(overlap_cv != nullptr); unsigned int ov_bc; unsigned int ov_twin_bc; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h index fdc111751de..0776b833613 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h @@ -133,10 +133,10 @@ public: { typedef const std::pair Intersection_base_point; - typedef boost::variant + typedef std::variant Intersection_base_result; typedef const std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; const auto* base_traits = m_traits.m_base_traits; @@ -170,7 +170,7 @@ public: // the extenede X_monotone_curve_2 for (const auto& xection : xections) { const Intersection_base_point* base_pt = - boost::get(&xection); + std::get_if(&xection); if (base_pt != nullptr) { Point_data pt_data(m_traits.invalid_index()); Point_2 point_plus(base_pt->first, pt_data); // the extended point @@ -180,7 +180,7 @@ public: } const Base_x_monotone_curve_2* overlap_cv = - boost::get(&xection); + std::get_if(&xection); CGAL_assertion(overlap_cv != nullptr); unsigned int ov_bc; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Polygon_conversions.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Polygon_conversions.h index f974c628e31..0f880d66ad2 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Polygon_conversions.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Polygon_conversions.h @@ -92,7 +92,7 @@ convert_polygon(const Polygon_2& polygon, if (polygon.is_empty()) return General_polygon_2(); using Point = typename ArrTraits::Point_2; using X_monotone_curve = typename ArrTraits::X_monotone_curve_2; - using Make_x_monotone_result = boost::variant; + using Make_x_monotone_result = std::variant; auto cv = ctr(boost::range::join(CGAL::make_range(polygon.vertices_begin(), polygon.vertices_end()), CGAL::make_single(*polygon.vertices_begin()))); @@ -101,7 +101,7 @@ convert_polygon(const Polygon_2& polygon, make_x_mtn(cv, boost::make_function_output_iterator ([&](const Make_x_monotone_result& obj) - { gpgn.push_back(*(boost::get(&obj))); })); + { gpgn.push_back(*(std::get_if(&obj))); })); return gpgn; } diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_general_polygon_constructions.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_general_polygon_constructions.cpp index be2fb2d3e5b..81add300c23 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_general_polygon_constructions.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_general_polygon_constructions.cpp @@ -66,11 +66,11 @@ int main() { ctr(boost::range::join(CGAL::make_range(points.begin(), points.end()), CGAL::make_single(*points.begin()))); General_pgn gpgn2; - using Make_x_monotone_result = boost::variant; + using Make_x_monotone_result = std::variant; make_x_mtn(curve2, boost::make_function_output_iterator ([&](const Make_x_monotone_result& obj) - { gpgn2.push_back(*(boost::get(&obj))); })); + { gpgn2.push_back(*(std::get_if(&obj))); })); std::cout << "gpgn2: " << gpgn2 << std::endl; // Case 3: Polyline-based GPS from polyline of segments @@ -81,7 +81,7 @@ int main() { make_x_mtn(curve3, boost::make_function_output_iterator ([&](const Make_x_monotone_result& obj) - { gpgn3.push_back(*(boost::get(&obj))); })); + { gpgn3.push_back(*(std::get_if(&obj))); })); std::cout << "gpgn3: " << gpgn3 << std::endl; if (! eql(gpgn2, gpgn3)) { diff --git a/CGAL_ImageIO/include/CGAL/SEP_header.h b/CGAL_ImageIO/include/CGAL/SEP_header.h index 17c40493ef5..d7a26eda8ff 100644 --- a/CGAL_ImageIO/include/CGAL/SEP_header.h +++ b/CGAL_ImageIO/include/CGAL/SEP_header.h @@ -57,12 +57,12 @@ public: { using boost::get; visitor vis(this, get<0>(tuple)); - boost::apply_visitor(vis, get<1>(tuple)); + std::visit(vis, get<1>(tuple)); return *this; } private: - struct visitor : public boost::static_visitor<> { + struct visitor { SEP_header_aux* self; std::string key; visitor(SEP_header_aux* header, std::string key) @@ -262,7 +262,7 @@ private: #endif // CGAL_SEP_READER_DEBUG } // end constructor of sep_header_grammar - typedef boost::variant value; typedef boost::tuple entry_type; diff --git a/Cartesian_kernel/include/CGAL/Cartesian_converter.h b/Cartesian_kernel/include/CGAL/Cartesian_converter.h index c2e9806c2bb..9333fa9f543 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian_converter.h +++ b/Cartesian_kernel/include/CGAL/Cartesian_converter.h @@ -55,7 +55,7 @@ struct Default_converter { // Out will be a variant, source kernel and target kernel template -struct Converting_visitor : boost::static_visitor<> { +struct Converting_visitor{ Converting_visitor(const Converter& conv, Output& out) : conv(&conv), out(&out) {} const Converter* conv; Output* out; @@ -138,13 +138,13 @@ public: // from the sequence, transform with the type mapper and throw the // new list into a variant // visit to get the type, and copy construct inside the return type - template + template typename - Type_mapper< std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >, + Type_mapper< std::optional< std::variant< U ... > >, K1, K2 >::type - operator()(const std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { + operator()(const std::optional< std::variant< U ... > >& o) const { typedef typename - Type_mapper< std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >, + Type_mapper< std::optional< std::variant< U ... > >, K1, K2 >::type result_type; result_type res; if(!o) { @@ -154,22 +154,22 @@ public: internal::Converting_visitor conv_visitor = internal::Converting_visitor(*this, res); - boost::apply_visitor(conv_visitor, *o); + std::visit(conv_visitor, *o); return res; } - template + template typename - Type_mapper< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) >, + Type_mapper< std::variant< U ... >, K1, K2 >::type - operator()(const boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > & o) const { + operator()(const std::variant< U ... > & o) const { typedef typename - Type_mapper< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) >, + Type_mapper< std::variant< U ... >, K1, K2 >::type result_type; result_type res; internal::Converting_visitor conv_visitor = internal::Converting_visitor(*this, res); - boost::apply_visitor(conv_visitor, o); + std::visit(conv_visitor, o); return res; } diff --git a/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmark.h b/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmark.h index 1e7db3856c0..a20f96ce0dd 100644 --- a/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmark.h +++ b/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmark.h @@ -11,7 +11,7 @@ #include #include #include "Input_data.h" -#include +#include diff --git a/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmarks_arrangement.cpp b/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmarks_arrangement.cpp index 674e5a0ea53..a0958077ead 100644 --- a/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmarks_arrangement.cpp +++ b/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmarks_arrangement.cpp @@ -72,7 +72,7 @@ for(i=1;i<6;i++){ typedef CircularKernel::Line_arc_2 Line_arc_2; typedef CGAL::Variant_traits CircularK_Variant_Traits; - typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; + typedef std::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef std::vector CircularKVarArcContainer; bench.kernel("CK VarTraits"); @@ -93,7 +93,7 @@ for(i=1;i<6;i++){ typedef BBCircularKernel::Circular_arc_2 Circular_arc_6; typedef BBCircularKernel::Line_arc_2 Line_arc_6; - typedef boost::variant BBCircVarArc; + typedef std::variant BBCircVarArc; typedef std::vector BBCircVarContainer; typedef CGAL::Variant_traits BBCircVariantTraits; diff --git a/Circular_kernel_2/benchmark/arrangement_traits/benchmark.h b/Circular_kernel_2/benchmark/arrangement_traits/benchmark.h index 36210feffcb..3e51c351e48 100644 --- a/Circular_kernel_2/benchmark/arrangement_traits/benchmark.h +++ b/Circular_kernel_2/benchmark/arrangement_traits/benchmark.h @@ -11,7 +11,7 @@ #include #include #include "Input_data.h" -#include +#include class Bench { diff --git a/Circular_kernel_2/benchmark/arrangement_traits/benchmarks_arrangement.cpp b/Circular_kernel_2/benchmark/arrangement_traits/benchmarks_arrangement.cpp index 5ebf26838bc..056ae74e392 100644 --- a/Circular_kernel_2/benchmark/arrangement_traits/benchmarks_arrangement.cpp +++ b/Circular_kernel_2/benchmark/arrangement_traits/benchmarks_arrangement.cpp @@ -166,7 +166,7 @@ Bench bench(Htmlfilename,Texfilename,Dxffilename[i]); typedef CircularKernel::Line_arc_2 Line_arc_2; typedef CGAL::Variant_traits CircularK_Variant_Traits; - typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; + typedef std::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef std::vector CircularKVarArcContainer; bench.kernel("Circular kernel Variant traits"); diff --git a/Circular_kernel_2/benchmark/benchmark.h b/Circular_kernel_2/benchmark/benchmark.h index 9d13d728f65..94b00a88906 100644 --- a/Circular_kernel_2/benchmark/benchmark.h +++ b/Circular_kernel_2/benchmark/benchmark.h @@ -11,7 +11,7 @@ #include #include #include "Input_data.h" -#include +#include #include diff --git a/Circular_kernel_2/benchmark/benchmark_CK2.cpp b/Circular_kernel_2/benchmark/benchmark_CK2.cpp index 54a4137e4ce..814bb3c0481 100644 --- a/Circular_kernel_2/benchmark/benchmark_CK2.cpp +++ b/Circular_kernel_2/benchmark/benchmark_CK2.cpp @@ -38,7 +38,7 @@ typedef std::vector CircularKArcContainer; typedef CircularKernel::Circular_arc_2 Circular_arc_2; typedef CircularKernel::Line_arc_2 Line_arc_2; typedef CGAL::Arr_circular_line_arc_traits_2 CircularK_Variant_Traits; -typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; +typedef std::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef std::vector CircularKVarArcContainer; @@ -55,7 +55,7 @@ typedef BBCircularKernel::Circular_arc_2 Circular_arc_6; typedef BBCircularKernel::Line_arc_2 Line_arc_6; -typedef boost::variant +typedef std::variant BBCircVarArc; typedef std::vector BBCircVarContainer; diff --git a/Circular_kernel_2/benchmark/benchmarks_arrangement.cpp b/Circular_kernel_2/benchmark/benchmarks_arrangement.cpp index 3b548a20e2a..59867dbd1e3 100644 --- a/Circular_kernel_2/benchmark/benchmarks_arrangement.cpp +++ b/Circular_kernel_2/benchmark/benchmarks_arrangement.cpp @@ -163,7 +163,7 @@ Bench bench; //If you want create table with all datasets typedef CircularKernel::Line_arc_2 Line_arc_2; typedef CGAL::Arr_circular_line_arc_traits_2 CircularK_Variant_Traits; - typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; + typedef std::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef std::vector CircularKVarArcContainer; bench.kernel("CKVar"); @@ -197,7 +197,7 @@ bench.Compute_no_dxf BBCircVarArc; + typedef std::variant BBCircVarArc; typedef std::vector BBCircVarContainer; typedef CGAL::Arr_circular_line_arc_traits_2 BBCircVariantTraits; diff --git a/Circular_kernel_2/benchmark/bff_reader/Breader.cpp b/Circular_kernel_2/benchmark/bff_reader/Breader.cpp index 3fac248eb68..ac18cceab92 100644 --- a/Circular_kernel_2/benchmark/bff_reader/Breader.cpp +++ b/Circular_kernel_2/benchmark/bff_reader/Breader.cpp @@ -189,7 +189,7 @@ int main( int argc, char* argv[] ) { typedef CK::Circular_arc_2 Circular_arc_2; typedef CK::Line_arc_2 Line_arc_2; typedef CGAL::Variant_traits CircularK_Variant_Traits; - typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; + typedef std::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef std::vector CircularKVarArcContainer; CircularKVarArcContainer arc; typedef CGAL::Arrangement_2 Pmwx; diff --git a/Circular_kernel_2/benchmark/dxf_to_bff/dxf_converter.h b/Circular_kernel_2/benchmark/dxf_to_bff/dxf_converter.h index b8ad60ea3c1..3b54da14f93 100644 --- a/Circular_kernel_2/benchmark/dxf_to_bff/dxf_converter.h +++ b/Circular_kernel_2/benchmark/dxf_to_bff/dxf_converter.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Circular_kernel_2/benchmark/incremental_insertion/benchmark.h b/Circular_kernel_2/benchmark/incremental_insertion/benchmark.h index 3787adde522..75218b2430b 100644 --- a/Circular_kernel_2/benchmark/incremental_insertion/benchmark.h +++ b/Circular_kernel_2/benchmark/incremental_insertion/benchmark.h @@ -11,7 +11,7 @@ #include #include #include "Input_data.h" -#include +#include class Bench { diff --git a/Circular_kernel_2/benchmark/incremental_insertion/benchmarks_arrangement.cpp b/Circular_kernel_2/benchmark/incremental_insertion/benchmarks_arrangement.cpp index 8895b11f372..c00db5e079a 100644 --- a/Circular_kernel_2/benchmark/incremental_insertion/benchmarks_arrangement.cpp +++ b/Circular_kernel_2/benchmark/incremental_insertion/benchmarks_arrangement.cpp @@ -157,7 +157,7 @@ Bench bench(Htmlfilename,Texfilename,Dxffilename[i],true); typedef CircularKernel::Line_arc_2 Line_arc_2; typedef CGAL::Variant_traits CircularK_Variant_Traits; - typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; + typedef std::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef std::vector CircularKVarArcContainer; bench.kernel("Circular kernel Variant traits"); diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h index 674b4ca27b2..34ba0ccc386 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h @@ -19,7 +19,7 @@ #include -#include +#include namespace CGAL { @@ -40,7 +40,7 @@ template struct CK2_Intersection_traits { typedef typename - boost::variant< typename CK::Circle_2, + std::variant< typename CK::Circle_2, typename std::pair< typename CK::Circular_arc_point_2, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -52,7 +52,7 @@ template struct CK2_Intersection_traits { typedef typename - boost::variant< typename CK::Circular_arc_2, + std::variant< typename CK::Circular_arc_2, typename std::pair< typename CK::Circular_arc_point_2, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -64,7 +64,7 @@ template struct CK2_Intersection_traits { typedef typename - boost::variant< typename CK::Line_arc_2, + std::variant< typename CK::Line_arc_2, typename std::pair< typename CK::Circular_arc_point_2, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -76,7 +76,7 @@ template struct CK2_Intersection_traits { typedef typename - boost::variant< typename std::pair< typename CK::Circular_arc_point_2, + std::variant< typename std::pair< typename CK::Circular_arc_point_2, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL > @@ -92,7 +92,7 @@ template struct CK2_Intersection_traits { typedef typename - boost::variant< typename std::pair< typename CK::Circular_arc_point_2, + std::variant< typename std::pair< typename CK::Circular_arc_point_2, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL > @@ -108,7 +108,7 @@ template struct CK2_Intersection_traits { typedef typename - boost::variant< typename CK::Line_arc_2, + std::variant< typename CK::Line_arc_2, typename std::pair< typename CK::Circular_arc_point_2, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -125,7 +125,7 @@ template struct CK2_Intersection_traits { typedef typename - boost::variant< typename std::pair< typename CK::Circular_arc_point_2, + std::variant< typename std::pair< typename CK::Circular_arc_point_2, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL > @@ -155,7 +155,7 @@ template struct CK2_Intersection_traits { typedef typename - boost::variant< typename std::pair< typename CK::Circular_arc_point_2, + std::variant< typename std::pair< typename CK::Circular_arc_point_2, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL > diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h index baecb215725..ce3bb2e507f 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h @@ -497,7 +497,7 @@ namespace CircularFunctors { } template - struct Has_on_visitor : public boost::static_visitor { + struct Has_on_visitor { Has_on_visitor(const T* l) : l(l){} const T* l; bool operator()(const std::pair& pair) const { @@ -527,7 +527,7 @@ namespace CircularFunctors { for (typename solutions_container::iterator it = solutions.begin(); it != solutions.end(); ++it) { - if(boost::apply_visitor(Has_on_visitor(&l), *it)) + if(std::visit(Has_on_visitor(&l), *it)) *res++ = *it; } @@ -681,8 +681,8 @@ namespace CircularFunctors { for (typename solutions_container::iterator it = solutions.begin(); it != solutions.end(); ++it) { - if(boost::apply_visitor(Has_on_visitor(&l), *it) && - boost::apply_visitor(Has_on_visitor(&c), *it) ) + if(std::visit(Has_on_visitor(&l), *it) && + std::visit(Has_on_visitor(&c), *it) ) { *res++ = *it; } @@ -757,7 +757,7 @@ namespace CircularFunctors { v = intersection(l, la.supporting_line()); if(!v) return res; - const Point_2 *pt = boost::get(&*v); + const Point_2 *pt = std::get_if(&*v); if(pt == nullptr) return res; Circular_arc_point_2 intersect_point = Circular_arc_point_2(*pt); @@ -790,7 +790,7 @@ namespace CircularFunctors { for (typename solutions_container::const_iterator it = solutions.begin(); it != solutions.end(); ++it) { - if(boost::apply_visitor(Has_on_visitor(&c), *it)) + if(std::visit(Has_on_visitor(&c), *it)) *res++ = *it; } return res; 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 d0ace79c85c..f6eb3d8fd78 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include @@ -47,7 +47,7 @@ template typedef typename CK::Line_2 Line_2; typedef typename CK::Point_2 Point_2; typedef typename CK::Circle_2 Circle_2; - typedef typename boost::variant< Circular_arc_2, Line_arc_2 > Arc; + typedef typename std::variant< Circular_arc_2, Line_arc_2 > Arc; typedef std::list Polygon; typedef std::list Polygons; typedef std::list Circles; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h index 9ef9b35f134..fb5420471db 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h @@ -167,11 +167,11 @@ namespace CGAL { CGAL_kernel_precondition(sols1.size() > 0); CGAL_kernel_precondition(sols2.size() > 0); const std::pair& pair1= - *boost::get >( + *std::get >( &sols1[(sols1.size()==1)?(0):(less_xyz_s1?0:1)] ); const std::pair& pair2= - *boost::get >( + *std::get >( &sols2[(sols2.size()==1)?(0):(less_xyz_s2?0:1)] ); // the source and target must be different @@ -194,11 +194,11 @@ namespace CGAL { CGAL_kernel_precondition(sols1.size() > 0); CGAL_kernel_precondition(sols2.size() > 0); const std::pair& pair1= - *boost::get >( + *std::get >( &sols1[(sols1.size()==1)?(0):(less_xyz_p1?0:1)] ); const std::pair& pair2= - *boost::get >( + *std::get >( &sols2[(sols2.size()==1)?(0):(less_xyz_p2?0:1)] ); // the source and target must be different diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h index bfb44edf924..99eb521e1fa 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h @@ -81,13 +81,13 @@ public: if(sols.size() == 1) { // the intersection must be a point const std::pair* pair= - boost::get >(&sols[0]); + std::get_if >(&sols[0]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= - boost::get >(&sols[less_xyz?0:1]); + std::get_if >(&sols[less_xyz?0:1]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } @@ -104,13 +104,13 @@ public: if(sols.size() == 1) { // the intersection must be a point const std::pair* pair= - boost::get >(&sols[0]); + std::get_if >(&sols[0]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= - boost::get >(&sols[less_xyz?0:1]); + std::get_if >(&sols[less_xyz?0:1]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } @@ -127,13 +127,13 @@ public: if(sols.size() == 1) { // the intersection must be a point const std::pair* pair= - boost::get >(&sols[0]); + std::get_if >(&sols[0]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= - boost::get >(&sols[less_xyz?0:1]); + std::get_if >(&sols[less_xyz?0:1]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } @@ -149,13 +149,13 @@ public: if(sols.size() == 1) { // the intersection must be a point const std::pair* pair= - boost::get >(&sols[0]); + std::get_if >(&sols[0]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= - boost::get >(&sols[less_xyz?0:1]); + std::get_if >(&sols[less_xyz?0:1]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } @@ -171,13 +171,13 @@ public: if(sols.size() == 1) { // the intersection must be a point const std::pair* pair= - boost::get >(&sols[0]); + std::get_if >(&sols[0]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= - boost::get >(&sols[less_xyz?0:1]); + std::get_if >(&sols[less_xyz?0:1]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } @@ -193,13 +193,13 @@ public: if(sols.size() == 1) { // the intersection must be a point const std::pair* pair= - boost::get >(&sols[0]); + std::get_if >(&sols[0]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= - boost::get >(&sols[less_xyz?0:1]); + std::get_if >(&sols[less_xyz?0:1]); CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h index 7a90c240e03..02da04e0897 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h @@ -15,7 +15,7 @@ #include -#include +#include #include namespace CGAL { @@ -36,7 +36,7 @@ struct SK3_Intersection_traits template struct SK3_Intersection_traits { - typedef boost::variant< + typedef std::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int > CGAL_ADDITIONAL_VARIANT_FOR_ICL > type; @@ -49,7 +49,7 @@ struct SK3_Intersection_traits template struct SK3_Intersection_traits { - typedef boost::variant< + typedef std::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int >, typename SK::Circle_3 CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -63,7 +63,7 @@ struct SK3_Intersection_traits template struct SK3_Intersection_traits { - typedef boost::variant< + typedef std::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int >, typename SK::Circle_3 CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -77,7 +77,7 @@ struct SK3_Intersection_traits template struct SK3_Intersection_traits { - typedef boost::variant< + typedef std::variant< std::pair , typename SK::Circle_3 CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -87,7 +87,7 @@ struct SK3_Intersection_traits template struct SK3_Intersection_traits { - typedef boost::variant< + typedef std::variant< std::pair CGAL_ADDITIONAL_VARIANT_FOR_ICL > type; @@ -100,7 +100,7 @@ struct SK3_Intersection_traits template struct SK3_Intersection_traits { - typedef boost::variant< + typedef std::variant< typename SK::Circle_3, std::pair , typename SK::Circular_arc_3 @@ -111,7 +111,7 @@ struct SK3_Intersection_traits struct SK3_Intersection_traits { - typedef boost::variant< + typedef std::variant< std::pair , typename SK::Circular_arc_3 CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -125,7 +125,7 @@ struct SK3_Intersection_traits struct SK3_Intersection_traits { - typedef boost::variant< + typedef std::variant< std::pair , typename SK::Line_arc_3 CGAL_ADDITIONAL_VARIANT_FOR_ICL @@ -136,7 +136,7 @@ struct SK3_Intersection_traits struct SK3_intersect_ternary { - typedef boost::variant< + typedef std::variant< typename SK::Circle_3, typename SK::Plane_3, typename SK::Sphere_3, diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h index 9d10940f0aa..de30249490d 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h @@ -94,9 +94,9 @@ namespace CGAL { // l must intersect s in 2 points CGAL_kernel_precondition(sols.size() == 2); const std::pair& pair1= - *boost::get >(&sols[0]); + *std::get_if >(&sols[0]); const std::pair& pair2= - *boost::get >(&sols[1]); + *std::get_if >(&sols[1]); if(less_xyz_first) { *this = Line_arc_3(l, pair1.first, pair2.first); } else { @@ -115,9 +115,9 @@ namespace CGAL { CGAL_kernel_precondition(sols1.size() > 0); CGAL_kernel_precondition(sols2.size() > 0); const std::pair& pair1= - *boost::get >(&sols1[(sols1.size()==1)?(0):(less_xyz_s1?0:1)]); + *std::get_if >(&sols1[(sols1.size()==1)?(0):(less_xyz_s1?0:1)]); const std::pair& pair2= - *boost::get >(&sols2[(sols2.size()==1)?(0):(less_xyz_s2?0:1)]); + *std::get_if >(&sols2[(sols2.size()==1)?(0):(less_xyz_s2?0:1)]); // the source and target must be different CGAL_kernel_precondition(pair1.first != pair2.first); *this = Line_arc_3(l, pair1.first, pair2.first); @@ -134,8 +134,8 @@ namespace CGAL { typedef typename SK3_Intersection_traits::type Intersection; Intersection i1 = SK().intersect_3_object()(l, p1); Intersection i2 = SK().intersect_3_object()(l, p2); - const typename SK::Point_3* point1=boost::get( & *i1 ); - const typename SK::Point_3* point2=boost::get( & *i2 ); + const typename SK::Point_3* point1=std::get_if( & *i1 ); + const typename SK::Point_3* point2=std::get_if( & *i2 ); CGAL_assertion(point1!=nullptr); CGAL_assertion(point2!=nullptr); // the source and target must be different diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h index 43a371937ec..f17acf26908 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h @@ -223,7 +223,7 @@ namespace CGAL { // (again: converting to RT before assigning to the Iterator is // just to keep object working) template - struct Point_conversion_visitor : public boost::static_visitor { + struct Point_conversion_visitor { Point_conversion_visitor(const OutputIterator& it) : it(it) {} template OutputIterator operator()(const T& t) { *it++ = RT(t); return it; } @@ -291,7 +291,7 @@ namespace CGAL { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(s1, s3)) { internal::Point_conversion_visitor visitor(res); - return boost::apply_visitor(visitor, + return std::visit(visitor, *v); } return res; @@ -300,7 +300,7 @@ namespace CGAL { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(s1, s2)) { internal::Point_conversion_visitor visitor(res); - return boost::apply_visitor( + return std::visit( visitor, *v); } @@ -342,7 +342,7 @@ namespace CGAL { const typename SK::Sphere_3 & s2, OutputIterator res) { - typedef typename boost::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int>, + typedef typename std::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int>, typename SK::Circle_3 > result_type; typedef typename SK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename SK::Polynomial_for_spheres_2_3 Equation_sphere; @@ -357,7 +357,7 @@ namespace CGAL { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p, s1)) { internal::Point_conversion_visitor visitor(res); - return boost::apply_visitor( + return std::visit( visitor, *v); } @@ -368,7 +368,7 @@ namespace CGAL { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p, s1)) { internal::Point_conversion_visitor visitor(res); - return boost::apply_visitor( + return std::visit( visitor, *v); } @@ -391,7 +391,7 @@ namespace CGAL { const typename SK::Sphere_3 & s, OutputIterator res) { - typedef typename boost::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int>, + typedef typename std::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int>, typename SK::Circle_3 > result_type; typedef typename SK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename SK::Polynomial_for_spheres_2_3 Equation_sphere; @@ -406,7 +406,7 @@ namespace CGAL { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p1, s)) { internal::Point_conversion_visitor visitor(res); - return boost::apply_visitor( + return std::visit( visitor, *v); } 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 7a1921c698d..be2ca1e37fb 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 @@ -67,7 +67,7 @@ namespace CGAL // Typedefs for intersection typedef typename Kernel::Plane_3 Plane_3; typedef typename Kernel::Line_3 Line_3; - typedef std::optional< boost::variant< Point_3, + typedef std::optional< std::variant< Point_3, Line_3, Plane_3 > > result_inter; @@ -97,10 +97,10 @@ namespace CGAL result_inter result = CGAL::intersection(pp1, pp2, pp3); CGAL_assertion_msg(bool(result), "halfspace_intersection_3: no intersection"); - CGAL_assertion_msg(boost::get(& *result) != nullptr, + CGAL_assertion_msg(std::get_if(& *result) != nullptr, "halfspace_intersection_3: intersection is not a point"); - const Point_3* pp = boost::get(& *result); + const Point_3* pp = std::get_if(& *result); // Primal vertex associated to the current dual plane Point_3 ppp(origin.x() + pp->x(), diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_2.h index e2909ff4dd0..b21d123ab68 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_2.h @@ -15,14 +15,14 @@ #include #include -#include +#include namespace CGAL { // This class should go away. // It is now only used by the Filtered_kernel. // It allows to iterate over the coordinates of both a Point_2 and a Vector_2, -// using a boost::variant, as the iterator types are the same at the kernel level. +// using a std::variant, as the iterator types are the same at the kernel level. template class Cartesian_coordinate_iterator_2 @@ -31,7 +31,7 @@ class Cartesian_coordinate_iterator_2 protected: typedef typename K::Point_2 P; typedef typename K::Vector_2 V; - boost::variant var; + std::variant var; int index; typedef Cartesian_coordinate_iterator_2 Self; @@ -57,9 +57,9 @@ public: reference operator*() const { - if (const P* const* p = boost::get(&var)) + if (const P* const* p = std::get_if(&var)) return (*p)->cartesian(index); - const V* const* v = boost::get(&var); + const V* const* v = std::get_if(&var); CGAL_assertion(v != 0); return (*v)->cartesian(index); } diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_3.h index c5a16320dc0..2dfc7bcf27d 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_3.h @@ -15,14 +15,14 @@ #include #include -#include +#include namespace CGAL { // This class should go away. // It is now only used by the Filtered_kernel. // It allows to iterate over the coordinates of both a Point_3 and a Vector_3, -// using a boost::variant, as the iterator types are the same at the kernel level. +// using a std::variant, as the iterator types are the same at the kernel level. template class Cartesian_coordinate_iterator_3 @@ -31,7 +31,7 @@ class Cartesian_coordinate_iterator_3 protected: typedef typename K::Point_3 P; typedef typename K::Vector_3 V; - boost::variant var; + std::variant var; int index; typedef Cartesian_coordinate_iterator_3 Self; @@ -57,9 +57,9 @@ public: reference operator*() const { - if (const P* const* p = boost::get(&var)) + if (const P* const* p = std::get_if(&var)) return (*p)->cartesian(index); - const V* const* v = boost::get(&var); + const V* const* v = std::get_if(&var); CGAL_assertion(v != 0); return (*v)->cartesian(index); } diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index c9ff97618c3..41e1e371db7 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -31,7 +31,7 @@ #include #include -#include +#include #ifdef CGAL_LAZY_KERNEL_DEBUG # include #endif @@ -1425,19 +1425,19 @@ struct Ith_for_intersection_with_variant { : i(i_) {} - template< BOOST_VARIANT_ENUM_PARAMS(typename U) > + template< typename ... U > const T2& - operator()(const std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const + operator()(const std::optional< std::variant< U ... > >& o) const { - const std::vector* ptr = (boost::get >(&(*o))); + const std::vector* ptr = (std::get_if >(&(*o))); return (*ptr)[i]; } - template< BOOST_VARIANT_ENUM_PARAMS(typename U) > + template< typename ... U > const T2& - operator()(const boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) >& o) const + operator()(const std::variant< U ... >& o) const { - const std::vector* ptr = (boost::get >(&o)); + const std::vector* ptr = (std::get_if >(&o)); return (*ptr)[i]; } }; @@ -1856,26 +1856,26 @@ template struct Variant_cast { typedef T result_type; - template + template const T& - operator()(const std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { + operator()(const std::optional< std::variant< U ... > >& o) const { // can throw but should never because we always build it inside // a static visitor with the right type - return boost::get(*o); + return std::get(*o); } - template + template T& - operator()(std::optional< boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) > >& o) const { + operator()(std::optional< std::variant< U ... > >& o) const { // can throw but should never because we always build it inside // a static visitor with the right type, if it throws bad_get - return boost::get(*o); + return std::get(*o); } }; template -struct Fill_lazy_variant_visitor_2 : boost::static_visitor<> { +struct Fill_lazy_variant_visitor_2 { Fill_lazy_variant_visitor_2(Result& r, Origin& o) : r(&r), o(&o) {} Result* r; Origin* o; @@ -1912,7 +1912,7 @@ struct Fill_lazy_variant_visitor_2 : boost::static_visitor<> { }; template -struct Fill_lazy_variant_visitor_0 : boost::static_visitor<> { +struct Fill_lazy_variant_visitor_0 { Fill_lazy_variant_visitor_0(Result& r) : r(&r) {} Result* r; @@ -1998,7 +1998,7 @@ struct Lazy_construction_variant { // the static visitor fills the result_type with the correct unwrapped type internal::Fill_lazy_variant_visitor_2< result_type, AK, LK, EK, Lazy > visitor(res, lazy); - boost::apply_visitor(visitor, *approx_v); + std::visit(visitor, *approx_v); return res; } catch (Uncertain_conversion_exception&) {} @@ -2014,7 +2014,7 @@ struct Lazy_construction_variant { } internal::Fill_lazy_variant_visitor_0 visitor(res); - boost::apply_visitor(visitor, *exact_v); + std::visit(visitor, *exact_v); return res; } @@ -2052,7 +2052,7 @@ struct Lazy_construction_variant { // the static visitor fills the result_type with the correct unwrapped type internal::Fill_lazy_variant_visitor_2< result_type, AK, LK, EK, Lazy > visitor(res, lazy); - boost::apply_visitor(visitor, *approx_v); + std::visit(visitor, *approx_v); return res; } catch (Uncertain_conversion_exception&) {} @@ -2068,7 +2068,7 @@ struct Lazy_construction_variant { } internal::Fill_lazy_variant_visitor_0< result_type, AK, LK, EK> visitor(res); - boost::apply_visitor(visitor, *exact_v); + std::visit(visitor, *exact_v); return res; } }; diff --git a/Filtered_kernel/test/Filtered_kernel/test_lazy_vector_objects.cpp b/Filtered_kernel/test/Filtered_kernel/test_lazy_vector_objects.cpp index 041f6022a0e..dd998fce87c 100644 --- a/Filtered_kernel/test/Filtered_kernel/test_lazy_vector_objects.cpp +++ b/Filtered_kernel/test/Filtered_kernel/test_lazy_vector_objects.cpp @@ -42,7 +42,7 @@ int main() } V = nullptr; - if( !(V = boost::get >(&(*o_variant))) ){ + if( !(V = std::get_if >(&(*o_variant))) ){ std::cerr << "ERROR, something other than vector< point_2 >" << std::endl; return EXIT_FAILURE; } @@ -82,7 +82,7 @@ int main() } V = nullptr; - if( !(V = boost::get > (&(*o_variant))) ){ + if( !(V = std::get_if > (&(*o_variant))) ){ std::cerr << "ERROR" << std::endl; return EXIT_FAILURE; } 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 73eea197640..81522776a5b 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 @@ -80,12 +80,12 @@ public: PainterOstream& operator<<(const Hyperbolic_segment_2& s) { - if(const Euclidean_segment_2* seg = boost::get(&s)) { + if(const Euclidean_segment_2* seg = std::get_if(&s)) { CGAL::Qt::PainterOstream::operator << (*seg); return *this; } - const Circular_arc_2& arc = boost::get(s); + const Circular_arc_2& arc = std::get(s); if(arc.squared_radius() > 100) { Euclidean_segment_2 seg(arc.source(), arc.target()); 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 8f434a5a41f..61d6630eeb3 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 @@ -44,12 +44,12 @@ namespace Qt { PainterOstream& operator <<(const Hyperbolic_segment_2& s) { - if(const Line_arc* seg = boost::get(&s)) { + if(const Line_arc* seg = std::get_if(&s)) { operator << (*seg); return *this; } - const Circular_arc& arc = boost::get(s); + const Circular_arc& arc = std::get(s); if(arc.squared_radius() > 10) { diff --git a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h index 8913899a271..3dcd277ab47 100644 --- a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h +++ b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h @@ -35,7 +35,7 @@ public: typedef typename K::Circular_arc_point_2 Hyperbolic_Voronoi_point_2; typedef typename K::Circular_arc_2 Circular_arc_2; typedef typename K::Line_arc_2 Line_arc_2; - typedef boost::variant Hyperbolic_segment_2; typedef typename K::Triangle_2 Hyperbolic_triangle_2; /// @} diff --git a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h index 8eab67ea083..c1131a1e1ef 100644 --- a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h +++ b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h @@ -35,7 +35,7 @@ public: typedef Hyperbolic_point_2 Hyperbolic_Voronoi_point_2; typedef unspecified_type Circular_arc_2; typedef typename K::Segment_2 Euclidean_segment_2; - typedef boost::variant< Circular_arc_2, + typedef std::variant< Circular_arc_2, Euclidean_segment_2 > Hyperbolic_segment_2; typedef typename K::Triangle_2 Hyperbolic_triangle_2; /// @} 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 da42c7429f9..ee95f6c0f85 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 @@ -24,7 +24,7 @@ #include #include -#include +#include #include @@ -69,9 +69,9 @@ namespace internal { Euclidean_line_2* l; Circle_2* c; - if(Circle_2* c_pq = boost::get(&bis_pq)) + if(Circle_2* c_pq = std::get_if(&bis_pq)) { - if(Circle_2* c_qr = boost::get(&bis_qr)) + if(Circle_2* c_qr = std::get_if(&bis_qr)) { typedef typename CK2_Intersection_traits::type Intersection_result; std::vector< Intersection_result > inters; @@ -90,14 +90,14 @@ namespace internal { } // here bis_qr is a line - l = boost::get(&bis_qr); + l = std::get_if(&bis_qr); c = c_pq; } else { // here bis_pq is a line, and bis_qr is necessarily a circle - l = boost::get(&bis_pq); - c = boost::get(&bis_qr); + l = std::get_if(&bis_pq); + c = std::get_if(&bis_qr); } typedef typename CK2_Intersection_traits::type Intersection_result; @@ -157,7 +157,7 @@ namespace internal { } Euclidean_circle_or_line_2 bis_pq = cclsb(p, q); - Circle_2* c = boost::get(&bis_pq); + Circle_2* c = std::get_if(&bis_pq); if(_gt.less_y_2_object()(po, c->center())) return Circular_arc_2(*c, l_inf, true, l_inf, false); @@ -200,7 +200,7 @@ namespace internal { Euclidean_circle_or_line_2 bis_pq = cclsb(p, q); - Circle_2* c_pq = boost::get(&bis_pq); + Circle_2* c_pq = std::get_if(&bis_pq); if(_gt.compare_distance_2_object()(po, p, q) == POSITIVE) { @@ -251,7 +251,7 @@ namespace internal { } Euclidean_circle_or_line_2 bis_pq = cclsb(p, q); - Circle_2* c_pq = boost::get(&bis_pq); + Circle_2* c_pq = std::get_if(&bis_pq); Hyperbolic_point_2 approx_a(to_double(a.x()),to_double(a.y())); @@ -311,14 +311,14 @@ public: typedef typename R::Point_2 Hyperbolic_point_2; typedef typename R::Circle_2 Circle_2; typedef typename R::Line_2 Euclidean_line_2; - typedef boost::variant Euclidean_circle_or_line_2; + typedef std::variant Euclidean_circle_or_line_2; typedef typename R::Circular_arc_2 Circular_arc_2; typedef typename R::Line_arc_2 Line_arc_2; typedef typename R::Circular_arc_point_2 Circular_arc_point_2; typedef Circular_arc_point_2 Hyperbolic_Voronoi_point_2; typedef typename R::Segment_2 Euclidean_segment_2; // only used internally here - typedef boost::variant Hyperbolic_segment_2; + typedef std::variant Hyperbolic_segment_2; typedef typename R::Triangle_2 Hyperbolic_triangle_2; 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 801ee71d993..e54c4cb75a8 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 @@ -28,7 +28,7 @@ #include #include -#include +#include #include @@ -187,9 +187,9 @@ public: Hyperbolic_point_2 operator()(Hyperbolic_segment_2 s1, Hyperbolic_segment_2 s2) { - if(Circular_arc_2* c1 = boost::get(&s1)) + if(Circular_arc_2* c1 = std::get_if(&s1)) { - if(Circular_arc_2* c2 = boost::get(&s2)) + if(Circular_arc_2* c2 = std::get_if(&s2)) { std::pair res = operator()(c1->supporting_circle(), c2->supporting_circle()); Hyperbolic_point_2 p1 = res.first; @@ -202,7 +202,7 @@ public: } else { - Euclidean_segment_2* ell2 = boost::get(&s2); + Euclidean_segment_2* ell2 = std::get_if(&s2); std::pair res = operator()(c1->supporting_circle(), ell2->supporting_line()); Hyperbolic_point_2 p1 = res.first; @@ -216,8 +216,8 @@ public: } else { - Euclidean_segment_2* ell1 = boost::get(&s1); - if(Circular_arc_2* c2 = boost::get(&s2)) + Euclidean_segment_2* ell1 = std::get_if(&s1); + if(Circular_arc_2* c2 = std::get_if(&s2)) { std::pair res = operator()(ell1->supporting_line(), c2->supporting_circle()); @@ -231,7 +231,7 @@ public: } else { - Euclidean_segment_2* ell2 = boost::get(&s2); + Euclidean_segment_2* ell2 = std::get_if(&s2); Hyperbolic_point_2 p1 = operator()(ell1->supporting_line(), ell2->supporting_line()); CGAL_assertion(p1.x()*p1.x() + p1.y()*p1.y() < FT(1)); return p1; @@ -279,9 +279,9 @@ public: Euclidean_line_2* l; Circle_2* c; - if(Circle_2* c_pq = boost::get(&bis_pq)) + if(Circle_2* c_pq = std::get_if(&bis_pq)) { - if(Circle_2* c_qr = boost::get(&bis_qr)) + if(Circle_2* c_qr = std::get_if(&bis_qr)) { std::pair inters = ci(*c_pq, *c_qr); @@ -291,14 +291,14 @@ public: return inters.second; } - l = boost::get(&bis_qr); + l = std::get_if(&bis_qr); c = c_pq; } else { // here bis_pq is a line - l = boost::get(&bis_pq); - c = boost::get(&bis_qr); + l = std::get_if(&bis_pq); + c = std::get_if(&bis_qr); } std::pair inters = ci(*c, *l); @@ -348,7 +348,7 @@ public: } Euclidean_circle_or_line_2 bis_pq = cclsb(p, q); - Circle_2* c = boost::get(&bis_pq); + Circle_2* c = std::get_if(&bis_pq); std::pair inters = ci(*c, l_inf); if(_gt.orientation_2_object()(c->center(), inters.first, inters.second) == POSITIVE) @@ -388,7 +388,7 @@ public: } Euclidean_circle_or_line_2 bis_pq = cclsb(p, q); - Circle_2* c_pq = boost::get(&bis_pq); + Circle_2* c_pq = std::get_if(&bis_pq); if(_gt.compare_distance_2_object()(po, p, q) == POSITIVE) { // then p is inside the supporting circle @@ -430,7 +430,7 @@ public: } Euclidean_circle_or_line_2 bis_pq = cclsb(p, q); - Circle_2* c_pq = boost::get(&bis_pq); + Circle_2* c_pq = std::get_if(&bis_pq); std::pair inters = ci(*c_pq, l_inf); Hyperbolic_point_2 approx_pinf = inters.first; @@ -468,10 +468,10 @@ public: typedef Hyperbolic_point_2 Hyperbolic_Voronoi_point_2; typedef typename Kernel::Circle_2 Circle_2; typedef typename Kernel::Line_2 Euclidean_line_2; - typedef boost::variant Euclidean_circle_or_line_2; + typedef std::variant Euclidean_circle_or_line_2; typedef internal::HDT_2_Circular_arc_2 Circular_arc_2; typedef typename Kernel::Segment_2 Euclidean_segment_2; // only used internally here - typedef boost::variant Hyperbolic_segment_2; + typedef std::variant Hyperbolic_segment_2; typedef typename Kernel::Triangle_2 Hyperbolic_triangle_2; diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 386d2a27202..d4f9b06a843 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -12,6 +12,7 @@ Release date: October 2023 - Support for Visual `C++` 14.0 (Visual studio 2015) is dropped. - **Breaking change**: The usage of `boost::shared_ptr` has been replaced by `std::shared_ptr`. Packages affected are 2D Straight Line Skeleton and Shape Detection. - **Breaking change**: The usage of `boost::optional` has been replaced by `std::optional`. Packages affected are 2D Straight Line Skeleton, 3D Fast Intersection and Distance Computation (AABB Tree), and the Kernel intersection. +- **Breaking change**: The usage of `boost::variant` has been replaced by `std::variant`. Packages affected are 2D Arrangements, and the Kernel intersection. [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) diff --git a/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp b/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp index c5176eda212..7fa07b4760a 100644 --- a/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp +++ b/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include @@ -26,7 +26,7 @@ struct Intersection_traits; template struct Intersection_traits { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -54,7 +54,7 @@ OutputIterator intersect_do_iterator(const typename K::Segment_2 &seg1, template std::optional< - boost::variant + std::variant > intersection_variant(const typename K::Segment_2 &seg1, const typename K::Segment_2 &seg2, @@ -62,7 +62,7 @@ intersection_variant(const typename K::Segment_2 &seg1, { typedef CGAL::internal::Segment_2_Segment_2_pair is_t; - typedef boost::variant Variant; + typedef std::variant Variant; typedef std::optional OptVariant; is_t ispair(&seg1, &seg2); @@ -122,7 +122,7 @@ protected: std::vector* s; }; -struct Visitor : public boost::static_visitor<>, Vec_holder +struct Visitor { Visitor(std::vector* p, std::vector* s) : Vec_holder(p, s) { } @@ -141,7 +141,7 @@ struct Variant_f { void operator()(const Segment& s1, const Segment& s2) { result_type obj = intersection_variant(s1, s2, K()); if(obj) { - boost::apply_visitor(v, *obj); + std::visit(v, *obj); } } }; @@ -224,7 +224,7 @@ std::tuple intersect_each_variant_overload(const Vector& segs) { std::function( [&ret](const Point& p) { (void)p; ++(std::get<0>(ret)); }))); - boost::apply_visitor(v, *obj); + std::visit(v, *obj); } else { ++(std::get<2>(ret)); } diff --git a/Intersections_2/include/CGAL/Intersection_traits.h b/Intersections_2/include/CGAL/Intersection_traits.h index ca313a2c852..35dcf6540fa 100644 --- a/Intersections_2/include/CGAL/Intersection_traits.h +++ b/Intersections_2/include/CGAL/Intersection_traits.h @@ -18,14 +18,14 @@ #include #include -#include +#include #include #define CGAL_INTERSECTION_TRAITS_2(A, B, R1, R2) \ template \ struct Intersection_traits { \ - typedef typename boost::variant \ + typedef typename std::variant \ variant_type; \ typedef typename std::optional< variant_type > result_type; \ }; @@ -33,7 +33,7 @@ #define CGAL_INTERSECTION_TRAITS_3(A, B, R1, R2, R3) \ template \ struct Intersection_traits { \ - typedef typename boost::variant variant_type; \ typedef typename std::optional< variant_type > result_type; \ }; @@ -118,16 +118,16 @@ const T* intersect_get(const CGAL::Object& o) { return CGAL::object_cast(&o); } -template +template inline -const T* intersect_get(const std::optional< boost::variant >& v) { - return boost::get(&*v); +const T* intersect_get(const std::optional< std::variant >& v) { + return std::get_if(&*v); } -template +template inline -const T* intersect_get(const boost::variant & v) { - return boost::get(&v); +const T* intersect_get(const std::variant & v) { + return std::get_if(&v); } template diff --git a/Intersections_2/include/CGAL/Intersection_traits_2.h b/Intersections_2/include/CGAL/Intersection_traits_2.h index df4d10a6c2a..bf43d9a079a 100644 --- a/Intersections_2/include/CGAL/Intersection_traits_2.h +++ b/Intersections_2/include/CGAL/Intersection_traits_2.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -49,7 +49,7 @@ CGAL_INTERSECTION_TRAITS_2(Ray_2, Triangle_2, Point_2, Segment_2) template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_2, typename K::Segment_2, + std::variant< typename K::Point_2, typename K::Segment_2, typename K::Triangle_2, typename std::vector< typename K::Point_2 > > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -69,7 +69,7 @@ CGAL_INTERSECTION_TRAITS_2(Ray_2, Iso_rectangle_2, Point_2, Segment_2) // Variants of one for backwards compatibility template struct Intersection_traits { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef std::optional result_type; }; @@ -77,26 +77,26 @@ struct Intersection_traits struct Intersection_traits { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef std::optional result_type; }; template struct Intersection_traits { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef std::optional result_type; }; template struct Intersection_traits { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef std::optional result_type; }; template struct Intersection_traits { - typedef typename boost::variant > variant_type; typedef typename std::optional < variant_type > result_type; @@ -118,13 +118,13 @@ struct Intersection_traits { template struct Intersection_traits { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef std::optional result_type; }; template struct Intersection_traits { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef std::optional result_type; }; diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Bbox_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Bbox_2.h index 4081086aa1c..2ebd27332ad 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Bbox_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Bbox_2.h @@ -25,12 +25,12 @@ do_intersect(const CGAL::Bbox_2& c, return CGAL::do_overlap(c, bbox); } -typename std::optional< typename boost::variant > +typename std::optional< typename std::variant > inline intersection(const CGAL::Bbox_2& a, const CGAL::Bbox_2& b) { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef typename std::optional result_type; if(!do_intersect(a, b)) diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index 5c15555404a..38a81c0a29a 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -490,7 +490,7 @@ struct Test std::set ds; auto test = [&ds](S s1, S s2) { - P i = boost::get

    (*CGAL::intersection(s1,s2)); + P i = std::get

    (*CGAL::intersection(s1,s2)); ds.insert(CGAL::to_double(i.x())); ds.insert(CGAL::to_double(i.y())); assert(ds.size()==2); }; diff --git a/Intersections_3/include/CGAL/Intersection_traits_3.h b/Intersections_3/include/CGAL/Intersection_traits_3.h index a72f5cac923..2d2b8ca64ff 100644 --- a/Intersections_3/include/CGAL/Intersection_traits_3.h +++ b/Intersections_3/include/CGAL/Intersection_traits_3.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -84,7 +84,7 @@ CGAL_INTERSECTION_TRAITS_3(Sphere_3, Sphere_3, Point_3, Circle_3, Sphere_3) template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, typename std::vector< typename K::Point_3 > > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -108,7 +108,7 @@ CGAL_INTERSECTION_TRAITS_2(Iso_cuboid_3, Ray_3, Point_3, Segment_3) template struct Intersection_traits { typedef typename - boost::variant< typename K::Iso_cuboid_3 > variant_type; + std::variant< typename K::Iso_cuboid_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -118,7 +118,7 @@ struct Intersection_traits struct Intersection_traits { typedef typename - boost::variant< typename K::Segment_3, typename K::Point_3 > variant_type; + std::variant< typename K::Segment_3, typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -148,7 +148,7 @@ struct Intersection_traits : template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -156,14 +156,14 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -172,7 +172,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Iso_cuboid_3 > variant_type; + std::variant< typename K::Iso_cuboid_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -184,7 +184,7 @@ struct Intersection_traits template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -192,7 +192,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; @@ -201,7 +201,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; @@ -211,7 +211,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; @@ -220,7 +220,7 @@ struct Intersection_traits template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; @@ -230,7 +230,7 @@ struct Intersection_traits template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; @@ -239,7 +239,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; @@ -249,7 +249,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; @@ -258,7 +258,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3, typename K::Segment_3, + std::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; @@ -268,7 +268,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -276,7 +276,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -284,7 +284,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -292,7 +292,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -300,7 +300,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -308,7 +308,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -316,7 +316,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -324,7 +324,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -332,7 +332,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -340,7 +340,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -348,7 +348,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -356,7 +356,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -364,7 +364,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -372,7 +372,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -380,7 +380,7 @@ struct Intersection_traits { template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 > variant_type; + std::variant< typename K::Point_3 > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -389,7 +389,7 @@ template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 , typename K::Segment_3, + std::variant< typename K::Point_3 , typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -399,7 +399,7 @@ template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 , typename K::Segment_3, + std::variant< typename K::Point_3 , typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -409,7 +409,7 @@ template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 , typename K::Segment_3, + std::variant< typename K::Point_3 , typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; }; @@ -419,7 +419,7 @@ template struct Intersection_traits { typedef typename - boost::variant< typename K::Point_3 , typename K::Segment_3, + std::variant< typename K::Point_3 , typename K::Segment_3, typename K::Triangle_3, std::vector > variant_type; typedef typename std::optional< variant_type > result_type; }; 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 44af7d691c0..c3303e93e80 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 @@ -25,7 +25,7 @@ #include #include -#include +#include #include @@ -39,12 +39,12 @@ do_intersect(const CGAL::Bbox_3& c, return CGAL::do_overlap(c, bbox); } -typename std::optional< typename boost::variant< Bbox_3> > +typename std::optional< typename std::variant< Bbox_3> > inline intersection(const CGAL::Bbox_3& a, const CGAL::Bbox_3& b) { - typedef typename boost::variant variant_type; + typedef typename std::variant variant_type; typedef typename std::optional result_type; if(!do_intersect(a,b)) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_intersection.h index df219948c4e..1ec423af9c9 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_intersection.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace CGAL { namespace Intersections { @@ -34,7 +34,7 @@ namespace internal { // But it must be a template function since the original kernel must be // taken into account. template -typename std::optional< boost::variant > +typename std::optional< std::variant > intersection_bl(const Bbox_3& box, double lpx, double lpy, double lpz, double ldx, double ldy, double ldz, @@ -45,7 +45,7 @@ intersection_bl(const Bbox_3& box, typedef typename K::Vector_3 Vector_3; typedef typename K::Segment_3 Segment_3; - typedef typename std::optional > result_type; + typedef typename std::optional > result_type; double seg_min = 0.0, seg_max = 1.0; // first on x value diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_intersection.h index ccdba585679..2c834588f6b 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_intersection.h @@ -67,7 +67,7 @@ void clip_poly_halfspace( SP_type inter = k.intersect_3_object()(seg, pl); if(inter) { - Point* p_inter = boost::get(&*inter); + Point* p_inter = std::get_if(&*inter); if(p_inter && !(k.equal_3_object()(*p_inter, p1)) && !(k.equal_3_object()(*p_inter, p2))) @@ -90,7 +90,7 @@ void clip_poly_halfspace( SP_type inter = typename K::Intersect_3()(seg, pl); if(inter) { - Point* p_inter = boost::get(&*inter); + Point* p_inter = std::get_if(&*inter); if(p_inter && !(k.equal_3_object()(*p_inter, p1)) && !(k.equal_3_object()(*p_inter, p2))) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_intersection.h index bdc881bf75a..b0cc8f3ec22 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_intersection.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace CGAL { namespace Intersections { @@ -74,13 +74,13 @@ intersection_point(const typename K::Plane_3& plane1, } template -std::optional > +std::optional > intersection(const typename K::Plane_3& plane1, const typename K::Plane_3& plane2, const typename K::Plane_3& plane3, const K& k) { - typedef typename std::optional > result_type; diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Segment_3_intersection.h index 9bf2ed97ac7..c231137fd7d 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Segment_3_intersection.h @@ -76,8 +76,6 @@ intersection_collinear_segments(const typename K::Segment_3& s1, template struct L_p_visitor - : public boost::static_visitor< - typename Intersection_traits::result_type> { typedef typename Intersection_traits::result_type result_type; @@ -117,7 +115,7 @@ intersection(const typename K::Segment_3& s1, v = internal::intersection(s1.supporting_line(), s2.supporting_line(), k); if(v) - return apply_visitor(L_p_visitor(s1, s2) , *v); + return std::visit(L_p_visitor(s1, s2) , *v); return intersection_return(); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h index 424e1fc9361..41a25d4eca0 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h @@ -209,7 +209,7 @@ intersection(const typename K::Triangle_3& t1, return intersection_return(); } - return boost::apply_visitor(Triangle_Line_visitor(), *inter1, *inter2); + return std::visit(Triangle_Line_visitor(), *inter1, *inter2); } return intersection_return(); diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h b/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h index 1dc059a20f1..4aba04c9e1a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h @@ -68,7 +68,7 @@ struct Tetrahedron_lines_intersection_3_base if(do_intersect(o, triangle)) { tr_seg[i] = typename K::Intersect_3()(o, triangle); - if(boost::get(&*tr_seg[i]) != nullptr) + if(std::get_if(&*tr_seg[i]) != nullptr) { res_id = i; break; @@ -91,7 +91,7 @@ struct Tetrahedron_lines_intersection_3_base { if(tr_seg[i]) { - if(const typename K::Point_3* p = boost::get(&*tr_seg[i])) + if(const typename K::Point_3* p = std::get_if(&*tr_seg[i])) { if(res_points.empty()) { diff --git a/Intersections_3/test/Intersections_3/intersection_test_helper.h b/Intersections_3/test/Intersections_3/intersection_test_helper.h index a38e2bad55f..2e9806ad03b 100644 --- a/Intersections_3/test/Intersections_3/intersection_test_helper.h +++ b/Intersections_3/test/Intersections_3/intersection_test_helper.h @@ -311,7 +311,7 @@ public: { if(ov->type() == typeid(T)) { - auto* r = boost::get(&*ov); // ov is an optional + auto* r = std::get_if(&*ov); // ov is an optional assert(r); return (t == *r); } @@ -363,7 +363,7 @@ public: assert(ires12 && ires34); Variant_visitor vis(ires12); - boost::apply_visitor(vis, *ires34); + std::visit(vis, *ires34); assert(vis.equal); } } diff --git a/Intersections_3/test/Intersections_3/test_intersections_Iso_cuboid_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Iso_cuboid_3.cpp index 91e91913a48..e5ef0e49284 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Iso_cuboid_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Iso_cuboid_3.cpp @@ -208,7 +208,7 @@ public: // face auto res = CGAL::intersection(cub, Pl(p(1,1,1), p(1,2,1), p(1,2,2))); - const std::vector

    * poly = boost::get >(&*res); + const std::vector

    * poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 4); for(const P& pt : *poly) @@ -217,7 +217,7 @@ public: } res = CGAL::intersection(cub, Pl(p(1,1,1), p(1,2,1), p(2,2,2))); - poly = boost::get >(&*res); + poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 4); for(const P& pt : *poly) { @@ -227,7 +227,7 @@ public: // other edge Pl pln(p(1,1,1), p(1,2,1), P(1.5, 1, 2)); res = CGAL::intersection(cub, pln); - poly = boost::get >(&*res); + poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 4); for(const P& pt : *poly) { @@ -245,7 +245,7 @@ public: // random pln = Pl(0.265189, 0.902464, 0.33946, -2.47551); res = CGAL::intersection(cub, pln); - poly = boost::get >(&*res); + poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 5); for(const P& pt : *poly) { @@ -575,7 +575,7 @@ public: // face in a tr Tr tr(p(-3, -3, 1), p(3, -3, 1), P(1.5, 6, 1)); Res res = CGAL::intersection(cub, tr); - Pol* poly = boost::get >(&*res); + Pol* poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 4); if(this->has_exact_c) @@ -618,7 +618,7 @@ public: // tr through tr = Tr(p(2, 4, 2), P(1, 3.5, -0.5), p(1, -1, 1)); res = CGAL::intersection(cub, tr); - poly = boost::get >(&*res); + poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 4); if(this->has_exact_c) @@ -635,7 +635,7 @@ public: // cutting in half along diagonal (intersection included in triangle) tr = Tr(p(1, 1, 10), p(10, 10, 1), p(1, 1, 1)); res = CGAL::intersection(cub, tr); - poly = boost::get >(&*res); + poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 4); if(this->has_exact_c) @@ -647,7 +647,7 @@ public: // 6 points intersection tr = Tr(P(18.66, -5.4, -11.33), P(-2.41, -7.33, 19.75), P(-10.29, 20.15, -10.33)); res = CGAL::intersection(cub, tr); - poly = boost::get >(&*res); + poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 6); if(this->has_exact_c) @@ -659,7 +659,7 @@ public: // triangle clipping a cuboid corner tr = Tr(P(1.02, 1.33, 0.62), P(1.95, 2.54, 0.95), P(0.79, 2.36, 1.92)); res = CGAL::intersection(cub, tr); - Tr* tr_res = boost::get(&*res); + Tr* tr_res = std::get_if(&*res); assert(tr_res != nullptr); if(this->has_exact_c) { diff --git a/Intersections_3/test/Intersections_3/test_intersections_Plane_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Plane_3.cpp index fc32a571b4c..265435329e5 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Plane_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Plane_3.cpp @@ -286,7 +286,7 @@ public: // Don't have the right values to test further. auto res = CGAL::intersection(tet, pln); - const std::vector

    * poly = boost::get >(&*res); + const std::vector

    * poly = std::get_if >(&*res); assert(poly != nullptr); assert(poly->size() == 4); } 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 29b21af670f..f6b40f5e778 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Tetrahedron_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Tetrahedron_3.cpp @@ -226,7 +226,7 @@ public: Tr tr(p(-2,2,0), p(2,2,0), P(0.25,0.25,0)); auto res = CGAL::intersection(tet, tr); - const Poly* poly = boost::get(&*res); + const Poly* poly = std::get_if(&*res); assert(poly != nullptr); assert(poly->size() == 4); for(const P& pt : *poly) { @@ -235,7 +235,7 @@ public: tr = Tr(P(0.45, 0.20, 0.1), P(0.1, 0.20, 0.5), P(-0.5, 0.25, -0.5)); res = CGAL::intersection(tet, tr); - const Poly* inter = boost::get(&*res); + const Poly* inter = std::get_if(&*res); assert(inter != nullptr); assert(inter->size() == 5); for(const P& pt : *inter) { @@ -287,22 +287,22 @@ public: auto res = CGAL::intersection(tet, tr); std::vector

    points; - if(const P* pt = boost::get

    (&*res)) + if(const P* pt = std::get_if

    (&*res)) { points.push_back(*pt); } - else if(const S* s = boost::get(&*res)) + else if(const S* s = std::get_if(&*res)) { points.push_back(s->source()); points.push_back(s->target()); } - else if(const Tr* itr = boost::get(&*res)) + else if(const Tr* itr = std::get_if(&*res)) { points.push_back(itr->operator[](0)); points.push_back(itr->operator[](1)); points.push_back(itr->operator[](2)); } - else if(const Poly* poly = boost::get(&*res)) + else if(const Poly* poly = std::get_if(&*res)) { points = *poly; @@ -323,7 +323,7 @@ public: 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 != std::nullopt); - const std::vector

    *vps = boost::get>(&*res); + const std::vector

    *vps = std::get_if>(&*res); assert(vps!=nullptr); } diff --git a/Kernel_23/doc/Kernel_23/CGAL/Projection_traits_xy_3.h b/Kernel_23/doc/Kernel_23/CGAL/Projection_traits_xy_3.h index 88afb8e5bff..fec8c6c80a1 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Projection_traits_xy_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Projection_traits_xy_3.h @@ -81,7 +81,7 @@ typedef Line_3 Line_2; A construction object. Provides the operator : -`std::optional< boost::variant > operator()(Segment_2 s1, Segment_2 s2);` +`std::optional< std::variant > operator()(Segment_2 s1, Segment_2 s2);` which returns a 3D object whose projection on the xy-plane is the intersection of the projections of `s1` and `s2`. If non empty, the returned object is either a segment or a point. diff --git a/Kernel_23/doc/Kernel_23/CGAL/Spherical_kernel_intersections.h b/Kernel_23/doc/Kernel_23/CGAL/Spherical_kernel_intersections.h index f235beb0e79..85554368984 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Spherical_kernel_intersections.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Spherical_kernel_intersections.h @@ -102,7 +102,7 @@ intersection(const SphericalType1 &obj1, const SphericalType2 &obj2, /*! Copies in the output iterator the intersection elements between the three objects. `intersections` iterates on -elements of type `boost::variant< Circle_3, Plane_3, Sphere_3, std::pair< Circular_arc_point_3, unsigned > >`, in lexicographic order +elements of type `std::variant< Circle_3, Plane_3, Sphere_3, std::pair< Circular_arc_point_3, unsigned > >`, in lexicographic order when this ordering is defined on the computed objects where `Type1`, `Type2` and `Type3` diff --git a/Kernel_23/doc/Kernel_23/CGAL/intersections.h b/Kernel_23/doc/Kernel_23/CGAL/intersections.h index 430e37cbcc0..160bb35d7eb 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/intersections.h +++ b/Kernel_23/doc/Kernel_23/CGAL/intersections.h @@ -103,7 +103,7 @@ The following tables give the possible values for `Type1` and `Type2`. The return type of intersecting two objects of the types `Type1` and `Type2` can be specified through the placeholder type specifier `auto`. It is equivalent to -`std::optional< boost::variant< T... > >`, the last column in the table providing +`std::optional< std::variant< T... > >`, the last column in the table providing the template parameter pack.

    @@ -193,7 +193,7 @@ the template parameter pack.
    Additional overloads are provided for the type `Point_2` combined with any other type with the result type being -`std::optional< boost::variant< Point_2 > >`. +`std::optional< std::variant< Point_2 > >`. Overloads are also provided for the type `Bbox_2`, for all intersections existing with the type `Iso_rectangle_2`. Note that the return type for `Bbox_2` - `Bbox_2` is `Bbox_2` and not `Iso_rectangle_2`. @@ -202,7 +202,7 @@ intersections existing with the type `Iso_rectangle_2`. Note that the return typ The return type of intersecting two objects of the types `Type1` and `Type2` can be specified through the placeholder type specifier `auto`. It is equivalent to -`std::optional< boost::variant< T... > >`, the last column in the table providing +`std::optional< std::variant< T... > >`, the last column in the table providing the template parameter pack.
    @@ -351,7 +351,7 @@ the template parameter pack.
    Additional overloads are provided for the type `Point_3` combined with any other type with the result type being -`std::optional< boost::variant< Point_3 > >`. Overloads are also provided for the type `Bbox_3`, for all +`std::optional< std::variant< Point_3 > >`. Overloads are also provided for the type `Bbox_3`, for all intersections existing with the type `Iso_cuboid_3`. Note that the return type for `Bbox_3` - `Bbox_3` is `Bbox_3` and not `Iso_cuboid_3`. @@ -363,18 +363,18 @@ The following examples demonstrate the most common use of In the first two examples we intersect a segment and a line. The result type can be specified through the placeholder type specifier `auto`, -but you must anyway know that the result type is a `std::optional >`, +but you must anyway know that the result type is a `std::optional >`, in order to unpack the point or segment. `std::optional` comes in -as there might be no intersection. `boost::variant` comes in +as there might be no intersection. `std::variant` comes in as, if there is an intersection, it is either a point or a segment. -As explained in the boost manual pages for `boost::variant`, there are two ways to access the variants. The first examples uses `boost::get`. +As explained in the boost manual pages for `std::variant`, there are two ways to access the variants. The first examples uses `boost::get`. \cgalExample{Kernel_23/intersection_get.cpp} -The second example uses `boost::apply_visitor`. +The second example uses `std::visit`. \cgalExample{Kernel_23/intersection_visitor.cpp} diff --git a/Kernel_23/doc/Kernel_23/Kernel_23.txt b/Kernel_23/doc/Kernel_23/Kernel_23.txt index 451829f8eae..0919077d3ab 100644 --- a/Kernel_23/doc/Kernel_23/Kernel_23.txt +++ b/Kernel_23/doc/Kernel_23/Kernel_23.txt @@ -495,7 +495,7 @@ especially integer types and rationals. Some functions, for example \link intersection_linear_grp `intersection()`\endlink, can return different types of objects. To achieve this in a type-safe way \cgal uses -return values of type `std::optional< boost::variant< T... > >` where `T...` is a +return values of type `std::optional< std::variant< T... > >` where `T...` is a list of all possible resulting geometric objects. The exact result type of an intersection can be specified through the placeholder type specifier `auto`. @@ -521,10 +521,10 @@ std::cin >> segment_1 >> segment_2; auto v = intersection(segment_1, segment_2); if (v) { /* not empty */ - if (const Point_2 *p = boost::get(&*v) ) { + if (const Point_2 *p = std::get_if(&*v) ) { /* do something with *p */ } else { - const Segment_2 *s = boost::get(&*v); + const Segment_2 *s = std::get_if(&*v); /* do something with *s */ } } else { diff --git a/Kernel_23/examples/Kernel_23/cartesian_converter.cpp b/Kernel_23/examples/Kernel_23/cartesian_converter.cpp index ebd4343d304..6d13c05bce1 100644 --- a/Kernel_23/examples/Kernel_23/cartesian_converter.cpp +++ b/Kernel_23/examples/Kernel_23/cartesian_converter.cpp @@ -30,7 +30,7 @@ int main(){ // As we are sure that there IS an intersection // and that the intersection IS a point // we do not have to check for this, or put it in a try/catch - const EK::Point_3& exact_pt = boost::get(*inter); + const EK::Point_3& exact_pt = std::get(*inter); EK_to_IK to_inexact; diff --git a/Kernel_23/examples/Kernel_23/intersection_get.cpp b/Kernel_23/examples/Kernel_23/intersection_get.cpp index ff2332a153c..b245edd4a56 100644 --- a/Kernel_23/examples/Kernel_23/intersection_get.cpp +++ b/Kernel_23/examples/Kernel_23/intersection_get.cpp @@ -14,10 +14,10 @@ int main() const auto result = intersection(seg, lin); if (result) { - if (const Segment_2* s = boost::get(&*result)) { + if (const Segment_2* s = std::get_if(&*result)) { std::cout << *s << std::endl; } else { - const Point_2* p = boost::get(&*result); + const Point_2* p = std::get_if(&*result); std::cout << *p << std::endl; } } diff --git a/Kernel_23/examples/Kernel_23/intersection_visitor.cpp b/Kernel_23/examples/Kernel_23/intersection_visitor.cpp index ffe5c09c7d8..61d0dbba7e2 100644 --- a/Kernel_23/examples/Kernel_23/intersection_visitor.cpp +++ b/Kernel_23/examples/Kernel_23/intersection_visitor.cpp @@ -28,7 +28,7 @@ int main() const auto result = intersection(seg, lin); if (result) { - boost::apply_visitor(Intersection_visitor(), *result); + std::visit(Intersection_visitor(), *result); } else { // no intersection } diff --git a/Kernel_23/include/CGAL/Kernel/Type_mapper.h b/Kernel_23/include/CGAL/Kernel/Type_mapper.h index a33224fcd59..af76c746956 100644 --- a/Kernel_23/include/CGAL/Kernel/Type_mapper.h +++ b/Kernel_23/include/CGAL/Kernel/Type_mapper.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -66,9 +66,9 @@ struct Type_mapper_impl, K1, K2 > { #define CGAL_VARIANT_TYPEMAP(z, n, d) \ template< typename K1, typename K2, BOOST_PP_ENUM_PARAMS(n, class T) > \ -struct Type_mapper_impl, K1, K2> { \ +struct Type_mapper_impl, K1, K2> { \ BOOST_PP_REPEAT(n, CGAL_TYPEMAP_TYPEDEFS, T) \ - typedef boost::variant type; \ + typedef std::variant type; \ }; BOOST_PP_REPEAT_FROM_TO(1, 10, CGAL_VARIANT_TYPEMAP, _) @@ -76,16 +76,6 @@ BOOST_PP_REPEAT_FROM_TO(1, 10, CGAL_VARIANT_TYPEMAP, _) #undef CGAL_TYPEMAP_TYPEDEFS #undef CGAL_VARIANT_TYPEMAP -// CODE_TAG -//template -//struct Type_mapper_impl, K1, K2 > { -// typedef typename boost::make_variant_over< -// typename boost::mpl::transform< -// typename boost::variant::types, -// Type_mapper_impl >::type -// >::type type; -//}; - // Then we specialize for all kernel objects. // More details on why it is like that are here: https://github.com/CGAL/cgal/pull/4878#discussion_r459986501 #define CGAL_Kernel_obj(X) \ diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 29d74179a87..b60b44a2825 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -1765,7 +1765,7 @@ namespace CommonKernelFunctors { const auto res = typename K::Intersect_3()(l1,l2); CGAL_assertion(res!=std::nullopt); - const Point* e_pt = boost::get(&(*res)); + const Point* e_pt = std::get_if(&(*res)); CGAL_assertion(e_pt!=nullptr); return *e_pt; } @@ -2173,7 +2173,7 @@ namespace CommonKernelFunctors { const auto res = typename K::Intersect_3()(plane,line); CGAL_assertion(res!=std::nullopt); - const Point* e_pt = boost::get(&(*res)); + const Point* e_pt = std::get_if(&(*res)); CGAL_assertion(e_pt!=nullptr); return *e_pt; } @@ -2186,7 +2186,7 @@ namespace CommonKernelFunctors { const auto res = typename K::Intersect_3()(plane,line); CGAL_assertion(res!=std::nullopt); - const Point* e_pt = boost::get(&(*res)); + const Point* e_pt = std::get_if(&(*res)); CGAL_assertion(e_pt!=nullptr); return *e_pt; } @@ -3413,7 +3413,7 @@ namespace CommonKernelFunctors { 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"); - const Point_3* p = boost::get(&*optional); + const Point_3* p = std::get_if(&*optional); 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(); } @@ -3618,7 +3618,7 @@ namespace CommonKernelFunctors { operator()(const T1& t1, const T2& t2) const { return Intersections::internal::intersection(t1, t2, K() ); } - std::optional > + std::optional > operator()(const Plane_3& pl1, const Plane_3& pl2, const Plane_3& pl3)const { return Intersections::internal::intersection(pl1, pl2, pl3, K() ); } }; 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 d1cb83d135d..dd4e24005a4 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 @@ -428,10 +428,10 @@ public: - std::optional< boost::variant > + std::optional< std::variant > operator()(const Segment_3& s1, const Segment_3& s2) const { - typedef boost::variant variant_type; + typedef std::variant variant_type; Point_2 s1_source = project(s1.source()); Point_2 s1_target = project(s1.target()); @@ -450,7 +450,7 @@ public: return std::nullopt; } - if(const Segment_2* si = boost::get(&*o)){ + if(const Segment_2* si = std::get_if(&*o)){ FT src[3],tgt[3]; //the third coordinate is the midpoint between the points on s1 and s2 FT z1 = s1.source()[dim] + ( alpha(si->source(), s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); @@ -472,7 +472,7 @@ public: } - const Point_2* pi = boost::get(&*o); + const Point_2* pi = std::get_if(&*o); FT coords[3]; //compute the third coordinate of the projected intersection point onto 3D segments FT z1 = s1.source()[dim] + ( alpha(*pi, s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); diff --git a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h index 873ad1bcb14..089fe5ba6cb 100644 --- a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h +++ b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h @@ -182,12 +182,12 @@ public: CGAL_TIME_PROFILER("Construct Projected_intersect_3") } - std::optional > + std::optional > operator()(const Segment& s1, const Segment& s2) { CGAL_PROFILER("Projected_intersect_3::operator()") CGAL_TIME_PROFILER("Projected_intersect_3::operator()") - typedef boost::variant variant_type; + typedef std::variant variant_type; const Vector_3 u1 = cross_product(s1.to_vector(), normal); if(u1 == NULL_VECTOR) return K().intersect_3_object()(s1.supporting_line(), s2); @@ -206,7 +206,7 @@ public: #endif return std::nullopt; } - if(const Line* line = boost::get(&*planes_intersection)) + if(const Line* line = std::get_if(&*planes_intersection)) { // check if the intersection line intersects both segments by // checking if a point on the intersection line is between @@ -235,12 +235,12 @@ public: if(! inter){ return std::nullopt; } - if(const Point* point = boost::get(&*inter)){ + if(const Point* point = std::get_if(&*inter)){ return std::make_optional(variant_type(*point)); } } } - if(boost::get(&*planes_intersection)) + if(std::get_if(&*planes_intersection)) { #ifdef CGAL_T2_PTB_3_DEBUG std::cerr << "coplanar supporting lines\n"; diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_depth.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_depth.h index 313d448c871..b3e519f2979 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_depth.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_depth.h @@ -14,7 +14,7 @@ _test_depth(const R& ) Point_3 m = CGAL::midpoint(p,q); auto result = CGAL::intersection(s0, s1); - const Point_3* ip = boost::get(&*result); + const Point_3* ip = std::get_if(&*result); assert(CGAL::depth(p) == 0); assert(CGAL::depth(q) == 0); diff --git a/Kernel_d/doc/Kernel_d/CGAL/intersections_d.h b/Kernel_d/doc/Kernel_d/CGAL/intersections_d.h index 16448e7eff5..769b4a3d0a2 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/intersections_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/intersections_d.h @@ -36,7 +36,7 @@ The following table gives the possible values for `Type1` and `Type2`. The return type of intersecting two objects of the types `Type1` and `Type2` can be specified through the placeholder type specifier `auto`. It is equivalent to -`std::optional< boost::variant< T... > >`, the last column in the table providing +`std::optional< std::variant< T... > >`, the last column in the table providing the template parameter pack. @@ -147,7 +147,7 @@ void foo(Segment_d seg, Line_d lin) { // use auto auto result = intersection(seg, lin); - if(result) { boost::apply_visitor(Intersection_visitor(), *result); } + if(result) { std::visit(Intersection_visitor(), *result); } else { // no intersection } } @@ -156,7 +156,7 @@ void foo(Segment_d seg, Line_d lin) \sa `do_intersect` \sa `Kernel_d::Intersect_d` \sa `std::optional` -\sa `boost::variant` +\sa `std::variant` */ decltype(auto) diff --git a/Kernel_d/doc/Kernel_d/Kernel_d.txt b/Kernel_d/doc/Kernel_d/Kernel_d.txt index 1e1e3361096..ab2154269a8 100644 --- a/Kernel_d/doc/Kernel_d/Kernel_d.txt +++ b/Kernel_d/doc/Kernel_d/Kernel_d.txt @@ -477,7 +477,7 @@ Intersections on kernel objects currently cover only those objects that are part of flats (`R::Segment_d`, `R::Ray_d`, `R::Line_d`, and `R::Hyperplane_d`). For any pair of objects \f$ o1\f$, \f$ o2\f$ of these types the operation `intersection(o1,o2)` -returns a `std::optional< boost::variant< T... > >` +returns a `std::optional< std::variant< T... > >` where `T...` is a list of all possible resulting geometric objects. The return type of intersecting two objects of the types `Type1` and `Type2` can be @@ -501,10 +501,10 @@ std::cin >> s1 >> s2; auto v = intersection(s1, s2); if (v) { // not empty - if (const Point *p = boost::get(&*v) ) { + if (const Point *p = std::get_if(&*v) ) { // do something with *p } else { - const Segment *s = boost::get(&*v) ) { + const Segment *s = std::get_if(&*v) ) { // do something with *s } } else { diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objects.h b/Kernel_d/include/CGAL/Kernel_d/function_objects.h index 0e073c0272d..0a20e339cf0 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objects.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objects.h @@ -76,22 +76,22 @@ public: template struct result - { typedef std::optional< boost::variant< Point_d, Line_d > > type; }; + { typedef std::optional< std::variant< Point_d, Line_d > > type; }; template struct result - { typedef std::optional< boost::variant< Point_d, Segment_d > > type; }; + { typedef std::optional< std::variant< Point_d, Segment_d > > type; }; template struct result : result { }; template struct result - { typedef std::optional< boost::variant< Point_d, Segment_d > > type; }; + { typedef std::optional< std::variant< Point_d, Segment_d > > type; }; template struct result - { typedef std::optional< boost::variant< Point_d, Ray_d > > type; }; + { typedef std::optional< std::variant< Point_d, Ray_d > > type; }; template struct result : result @@ -99,7 +99,7 @@ public: template struct result - { typedef std::optional< boost::variant< Point_d, Segment_d > > type; }; + { typedef std::optional< std::variant< Point_d, Segment_d > > type; }; template struct result : result @@ -107,25 +107,25 @@ public: template struct result - { typedef std::optional< boost::variant< Point_d, Segment_d, Ray_d > > type; }; + { typedef std::optional< std::variant< Point_d, Segment_d, Ray_d > > type; }; template struct result - { typedef std::optional< boost::variant< Point_d, Line_d > > type; }; + { typedef std::optional< std::variant< Point_d, Line_d > > type; }; template struct result : result { }; template struct result - { typedef std::optional< boost::variant< Point_d, Ray_d > > type; }; + { typedef std::optional< std::variant< Point_d, Ray_d > > type; }; template struct result : result { }; template struct result - { typedef std::optional< boost::variant< Point_d, Segment_d > > type; }; + { typedef std::optional< std::variant< Point_d, Segment_d > > type; }; template struct result : result { }; diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index 9ca9eb02fa7..53157d070a2 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -143,7 +143,7 @@ #include #include #include -#include +#include #include // CGAL diff --git a/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h index 93b25870c21..5212ed6ea86 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h @@ -53,9 +53,9 @@ Function object that constructs the intersection between a 3D segment and a 3D triangle. Partial model of `::Kernel::Intersect_3`. Provides the operators: -- `std::optional< boost::variant< Point_3, Segment_3 > > operator()(Segment_3 seg, Triangle_3 tr)` +- `std::optional< std::variant< Point_3, Segment_3 > > operator()(Segment_3 seg, Triangle_3 tr)` -- `std::optional< boost::variant< Point_3, Segment_3 > > operator()(Triangle_3 tr, Segment_3 seg)` +- `std::optional< std::variant< Point_3, Segment_3 > > operator()(Triangle_3 tr, Segment_3 seg)` which computes the intersection between the triangle and the segment. */ diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h index 63fcddb7a40..8958ab919a7 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h @@ -312,11 +312,11 @@ public: /*! A constructor object that must provide the function operators: - `std::optional< boost::variant< T... > > operator()(Segment_3 s, Plane_3 p)` + `std::optional< std::variant< T... > > operator()(Segment_3 s, Plane_3 p)` - `std::optional< boost::variant< T... > > operator()(Ray_3 r, Iso_cuboid i)` + `std::optional< std::variant< T... > > operator()(Ray_3 r, Iso_cuboid i)` - `std::optional< boost::variant< T... > > operator()(Segment_3 s, Iso_cuboid i)` + `std::optional< std::variant< T... > > operator()(Segment_3 s, Iso_cuboid i)` which returns the intersection region of two geometrical objects. */ diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index a6fd33ab1ec..7e7f98b86e5 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -1096,7 +1096,7 @@ public: { const auto clipped = CGAL::intersection(query, r_domain_.bbox_); if(clipped) - if(const Segment_3* s = boost::get(&*clipped)) + if(const Segment_3* s = std::get_if(&*clipped)) return this->operator()(*s); return Surface_patch(); @@ -1224,7 +1224,7 @@ public: { const auto clipped = CGAL::intersection(query, r_domain_.bbox_); if(clipped) - if(const Segment_3* s = boost::get(&*clipped)) + if(const Segment_3* s = std::get_if(&*clipped)) return this->operator()(*s); return Intersection(); @@ -1259,14 +1259,14 @@ public: * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const - { return boost::get(index); } + { return std::get(index); } /* * Returns the index of the subdomain containing a vertex * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const - { return boost::get(index); } + { return std::get(index); } // ----------------------------------- // Backward Compatibility diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h index a35b1172791..344654e42b1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h @@ -501,7 +501,7 @@ struct Sizing_field_with_aabb_tree const auto int_res = CGAL::intersection(prim.datum(), curr_ortho_plane); if (int_res) { - if (const Point_3* pp = boost::get(&*int_res)) + if (const Point_3* pp = std::get_if(&*int_res)) { FT new_sqd = CGAL::squared_distance(p, *pp); FT dist = CGAL::abs(d_ptr->domain.signed_geodesic_distance(p, *pp, curve_id)); 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 47b9bf495ad..47e8fe5d205 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 @@ -38,7 +38,7 @@ #include #include // for boost::prior and boost::next -#include +#include #include namespace CGAL { @@ -772,22 +772,22 @@ public: * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const - { return boost::get(index); } + { return std::get(index); } /** * Returns the index of the subdomain containing a vertex * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const - { return boost::get(index); } + { return std::get(index); } /// Returns a `Curve_index` from an `Index` Curve_index curve_index(const Index& index) const - { return boost::get(index); } + { return std::get(index); } /// Returns a `Corner_index` from an `Index` Corner_index corner_index(const Index& index) const - { return boost::get(index); } + { return std::get(index); } /// @cond DEVELOPERS #ifndef CGAL_NO_DEPRECATED_CODE diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 66178d3906f..73430e2aec5 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -536,15 +536,15 @@ public: return std::nullopt; else { for(const Inter_and_prim& i_p: all_intersections) { - if(boost::get( &i_p.first) == 0) return AABB_primitive_id(); + if(std::get_if( &i_p.first) == 0) return AABB_primitive_id(); } auto it = std::min_element (all_intersections.begin(), all_intersections.end(), [p](const Inter_and_prim& a, const Inter_and_prim& b) { - const Point_3& pa = boost::get(a.first); - const Point_3& pb = boost::get(b.first); + const Point_3& pa = std::get(a.first); + const Point_3& pb = std::get(b.first); return compare_distance_to_point(p, pa, pb) == CGAL::SMALLER; }); diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 5ac9a12411a..417c27777a6 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -459,7 +459,7 @@ public: // intersection may be either a point or a segment if ( const Bare_point* p_intersect_pt = - boost::get( &(intersection->first) ) ) + std::get_if( &(intersection->first) ) ) { return Intersection(*p_intersect_pt, r_domain_.index_from_surface_patch_index( @@ -467,7 +467,7 @@ public: 2); } else if ( const Segment_3* p_intersect_seg = - boost::get(&(intersection->first))) + std::get_if(&(intersection->first))) { CGAL_MESH_3_PROFILER("Mesh_3 profiler: Intersection is a segment"); @@ -533,14 +533,14 @@ public: * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const - { return boost::get(index); } + { return std::get(index); } /** * Returns the index of the subdomain containing a vertex * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const - { return boost::get(index); } + { return std::get(index); } // ----------------------------------- // Backward Compatibility @@ -607,7 +607,7 @@ private: AABB_tree_* bounding_tree_; // cache queries and intersected primitive - typedef typename boost::make_variant_over::type Cached_query; + typedef typename std::variant::type Cached_query; struct Query_cache { Query_cache() : has_cache(false) {} 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 25a468bbf6f..e5e5cf7f04f 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 @@ -205,7 +205,7 @@ private: 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_if(&ii)); assert(std::get<2>(i) == 2); } @@ -213,7 +213,7 @@ private: 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_if(&ii)); assert(std::get<2>(i) == 0); } @@ -222,7 +222,7 @@ private: 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_if(&ii)); assert(std::get<2>(i) == 2); } @@ -230,7 +230,7 @@ private: 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_if(&ii)); assert(std::get<2>(i) == 0); } @@ -239,7 +239,7 @@ private: 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_if(&ii)); assert(std::get<2>(i) == 2); } @@ -247,7 +247,7 @@ private: 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_if(&ii)); assert(std::get<2>(i) == 0); } } diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h index 8db0bd9849a..1cb47858c42 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h @@ -297,10 +297,10 @@ public: OutputIterator oi) const { typedef std::pair Intersection_base_point; - typedef boost::variant + typedef std::variant Intersection_base_result; typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; // In case the curves are adjacent in their curve sequence, we do @@ -317,7 +317,7 @@ public: // Attach labels to the intersection objects. for (const auto& xection : xections) { const Intersection_base_point* base_pt = - boost::get(&xection); + std::get_if(&xection); if (base_pt != nullptr) { // Attach an invalid label to an itersection point. @@ -327,7 +327,7 @@ public: } const Base_x_monotone_curve_2* base_xcv = - boost::get(&xection); + std::get_if(&xection); CGAL_assertion(base_xcv != nullptr); // Attach a merged label to the overlapping curve. diff --git a/Nef_2/include/CGAL/Nef_2/geninfo.h b/Nef_2/include/CGAL/Nef_2/geninfo.h index 41fab418e91..eb723de0fcd 100644 --- a/Nef_2/include/CGAL/Nef_2/geninfo.h +++ b/Nef_2/include/CGAL/Nef_2/geninfo.h @@ -17,7 +17,7 @@ #define CGAL_DEPRECATED_HEADER "" #define CGAL_DEPRECATED_MESSAGE_DETAILS \ - "Something like std::any or boost::variant should be used instead." + "Something like std::any or std::variant should be used instead." #include #include diff --git a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xy_3.h b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xy_3.h index 7b944428601..c35cfd303f5 100644 --- a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xy_3.h +++ b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xy_3.h @@ -34,7 +34,7 @@ struct Exact_intersect_xy_2 typedef typename R::Point_3 Point_3; typedef typename R::Segment_3 Segment_3; - typedef boost::variant variant_type; + typedef std::variant variant_type; std::optional operator() (const Segment_3& s3, const Segment_3& t3) @@ -57,12 +57,12 @@ struct Exact_intersect_xy_2 if(! obj){ return std::nullopt; } - if (const Point_2* pi = boost::get(&*obj)) + if (const Point_2* pi = std::get_if(&*obj)) { return std::make_optional(variant_type(Point_3(p2.x(),p2.y(),0))); } - const Segment_2* si = boost::get(&*obj); + const Segment_2* si = std::get_if(&*obj); p2 = si->source(); q2 = si->target(); @@ -80,7 +80,7 @@ struct Exact_intersect_xy_2 typedef typename R::Point_3 Point_3; typedef typename R::Segment_3 Segment_3; - typedef boost::variant variant_type; + typedef std::variant variant_type; std::optional operator() (Segment_3 s3, Segment_3 t3) { Point_2 p2, q2; @@ -104,12 +104,12 @@ struct Exact_intersect_xy_2 if(! obj){ return std::nullopt; } - if (const Point_2* pi = boost::get(&*obj)) + if (const Point_2* pi = std::get_if(&*obj)) { return std::make_optional(variant_type(Point_3(p2.hx(),p2.hy(),0,p2.hw()))); } - const Segment_2* si = boost::get(&*obj); + const Segment_2* si = std::get_if(&*obj); p2 = si->source(); q2 = si->target(); diff --git a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xz_3.h b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xz_3.h index 77329529249..b68849ee87e 100644 --- a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xz_3.h +++ b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_xz_3.h @@ -33,7 +33,7 @@ struct Exact_intersect_xz_2 typedef typename R::Point_3 Point_3; typedef typename R::Segment_3 Segment_3; - typedef boost::variant variant_type; + typedef std::variant variant_type; std::optional operator() (const Segment_3& s3, const Segment_3& t3) @@ -56,12 +56,12 @@ struct Exact_intersect_xz_2 if(! obj){ return std::nullopt; } - if (const Point_2* pi = boost::get(&*obj)) + if (const Point_2* pi = std::get_if(&*obj)) { return std::make_optional(variant_type(Point_3(p2.x(),0,p2.y()))); } - const Segment_2* si = boost::get(&*obj); + const Segment_2* si = std::get_if(&*obj); p2 = si->source(); q2 = si->target(); @@ -79,7 +79,7 @@ struct Exact_intersect_xz_2 typedef typename R::Point_3 Point_3; typedef typename R::Segment_3 Segment_3; - typedef boost::variant variant_type; + typedef std::variant variant_type; std::optional operator() (Segment_3 s3, Segment_3 t3) { Point_2 p2, q2; @@ -103,12 +103,12 @@ struct Exact_intersect_xz_2 if(! obj){ return std::nullopt; } - if (const Point_2* pi = boost::get(&*obj)) + if (const Point_2* pi = std::get_if(&*obj)) { return std::make_optional(variant_type(Point_3(p2.hx(),0,p2.hy(),p2.hw()))); } - const Segment_2* si = boost::get(&*obj); + const Segment_2* si = std::get_if(&*obj); p2 = si->source(); q2 = si->target(); diff --git a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_yz_3.h b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_yz_3.h index ac2007ce556..6b396bf9dd9 100644 --- a/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_yz_3.h +++ b/Nef_3/include/CGAL/Nef_3/Exact_triangulation_euclidean_traits_yz_3.h @@ -34,7 +34,7 @@ struct Exact_intersect_yz_2 typedef typename R::Point_3 Point_3; typedef typename R::Segment_3 Segment_3; - typedef boost::variant variant_type; + typedef std::variant variant_type; std::optional operator() (const Segment_3& s3, const Segment_3& t3) @@ -57,12 +57,12 @@ struct Exact_intersect_yz_2 if(! obj){ return std::nullopt; } - if (const Point_2* pi = boost::get(&*obj)) + if (const Point_2* pi = std::get_if(&*obj)) { return std::make_optional(variant_type(Point_3(0,p2.x(),p2.y()))); } - const Segment_2* si = boost::get(&*obj); + const Segment_2* si = std::get_if(&*obj); p2 = si->source(); q2 = si->target(); @@ -80,7 +80,7 @@ struct Exact_intersect_yz_2 typedef typename R::Point_3 Point_3; typedef typename R::Segment_3 Segment_3; - typedef boost::variant variant_type; + typedef std::variant variant_type; std::optional operator() (Segment_3 s3, Segment_3 t3) { Point_2 p2, q2; @@ -104,12 +104,12 @@ struct Exact_intersect_yz_2 if(! obj){ return std::nullopt; } - if (const Point_2* pi = boost::get(&*obj)) + if (const Point_2* pi = std::get_if(&*obj)) { return std::make_optional(variant_type(Point_3(0,p2.hx(),p2.hy(),p2.hw()))); } - const Segment_2* si = boost::get(&*obj); + const Segment_2* si = std::get_if(&*obj); p2 = si->source(); q2 = si->target(); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h b/NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h index 09ed5664c46..d62b8215cc5 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h @@ -182,7 +182,7 @@ typename typeset_intersection()(obj,*this); } - //TODO: convert boost::variant + //TODO: convert std::variant }; diff --git a/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_triangulation_2.h b/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_triangulation_2.h index fecb03e33a1..979ec116b10 100644 --- a/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_triangulation_2.h +++ b/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_triangulation_2.h @@ -793,7 +793,7 @@ public: const auto result = intersection(lab, lts); if (result) { - const Point* iq = boost::get(&(*result)); + const Point* iq = std::get_if(&(*result)); if (iq) Dqt = CGAL::approximate_sqrt(geom_traits().compute_squared_distance_2_object()(*iq, pt)); } 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 4a644675add..d46e847a2c0 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 @@ -980,7 +980,7 @@ dump_dummy_points(const std::string filename) const for(; vit!=vend; ++vit) { Index index = c3t3_.index(vit); - const int* i = boost::get(&index); + const int* i = std::get_if(&index); if(i && *i == 0) dummy_out << cp(c3t3_.triangulation().point(vit)) << std::endl; } @@ -994,7 +994,7 @@ try_to_remove_dummy_vertex(const Vertex_handle dummy_vertex) const { // 'dummy_vertex' must correspond to a dummy point CGAL_precondition_code(Index index = c3t3_.index(dummy_vertex);) - CGAL_precondition_code(if(const int* i = boost::get(&index)) {) + CGAL_precondition_code(if(const int* i = std::get_if(&index)) {) CGAL_precondition(*i == 0); CGAL_precondition_code(}) @@ -1340,7 +1340,7 @@ try_to_solve_close_dummy_point(Vertex_handle& protection_vertex, { // dummy_vertex must be a dummy point CGAL_precondition_code(Index index = c3t3_.index(dummy_vertex);) - CGAL_precondition_code(if(const int* i = boost::get(&index)) {) + CGAL_precondition_code(if(const int* i = std::get_if(&index)) {) CGAL_precondition(*i == 0); CGAL_precondition_code(}) @@ -1608,7 +1608,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, Vertex_handle v = ch->vertex(li); Index existing_vertex_index = c3t3_.index(v); - const int* i = boost::get(&existing_vertex_index); + const int* i = std::get_if(&existing_vertex_index); if(i && *i == 0) { @@ -1677,7 +1677,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, << "at distance: " << sq_d << std::endl; Index nearest_vh_index = c3t3_.index(nearest_vh); - int* i = boost::get(&nearest_vh_index); + int* i = std::get_if(&nearest_vh_index); if(i && *i == 0) std::cerr << "Nearest power vertex is a dummy point" << std::endl; #endif @@ -1745,7 +1745,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, #ifdef CGAL_PERIODIC_PROTECTION_ATTEMPT_TO_REMOVE_DUMMY_PTS Index v_index = c3t3_.index(v); - const int* id = boost::get(&v_index); + const int* id = std::get_if(&v_index); bool is_v_dummy_vertex(id && *id == 0); #endif @@ -1792,7 +1792,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, << c3t3_.triangulation().point(nearest_vertex) << ")\n"; Index nearest_vertex_index = c3t3_.index(nearest_vertex); - i = boost::get(&nearest_vertex_index); + i = std::get_if(&nearest_vertex_index); if(i && *i == 0) std::cerr << "reduced due to dummy" << std::endl; #endif 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 5197b36d752..0e907a9b374 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 @@ -69,7 +69,7 @@ void find_points_to_project(C3T3& c3t3, OutputIterator vertices) Vertex_handle v = c->vertex((ind+i)&3); typename C3T3::Index index = c3t3.index(v); - if(const int* i = boost::get(&index)) + if(const int* i = std::get_if(&index)) { if(*i == 0) // '0' is the index of dummies *vertices++ = v; diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstream.h b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstream.h index 36cfbb488e9..97fc3e0d06a 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstream.h +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstream.h @@ -77,12 +77,12 @@ public: using Base::operator <<; PainterOstream& operator << (Hyperbolic_segment_2 s) { - if(const Euclidean_segment_2* seg = boost::get(&s)) { + if(const Euclidean_segment_2* seg = std::get_if(&s)) { CGAL::Qt::PainterOstream::operator << (*seg); return *this; } - Circular_arc_2* arc = boost::get(&s); + Circular_arc_2* arc = std::get_if(&s); if(arc->squared_radius() > 100) { Euclidean_segment_2 seg(arc->source(), arc->target()); diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/hyperbolic_free_motion_animation.h b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/hyperbolic_free_motion_animation.h index 5651f2c614a..80f9808370b 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/hyperbolic_free_motion_animation.h +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/hyperbolic_free_motion_animation.h @@ -28,7 +28,7 @@ MainWindow::initialize_animation_parameters() { source = Point(rx1, ry1); target = Point(rx2, ry2); Segment_2 seg = Construct_hyperbolic_segment_2()(source, target); - Circular_arc_2* carc = boost::get(&seg); + Circular_arc_2* carc = std::get_if(&seg); source = carc->source(); target = carc->target(); @@ -118,7 +118,7 @@ Point MainWindow::get_image(Point src, Point tgt, double time) { //std::cout << " ..getting image "; std::cout.flush(); Segment_2 seg = Construct_hyperbolic_segment_2()(src, tgt); - Circular_arc_2* carc = boost::get(&seg); + Circular_arc_2* carc = std::get_if(&seg); Circle_2 crc = carc->supporting_circle(); double sx = CGAL::to_double(((src.x()) - crc.center().x())/sqrt(crc.squared_radius())); @@ -233,7 +233,7 @@ MainWindow::animate() { // Correct in case of wrong orientation. //std::cout << " ..making line..." << std::endl; Segment_2 seg = Construct_hyperbolic_segment_2()(source, target); - Circular_arc_2* carc = boost::get(&seg); + Circular_arc_2* carc = std::get_if(&seg); std::pair inters = Construct_inexact_intersection_2()(carc->supporting_circle(), poincare); if(squared_distance(source, inters.first) < squared_distance(source, inters.second)) { source = inters.first; diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_traits_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_traits_2.h index 8304f78bf98..9c89cc574d0 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_traits_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_traits_2.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include @@ -371,9 +371,9 @@ class Compute_approximate_hyperbolic_diameter Hyperbolic_point_2 operator()(const Hyperbolic_segment_2& s1, const Hyperbolic_segment_2& s2) { - if(Circular_arc_2* c1 = boost::get(&s1)) + if(Circular_arc_2* c1 = std::get_if(&s1)) { - if(Circular_arc_2* c2 = boost::get(&s2)) + if(Circular_arc_2* c2 = std::get_if(&s2)) { std::pair res = operator()(c1->circle(), c2->circle()); @@ -387,7 +387,7 @@ class Compute_approximate_hyperbolic_diameter } else { - Euclidean_segment_2* ell2 = boost::get(&s2); + Euclidean_segment_2* ell2 = std::get_if(&s2); std::pair res = operator()(c1->circle(), ell2->supporting_line()); Hyperbolic_point_2 p1 = res.first; @@ -401,8 +401,8 @@ class Compute_approximate_hyperbolic_diameter } else { - Euclidean_segment_2* ell1 = boost::get(&s1); - if(Circular_arc_2* c2 = boost::get(&s2)) + Euclidean_segment_2* ell1 = std::get_if(&s1); + if(Circular_arc_2* c2 = std::get_if(&s2)) { std::pair res = operator()(ell1->supporting_line(), c2->circle()); @@ -416,7 +416,7 @@ class Compute_approximate_hyperbolic_diameter } else { - Euclidean_segment_2* ell2 = boost::get(&s2); + Euclidean_segment_2* ell2 = std::get_if(&s2); Hyperbolic_point_2 p1 = operator()(ell1->supporting_line(), ell2->supporting_line()); CGAL_assertion(p1.x()*p1.x() + p1.y()*p1.y()) < FT(1); return p1; @@ -465,9 +465,9 @@ class Compute_approximate_hyperbolic_diameter Euclidean_line_2* l; Circle_2* c; - if(Circle_2* c_pq = boost::get(&bis_pq)) + if(Circle_2* c_pq = std::get_if(&bis_pq)) { - if(Circle_2* c_qr = boost::get(&bis_qr)) + if(Circle_2* c_qr = std::get_if(&bis_qr)) { std::pair inters = _gt.construct_inexact_intersection_2_object()(*c_pq, *c_qr); @@ -477,14 +477,14 @@ class Compute_approximate_hyperbolic_diameter return inters.second; } // here bis_qr is a line - l = boost::get(&bis_qr); + l = std::get_if(&bis_qr); c = c_pq; } else { // here bis_pq is a line - l = boost::get(&bis_pq); - c = boost::get(&bis_qr); + l = std::get_if(&bis_pq); + c = std::get_if(&bis_qr); } std::pair inters = _gt.construct_inexact_intersection_2_object()(*c, *l); 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 335ba822647..59fba116ed9 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -58,8 +58,8 @@ is a vertex). The implementation follow \cgalCite{cgal:la-srpss-13}. \tparam Kernel a model of `EfficientRANSACTraits` that must provide in addition a function `Intersect_3 intersection_3_object() const` and a functor `Intersect_3` with: -- `std::optional< boost::variant< Traits::Plane_3, Traits::Line_3 > > operator()(typename Traits::Plane_3, typename Traits::Plane_3)` -- `std::optional< boost::variant< Traits::Line_3, Traits::Point_3 > > operator()(typename Traits::Line_3, typename Traits::Plane_3)` +- `std::optional< std::variant< Traits::Plane_3, Traits::Line_3 > > operator()(typename Traits::Plane_3, typename Traits::Plane_3)` +- `std::optional< std::variant< Traits::Line_3, Traits::Point_3 > > operator()(typename Traits::Line_3, typename Traits::Plane_3)` */ template @@ -808,7 +808,7 @@ private: continue; } - if (const Line* l = boost::get(&*result)) + if (const Line* l = std::get_if(&*result)) m_edges[i].support = *l; else { @@ -1029,7 +1029,7 @@ private: auto result = CGAL::intersection (plane1, ortho); if (result) { - if (const Line* l = boost::get(&*result)) + if (const Line* l = std::get_if(&*result)) { if (!(pts1.empty())) { @@ -1066,7 +1066,7 @@ private: result = CGAL::intersection (plane2,ortho); if (result) { - if (const Line* l = boost::get(&*result)) + if (const Line* l = std::get_if(&*result)) { if (!(pts2.empty())) { @@ -1193,12 +1193,12 @@ private: const auto result = CGAL::intersection(plane1, plane2); if (result) { - if (const Line* l = boost::get(&*result)) + if (const Line* l = std::get_if(&*result)) { const auto result2 = CGAL::intersection(*l, plane3); if (result2) { - if (const Point* p = boost::get(&*result2)) + if (const Point* p = std::get_if(&*result2)) m_corners[i].support = *p; else { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h index 468acfaf5b4..9c32aa05b3a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h @@ -268,7 +268,7 @@ public: CGAL_assertion(inter_res != std::nullopt); const Exact_kernel::Point_3* pt = - boost::get(&(*inter_res)); + std::get_if(&(*inter_res)); CGAL_assertion(pt!=nullptr); add_new_node(*pt); } @@ -389,7 +389,7 @@ public: CGAL_assertion(inter_res != std::nullopt); const Point_3* pt = - boost::get(&(*inter_res)); + std::get_if(&(*inter_res)); CGAL_assertion(pt!=nullptr); add_new_node(*pt); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h index 92c5871d290..99483e93abc 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h @@ -15,7 +15,7 @@ #include #include -#include +#include #ifndef CGAL_INTERNAL_POLYGON_MESH_SLICER_AXIS_PARALLEL_PLANE_TRAITS_H @@ -95,7 +95,7 @@ public: const typename Traits::Construct_source_3 m_source_3; const typename Traits::Construct_target_3 m_target_3; - typedef boost::variant Variant_type; + typedef std::variant Variant_type; typedef std::optional< Variant_type > result_type; Intersect_3(const Axis_parallel_plane_traits& traits) 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 090f0c775e2..670556ecec4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -95,7 +95,7 @@ struct Location_traits /// /// A variant used in the function `get_descriptor_from_location()`. template -using descriptor_variant = boost::variant::vertex_descriptor, +using descriptor_variant = std::variant::vertex_descriptor, typename boost::graph_traits::halfedge_descriptor, typename boost::graph_traits::face_descriptor>; @@ -149,13 +149,13 @@ incident_faces(const std::pair::face_ const descriptor_variant dv = get_descriptor_from_location(location, tm); - if(const vertex_descriptor* vd_ptr = boost::get(&dv)) + if(const vertex_descriptor* vd_ptr = std::get_if(&dv)) { const vertex_descriptor vd = *vd_ptr; for(face_descriptor fd : faces_around_target(halfedge(vd, tm), tm)) *out++ = fd; } - else if(const halfedge_descriptor* hd_ptr = boost::get(&dv)) + else if(const halfedge_descriptor* hd_ptr = std::get_if(&dv)) { const halfedge_descriptor hd = *hd_ptr; *out++ = face(hd, tm); @@ -163,7 +163,7 @@ incident_faces(const std::pair::face_ } else { - const face_descriptor fd = boost::get(dv); + const face_descriptor fd = std::get(dv); *out++ = fd; } @@ -664,7 +664,7 @@ is_on_vertex(const std::pair::face_de const descriptor_variant dv = get_descriptor_from_location(loc, tm); - if(const vertex_descriptor* vd_ptr = boost::get(&dv)) + if(const vertex_descriptor* vd_ptr = std::get_if(&dv)) return (vd == *vd_ptr); return false; @@ -709,9 +709,9 @@ is_on_halfedge(const std::pair::face_ const descriptor_variant dv = get_descriptor_from_location(loc, tm); - if(const vertex_descriptor* vd_ptr = boost::get(&dv)) + if(const vertex_descriptor* vd_ptr = std::get_if(&dv)) return (*vd_ptr == source(hd, tm) || *vd_ptr == target(hd, tm)); - else if(const halfedge_descriptor* hd_ptr = boost::get(&dv)) + else if(const halfedge_descriptor* hd_ptr = std::get_if(&dv)) return (*hd_ptr == hd); return false; @@ -1193,14 +1193,14 @@ locate_in_adjacent_face(const std::pair loc_in_fd = std::make_pair(fd, CGAL::make_array(FT(0), FT(0), FT(0))); const descriptor_variant dv = get_descriptor_from_location(loc, tm); - if(const vertex_descriptor* vd_ptr = boost::get(&dv)) + if(const vertex_descriptor* vd_ptr = std::get_if(&dv)) { int index_of_vd = vertex_index_in_face(*vd_ptr, fd, tm); loc_in_fd.second[index_of_vd] = FT(1); // Note that the barycentric coordinates were initialized to 0, // so the second and third coordinates are already set up properly. } - else if(const halfedge_descriptor* hd_ptr = boost::get(&dv)) + else if(const halfedge_descriptor* hd_ptr = std::get_if(&dv)) { // Note that, here, we know that we are _not_ on a vertex const halfedge_descriptor hd = *hd_ptr; @@ -1225,7 +1225,7 @@ locate_in_adjacent_face(const std::pair(dv);) + CGAL_assertion_code(const face_descriptor fd2 = std::get(dv);) CGAL_assertion(fd2 != boost::graph_traits::null_face()); CGAL_assertion(fd2 != fd); @@ -1264,7 +1264,7 @@ locate_in_common_face(std::pair::face bool is_query_location_in_face = false; - if(const vertex_descriptor* vd_ptr = boost::get(&dv)) + if(const vertex_descriptor* vd_ptr = std::get_if(&dv)) { const vertex_descriptor vd = *vd_ptr; halfedge_descriptor hd = halfedge(vd, tm); @@ -1284,7 +1284,7 @@ locate_in_common_face(std::pair::face break; } } - else if(const halfedge_descriptor* hd_ptr = boost::get(&dv)) + else if(const halfedge_descriptor* hd_ptr = std::get_if(&dv)) { const halfedge_descriptor hd = *hd_ptr; if(!is_border(hd, tm)) @@ -1304,7 +1304,7 @@ locate_in_common_face(std::pair::face } else { - const face_descriptor fd = boost::get(dv); + const face_descriptor fd = std::get(dv); CGAL_precondition(fd != boost::graph_traits::null_face()); query_location = locate_in_face(query, fd, tm, np); @@ -1866,7 +1866,7 @@ locate_with_AABB_tree(const typename internal::Location_traits(&(intersections[i]->first)); + Point_3* intersection_point = std::get_if(&(intersections[i]->first)); if(intersection_point) { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h index 56733b660fd..f1b88540a60 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include @@ -102,7 +102,7 @@ class Polygon_mesh_slicer typedef typename Traits::FT FT; /// typedefs for internal graph to get connectivity of the polylines - typedef boost::variant AL_vertex_info; + typedef std::variant AL_vertex_info; typedef boost::adjacency_list < boost::vecS, boost::vecS, @@ -181,9 +181,9 @@ class Polygon_mesh_slicer AL_vertex_info v1 = al_graph[nodes_for_orient.first]; AL_vertex_info v2 = al_graph[nodes_for_orient.second]; - if (const vertex_descriptor* vd1_ptr = boost::get(&v1) ) + if (const vertex_descriptor* vd1_ptr = std::get_if(&v1) ) { - if (const vertex_descriptor* vd2_ptr = boost::get(&v2) ) + if (const vertex_descriptor* vd2_ptr = std::get_if(&v2) ) { CGAL_assertion( halfedge(*vd1_ptr, *vd2_ptr, m_tmesh).second ); halfedge_descriptor h_opp = halfedge(*vd1_ptr, *vd2_ptr, m_tmesh).first; @@ -207,7 +207,7 @@ class Polygon_mesh_slicer else { // e2 is intersected in its interior - edge_descriptor e2 = boost::get(v2); + edge_descriptor e2 = std::get(v2); halfedge_descriptor h2 = halfedge(e2, m_tmesh); if ( target(next(h2, m_tmesh), m_tmesh) != *vd1_ptr ) h2=opposite(h2, m_tmesh); @@ -216,9 +216,9 @@ class Polygon_mesh_slicer } else { - edge_descriptor e1 = boost::get(v1); + edge_descriptor e1 = std::get(v1); halfedge_descriptor h1 = halfedge(e1, m_tmesh); - if (const vertex_descriptor* vd2_ptr = boost::get(&v2) ) + if (const vertex_descriptor* vd2_ptr = std::get_if(&v2) ) { // e1 is intersected in its interior if ( target(next(h1, m_tmesh), m_tmesh) != *vd2_ptr ) @@ -228,7 +228,7 @@ class Polygon_mesh_slicer else { // intersection in the interior of both edges - edge_descriptor e2 = boost::get(v2); + edge_descriptor e2 = std::get(v2); halfedge_descriptor h2 = halfedge(e2, m_tmesh); if ( face(h1, m_tmesh) != face(h2,m_tmesh) ) { @@ -265,20 +265,20 @@ class Polygon_mesh_slicer nodes_for_orient.second=node_id; AL_vertex_info v = al_graph[node_id]; - if (const vertex_descriptor* vd_ptr = boost::get(&v) ) + if (const vertex_descriptor* vd_ptr = std::get_if(&v) ) { current_poly.push_back( get(m_vpmap, *vd_ptr) ); } else { - edge_descriptor ed = boost::get(v); + edge_descriptor ed = std::get(v); Segment_3 s( get(m_vpmap, source(ed, m_tmesh)), get(m_vpmap,target(ed, m_tmesh)) ); const auto inter = intersect_3(m_plane, s); CGAL_assertion(inter != std::nullopt); - const Point_3* pt_ptr = boost::get(&(*inter)); + const Point_3* pt_ptr = std::get_if(&(*inter)); current_poly.push_back( *pt_ptr ); } } diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp index 17b35766008..93e4b9eded2 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp @@ -209,19 +209,19 @@ void test_constructions(const G& g, // --------------------------------------------------------------------------- loc = std::make_pair(f, CGAL::make_array(FT(0.3), FT(0.4), FT(0.3))); descriptor_variant dv = PMP::get_descriptor_from_location(loc, g); - const face_descriptor* fd = boost::get(&dv); + const face_descriptor* fd = std::get_if(&dv); assert(fd); loc = std::make_pair(f, CGAL::make_array(FT(0.5), FT(0.5), FT(0))); dv = PMP::get_descriptor_from_location(loc, g); - const halfedge_descriptor* hd = boost::get(&dv); + const halfedge_descriptor* hd = std::get_if(&dv); assert(hd); loc = std::make_pair(f, CGAL::make_array(FT(1), FT(0), FT(0))); assert(PMP::is_on_vertex(loc, source(halfedge(f, g), g), g)); dv = PMP::get_descriptor_from_location(loc, g); - if(const vertex_descriptor* v = boost::get(&dv)) { } else { assert(false); } + if(const vertex_descriptor* v = std::get_if(&dv)) { } else { assert(false); } // --------------------------------------------------------------------------- // just to check the API 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 7a889e4da14..c83911ea93f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -265,7 +265,7 @@ struct Fake_mesh_domain { typedef std::pair Surface_patch_index; typedef int Curve_index; typedef int Corner_index; - typedef boost::variant Index; + typedef std::variant Index; }; typedef Geom_traits Fake_gt; @@ -417,12 +417,12 @@ struct Update_vertex case 2: { const typename V1::Index& index = v1.index(); - const Sp_index sp_index = boost::get(index); + const Sp_index sp_index = std::get(index); v2.set_index((std::max)(sp_index.first, sp_index.second)); } break; default:// -1, 0, 1, 3 - v2.set_index(boost::get(v1.index())); + v2.set_index(std::get(v1.index())); } return true; } 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 da298acf6ff..cb10a9a806a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -231,7 +231,7 @@ private: IMAGE_MESH_ITEMS, IMPLICIT_MESH_ITEMS }; - mutable std::optional> items; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp index b39fd8b8f0a..036cdc43026 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp @@ -216,13 +216,13 @@ void Polyhedron_demo_intersection_plugin::intersectionPolylines() CGAL::cpp11::result_of::type result = CGAL::intersection(segA, segB); if (result) { - if (const Kernel::Segment_3* s = boost::get(&*result)) { + if (const Kernel::Segment_3* s = std::get_if(&*result)) { Polyline_3 p; p.push_back(s->point(0)); p.push_back(s->point(1)); new_pol_item->polylines.push_back(p); } else { - const Kernel::Point_3* p = boost::get(&*result); + const Kernel::Point_3* p = std::get_if(&*result); new_point_item->point_set()->insert(*p); } } @@ -326,13 +326,13 @@ void Polyhedron_demo_intersection_plugin::intersectionSurfacePolyline() CGAL::cpp11::result_of::type result = CGAL::intersection(triangle, segment); if (result) { - if (const Kernel::Segment_3* s = boost::get(&*result)) { + if (const Kernel::Segment_3* s = std::get_if(&*result)) { Polyline_3 p; p.push_back(s->point(0)); p.push_back(s->point(1)); new_pol_item->polylines.push_back(p); } else { - const Kernel::Point_3* p = boost::get(&*result); + const Kernel::Point_3* p = std::get_if(&*result); new_point_item->point_set()->insert(*p); } } diff --git a/Polyhedron/demo/Polyhedron/Scene.h b/Polyhedron/demo/Polyhedron/Scene.h index b661ed7baa8..af6a0b55f0e 100644 --- a/Polyhedron/demo/Polyhedron/Scene.h +++ b/Polyhedron/demo/Polyhedron/Scene.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include class QEvent; class QMouseEvent; diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 75db7480aaa..c1b8d2a4619 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -1214,7 +1214,7 @@ Scene_surface_mesh_item::select(double orig_x, { const EPICK::Point_3* closest_point = - boost::get(&(closest->first)); + std::get_if(&(closest->first)); for(Intersections::iterator it = boost::next(intersections.begin()), end = intersections.end(); @@ -1225,7 +1225,7 @@ Scene_surface_mesh_item::select(double orig_x, } else { const EPICK::Point_3* it_point = - boost::get(&it->first); + std::get_if(&it->first); if(it_point && (ray_dir * (*it_point - *closest_point)) < 0) { @@ -1923,7 +1923,7 @@ void Scene_surface_mesh_item::zoomToPosition(const QPoint &point, CGAL::Three::V if(!intersections.empty()) { Intersections::iterator closest = intersections.begin(); const EPICK::Point_3* closest_point = - boost::get(&closest->first); + std::get_if(&closest->first); for(Intersections::iterator it = boost::next(intersections.begin()), end = intersections.end(); @@ -1934,7 +1934,7 @@ void Scene_surface_mesh_item::zoomToPosition(const QPoint &point, CGAL::Three::V } else { const EPICK::Point_3* it_point = - boost::get(&it->first); + std::get_if(&it->first); if(it_point && (ray_dir * (*it_point - *closest_point)) < 0) { diff --git a/Polyhedron/demo/Polyhedron/include/id_printing.h b/Polyhedron/demo/Polyhedron/include/id_printing.h index 46d142a24bb..89276883dc3 100644 --- a/Polyhedron/demo/Polyhedron/include/id_printing.h +++ b/Polyhedron/demo/Polyhedron/include/id_printing.h @@ -153,7 +153,7 @@ bool find_primitive_id(const QPoint& point, return false; typename Intersections::iterator closest = intersections.begin(); const Point* closest_point = - boost::get(&closest->first); + std::get_if(&closest->first); for(typename Intersections::iterator it = boost::next(intersections.begin()), end = intersections.end(); @@ -164,7 +164,7 @@ bool find_primitive_id(const QPoint& point, } else { const Point* it_point = - boost::get(&it->first); + std::get_if(&it->first); if(it_point && (ray_dir * (*it_point - *closest_point)) < 0) { diff --git a/SMDS_3/include/CGAL/IO/output_to_vtu.h b/SMDS_3/include/CGAL/IO/output_to_vtu.h index e78f1b680a2..37cd018570f 100644 --- a/SMDS_3/include/CGAL/IO/output_to_vtu.h +++ b/SMDS_3/include/CGAL/IO/output_to_vtu.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -273,7 +273,7 @@ enum VTU_ATTRIBUTE_TYPE{ SIZE_TYPE }; -typedef boost::variant*, const std::vector*, const std::vector* > Vtu_attributes; +typedef std::variant*, const std::vector*, const std::vector* > Vtu_attributes; template void output_to_vtu_with_attributes(std::ostream& os, @@ -316,13 +316,13 @@ void output_to_vtu_with_attributes(std::ostream& os, { switch(attributes[i].second.which()){ case 0: - write_attribute_tag(os,attributes[i].first, *boost::get* >(attributes[i].second), binary,offset); + write_attribute_tag(os,attributes[i].first, *std::get* >(attributes[i].second), binary,offset); break; case 1: - write_attribute_tag(os,attributes[i].first, *boost::get* >(attributes[i].second), binary,offset); + write_attribute_tag(os,attributes[i].first, *std::get* >(attributes[i].second), binary,offset); break; default: - write_attribute_tag(os,attributes[i].first, *boost::get* >(attributes[i].second), binary,offset); + write_attribute_tag(os,attributes[i].first, *std::get* >(attributes[i].second), binary,offset); break; } } @@ -336,13 +336,13 @@ void output_to_vtu_with_attributes(std::ostream& os, for(std::size_t i = 0; i< attributes.size(); ++i) switch(attributes[i].second.which()){ case 0: - write_attributes(os, *boost::get* >(attributes[i].second)); + write_attributes(os, *std::get* >(attributes[i].second)); break; case 1: - write_attributes(os, *boost::get* >(attributes[i].second)); + write_attributes(os, *std::get* >(attributes[i].second)); break; default: - write_attributes(os, *boost::get* >(attributes[i].second)); + write_attributes(os, *std::get* >(attributes[i].second)); break; } } diff --git a/SMDS_3/include/CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h b/SMDS_3/include/CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h index cd3c8f135a9..977909a463d 100644 --- a/SMDS_3/include/CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h +++ b/SMDS_3/include/CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace CGAL { template <> @@ -52,19 +52,19 @@ public: }; template <> -class Output_rep > > : public IO_rep_is_specialized { - typedef boost::variant > Variant; + typedef std::variant > Variant; const Variant& v; public: Output_rep(const Variant& v) : v(v) {} std::ostream& operator()( std::ostream& out) const { if(v.which() == 1) { - out << IO::oformat(boost::get >(v)); + out << IO::oformat(std::get >(v)); } else { - out << boost::get(v); + out << std::get(v); } return out; } 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 0e4e8901ce5..5ea95241e69 100644 --- a/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h +++ b/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -36,12 +35,12 @@ namespace internal { // ----------------------------------- // Index_generator -// Don't use boost::variant if types are the same type +// Don't use std::variant if types are the same type // ----------------------------------- template < typename Subdomain_index, typename Surface_patch_index > struct Index_generator { - typedef boost::variant Index; + typedef std::variant Index; typedef Index type; }; @@ -72,19 +71,19 @@ struct Indices_tuple_generator template using Indices_tuple_t = typename Indices_tuple_generator::type; -// Nasty meta-programming to get a boost::variant of four types that +// Nasty meta-programming to get a std::variant of four types that // may not be all different. template struct seq1 { typedef T0 type; }; template struct seq2 { - typedef boost::variant type; + typedef std::variant type; }; template struct seq3 { - typedef boost::variant type; + typedef std::variant type; }; template struct seq4 { - typedef boost::variant type; + typedef std::variant type; }; template struct insert; @@ -145,7 +144,7 @@ struct Index_generator_with_features template const T& get_index(const Boost_variant& x, std::enable_if_t::value > * = 0) -{ return boost::get(x); } +{ return std::get(x); } template const T& get_index(const T& x) { return x; } @@ -305,8 +304,8 @@ struct Variant_read_visitor { }; template -struct Read_write_index> { - using Index = boost::variant; +struct Read_write_index> { + using Index = std::variant; using index_seq = std::make_index_sequence::value>; template @@ -317,12 +316,12 @@ struct Read_write_index> { void operator()(std::ostream& os, int, Index index) const { Variant_write_visitor visitor{os}; - apply_visitor(visitor, index); + std::visit(visitor, index); } Index operator()(std::istream& is, int dimension) const { Index index = get_index(dimension, index_seq{}); Variant_read_visitor visitor{is, index}; - apply_visitor(visitor, index); + std::visit(visitor, index); return index; } }; diff --git a/SMDS_3/include/CGAL/SMDS_3/io_signature.h b/SMDS_3/include/CGAL/SMDS_3/io_signature.h index ba50d850123..22022ba6051 100644 --- a/SMDS_3/include/CGAL/SMDS_3/io_signature.h +++ b/SMDS_3/include/CGAL/SMDS_3/io_signature.h @@ -33,7 +33,7 @@ #include #endif -#include +#include #include #include @@ -149,10 +149,10 @@ struct Get_io_signature }; template -struct Get_io_signature > +struct Get_io_signature > { std::string operator()() { - return std::string("boost::variant<") + + return std::string("std::variant<") + Get_io_signature()() + "," + Get_io_signature()() + ">"; } @@ -179,10 +179,10 @@ struct Get_io_signature > }; template -struct Get_io_signature > +struct Get_io_signature > { std::string operator()() { - return std::string("boost::variant<") + + return std::string("std::variant<") + Get_io_signature()() + "," + Get_io_signature()() + "," + Get_io_signature()() + ">"; @@ -191,10 +191,10 @@ struct Get_io_signature > template -struct Get_io_signature > +struct Get_io_signature > { std::string operator()() { - return std::string("boost::variant<") + + return std::string("std::variant<") + Get_io_signature()() + "," + Get_io_signature()() + "," + Get_io_signature()() + "," + diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h index 3f1a9c92d42..04b6f19af18 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -53,7 +53,7 @@ public: using Vertex_handle = typename Vb::Vertex_handle; // Types - using Index = boost::variant; + using Index = std::variant; using FT = typename GT::FT; // Constructor diff --git a/SMDS_3/test/SMDS_3/data/c3t3_io-hetero.cgal b/SMDS_3/test/SMDS_3/data/c3t3_io-hetero.cgal index f0c10161e35..e32557d8173 100644 --- a/SMDS_3/test/SMDS_3/data/c3t3_io-hetero.cgal +++ b/SMDS_3/test/SMDS_3/data/c3t3_io-hetero.cgal @@ -1,4 +1,4 @@ -CGAL c3t3 Triangulation_3(Weighted_point,Vb(Tvb_3+i+boost::variant,i,d>),Cb(enum+RTcb_3+(std::pair)[4])) +CGAL c3t3 Triangulation_3(Weighted_point,Vb(Tvb_3+i+std::variant,i,d>),Cb(enum+RTcb_3+(std::pair)[4])) 3 6 10 11 12 0 0 7 diff --git a/SMDS_3/test/SMDS_3/test_c3t3_io.cpp b/SMDS_3/test/SMDS_3/test_c3t3_io.cpp index ef8d9e16d7a..7105303ee34 100644 --- a/SMDS_3/test/SMDS_3/test_c3t3_io.cpp +++ b/SMDS_3/test/SMDS_3/test_c3t3_io.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include @@ -48,7 +48,7 @@ struct MD_heterogeneous_types { typedef std::pair Surface_patch_index; typedef int Curve_index; typedef double Corner_index; - typedef boost::variant Index; @@ -63,7 +63,7 @@ struct MD_heterogeneous_types { static std::string reference_format_string() { - return "Triangulation_3(Weighted_point,Vb(Tvb_3+i+boost::variant,i,d>),Cb(enum+RTcb_3+(std::pair)[4]))"; + return "Triangulation_3(Weighted_point,Vb(Tvb_3+i+std::variant,i,d>),Cb(enum+RTcb_3+(std::pair)[4]))"; } }; diff --git a/STL_Extension/doc/STL_Extension/CGAL/Object.h b/STL_Extension/doc/STL_Extension/CGAL/Object.h index 7a329af795f..4c843935996 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Object.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Object.h @@ -110,16 +110,16 @@ Object(const Object &o); /*! Implicit converting constructor for compatibility with -`boost::variant`. +`std::variant`. */ -Object(boost::variant); +Object(std::variant); /*! Implicit converting constructor for compatibility with -`std::optional` and `boost::variant`. +`std::optional` and `std::variant`. */ -Object(std::optional< boost::variant >); +Object(std::optional< std::variant >); /// @} diff --git a/STL_Extension/doc/STL_Extension/CGAL/iterator.h b/STL_Extension/doc/STL_Extension/CGAL/iterator.h index 5e1e1acce56..2ba1736893d 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/iterator.h +++ b/STL_Extension/doc/STL_Extension/CGAL/iterator.h @@ -106,8 +106,8 @@ The class `Dispatch_or_drop_output_iterator` defines an `OutputIterator` that contains a tuple of output iterators, and dispatches among those based on the type of the value type which is put in it. Besides defining assignment for all parameters of `V` -and for a tuple of type `V`, it is also defined for the types `boost::variant` and -`std::optional >`, where `T...` +and for a tuple of type `V`, it is also defined for the types `std::variant` and +`std::optional >`, where `T...` must be a subset of the parameters of `V`. Should the `std::optional` be empty, it will be discarded. @@ -194,8 +194,8 @@ dispatches among those based on the type of the value type which is put in it. Other types are also accepted, and the object is discarded in this case. Besides defining assignment for all parameters of `V` and for a tuple of type `V`, it is also defined for the types -`boost::variant` and -`std::optional >`, where `T...` +`std::variant` and +`std::optional >`, where `T...` can be a list of arbitrary types. It also inherits from `O`, which makes it easy to treat like a diff --git a/STL_Extension/examples/STL_Extension/Dispatch_output_iterator.cpp b/STL_Extension/examples/STL_Extension/Dispatch_output_iterator.cpp index 44ff692c788..89abf64fbcc 100644 --- a/STL_Extension/examples/STL_Extension/Dispatch_output_iterator.cpp +++ b/STL_Extension/examples/STL_Extension/Dispatch_output_iterator.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include int main() @@ -21,7 +21,7 @@ int main() std::back_inserter(b), std::back_inserter(c)); - typedef boost::variant var; + typedef std::variant var; var va = 23; var vb = 4.2; var vc = 'x'; // goes to a diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index 24d6ecc1b12..7b6bdc37bba 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include @@ -39,7 +39,7 @@ class Object std::shared_ptr obj; // returns an any pointer from a variant - struct Any_from_variant : public boost::static_visitor { + struct Any_from_variant { template std::any* operator()(const T& t) const { return new std::any(t); @@ -64,14 +64,14 @@ class Object Object(T && t, private_tag) : obj(new std::any(std::forward(t))) { } // implicit constructor from optionals containing variants - template - Object(const std::optional< boost::variant >& t) - : obj( t ? boost::apply_visitor(Any_from_variant(), *t) : nullptr) { } + template + Object(const std::optional< std::variant >& t) + : obj( t ? std::visit(Any_from_variant(), *t) : nullptr) { } // implicit constructor from variants - template - Object(const boost::variant& v) - : obj(boost::apply_visitor(Any_from_variant(), v)) { } + template + Object(const std::variant& v) + : obj(std::visit(Any_from_variant(), v)) { } template bool assign(T &t) const diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index 4928d3d519f..95295f89f83 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -1262,7 +1262,7 @@ filter_output_iterator(I e, const P& p) namespace internal { template -struct Output_visitor : boost::static_visitor { +struct Output_visitor { Output_visitor(OutputIterator* it) : out(it) {} OutputIterator* out; @@ -1380,17 +1380,17 @@ public: return *this; } - template - Self& operator=(const boost::variant& t) { + template + Self& operator=(const std::variant< T ... >& t) { internal::Output_visitor visitor(this); - t.apply_visitor(visitor); + std::visit(visitor, t); return *this; } - template - Self& operator=(const std::optional< boost::variant >& t) { + template + Self& operator=(const std::optional< std::variant< T ... > >& t) { internal::Output_visitor visitor(this); - if(t) boost::apply_visitor(visitor, *t); + if(t) std::visit(visitor, *t); return *this; } diff --git a/STL_Extension/test/STL_Extension/test_Object.cpp b/STL_Extension/test/STL_Extension/test_Object.cpp index 36cacb0f334..1e65bf5cf97 100644 --- a/STL_Extension/test/STL_Extension/test_Object.cpp +++ b/STL_Extension/test/STL_Extension/test_Object.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include @@ -11,7 +11,7 @@ void from_opt_var() { int i = 0; double j = 0.0; - std::optional< boost::variant > v(23); + std::optional< std::variant > v(23); CGAL::Object o = v; assert(!o.empty()); assert(CGAL::assign(i, o)); @@ -23,7 +23,7 @@ void from_opt_var() { assert(CGAL::assign(j, o)); assert(j == 2.0); //empty optional - std::optional< boost::variant > v2; + std::optional< std::variant > v2; CGAL::Object o2 = v2; assert(o2.empty()); } @@ -31,7 +31,7 @@ void from_opt_var() { void from_var() { int i = 0; - boost::variant v(23); + std::variant v(23); CGAL::Object o = v; assert(!o.empty()); assert(CGAL::assign(i, o)); diff --git a/STL_Extension/test/STL_Extension/test_dispatch_output.cpp b/STL_Extension/test/STL_Extension/test_dispatch_output.cpp index b4340772add..250fe0a57ca 100644 --- a/STL_Extension/test/STL_Extension/test_dispatch_output.cpp +++ b/STL_Extension/test/STL_Extension/test_dispatch_output.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include struct A{}; @@ -91,7 +91,7 @@ void complete_test(std::vector data1,std::list data2){ } void variant_test() { - typedef boost::variant var; + typedef std::variant var; typedef std::optional< var > ovar; std::vector a; std::vector b; diff --git a/Shape_regularization/include/CGAL/Shape_regularization/internal/Contour_base_2.h b/Shape_regularization/include/CGAL/Shape_regularization/internal/Contour_base_2.h index 1f8a5b8aafd..bbd1a13132e 100644 --- a/Shape_regularization/include/CGAL/Shape_regularization/internal/Contour_base_2.h +++ b/Shape_regularization/include/CGAL/Shape_regularization/internal/Contour_base_2.h @@ -755,10 +755,10 @@ namespace internal { typename CGAL::cpp11::result_of::type result = CGAL::intersection(line_1, line_2); if (result) { - if (const Line_2* line = boost::get(&*result)) { + if (const Line_2* line = std::get_if(&*result)) { return false; } else { - const Point_2* point = boost::get(&*result); + const Point_2* point = std::get_if(&*result); in_point = *point; return true; } } diff --git a/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp b/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp index 60174dc2fc4..eba06f7b578 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp @@ -53,8 +53,8 @@ int main() tree.any_intersection(segment_query); if(intersection){ // gets intersection object - if(boost::get(&(intersection->first))){ - Point* p = boost::get(&(intersection->first)); + if(std::get_if(&(intersection->first))){ + Point* p = std::get_if(&(intersection->first)); std::cout << "intersection object is a point " << *p << std::endl; std::cout << "with face "<< intersection->second << std::endl; } @@ -77,8 +77,8 @@ int main() // (generally a segment) Plane_intersection plane_intersection = tree.any_intersection(plane_query); if(plane_intersection){ - if(boost::get(&(plane_intersection->first))){ - Segment* s = boost::get(&(plane_intersection->first)); + if(std::get_if(&(plane_intersection->first))){ + Segment* s = std::get_if(&(plane_intersection->first)); std::cout << "one intersection object is the segment " << s << std::endl; std::cout << "with face "<< intersection->second << std::endl; } diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h index f221ee28c45..5709694f491 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h @@ -434,7 +434,7 @@ private: } const Point* i_point; - if(!(i_point = boost::get(&object))) { + if(!(i_point = std::get_if(&object))) { continue; // continue in case of segment. } @@ -483,7 +483,7 @@ private: if(!min_intersection) return boost::make_tuple(false, false, 0.0, Primitive_id()); - const Point* i_point = boost::get( &min_intersection->first ); + const Point* i_point = std::get_if( &min_intersection->first ); if (!i_point) //segment case ignored return boost::make_tuple(false, false, 0.0, Primitive_id()); diff --git a/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/Concepts/SurfaceMeshShortestPathTraits.h b/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/Concepts/SurfaceMeshShortestPathTraits.h index e44cd401304..2095e338943 100644 --- a/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/Concepts/SurfaceMeshShortestPathTraits.h +++ b/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/Concepts/SurfaceMeshShortestPathTraits.h @@ -152,7 +152,7 @@ public: /*! Function object type. Must provide - `std::optional< boost::variant< T... > > operator()(A obj1, B obj2)` + `std::optional< std::variant< T... > > operator()(A obj1, B obj2)` to compute the intersection between `obj1` and `obj2`, where `A` and `B` can be any type amongst `Line_2`, `Ray_2`, `Segment_2`. */ diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_sequence.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_sequence.cpp index 98340eb0000..857321096b2 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_sequence.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_sequence.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include @@ -26,10 +26,10 @@ typedef Graph_traits::face_descriptor face_descriptor; typedef Graph_traits::halfedge_descriptor halfedge_descriptor; // A model of SurfacemeshShortestPathVisitor storing simplicies -// using boost::variant +// using std::variant struct Sequence_collector { - typedef boost::variant< vertex_descriptor, + typedef std::variant< vertex_descriptor, std::pair, std::pair > Simplex; std::vector< Simplex > sequence; @@ -50,9 +50,8 @@ struct Sequence_collector } }; -// A visitor to print what a variant contains using boost::apply_visitor +// A visitor to print what a variant contains using std::visit struct Print_visitor - : public boost::static_visitor<> { int i; Triangle_mesh& g; @@ -123,7 +122,7 @@ int main(int argc, char** argv) // print the sequence using the visitor pattern Print_visitor print_visitor(tmesh); for (size_t i = 0; i < sequence_collector.sequence.size(); ++i) - boost::apply_visitor(print_visitor, sequence_collector.sequence[i]); + std::visit(print_visitor, sequence_collector.sequence[i]); return 0; } diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h index 241c9647350..7c16da8876c 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h @@ -1082,7 +1082,7 @@ private: { const auto cgalIntersection = i2(cl2(segment), cl2(leftBoundary)); - if (!cgalIntersection || !boost::get(&*cgalIntersection)) + if (!cgalIntersection || !std::get_if(&*cgalIntersection)) { if (m_debugOutput) { @@ -1092,7 +1092,7 @@ private: } else { - const Point_2* result = boost::get(&*cgalIntersection); + const Point_2* result = std::get_if(&*cgalIntersection); FT t0 = pdas2(cs2(segment), ct2(segment), *result); if (t0 >= FT(1)) @@ -1140,7 +1140,7 @@ private: { const auto cgalIntersection = i2(cl2(segment), cl2(rightBoundary)); - if (!cgalIntersection || !boost::get(&*cgalIntersection)) + if (!cgalIntersection || !std::get_if(&*cgalIntersection)) { if (m_debugOutput) { @@ -1150,7 +1150,7 @@ private: } else { - const Point_2* result = boost::get(&*cgalIntersection); + const Point_2* result = std::get_if(&*cgalIntersection); FT t0 = pdas2(cs2(segment), ct2(segment), *result); if (t0 <= FT(0)) @@ -1778,7 +1778,7 @@ private: CGAL_assertion(bool(cgalIntersection)); - const Point_2* result = boost::get(&*cgalIntersection); + const Point_2* result = std::get_if(&*cgalIntersection); if (!result) result = ¤tSourceImage; @@ -3064,7 +3064,7 @@ public: { if (intersections[i]) { - Point_3* intersectionPoint = boost::get(&(intersections[i]->first)); + Point_3* intersectionPoint = std::get_if(&(intersections[i]->first)); if (intersectionPoint) { diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h index 19a2ed5105b..227d20833c4 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h @@ -465,7 +465,7 @@ public: CGAL_assertion(bool(intersectResult1)); if (!intersectResult1) return CGAL::SMALLER; - const Point_2* p1_ptr = boost::get(&*intersectResult1); + const Point_2* p1_ptr = std::get_if(&*intersectResult1); CGAL_assertion(p1_ptr && "Intersection should have been a point"); if (!p1_ptr) return CGAL::SMALLER; @@ -477,7 +477,7 @@ public: CGAL_assertion(bool(intersectResult2)); if (!intersectResult2) return CGAL::SMALLER; - const Point_2* p2_ptr = boost::get(&*intersectResult2); + const Point_2* p2_ptr = std::get_if(&*intersectResult2); CGAL_assertion(p2_ptr && "Intersection should have been a point"); if (!p2_ptr) return CGAL::SMALLER; diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2.h index 16c2fdedb38..2241424c8e4 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2.h @@ -102,7 +102,7 @@ public: typedef typename Base::Status_line_iterator Status_line_iterator; typedef std::pair Intersection_point; - typedef boost::variant + typedef std::variant Intersection_result; typedef std::vector Intersection_vector; typedef Random_access_output_iterator diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h index 52f2dde71b1..9eece3004a9 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h @@ -624,7 +624,7 @@ void Surface_sweep_2::_intersect(Subcurve* c1, Subcurve* c2, intersector(xc, (*sc_it)->last_curve(), vector_inserter(xections)); CGAL_assertion(xections.size() == 1); auto& item = xections.front(); - xc = *boost::get(&item); + xc = *std::get_if(&item); } CGAL_assertion @@ -667,7 +667,7 @@ void Surface_sweep_2::_intersect(Subcurve* c1, Subcurve* c2, this->m_traits->is_closed_2_object()(c1->last_curve(), ARR_MIN_END) && this->m_traits->is_closed_2_object()(c2->last_curve(), ARR_MIN_END)) { - if ((boost::get(&(*vi)) != nullptr) && + if ((std::get_if(&(*vi)) != nullptr) && this->m_traits->equal_2_object()(ctr_min(c1->last_curve()), ctr_min(c2->last_curve()))) { @@ -685,7 +685,7 @@ void Surface_sweep_2::_intersect(Subcurve* c1, Subcurve* c2, vector_inserter vi_last = vi_end; --vi_last; - if (boost::get(&(*vi_last)) != nullptr) { + if (std::get_if(&(*vi_last)) != nullptr) { CGAL_SS_PRINT_TEXT("Skipping common right endpoint..."); CGAL_SS_PRINT_EOL(); --vi_end; @@ -712,7 +712,7 @@ void Surface_sweep_2::_intersect(Subcurve* c1, Subcurve* c2, vector_inserter vi_last = vi_end; --vi_last; - if (boost::get(&(*vi_last)) != nullptr) { + if (std::get_if(&(*vi_last)) != nullptr) { CGAL_SS_PRINT_TEXT("Skipping common right endpoint on boundary..."); CGAL_SS_PRINT_EOL(); --vi_end; @@ -725,7 +725,7 @@ void Surface_sweep_2::_intersect(Subcurve* c1, Subcurve* c2, // SL: curves are split and no event strictly before the current event should // be reported if (vi != vi_end) { - const Intersection_point* xp_point = boost::get(&(*vi)); + const Intersection_point* xp_point = std::get_if(&(*vi)); if (xp_point != nullptr) { // Skip the intersection point if it is not larger than the current event. // To correctly do so, we have to set the ps_x and ps_y for xp_point->first @@ -744,7 +744,7 @@ void Surface_sweep_2::_intersect(Subcurve* c1, Subcurve* c2, bool first_i = true; for (; vi != vi_end; ++vi) { Multiplicity multiplicity = 0; - const Intersection_point* xp_point = boost::get(&(*vi)); + const Intersection_point* xp_point = std::get_if(&(*vi)); if (xp_point != nullptr) { Point_2 xp = xp_point->first; multiplicity = xp_point->second; @@ -753,7 +753,7 @@ void Surface_sweep_2::_intersect(Subcurve* c1, Subcurve* c2, _create_intersection_point(xp, multiplicity, c1, c2); } else { - const X_monotone_curve_2 icv = *boost::get(&(*vi)); + const X_monotone_curve_2 icv = *std::get_if(&(*vi)); // CGAL_assertion(icv != nullptr); CGAL_SS_PRINT_TEXT("Found an overlap"); diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_utils.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_utils.h index d3c785ea8f2..1fdbd1ab094 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_utils.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_utils.h @@ -51,7 +51,7 @@ void make_x_monotone(CurveInputIter begin, CurveInputIter end, { typedef typename Traits::Point_2 Point_2; typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; - typedef boost::variant Make_x_monotone_result; + typedef std::variant Make_x_monotone_result; // Split the input curves into x-monotone objects. std::size_t num_of_curves = std::distance(begin, end); @@ -63,14 +63,14 @@ void make_x_monotone(CurveInputIter begin, CurveInputIter end, // Transform each object to either a point or an x-monotone curve. for (const auto& obj : object_vec) { - const X_monotone_curve_2* xcv = boost::get(&obj); + const X_monotone_curve_2* xcv = std::get_if(&obj); if (xcv != nullptr) { // The object is an x-monotone curve. *x_curves++ = *xcv; continue; } // The object is an isolated point. - const Point_2* pt = boost::get(&obj); + const Point_2* pt = std::get_if(&obj); CGAL_assertion(pt != nullptr); *iso_points++ = *pt; } 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 be81a7809a4..5cf73bf4651 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 @@ -535,7 +535,7 @@ void set_index(typename C3t3::Vertex_handle v, const C3t3& c3t3) v->set_index(typename C3t3::Curve_index(1)); break; case 0: - v->set_index(boost::get(v->index())); + v->set_index(std::get(v->index())); break; default: CGAL_assertion(false); diff --git a/Triangulation_2/doc/Triangulation_2/Concepts/ConstrainedTriangulationTraits_2.h b/Triangulation_2/doc/Triangulation_2/Concepts/ConstrainedTriangulationTraits_2.h index 652cb033ab8..e57a8ebb6f4 100644 --- a/Triangulation_2/doc/Triangulation_2/Concepts/ConstrainedTriangulationTraits_2.h +++ b/Triangulation_2/doc/Triangulation_2/Concepts/ConstrainedTriangulationTraits_2.h @@ -40,7 +40,7 @@ public: /*! A function object whose `operator()` computes the intersection of two segments. -`std::optional > operator()(Segment_2 s1, Segment_2 s2);` +`std::optional > operator()(Segment_2 s1, Segment_2 s2);` Returns the intersection of `s1` and `s2`. */ typedef unspecified_type Intersect_2; diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 42867cfbb07..692b34199c0 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -1891,16 +1891,16 @@ compute_intersection(const Gt& gt, #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS typedef typename Gt::Segment_2 Segment_2; if(result){ - if (const Segment_2* s = boost::get(&*result)){ + if (const Segment_2* s = std::get_if(&*result)){ std::cerr << CGAL::internal::cdt_2_indent_level << "compute_intersection: " << *s << '\n'; - }else if(const Point_2* p = boost::get(&*result)) + }else if(const Point_2* p = std::get_if(&*result)) std::cerr << CGAL::internal::cdt_2_indent_level << "compute_intersection: " << *p << '\n'; } #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS if(result){ - if(const Point_2* p = boost::get(&*result)){ + if(const Point_2* p = std::get_if(&*result)){ pi = *p; return true; } diff --git a/Visibility_2/examples/Visibility_2/simple_polygon_visibility_2.cpp b/Visibility_2/examples/Visibility_2/simple_polygon_visibility_2.cpp index be460a83626..9df70f7f868 100644 --- a/Visibility_2/examples/Visibility_2/simple_polygon_visibility_2.cpp +++ b/Visibility_2/examples/Visibility_2/simple_polygon_visibility_2.cpp @@ -38,7 +38,7 @@ int main() { CGAL::Arr_naive_point_location pl(env); CGAL::Arr_point_location_result::Type obj = pl.locate(q); // The query point locates in the interior of a face - face = boost::get (&obj); + face = std::get (&obj); // compute non regularized visibility area // Define visibility object type that computes non-regularized visibility area diff --git a/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h b/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h index f5cf4d1873d..384d99acb30 100644 --- a/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h +++ b/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h @@ -306,7 +306,7 @@ namespace CGAL { Location_result result = point_location.ray_shoot_up(q); if(const Halfedge_const_handle* e = - boost::get(&(result))) + std::get_if(&(result))) { CGAL_assertion((*e)->face() == face); Point_2 p(q.x(), @@ -321,7 +321,7 @@ namespace CGAL { return (*e)->next()->ccb(); } else if (const Vertex_const_handle* v = - boost::get(&(result))) + std::get_if(&(result))) { Halfedge_around_vertex_const_circulator cir = (*v)->incident_halfedges(); diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Voronoi_diagram_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Voronoi_diagram_2.h index e0dd1cdc461..344fed3378c 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Voronoi_diagram_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Voronoi_diagram_2.h @@ -720,7 +720,7 @@ typedef unspecified_type Site_iterator; /*! The result type of the point location queries. */ -typedef boost::variant +typedef std::variant Locate_result; /// @} diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationTraits_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationTraits_2.h index bdd87560936..45693eaf6f9 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationTraits_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationTraits_2.h @@ -113,7 +113,7 @@ It must provide the following operator:
    `result_type operator()(Delaunay_graph dg, Point_2 p)`
    where the result type `result_type` is -`boost::variant`. +`std::variant`. This type is required only if `Has_nearest_site_2` is equal to `CGAL::Tag_true`. diff --git a/Voronoi_diagram_2/examples/Voronoi_diagram_2/vd_2_point_location.cpp b/Voronoi_diagram_2/examples/Voronoi_diagram_2/vd_2_point_location.cpp index 8451c216bde..967660d2efb 100644 --- a/Voronoi_diagram_2/examples/Voronoi_diagram_2/vd_2_point_location.cpp +++ b/Voronoi_diagram_2/examples/Voronoi_diagram_2/vd_2_point_location.cpp @@ -60,17 +60,17 @@ int main() << ") lies on a Voronoi " << std::flush; Locate_result lr = vd.locate(p); - if ( Vertex_handle* v = boost::get(&lr) ) { + if ( Vertex_handle* v = std::get_if(&lr) ) { std::cout << "vertex." << std::endl; std::cout << "The Voronoi vertex is:" << std::endl; std::cout << "\t" << (*v)->point() << std::endl; - } else if ( Halfedge_handle* e = boost::get(&lr) ) { + } else if ( Halfedge_handle* e = std::get_if(&lr) ) { std::cout << "edge." << std::endl; std::cout << "The source and target vertices " << "of the Voronoi edge are:" << std::endl; print_endpoint(*e, true); print_endpoint(*e, false); - } else if ( Face_handle* f = boost::get(&lr) ) { + } else if ( Face_handle* f = std::get_if(&lr) ) { std::cout << "face." << std::endl; std::cout << "The vertices of the Voronoi face are" << " (in counterclockwise order):" << std::endl; diff --git a/Voronoi_diagram_2/examples/Voronoi_diagram_2/vd_2_point_location_sdg_linf.cpp b/Voronoi_diagram_2/examples/Voronoi_diagram_2/vd_2_point_location_sdg_linf.cpp index 3fa8850e2cc..59ec3453781 100644 --- a/Voronoi_diagram_2/examples/Voronoi_diagram_2/vd_2_point_location_sdg_linf.cpp +++ b/Voronoi_diagram_2/examples/Voronoi_diagram_2/vd_2_point_location_sdg_linf.cpp @@ -62,17 +62,17 @@ int main() << ") lies on a Voronoi " << std::flush; Locate_result lr = vd.locate(p); - if ( Vertex_handle* v = boost::get(&lr) ) { + if ( Vertex_handle* v = std::get_if(&lr) ) { std::cout << "vertex." << std::endl; std::cout << "The Voronoi vertex is:" << std::endl; std::cout << "\t" << (*v)->point() << std::endl; - } else if ( Halfedge_handle* e = boost::get(&lr) ) { + } else if ( Halfedge_handle* e = std::get_if(&lr) ) { std::cout << "edge." << std::endl; std::cout << "The source and target vertices " << "of the Voronoi edge are:" << std::endl; print_endpoint(*e, true); print_endpoint(*e, false); - } else if ( Face_handle* f = boost::get(&lr) ) { + } else if ( Face_handle* f = std::get_if(&lr) ) { std::cout << "face." << std::endl; std::cout << "The vertices of the Voronoi face are" << " (in counterclockwise order):" << std::endl; diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2.h index 82f0bdc6d67..9d4e3785215 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2.h @@ -41,7 +41,7 @@ #include -#include +#include #include namespace CGAL { @@ -268,7 +268,7 @@ protected: public: typedef typename Adaptation_traits::Point_2 Point_2; - typedef boost::variant + typedef std::variant Locate_result; private: @@ -634,15 +634,15 @@ public: Query_result ns_qr = nearest_site(dual_, p); if ( const Delaunay_vertex_handle* dv = - boost::get(&ns_qr) ) { + std::get_if(&ns_qr) ) { return Face_handle( Face(this, *dv) ); } else if ( const Delaunay_face_handle *df = - boost::get(&ns_qr) ) { + std::get_if(&ns_qr) ) { Find_valid_vertex vertex_finder; Delaunay_face_handle dfvalid = vertex_finder(this, *df); return Vertex_handle( Vertex(this, dfvalid) ); } else if ( const Delaunay_edge* de = - boost::get(&ns_qr) ) { + std::get_if(&ns_qr) ) { CGAL_assertion( !edge_rejector()(dual_, *de) ); if ( dual_.dimension() == 1 ) { Delaunay_vertex_handle v1 = diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_nearest_site_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_nearest_site_2.h index d0f1fbf11a6..6bf63d83fde 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_nearest_site_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_nearest_site_2.h @@ -20,7 +20,7 @@ #include #include -#include +#include namespace CGAL { @@ -48,7 +48,7 @@ class Apollonius_graph_nearest_site_2 typedef typename Delaunay_graph::Edge_circulator Edge_circulator; public: - typedef boost::variant result_type; + typedef std::variant result_type; result_type operator()(const Delaunay_graph& dg, const Point_2& p) const { CGAL_precondition( dg.dimension() >= 0 ); diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_nearest_site_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_nearest_site_2.h index 6014724302f..f3739a2da68 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_nearest_site_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_nearest_site_2.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace CGAL { @@ -48,7 +48,7 @@ class Delaunay_triangulation_nearest_site_2 typedef typename Delaunay_graph::Edge_circulator Edge_circulator; public: - typedef boost::variant result_type; + typedef std::variant result_type; result_type operator()(const Delaunay_graph& dg, const Point_2& p) const { CGAL_precondition( dg.dimension() >= 0 ); diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_nearest_site_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_nearest_site_2.h index 9b9c88965d9..ebc19ed6e1f 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_nearest_site_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_nearest_site_2.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace CGAL { @@ -50,7 +50,7 @@ class Regular_triangulation_nearest_site_2 typedef typename Geom_traits::Weighted_point_2 Weighted_point_2; public: - typedef boost::variant result_type; + typedef std::variant result_type; result_type operator()(const Delaunay_graph& dg, const Point_2& p) const { CGAL_precondition( dg.dimension() >= 0 ); diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_nearest_site_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_nearest_site_2.h index 8031047d03b..5d89d1c737a 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_nearest_site_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_nearest_site_2.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace CGAL { @@ -95,7 +95,7 @@ private: } public: - typedef boost::variant result_type; + typedef std::variant result_type; result_type operator()(const Delaunay_graph& dg, const Point_2& p) const { CGAL_precondition( dg.dimension() >= 0 ); diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_concept.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_concept.h index 9628e9ab45f..b9761752204 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_concept.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_concept.h @@ -17,7 +17,7 @@ #include #include "helper_functions.h" #include -#include +#include template @@ -567,11 +567,11 @@ void test_ns_concept(const DG& dg, const AT& at, CGAL::Tag_true) result_type qr = ns(dg, p); - if ( Face_handle* f = boost::get(&qr) ) { + if ( Face_handle* f = std::get_if(&qr) ) { kill_warning(f); - } else if ( Edge* e = boost::get(&qr) ) { + } else if ( Edge* e = std::get_if(&qr) ) { kill_warning(e); - } else if ( Vertex_handle* v = boost::get(&qr) ) { + } else if ( Vertex_handle* v = std::get_if(&qr) ) { kill_warning(v); } else { // we should have reached this line diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_locate.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_locate.h index 285e03cb62b..cfcff23df76 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_locate.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_locate.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include "helper_functions.h" @@ -81,13 +81,13 @@ void test_locate_dg(const VDA& vda, const Projector& , for (unsigned int i = 0; i < vecp.size(); ++i) { os << vecp[i] << "\t --> \t" << std::flush; ns_qr = nearest_site(vda.dual(), vecp[i]); - if ( Vertex_handle* v = boost::get(&ns_qr) ) { + if ( Vertex_handle* v = std::get_if(&ns_qr) ) { os << "FACE"; kill_warning( v ); - } else if ( Edge* e = boost::get(&ns_qr) ) { + } else if ( Edge* e = std::get_if(&ns_qr) ) { os << "EDGE"; kill_warning( e ); - } else if ( Face_handle* f = boost::get(&ns_qr) ) { + } else if ( Face_handle* f = std::get_if(&ns_qr) ) { os << "VERTEX"; kill_warning( f ); } else { @@ -114,7 +114,7 @@ void test_locate_vd(const VDA& vda, const Point_vector& vecp, for (unsigned int i = 0; i < vecp.size(); ++i) { os << vecp[i] << "\t --> \t" << std::flush; lr = vda.locate(vecp[i]); - if ( Halfedge_handle* ee = boost::get(&lr) ) { + if ( Halfedge_handle* ee = std::get_if(&lr) ) { Halfedge_handle e = *ee; os << "VORONOI EDGE"; if ( print_sites ) { @@ -135,7 +135,7 @@ void test_locate_vd(const VDA& vda, const Point_vector& vecp, } } // if ( print_sites ) kill_warning( e ); - } else if ( Vertex_handle* vv = boost::get(&lr) ) { + } else if ( Vertex_handle* vv = std::get_if(&lr) ) { os << "VORONOI VERTEX"; Vertex_handle v = *vv; if ( print_sites ) { @@ -145,7 +145,7 @@ void test_locate_vd(const VDA& vda, const Point_vector& vecp, } } kill_warning( v ); - } else if ( Face_handle* ff = boost::get(&lr) ) { + } else if ( Face_handle* ff = std::get_if(&lr) ) { typename VDA::Face_handle f = *ff; kill_warning( f ); os << "VORONOI FACE"; diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_vda.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_vda.h index 2b2974ae273..bb9ea6b426e 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_vda.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_vda.h @@ -223,13 +223,13 @@ void test_vdqr_concept(const VDA& vda, const CGAL::Tag_true&) Point_2 p(0,0); Locate_result lr = vda.locate(p); - if ( Vertex_handle* vv = boost::get(&lr) ) { + if ( Vertex_handle* vv = std::get_if(&lr) ) { Vertex_handle v = *vv; kill_warning(v); - } else if ( Halfedge_handle* ee = boost::get(&lr) ) { + } else if ( Halfedge_handle* ee = std::get_if(&lr) ) { Halfedge_handle e = *ee; kill_warning(e); - } else if ( Face_handle* ff = boost::get(&lr) ) { + } else if ( Face_handle* ff = std::get_if(&lr) ) { Face_handle f = *ff; kill_warning(f); } From 56499e017d1992cb578324b49b4420f2e78e2c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 May 2023 18:52:01 +0200 Subject: [PATCH 058/156] do not use API that did not go into the standard --- .../include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h | 4 +--- Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h | 2 +- .../CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h | 2 +- .../test_corefinement_and_constraints.cpp | 4 ++-- .../Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp | 3 +-- Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h | 4 +--- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h index af0f793f4ed..f813f8ccc9a 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h @@ -609,9 +609,7 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, // This is the rightmost vertex in the current minimization diagram (out_d). // The intersection points/curves that interest us are the ones in // [v_leftmost, v]. - // Without using make_optional we get a "maybe uninitialized" warning with gcc -Wall - std::optional v_leftmost = - std::make_optional(false, Vertex_const_handle()); + std::optional v_leftmost; if (is_leftmost1 == true) { if (is_leftmost2 == false) 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 d2f1065785a..81140cdc66e 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 @@ -1524,7 +1524,7 @@ change_ball_size(const Vertex_handle& v, const FT squared_size, const bool speci Bare_point p = cp(c3t3_.triangulation().point(v)); // intentional copy // Remove v from the set of corners - std::optional corner_index = std::make_optional(false, Corner_index()); + std::optional corner_index; if ( c3t3_.is_in_complex(v) ) { corner_index = c3t3_.corner_index(v); 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 d46e847a2c0..e35eb180ba6 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 @@ -2479,7 +2479,7 @@ change_ball_size(Vertex_handle& v, const FT squared_size, const bool special_bal const Bare_point p = cp(c3t3_.triangulation().point(v)); // intentional copy // Remove v from the set of corners - std::optional corner_index = std::make_optional(false, Corner_index()); + std::optional corner_index; if(c3t3_.is_in_complex(v)) { corner_index = c3t3_.corner_index(v); 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 3f3af6c44ae..7642f81f493 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 @@ -167,8 +167,8 @@ void test_bool_op_no_copy( typedef std::optional OTM; Triangle_mesh *ptr = nullptr; const std::array output = - reverse ? CGAL::make_array(OTM(&tm2), OTM(&tm1), std::make_optional(false,ptr), std::make_optional(false,ptr)) - : CGAL::make_array(OTM(&tm1), OTM(&tm2), std::make_optional(false,ptr), std::make_optional(false,ptr)); + reverse ? CGAL::make_array(OTM(&tm2), OTM(&tm1), std::optional(), std::optional()) + : CGAL::make_array(OTM(&tm1), OTM(&tm2), std::optional(), std::optional()); PMP::corefine_and_compute_boolean_operations(tm1, tm2, output, 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 a25fa8072f0..85238d26ff4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp @@ -189,8 +189,7 @@ public Q_SLOTS: void on_Sample_random_points_from_bbox() { // calculate bbox of selected polyhedron items - std::optional bbox - = std::make_optional(false, CGAL::Three::Scene_interface::Bbox()); + std::optional bbox; // Workaround a bug in g++-4.8.3: // https://stackoverflow.com/a/21755207/1728537 // Using std::make_optional to copy-initialize 'bbox' hides the diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index 15b6171cf28..a65e7adf764 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -295,9 +295,7 @@ public: constVPmap vpm = get(CGAL::vertex_point, *polyhedron()); - std::optional item_bbox - = std::make_optional(false, CGAL::Bbox_3()); - + std::optional item_bbox; for(Selection_set_vertex::const_iterator v_it = selected_vertices.begin(); v_it != selected_vertices.end(); ++v_it) { From edc317d771fb9b4d747c4c3d240c9e246a694edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 May 2023 10:26:16 +0200 Subject: [PATCH 059/156] variant::which() => variant::index() + typos --- .../include/CGAL/Arr_circular_line_arc_traits_2.h | 1 - .../CGAL/Arr_point_location/Td_active_trapezoid.h | 4 ++-- .../include/CGAL/Arr_point_location/Td_traits.h | 14 +++++++------- .../Trapezoidal_decomposition_2.h | 2 ++ .../CGAL/Hyperbolic_triangulation_face_base_2.h | 2 +- SMDS_3/include/CGAL/IO/output_to_vtu.h | 4 ++-- .../SMDS_3/internal/Handle_IO_for_pair_of_int.h | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h index 4efc598b81d..c48fa96917c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -339,7 +339,6 @@ namespace CGAL { template class Variant_Construct_min_vertex_2 - { typedef typename CircularKernel::Circular_arc_point_2 Circular_arc_point_2; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h index 44834852a2b..d8a775c4179 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h @@ -459,12 +459,12 @@ private: Td_map_item item (*this); - if (ptr()->rb.which() != 0) + if (ptr()->rb.index() != 0) { Self tr(std::get(rb())); tr.set_lb(item); } - if (ptr()->rt.which() != 0) + if (ptr()->rt.index() != 0) { Self tr(std::get(rt())); tr.set_lt(item); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h index 59a3dd7f6b6..391fb264658 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h @@ -957,13 +957,13 @@ public: //returns true if the trapezoid is a curve bool is_empty_item(const Td_map_item& tr) const { - return (tr.which() == 0); + return (tr.index() == 0); } //returns true if the trapezoid is a point or a curve bool is_trapezoid(const Td_map_item& tr) const { - switch (tr.which()) + switch (tr.index()) { case TD_ACTIVE_TRAPEZOID: case TD_INACTIVE_TRAPEZOID: @@ -976,7 +976,7 @@ public: //returns true if the map item is a vertex bool is_td_vertex(const Td_map_item& tr) const { - switch (tr.which()) + switch (tr.index()) { case TD_ACTIVE_VERTEX: case TD_ACTIVE_FICTITIOUS_VERTEX: @@ -991,7 +991,7 @@ public: //returns true if the map item is an edge bool is_td_edge(const Td_map_item& tr) const { - switch (tr.which()) + switch (tr.index()) { case TD_ACTIVE_EDGE: case TD_INACTIVE_EDGE: @@ -1004,7 +1004,7 @@ public: //returns true if the map item is an edge bool is_td_trapezoid(const Td_map_item& tr) const { - switch (tr.which()) + switch (tr.index()) { case TD_ACTIVE_TRAPEZOID: case TD_INACTIVE_TRAPEZOID: @@ -1017,7 +1017,7 @@ public: //returns true if the trapezoid is a curve bool is_fictitious_vertex(const Td_map_item& tr) const { - switch (tr.which()) + switch (tr.index()) { case TD_ACTIVE_FICTITIOUS_VERTEX: case TD_INACTIVE_FICTITIOUS_VERTEX: @@ -1030,7 +1030,7 @@ public: //returns true if the trapezoid is a curve bool is_active(const Td_map_item& tr) const { - switch (tr.which()) + switch (tr.index()) { case TD_ACTIVE_TRAPEZOID: case TD_ACTIVE_EDGE: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index be7d7ac72b3..3888b097bb8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -717,6 +717,7 @@ public: /*! A visitor to set the cw halfedge of a vertex node. */ class set_cw_he_visitor + { public: set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {} @@ -735,6 +736,7 @@ public: /*! A visitor to reset the cw halfedge of a vertex node. */ class reset_cw_he_visitor + { public: void operator()(Td_active_vertex& t) const { t.reset_cw_he(); } 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 32d730aab7c..724f45794e6 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 @@ -23,7 +23,7 @@ namespace CGAL { class Hyperbolic_data { - typedef boost::int8_t Id; + typedef std::int8_t Id; private: // - 2 for infinite face diff --git a/SMDS_3/include/CGAL/IO/output_to_vtu.h b/SMDS_3/include/CGAL/IO/output_to_vtu.h index 37cd018570f..863bba2cebb 100644 --- a/SMDS_3/include/CGAL/IO/output_to_vtu.h +++ b/SMDS_3/include/CGAL/IO/output_to_vtu.h @@ -314,7 +314,7 @@ void output_to_vtu_with_attributes(std::ostream& os, os << " \n"; for(std::size_t i = 0; i< attributes.size(); ++i) { - switch(attributes[i].second.which()){ + switch(attributes[i].second.index()){ case 0: write_attribute_tag(os,attributes[i].first, *std::get* >(attributes[i].second), binary,offset); break; @@ -334,7 +334,7 @@ void output_to_vtu_with_attributes(std::ostream& os, write_c3t3_points(os,tr,V); // fills V if the mode is BINARY write_cells(os,c3t3,V); for(std::size_t i = 0; i< attributes.size(); ++i) - switch(attributes[i].second.which()){ + switch(attributes[i].second.index()){ case 0: write_attributes(os, *std::get* >(attributes[i].second)); break; diff --git a/SMDS_3/include/CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h b/SMDS_3/include/CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h index 977909a463d..87d4e5863d5 100644 --- a/SMDS_3/include/CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h +++ b/SMDS_3/include/CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h @@ -61,7 +61,7 @@ class Output_rep >(v)); } else { out << std::get(v); From bbc48b2c7e3479db56b993f55829a5ca44ce1939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 May 2023 13:03:22 +0200 Subject: [PATCH 060/156] more fixes use Mesh_3::internal::get_index std::dynamic_point_cast std::get_if --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 4 +- .../Mesh_domain_with_polyline_features_3.h | 8 +-- .../include/CGAL/Polyhedral_mesh_domain_3.h | 2 +- .../Plugins/Mesh_3/Mesh_3_plugin.cpp | 53 +++++++++---------- .../Point_set_shape_detection_plugin.cpp | 2 +- .../CGAL/SMDS_3/internal/indices_management.h | 6 +-- .../Efficient_RANSAC/Efficient_RANSAC.h | 2 +- .../test_efficient_RANSAC_cone_parameters.cpp | 2 +- ...t_efficient_RANSAC_cylinder_parameters.cpp | 2 +- ...test_efficient_RANSAC_plane_parameters.cpp | 2 +- ...est_efficient_RANSAC_sphere_parameters.cpp | 2 +- ...test_efficient_RANSAC_torus_parameters.cpp | 2 +- .../internal/flip_edges.h | 6 +-- .../tetrahedral_adaptive_remeshing_impl.h | 2 +- .../internal/tetrahedral_remeshing_helpers.h | 2 +- 15 files changed, 48 insertions(+), 49 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 7e7f98b86e5..0455d1711bb 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -1259,14 +1259,14 @@ public: * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const - { return std::get(index); } + { return Mesh_3::internal::get_index(index); } /* * Returns the index of the subdomain containing a vertex * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const - { return std::get(index); } + { return Mesh_3::internal::get_index(index); } // ----------------------------------- // Backward Compatibility 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 47e8fe5d205..183be517016 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 @@ -772,22 +772,22 @@ public: * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const - { return std::get(index); } + { return Mesh_3::internal::get_index(index); } /** * Returns the index of the subdomain containing a vertex * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const - { return std::get(index); } + { return Mesh_3::internal::get_index(index); } /// Returns a `Curve_index` from an `Index` Curve_index curve_index(const Index& index) const - { return std::get(index); } + { return Mesh_3::internal::get_index(index); } /// Returns a `Corner_index` from an `Index` Corner_index corner_index(const Index& index) const - { return std::get(index); } + { return Mesh_3::internal::get_index(index); } /// @cond DEVELOPERS #ifndef CGAL_NO_DEPRECATED_CODE diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 417c27777a6..723290bbd35 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -607,7 +607,7 @@ private: AABB_tree_* bounding_tree_; // cache queries and intersected primitive - typedef typename std::variant::type Cached_query; + typedef std::variant Cached_query; struct Query_cache { Query_cache() : has_cache(false) {} 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 cb10a9a806a..a51be995cc1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -279,7 +279,6 @@ void Mesh_3_plugin::mesh_3_volume() std::optional Mesh_3_plugin::get_items_or_return_error_string() const { - using boost::get; items = {}; features_protection_available = false; item = nullptr; @@ -322,7 +321,7 @@ std::optional Mesh_3_plugin::get_items_or_return_error_string() const { if (!items) continue; - auto poly_items_ptr = get(&*items); + auto poly_items_ptr = std::get_if(&items.value()); if(poly_items_ptr) { if (poly_items_ptr->polylines_item) { return tr("Only one polyline item is accepted"); @@ -331,7 +330,7 @@ std::optional Mesh_3_plugin::get_items_or_return_error_string() const } } else { - if(auto image_items_ptr = get(&*items)) + if(auto image_items_ptr = std::get_if(&items.value())) { if (image_items_ptr->polylines_item) { return tr("Only one polyline item is accepted"); @@ -357,8 +356,8 @@ std::optional Mesh_3_plugin::get_items_or_return_error_string() const //because of selection order if (polylines_item != nullptr && items != std::nullopt) { - auto poly_items_ptr = get(&*items); - auto image_items_ptr = get(&*items); + auto poly_items_ptr = std::get_if(&items.value()); + auto image_items_ptr = std::get_if(&items.value()); if(poly_items_ptr && poly_items_ptr == nullptr) poly_items_ptr->polylines_item = polylines_item; else if(image_items_ptr && image_items_ptr == nullptr) @@ -368,7 +367,7 @@ std::optional Mesh_3_plugin::get_items_or_return_error_string() const if (!items) { return tr("Selected objects can't be meshed"); } item = nullptr; features_protection_available = false; - if (auto poly_items = get(&*items)) { + if (auto poly_items = std::get_if(&items.value())) { auto& sm_items = poly_items->sm_items; if(sm_items.empty()) { return tr("ERROR: there must be at least one surface mesh item."); @@ -389,12 +388,12 @@ std::optional Mesh_3_plugin::get_items_or_return_error_string() const features_protection_available = true; } # ifdef CGAL_MESH_3_DEMO_ACTIVATE_IMPLICIT_FUNCTIONS - else if (auto implicit_mesh_items = get(&*items)) { + else if (auto implicit_mesh_items = std::get_if(&items.value())) { item = implicit_mesh_items->function_item; } # endif # ifdef CGAL_MESH_3_DEMO_ACTIVATE_SEGMENTED_IMAGES - else if (auto image_mesh_items = get(&*items)) { + else if (auto image_mesh_items = std::get_if(&items.value())) { auto& image_item = image_mesh_items->image_item; item = image_item; features_protection_available = true; @@ -403,7 +402,7 @@ std::optional Mesh_3_plugin::get_items_or_return_error_string() const if(item) { bbox = item->bbox(); - if (auto poly_items = get(&*items)) { + if (auto poly_items = std::get_if(&items.value())) { for (auto it : poly_items->sm_items) { bbox = bbox + it->bbox(); } @@ -435,28 +434,28 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, QMessageBox::warning(mw, tr("Mesh_3 plugin"), *error_string); return; } - using boost::get; + const bool more_than_one_item = - get(&*items) && - (get(&*items)->sm_items.size() > 1); + std::get_if(&items.value()) && + (std::get_if(&items.value())->sm_items.size() > 1); Scene_image_item* image_item = - get(&*items) - ? get(&*items)->image_item.get() + std::get_if(&items.value()) + ? std::get_if(&items.value())->image_item.get() : nullptr; Scene_surface_mesh_item* bounding_sm_item = - get(&*items) - ? get(&*items)->bounding_sm_item + std::get_if(&items.value()) + ? std::get_if(&items.value())->bounding_sm_item : nullptr; Scene_polylines_item* polylines_item = - get(&*items) - ? get(&*items)->polylines_item + std::get_if(&items.value()) + ? std::get_if(&items.value())->polylines_item : nullptr; - if (polylines_item == nullptr && get(&*items) != nullptr) - polylines_item = get(&*items)->polylines_item; + if (polylines_item == nullptr && std::get_if(&items.value()) != nullptr) + polylines_item = std::get_if(&items.value())->polylines_item; Scene_implicit_function_item* function_item = - get(&*items) - ? get(&*items)->function_item.get() + std::get_if(&items.value()) + ? std::get_if(&items.value())->function_item.get() : nullptr; // ----------------------------------- // Create Mesh dialog @@ -576,13 +575,13 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, ui.initializationGroup->setVisible(input_is_labeled_img); ui.grayImgGroup->setVisible(input_is_gray_img); - if (items->which() == POLYHEDRAL_MESH_ITEMS) + if (items->index() == POLYHEDRAL_MESH_ITEMS) ui.volumeGroup->setVisible(mesh_type == Mesh_type::VOLUME && nullptr != bounding_sm_item); else ui.volumeGroup->setVisible(mesh_type == Mesh_type::VOLUME); ui.sharpEdgesAngle->setValue(sharp_edges_angle_bound); - if (items->which() != POLYHEDRAL_MESH_ITEMS || polylines_item != nullptr) { + if (items->index() != POLYHEDRAL_MESH_ITEMS || polylines_item != nullptr) { ui.sharpEdgesAngleLabel->setVisible(false); ui.sharpEdgesAngle->setVisible(false); @@ -604,13 +603,13 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, const QString on_cube("Polylines on cube"); const QString triple_lines("Triple+ lines"); if (features_protection_available) { - if (items->which() == POLYHEDRAL_MESH_ITEMS) { + if (items->index() == POLYHEDRAL_MESH_ITEMS) { if (mesh_type == Mesh_type::SURFACE_ONLY) { ui.protectEdges->addItem(sharp_and_boundary); ui.protectEdges->addItem(boundary_only); } else ui.protectEdges->addItem(sharp_edges); - } else if (items->which() == IMAGE_MESH_ITEMS) { + } else if (items->index() == IMAGE_MESH_ITEMS) { if (polylines_item != nullptr) { ui.protectEdges->addItem(QString(input_polylines).append(" only")); ui.protectEdges->addItem(QString(on_cube).append(" and input polylines")); @@ -688,7 +687,7 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, : false; Meshing_thread* thread = nullptr; - switch (items->which()) { + switch (items->index()) { case POLYHEDRAL_MESH_ITEMS: { auto& poly_items = get(*items); auto& sm_items = poly_items.sm_items; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index b8117997037..8a46fc95c37 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -732,7 +732,7 @@ private: ss << item->name().toStdString() << "_plane_"; std::shared_ptr > pshape - = boost::dynamic_pointer_cast > (shape); + = std::dynamic_pointer_cast > (shape); Kernel::Point_3 ref = CGAL::ORIGIN + pshape->plane_normal (); 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 5ea95241e69..18d5e4b6cc8 100644 --- a/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h +++ b/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h @@ -141,9 +141,9 @@ struct Index_generator_with_features typedef Index type; }; -template -const T& get_index(const Boost_variant& x, - std::enable_if_t::value > * = 0) +template +const T& get_index(const Variant& x, + std::enable_if_t::value > * = 0) { return std::get(x); } template diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h index 3612ac02c70..88089e89e01 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h @@ -895,7 +895,7 @@ public: for (std::size_t i = 0; i < m_extracted_shapes->size(); ++i) { std::shared_ptr pshape - = boost::dynamic_pointer_cast((*m_extracted_shapes)[i]); + = std::dynamic_pointer_cast((*m_extracted_shapes)[i]); // Ignore all shapes other than plane if (pshape != std::shared_ptr()) diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cone_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cone_parameters.cpp index e907bbbfe0b..5d995f6faa3 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cone_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cone_parameters.cpp @@ -74,7 +74,7 @@ bool test_cone_parameters() { if (shapes.size() != 1) continue; - std::shared_ptr cone = boost::dynamic_pointer_cast((*shapes.first)); + std::shared_ptr cone = std::dynamic_pointer_cast((*shapes.first)); // Check: shape detected is a cone. if (!cone) diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cylinder_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cylinder_parameters.cpp index 4d05c98d068..8c3780e0368 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cylinder_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_cylinder_parameters.cpp @@ -73,7 +73,7 @@ bool test_cylinder_parameters() { if (shapes.size() != 1) continue; - std::shared_ptr cyl = boost::dynamic_pointer_cast((*shapes.first)); + std::shared_ptr cyl = std::dynamic_pointer_cast((*shapes.first)); // Check: shape detected is a cylinder. if (!cyl) diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_plane_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_plane_parameters.cpp index e47a2f47216..f0a8e772baa 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_plane_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_plane_parameters.cpp @@ -67,7 +67,7 @@ bool test_plane_parameters() { if (shapes.size() != 1) continue; - std::shared_ptr pl = boost::dynamic_pointer_cast((*shapes.first)); + std::shared_ptr pl = std::dynamic_pointer_cast((*shapes.first)); if (!pl) continue; diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_sphere_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_sphere_parameters.cpp index c6dcb0e0999..88f78d5326a 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_sphere_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_sphere_parameters.cpp @@ -70,7 +70,7 @@ bool test_sphere_parameters() { if (shapes.size() != 1) continue; - std::shared_ptr sphere = boost::dynamic_pointer_cast((*shapes.first)); + std::shared_ptr sphere = std::dynamic_pointer_cast((*shapes.first)); // Check: shape detected is a cylinder. if (!sphere) diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_torus_parameters.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_torus_parameters.cpp index c380d26c7f9..3d39f70b473 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_torus_parameters.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_torus_parameters.cpp @@ -73,7 +73,7 @@ bool test_torus_parameters() { continue; std::shared_ptr torus = - boost::dynamic_pointer_cast((*shapes.first)); + std::dynamic_pointer_cast((*shapes.first)); // Check: shape detected is a torus. if (!torus) 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 17b2c7edd35..798284fa04e 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/flip_edges.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/flip_edges.h @@ -620,7 +620,7 @@ void find_best_flip_to_improve_dh(C3t3& c3t3, indices(facet_circulator->second, i)); if (curr_vertex != vh0 && curr_vertex != vh1) { - if (is_edge_uv(vh, curr_vertex, boost::get(o_inc_vh))) + if (is_edge_uv(vh, curr_vertex, o_inc_vh.value())) { is_edge = true; break; @@ -778,7 +778,7 @@ Sliver_removal_result flip_n_to_m(C3t3& c3t3, indices(facet_circulator->second, i)); if (curr_vertex != vh0 && curr_vertex != vh1) { - if (is_edge_uv(vh, curr_vertex, boost::get(o_inc_vh))) + if (is_edge_uv(vh, curr_vertex, o_inc_vh.value())) return NOT_FLIPPABLE; } } @@ -1202,7 +1202,7 @@ std::size_t flip_all_edges(const std::vector& edges, Cell_handle ch; int i0, i1; - if (is_edge_uv(vp.first, vp.second, boost::get(o_inc_vh), ch, i0, i1)) + if (is_edge_uv(vp.first, vp.second, o_inc_vh.value(), ch, i0, i1)) { Edge edge(ch, i0, i1); 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 b9147708c01..d06a9c52a97 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 @@ -346,7 +346,7 @@ public: if(f_on_surface[i]) m_c3t3.remove_from_complex(c, i); else - m_c3t3.add_to_complex(c, i, patch.get()); + m_c3t3.add_to_complex(c, i, patch.value()); } m_c3t3.remove_from_complex(c); 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 5cf73bf4651..07848cbe492 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 @@ -535,7 +535,7 @@ void set_index(typename C3t3::Vertex_handle v, const C3t3& c3t3) v->set_index(typename C3t3::Curve_index(1)); break; case 0: - v->set_index(std::get(v->index())); + v->set_index(Mesh_3::internal::get_index(v->index())); break; default: CGAL_assertion(false); From bdfa15c08f020308eb2899c30e212c9eb72fc6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 13 Jun 2023 18:28:11 +0200 Subject: [PATCH 061/156] fixes after merge --- .../test/Intersections_3/intersection_test_helper.h | 4 +--- Intersections_3/test/Intersections_3/issue_5428.cpp | 2 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 2 +- Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h | 2 +- Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h | 4 ++-- .../CGAL/constructions/Straight_skeleton_cons_ftC2.h | 8 ++++---- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Intersections_3/test/Intersections_3/intersection_test_helper.h b/Intersections_3/test/Intersections_3/intersection_test_helper.h index 2e9806ad03b..167e18661fc 100644 --- a/Intersections_3/test/Intersections_3/intersection_test_helper.h +++ b/Intersections_3/test/Intersections_3/intersection_test_helper.h @@ -309,10 +309,8 @@ public: template bool compare_to_other_variant(const T& t) const { - if(ov->type() == typeid(T)) + if(auto* r = std::get_if(&*ov)) { - auto* r = std::get_if(&*ov); // ov is an optional - assert(r); return (t == *r); } diff --git a/Intersections_3/test/Intersections_3/issue_5428.cpp b/Intersections_3/test/Intersections_3/issue_5428.cpp index ba39e1bd109..ba905ed12c5 100644 --- a/Intersections_3/test/Intersections_3/issue_5428.cpp +++ b/Intersections_3/test/Intersections_3/issue_5428.cpp @@ -15,7 +15,7 @@ int main(int, char**) auto result = intersection(cub, pl); - const std::vector* res = boost::get >(&*result); + const std::vector* res = std::get_if >(&*result); for(const Point& p : *res) std::cout << p << std::endl; diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 49584ff06a7..8e51389c173 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -1148,7 +1148,7 @@ public: Intersection operator()(const Segment_3& s) const { #ifndef CGAL_MESH_3_NO_LONGER_CALLS_DO_INTERSECT_3 - CGAL_precondition(r_domain_.do_intersect_surface_object()(s) != boost::none); + CGAL_precondition(r_domain_.do_intersect_surface_object()(s) != std::nullopt); #endif // NOT CGAL_MESH_3_NO_LONGER_CALLS_DO_INTERSECT_3 return this->operator()(s.source(),s.target()); } 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 309e39ae64f..60abbe5d0be 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h @@ -751,7 +751,7 @@ Refine_cells_3:: number_of_bad_elements_impl() { typedef typename MD::Subdomain_index Subdomain_index; - typedef boost::optional Subdomain; + typedef std::optional Subdomain; typedef typename Tr::Finite_cells_iterator Finite_cell_iterator; int count = 0; 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 9802c09dd60..5d242c1a604 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -1053,7 +1053,7 @@ Refine_facets_3:: number_of_bad_elements_impl() { typedef typename MD::Subdomain_index Subdomain_index; - typedef boost::optional Subdomain; + typedef std::optional Subdomain; typedef typename Tr::Finite_facets_iterator Finite_facet_iterator; int count = 0, count_num_bad_surface_facets = 0; @@ -1735,7 +1735,7 @@ is_facet_encroached(const Facet& facet, const Weighted_point& point) const { typedef typename MD::Subdomain_index Subdomain_index; - typedef boost::optional Subdomain; + typedef std::optional Subdomain; if ( r_tr_.is_infinite(facet) || ! this->is_facet_on_surface(facet) ) return false; diff --git a/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h b/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h index 53397c44c21..54ed84a64ea 100644 --- a/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h @@ -572,7 +572,7 @@ compute_artifical_isec_timeC2 ( Trisegment_2_ptr< Trisegment_2(&*inter_res)) + if(const Segment_2* seg = std::get_if(&*inter_res)) { // get the segment extremity closest to the seed Boolean res = (K().compare_distance_2_object()(*seed, seg->source(), seg->target()) == CGAL::SMALLER); @@ -581,7 +581,7 @@ compute_artifical_isec_timeC2 ( Trisegment_2_ptr< Trisegment_2(&*inter_res); + const Point_2* inter_pt = std::get_if(&*inter_res); if(!CGAL_NTS is_finite(inter_pt->x()) || !CGAL_NTS is_finite(inter_pt->y())) return std::nullopt; t = l0->a() * inter_pt->x() + l0->b() * inter_pt->y() + l0->c() ; @@ -879,12 +879,12 @@ construct_artifical_isecC2 ( Trisegment_2_ptr< Trisegment_2(&*inter_res)) + if(const Point_2* inter_pt = std::get_if(&*inter_res)) { bool ok = CGAL_NTS is_finite(inter_pt->x()) && CGAL_NTS is_finite(inter_pt->y()) ; return cgal_make_optional(ok, *inter_pt) ; } - else if(const Segment_2* seg = std::get(&*inter_res)) + else if(const Segment_2* seg = std::get_if(&*inter_res)) { // get the segment extremity closest to the seed const Point_2& pt = (K().compare_distance_2_object()(*seed, From 640c98f21e37d078e186e39c113f3025684f9d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Jun 2023 18:36:38 +0200 Subject: [PATCH 062/156] add utility to avoid duplicate in variant + use it in SMDS_3 --- .../CGAL/Simplicial_mesh_vertex_base_3.h | 4 +- STL_Extension/include/CGAL/variant.h | 87 +++++++++++++++++++ 2 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 STL_Extension/include/CGAL/variant.h diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h index 04b6f19af18..24656da85e1 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h @@ -26,9 +26,9 @@ #include #include +#include #include -#include #include namespace CGAL { @@ -53,7 +53,7 @@ public: using Vertex_handle = typename Vb::Vertex_handle; // Types - using Index = std::variant; + using Index = Variant_with_no_duplicate_t; using FT = typename GT::FT; // Constructor diff --git a/STL_Extension/include/CGAL/variant.h b/STL_Extension/include/CGAL/variant.h new file mode 100644 index 00000000000..41bd836d8cc --- /dev/null +++ b/STL_Extension/include/CGAL/variant.h @@ -0,0 +1,87 @@ +// Copyright (c) 2023 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) : Sébastien Loriot +// + +#ifndef CGAL_VARIANT_H +#define CGAL_VARIANT_H + +#include + +namespace CGAL +{ + +template +struct Is_in_variant; + +template +struct Is_in_variant> +{ + inline static constexpr bool value = + std::is_same_v || Is_in_variant>::value; +}; + +template +struct Is_in_variant> +{ + inline static constexpr bool value = std::is_same_v; +}; + +/// equals true iif `T` is a possible type in `Variant` with `Variant` being a `std::variant` +template +inline constexpr bool Is_in_variant_v = Is_in_variant::value; + +// -- +template +struct Add_to_variant; + +template +struct Add_to_variant> +{ + using type = std::variant; +}; + +/// a `std::variant` with `T` appended to the types of the `std::variant` `Variant` +template< class T, class Variant > +using Add_to_variant_t = typename Add_to_variant::type; + +namespace internal{ +template +struct Get_variant_impl +{ + using type = typename Get_variant_impl< + std::conditional_t, + Variant, + Add_to_variant_t>, + Tn...>::type; +}; + +template +struct Get_variant_impl +{ + using type = std::conditional_t, + Variant, + Add_to_variant_t>; +}; +} // end of internal namespace + +template +struct Variant_with_no_duplicate +{ + using type = typename internal::Get_variant_impl, Tn ...>::type; +}; + +/// a `std::variant` with types being all different +template< class ... Tn > +using Variant_with_no_duplicate_t = typename Variant_with_no_duplicate::type; + +} //end of CGAL namespace + +#endif From cb840ac84b153c286dd1e5879083df04c74462de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Jun 2023 18:42:13 +0200 Subject: [PATCH 063/156] boost::optional::get -> std::optional::value --- .../Algebraic_kernel_d/Curve_analysis_2.h | 20 +++++++------- .../Curve_pair_analysis_2.h | 6 ++--- .../CGAL/Arr_algebraic_segment_traits_2.h | 26 +++++++++---------- BGL/examples/BGL_triangulation_2/dijkstra.cpp | 4 +-- .../include/CGAL/Delaunay_triangulation.h | 2 +- .../include/CGAL/Regular_triangulation.h | 2 +- Triangulation/include/CGAL/Triangulation.h | 4 +-- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h index a11c4283a98..ef940f96887 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h @@ -584,7 +584,7 @@ public: */ void set_f(Polynomial_2 f) { CGAL_precondition(! has_defining_polynomial()); - if((! this->ptr()->f) || f!=this->ptr()->f.get()) { + if((! this->ptr()->f) || f!=this->ptr()->f.value()) { this->copy_on_write(); this->ptr()->f=f; } @@ -639,7 +639,7 @@ public: //! Returns the defining polynomial Polynomial_2 polynomial_2() const { CGAL_precondition(bool(this->ptr()->f)); - return this->ptr()->f.get(); + return this->ptr()->f.value(); } public: @@ -714,8 +714,8 @@ public: = event_line; event_coordinates()[i].stack = event_line; } - CGAL_postcondition(event_coordinates()[i].stack.get().is_event()); - return event_coordinates()[i].stack.get(); + CGAL_postcondition(event_coordinates()[i].stack.value().is_event()); + return event_coordinates()[i].stack.value(); } public: @@ -1349,7 +1349,7 @@ public: } } } - return intermediate_values()[i].get(); + return intermediate_values()[i].value(); } @@ -1370,7 +1370,7 @@ public: if(! this->ptr()->content) { compute_content_and_primitive_part(); } - return this->ptr()->content.get(); + return this->ptr()->content.value(); } public: @@ -1389,7 +1389,7 @@ public: if(! this->ptr()->f_primitive) { compute_content_and_primitive_part(); } - return this->ptr()->f_primitive.get(); + return this->ptr()->f_primitive.value(); } Algebraic_kernel_with_analysis_2* kernel() const { @@ -1582,7 +1582,7 @@ private: if(! this->ptr()->resultant_of_primitive_and_derivative_y) { compute_resultant_of_primitive_and_derivative_y(); } - return this->ptr()->resultant_of_primitive_and_derivative_y.get(); + return this->ptr()->resultant_of_primitive_and_derivative_y.value(); } private: @@ -1714,7 +1714,7 @@ private: if(! this->ptr()->event_coordinates) { compute_event_coordinates(); } - return this->ptr()->event_coordinates.get(); + return this->ptr()->event_coordinates.value(); } private: @@ -1727,7 +1727,7 @@ private: event_coordinates(); CGAL_assertion(bool(this->ptr()->intermediate_values)); } - return this->ptr()->intermediate_values.get(); + return this->ptr()->intermediate_values.value(); } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index a38cf2ab659..d350a27a2df 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -1030,7 +1030,7 @@ public: this->ptr()->event_slices[i] = create_event_slice(i); } CGAL_assertion(bool(this->ptr()->event_slices[i])); - return this->ptr()->event_slices[i].get(); + return this->ptr()->event_slices[i].value(); } @@ -1045,7 +1045,7 @@ public: } - return intermediate_slices()[i].get(); + return intermediate_slices()[i].valuen(); } //! Returns bound representative value at the ith interval @@ -1074,7 +1074,7 @@ public: } } CGAL_assertion(bool(intermediate_values()[i])); - return intermediate_values()[i].get(); + return intermediate_values()[i].value(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index b1678fe4acd..ca15a9b2752 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -293,39 +293,39 @@ public: it_seg_p = std::get(&(*it)); } - bool left_on_arc = start && on_arc(start.get(), *it_seg_p); - bool right_on_arc = end && on_arc(end.get(), *it_seg_p); + bool left_on_arc = start && on_arc(start.value(), *it_seg_p); + bool right_on_arc = end && on_arc(end.value(), *it_seg_p); if ( left_on_arc && right_on_arc ) { - segs.push_back(it_seg_p->trim(start.get(),end.get())); + segs.push_back(it_seg_p->trim(start.value(),end.value())); } if (left_on_arc && (!right_on_arc)) { if (!it_seg_p->is_finite(CGAL::ARR_MAX_END) || - !equal(start.get(),right(*it_seg_p))) { + !equal(start.value(),right(*it_seg_p))) { if (it_seg_p->is_finite(CGAL::ARR_MIN_END) && - equal(start.get(),left(*it_seg_p))) + equal(start.value(),left(*it_seg_p))) { segs.push_back(*it_seg_p); } else { X_monotone_curve_2 split1,split2; - it_seg_p->split(start.get(),split1,split2); + it_seg_p->split(start.value(),split1,split2); segs.push_back(split2); } } } if ((!left_on_arc) && right_on_arc) { if (!it_seg_p->is_finite(CGAL::ARR_MIN_END) || - ! equal(left(*it_seg_p), end.get())) + ! equal(left(*it_seg_p), end.value())) { if (it_seg_p->is_finite(CGAL::ARR_MAX_END) && - equal(end.get(), right(*it_seg_p))) + equal(end.value(), right(*it_seg_p))) { segs.push_back(*it_seg_p); } else { X_monotone_curve_2 split1,split2; - it_seg_p->split(end.get(), split1, split2); + it_seg_p->split(end.value(), split1, split2); segs.push_back(split1); } } @@ -354,8 +354,8 @@ public: it--; it_seg_p = std::get(&(*it)); } - if (start && on_arc(start.get(),*it_seg_p)) { - segs.push_front(it_seg_p->trim(start.get(), right(*it_seg_p))); + if (start && on_arc(start.value(),*it_seg_p)) { + segs.push_front(it_seg_p->trim(start.value(), right(*it_seg_p))); break; } else { @@ -384,8 +384,8 @@ public: CGAL_assertion(it != arcs.end()); it_seg_p = std::get(&(*it)); } - if(end && on_arc(end.get(),*it_seg_p)) { - segs.push_back(it_seg_p->trim(left(*it_seg_p),end.get())); + if(end && on_arc(end.value(),*it_seg_p)) { + segs.push_back(it_seg_p->trim(left(*it_seg_p),end.value())); break; } else { diff --git a/BGL/examples/BGL_triangulation_2/dijkstra.cpp b/BGL/examples/BGL_triangulation_2/dijkstra.cpp index 87c308e18bb..1e63fc8810f 100644 --- a/BGL/examples/BGL_triangulation_2/dijkstra.cpp +++ b/BGL/examples/BGL_triangulation_2/dijkstra.cpp @@ -60,9 +60,9 @@ int main(int argc,char* argv[]) for(vertex_descriptor vd : vertices(tr)) { std::cout << vd->point() << " [" << vertex_id_map[vd] << "] "; - std::cout << " has distance = " << std::get(distance_pmap,vd) + std::cout << " has distance = " << get(distance_pmap,vd) << " and predecessor "; - vd = std::get(predecessor_pmap,vd); + vd = get(predecessor_pmap,vd); std::cout << vd->point() << " [" << vertex_id_map[vd] << "]\n "; } diff --git a/Triangulation/include/CGAL/Delaunay_triangulation.h b/Triangulation/include/CGAL/Delaunay_triangulation.h index 1dd1929cb68..a2203ee762e 100644 --- a/Triangulation/include/CGAL/Delaunay_triangulation.h +++ b/Triangulation/include/CGAL/Delaunay_triangulation.h @@ -145,7 +145,7 @@ private: { if(!*fop) *fop=cfo(a,b); - return ifsoos(fop->get(),a,b,p); + return ifsoos(fop->value(),a,b,p); } }; public: diff --git a/Triangulation/include/CGAL/Regular_triangulation.h b/Triangulation/include/CGAL/Regular_triangulation.h index 8294cb65598..b2e6a651d49 100644 --- a/Triangulation/include/CGAL/Regular_triangulation.h +++ b/Triangulation/include/CGAL/Regular_triangulation.h @@ -144,7 +144,7 @@ private: { if(!*fop) *fop=cfo(a,b); - return ifpt(fop->get(),a,b,p); + return ifpt(fop->value(),a,b,p); } }; diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index 1dc8e1a3459..9a3e4aecb47 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -101,10 +101,10 @@ protected: template CGAL::Orientation operator()(Iter a, Iter b) const { + return ifo(fop->value(),a,b); if (*fop) - return ifo(fop->get(),a,b); *fop = cfo(a,b); - CGAL_assertion(ifo(fop->get(),a,b) == CGAL::POSITIVE); + CGAL_assertion(ifo(fop->value(),a,b) == CGAL::POSITIVE); return CGAL::POSITIVE; } }; From f240a47451a2323d6ac589cfdd885e2b10428e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Jun 2023 18:45:35 +0200 Subject: [PATCH 064/156] boost::get -> std::get_if --- .../algebraic_segments.cpp | 2 +- .../edge_manipulation_curve_history.cpp | 2 +- .../point_location_utils.h | 12 +++---- .../unb_planar_vertical_decomposition.cpp | 8 ++--- .../include/CGAL/Arr_accessor.h | 6 ++-- .../CGAL/Arr_algebraic_segment_traits_2.h | 14 ++++---- .../CGAL/Arr_circular_line_arc_traits_2.h | 36 +++++++++---------- .../include/CGAL/Arr_curve_data_traits_2.h | 4 +-- .../Bezier_bounding_rational_traits.h | 8 ++--- .../include/CGAL/Arr_linear_traits_2.h | 2 +- .../CGAL/Arr_non_caching_segment_traits_2.h | 4 +-- .../Trapezoidal_decomposition_2_impl.h | 2 +- .../include/CGAL/Arr_point_location_result.h | 2 +- .../include/CGAL/Arr_polycurve_traits_2.h | 16 ++++----- .../include/CGAL/Arr_segment_traits_2.h | 2 +- .../include/CGAL/Arr_tracing_traits_2.h | 8 ++--- .../Arrangement_on_surface_2_global.h | 34 +++++++++--------- .../Arrangement_on_surface_2_impl.h | 4 +-- .../Arrangement_2/Arrangement_zone_2_impl.h | 18 +++++----- .../Surface_sweep_2/Arr_insertion_traits_2.h | 6 ++-- .../Surface_sweep_2/Arr_overlay_ss_visitor.h | 4 +-- .../Surface_sweep_2/Arr_overlay_traits_2.h | 8 ++--- .../simple_polygon_visibility_2.cpp | 2 +- 23 files changed, 102 insertions(+), 102 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp index c1bc7c4779d..69c4a66ea68 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp @@ -52,7 +52,7 @@ int main() { // but not in this case). std::vector segs; for(size_t i = 0; i < pre_segs.size(); ++i) { - auto* curr_p = std::get(&pre_segs[i]); + auto* curr_p = std::get_if(&pre_segs[i]); assert(curr_p); segs.push_back(*curr_p); } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp index c1ee293fd27..bd636bc94fe 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp @@ -45,7 +45,7 @@ int main() { Point_location pl(arr); const Point q{_7_halves, 7}; Point_location::result_type obj = pl.locate(q); - auto* e = std::get(&obj); + auto* e = std::get_if(&obj); // Split the edge e to two edges e1 and e2; auto e1 = arr.split_edge(arr.non_const_handle(*e), q); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h index f50236bb3e5..d6c29e08bac 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h @@ -46,13 +46,13 @@ void print_point_location const Face_const_handle* f; std::cout << "The point (" << q << ") is located "; - if ((f = std::get(&obj))) // inside a face + if ((f = std::get_if(&obj))) // inside a face std::cout << "inside " << (((*f)->is_unbounded()) ? "the unbounded" : "a bounded") << " face." << std::endl; - else if ((e = std::get(&obj))) // on an edge + else if ((e = std::get_if(&obj))) // on an edge std::cout << "on an edge: " << (*e)->curve() << std::endl; - else if ((v = std::get(&obj))) // on a vertex + else if ((v = std::get_if(&obj))) // on a vertex std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; else CGAL_error_msg("Invalid object."); @@ -101,12 +101,12 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs, std::cout << "Shooting up from (" << q << ") : hit "; - if ((v = std::get(&obj))) // hit a vertex + if ((v = std::get_if(&obj))) // hit a vertex std::cout << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; - else if ((e = std::get(&obj)) ) // hit an edge + else if ((e = std::get_if(&obj)) ) // hit an edge std::cout << "an edge: " << (*e)->curve() << std::endl; - else if ((f = std::get(&obj))) { // hit nothing + else if ((f = std::get_if(&obj))) { // hit nothing assert((*f)->is_unbounded()); std::cout << "nothing." << std::endl; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp index d51f4fae389..0b31dc9655b 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp @@ -41,10 +41,10 @@ int main() { std::cout << " feature below: "; if (! curr.first) std::cout << "EMPTY"; else { - auto* vh = std::get(&*(curr.first));; + auto* vh = std::get_if(&*(curr.first));; if (vh) std::cout << '(' << (*vh)->point() << ')'; else { - auto* hh = std::get(&*(curr.first)); + auto* hh = std::get_if(&*(curr.first)); if (! (*hh)->is_fictitious()) std::cout << '[' << (*hh)->curve() << ']'; else std::cout << "NONE"; @@ -54,10 +54,10 @@ int main() { std::cout << " feature above: "; if (! curr.second) std::cout << "EMPTY\n"; else { - auto* vh = std::get(&*(curr.second));; + auto* vh = std::get_if(&*(curr.second));; if (vh) std::cout << '(' << (*vh)->point() << ")\n"; else { - auto* hh = std::get(&*(curr.second)); + auto* hh = std::get_if(&*(curr.second)); if (! (*hh)->is_fictitious()) std::cout << '[' << (*hh)->curve() << "]\n"; else std::cout << "NONE\n"; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h b/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h index 202ca448b5e..bb60e54d224 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h @@ -114,13 +114,13 @@ public: auto obj = p_arr->topology_traits()->locate_curve_end(cv, ind, ps_x, ps_y); // Return a handle to the DCEL feature. - DFace** f_p = std::get(&obj); + DFace** f_p = std::get_if(&obj); if (f_p) return (Pl_result::make_result(p_arr->_const_handle_for(*f_p))); - DHalfedge** he_p = std::get(&obj); + DHalfedge** he_p = std::get_if(&obj); if (he_p) return (Pl_result::make_result(p_arr->_const_handle_for(*he_p))); - DVertex** v_p = std::get(&obj); + DVertex** v_p = std::get_if(&obj); if (v_p) return (Pl_result::make_result(p_arr->_const_handle_for(*v_p))); // We should never reach here: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index ca15a9b2752..af9b28db6f2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -286,11 +286,11 @@ public: this->_ckva()->make_x_monotone_2_object()(cv, std::back_inserter(arcs)); auto it = arcs.begin(); auto helper = it; - const auto* it_seg_p = std::get(&(*it)); + const auto* it_seg_p = std::get_if(&(*it)); while (it != arcs.end()) { if ( on_arc(p, *it_seg_p) ) break; it++; - it_seg_p = std::get(&(*it)); + it_seg_p = std::get_if(&(*it)); } bool left_on_arc = start && on_arc(start.value(), *it_seg_p); @@ -348,11 +348,11 @@ public: } CGAL_assertion(it != arcs.begin()); it--; - it_seg_p = std::get(&(*it)); + it_seg_p = std::get_if(&(*it)); while (! on_arc(point_it, *it_seg_p)) { CGAL_assertion(it != arcs.begin()); it--; - it_seg_p = std::get(&(*it)); + it_seg_p = std::get_if(&(*it)); } if (start && on_arc(start.value(),*it_seg_p)) { segs.push_front(it_seg_p->trim(start.value(), right(*it_seg_p))); @@ -365,7 +365,7 @@ public: } if (! right_on_arc) { it = helper; // reset - it_seg_p = std::get(&(*it)); + it_seg_p = std::get_if(&(*it)); Point_2 point_it; while (true) { if (it_seg_p->is_finite(CGAL::ARR_MAX_END) && @@ -378,11 +378,11 @@ public: } it++; CGAL_assertion(it != arcs.end()); - it_seg_p = std::get(&(*it)); + it_seg_p = std::get_if(&(*it)); while(! on_arc(point_it, *it_seg_p)) { it++; CGAL_assertion(it != arcs.end()); - it_seg_p = std::get(&(*it)); + it_seg_p = std::get_if(&(*it)); } if(end && on_arc(end.value(),*it_seg_p)) { segs.push_back(it_seg_p->trim(left(*it_seg_p),end.value())); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h index c48fa96917c..ba387ee0804 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -85,23 +85,23 @@ namespace CGAL { const std::variant< Arc1, Arc2 > &a2, const Circular_arc_point_2 &p) const { - if ( const Arc1* arc1 = std::get( &a1 ) ){ - if ( const Arc1* arc2 = std::get( &a2 ) ){ + if ( const Arc1* arc1 = std::get_if( &a1 ) ){ + if ( const Arc1* arc2 = std::get_if( &a2 ) ){ return CircularKernel() .compare_y_to_right_2_object()(*arc1, *arc2, p); } else { - const Arc2* arc2e = std::get( &a2 ); + const Arc2* arc2e = std::get_if( &a2 ); return CircularKernel() .compare_y_to_right_2_object()(*arc1, *arc2e, p); } } - const Arc2* arc1 = std::get( &a1 ); - if ( const Arc1* arc2 = std::get( &a2 ) ){ + const Arc2* arc1 = std::get_if( &a1 ); + if ( const Arc1* arc2 = std::get_if( &a2 ) ){ return CircularKernel() .compare_y_to_right_2_object()(*arc1, *arc2, p); } - const Arc2* arc2e = std::get( &a2 ); + const Arc2* arc2e = std::get_if( &a2 ); return CircularKernel() .compare_y_to_right_2_object()(*arc1, *arc2e, p); } @@ -189,11 +189,11 @@ namespace CGAL { operator() (const Circular_arc_point_2 &p, const std::variant< Arc1, Arc2 > &A1) const { - if ( const Arc1* arc1 = std::get( &A1 ) ){ + if ( const Arc1* arc1 = std::get_if( &A1 ) ){ return CircularKernel().compare_y_at_x_2_object()(p, *arc1); } else { - const Arc2* arc2 = std::get( &A1 ); + const Arc2* arc2 = std::get_if( &A1 ); return CircularKernel().compare_y_at_x_2_object()(p, *arc2); } } @@ -250,7 +250,7 @@ namespace CGAL { operator()(const std::variant &A, OutputIterator res) const { - if ( const Arc1* arc1 = std::get( &A ) ) { + if ( const Arc1* arc1 = std::get_if( &A ) ) { std::vector container; CircularKernel(). make_x_monotone_2_object()(*arc1,std::back_inserter(container)); @@ -258,7 +258,7 @@ namespace CGAL { (container, res); } else { - const Arc2* arc2 = std::get( &A ); + const Arc2* arc2 = std::get_if( &A ); std::vector container; CircularKernel(). make_x_monotone_2_object()(*arc2,std::back_inserter(container)); @@ -281,19 +281,19 @@ namespace CGAL { const std::variant< Arc1, Arc2 > &c2, OutputIterator oi) const { - if ( const Arc1* arc1 = std::get( &c1 ) ){ - if ( const Arc1* arc2 = std::get( &c2 ) ){ + if ( const Arc1* arc1 = std::get_if( &c1 ) ){ + if ( const Arc1* arc2 = std::get_if( &c2 ) ){ return CircularKernel().intersect_2_object()(*arc1, *arc2, oi); } - const Arc2* arc2 = std::get( &c2 ); + const Arc2* arc2 = std::get_if( &c2 ); return CircularKernel().intersect_2_object()(*arc1, *arc2, oi); } - const Arc2* arc1e = std::get( &c1 ); - if ( const Arc1* arc2 = std::get( &c2 ) ){ + const Arc2* arc1e = std::get_if( &c1 ); + if ( const Arc1* arc2 = std::get_if( &c2 ) ){ return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi); } - const Arc2* arc2 = std::get( &c2 ); + const Arc2* arc2 = std::get_if( &c2 ); return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi); } @@ -314,7 +314,7 @@ namespace CGAL { std::variant< Arc1, Arc2 > &ca2) const { // TODO : optimize by extracting the references from the variants ? - if ( const Arc1* arc1 = std::get( &A ) ){ + if ( const Arc1* arc1 = std::get_if( &A ) ){ Arc1 carc1; Arc1 carc2; CircularKernel().split_2_object()(*arc1, p, carc1, carc2); @@ -324,7 +324,7 @@ namespace CGAL { } else{ - const Arc2* arc2 = std::get( &A ); + const Arc2* arc2 = std::get_if( &A ); Arc2 cline1; Arc2 cline2; CircularKernel().split_2_object()(*arc2, p, cline1, cline2); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h index f487c055221..e8bb9a70703 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h @@ -138,12 +138,12 @@ public: // Attach the data to each of the resulting x-monotone curves. X_monotone_curve_data xdata = Convert()(cv.data()); for (const auto& base_obj : base_objects) { - if (const auto* bxcv = std::get(&base_obj)) { + if (const auto* bxcv = std::get_if(&base_obj)) { *oi++ = Make_x_monotone_result(X_monotone_curve_2(*bxcv, xdata)); continue; } // Current object is an isolated point: Leave it as is. - const auto* bp = std::get(&base_obj); + const auto* bp = std::get_if(&base_obj); CGAL_assertion(bp); *oi++ = Make_x_monotone_result(*bp); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h index 8b3abe1f57f..705682f05ca 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h @@ -1264,22 +1264,22 @@ private: Control_points aux_vec; auto res1 = f_intersect(skew1a, skew2a); - const Point_2* p1 = std::get(&*res1); + const Point_2* p1 = std::get_if(&*res1); if (! p1) CGAL_error(); aux_vec.push_back(*p1); auto res2 = f_intersect(skew1a, skew2b); - const Point_2* p2 = std::get(&*res2); + const Point_2* p2 = std::get_if(&*res2); if (! p2) CGAL_error(); aux_vec.push_back(*p2); auto res3 = f_intersect(skew1b, skew2a); - const Point_2* p3 = std::get(&*res3); + const Point_2* p3 = std::get_if(&*res3); if (! p3) CGAL_error(); aux_vec.push_back(*p3); auto res4 = f_intersect (skew1b, skew2b); - const Point_2* p4 = std::get(&*res4); + const Point_2* p4 = std::get_if(&*res4); if (! p4) CGAL_error(); aux_vec.push_back(*p4); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h index 079f5534e83..ef830934d74 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h @@ -1340,7 +1340,7 @@ public: if (! res) return oi; // Check whether we have a single intersection point. - const Point_2* ip = std::get(&*res); + const Point_2* ip = std::get_if(&*res); if (ip != nullptr) { // Check whether the intersection point ip lies on both segments. const bool ip_on_cv1 = cv1.is_vertical() ? diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h index 636d669eb36..d3397599ae6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h @@ -234,7 +234,7 @@ public: if (! res) return oi; // Check if the intersection is a point: - const Point_2* p_p = std::get(&*res); + const Point_2* p_p = std::get_if(&*res); if (p_p != nullptr) { // Create a pair representing the point with its multiplicity, // which is always 1 for line segments for all practical purposes. @@ -246,7 +246,7 @@ public: } // The intersection is a segment. - const X_monotone_curve_2* cv_p = std::get(&*res); + const X_monotone_curve_2* cv_p = std::get_if(&*res); CGAL_assertion(cv_p != nullptr); Comparison_result cmp1 = m_traits.compare_endpoints_xy_2_object()(cv1); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h index 7da418861f0..9b0a7617114 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h @@ -219,7 +219,7 @@ deactivate_trapezoid(Dag_node& trpz_node, Dag_node* active_node) const CGAL_precondition(traits->is_active(trpz_node.get_data())); CGAL_precondition(traits->is_td_trapezoid(trpz_node.get_data())); if (Td_active_trapezoid* trap = - std::get(&trpz_node.get_data())) + std::get_if(&trpz_node.get_data())) trap->non_recursive_clear_neighbors(); trpz_node.set_data(Td_inactive_trapezoid()); if (active_node) trpz_node.set_left_child(*active_node); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h index 8516cc85be2..15320d02bcd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h @@ -99,7 +99,7 @@ struct Arr_point_location_result { template static - inline const T* assign(const Type* obj) { return std::get(obj); } + inline const T* assign(const Type* obj) { return std::get_if(obj); } #endif // CGAL_ARR_POINT_LOCATION_VERSION < 2 //this one is only to remove warnings in functions diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h index 4998f53d646..a7aa0c32786 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h @@ -212,7 +212,7 @@ public: for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its) make_seg_x_monotone(*its, std::back_inserter(x_seg_objects)); auto it = x_seg_objects.begin(); - const auto* x_seg_p = std::get(&(*it)); + const auto* x_seg_p = std::get_if(&(*it)); #if ! defined (CGAL_NO_ASSERTIONS) CGAL_assertion(x_seg_p != nullptr); #endif @@ -260,7 +260,7 @@ public: #endif for (++it; it != x_seg_objects.end(); ++it) { - const auto* x_seg_p = std::get(&(*it)); + const auto* x_seg_p = std::get_if(&(*it)); #if ! defined (CGAL_NO_ASSERTIONS) CGAL_assertion(x_seg_p != nullptr); #endif @@ -350,7 +350,7 @@ public: for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its) make_seg_x_monotone(*its, std::back_inserter(x_seg_objects)); auto it = x_seg_objects.begin(); - const auto* x_seg_p = std::get(&(*it)); + const auto* x_seg_p = std::get_if(&(*it)); #if ! defined (CGAL_NO_ASSERTIONS) CGAL_assertion(x_seg_p != nullptr); #endif @@ -398,7 +398,7 @@ public: #endif for (++it; it != x_seg_objects.end(); ++it) { - const auto* x_seg_p = std::get(&(*it)); + const auto* x_seg_p = std::get_if(&(*it)); #if ! defined (CGAL_NO_ASSERTIONS) CGAL_assertion(x_seg_p != nullptr); #endif @@ -824,7 +824,7 @@ public: intersect(cv1[i1], cv2[i2], std::back_inserter(xections)); for (const auto& xection : xections) { const X_monotone_subcurve_2* subcv_p = - std::get(&xection); + std::get_if(&xection); if (subcv_p != nullptr) { ocv.push_back(*subcv_p); oi = output_ocv (ocv, invert_ocv, oi); @@ -832,7 +832,7 @@ public: } const Intersection_point* p_p = - std::get(&xection); + std::get_if(&xection); if (p_p != nullptr) *oi++ = Intersection_result(*p_p); } } @@ -846,7 +846,7 @@ public: for (const auto& item : sub_xections) { const X_monotone_subcurve_2* x_seg = - std::get(&item); + std::get_if(&item); if (x_seg != nullptr) { X_monotone_subcurve_2 seg = *x_seg; // We maintain the variant that if the input curves have opposite @@ -863,7 +863,7 @@ public: } const Intersection_point* p_ptr = - std::get(&item); + std::get_if(&item); if (p_ptr != nullptr) { // Any point that is not equal to the max_vertex of the // subcurve should be inserted into oi. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h index ccaa389826a..15a3cffe63d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h @@ -724,7 +724,7 @@ public: CGAL_assertion(bool(res)); // Check if we have a single intersection point. - const Point_2* ip = std::get(&*res); + const Point_2* ip = std::get_if(&*res); if (ip != nullptr) { CGAL_assertion(cv1.is_vertical() ? m_traits.is_in_y_range_2_object()(cv1, *ip) : diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h index 06f095fb54c..4778a4fe913 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h @@ -540,12 +540,12 @@ public: size_t i = 0; for (auto it = container.begin(); it != container.end(); ++it) { - if (const auto* xcv = std::get(&*it)) { + if (const auto* xcv = std::get_if(&*it)) { std::cout << " result[" << i++ << "]: xcv: " << *xcv << std::endl; continue; } - if (const auto* p = std::get(&*it)) { + if (const auto* p = std::get_if(&*it)) { std::cout << " result[" << i++ << "]: p: " << *p << std::endl; continue; } @@ -632,13 +632,13 @@ public: unsigned int i = 0; for (const auto& item : container) { - const X_monotone_curve_2* xcv = std::get(&item); + const X_monotone_curve_2* xcv = std::get_if(&item); if (xcv != nullptr) { std::cout << " result[" << i++ << "]: xcv: " << *xcv << std::endl; continue; } - const Intersection_point* ip = std::get(&item); + const Intersection_point* ip = std::get_if(&item); if (ip != nullptr) { std::cout << " result[" << i++ << "]: p: " << ip->first << ", multiplicity: " << ip->second << std::endl; diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h index 0338b67e73e..ee81a3e8a87 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h @@ -100,7 +100,7 @@ void insert(Arrangement_on_surface_2& arr, // Insert each x-monotone curve into the arrangement. for (const auto& x_obj : x_objects) { // Act according to the type of the current object. - const auto* x_curve = std::get(&x_obj); + const auto* x_curve = std::get_if(&x_obj); if (x_curve != nullptr) { // Inserting an x-monotone curve: // Initialize the zone-computation object with the given curve. @@ -118,7 +118,7 @@ void insert(Arrangement_on_surface_2& arr, arr_access.notify_after_global_change(); continue; } - const auto* iso_p = std::get(&x_obj); + const auto* iso_p = std::get_if(&x_obj); CGAL_assertion(iso_p != nullptr); // Inserting a point into the arrangement: @@ -683,7 +683,7 @@ insert_non_intersecting_curve // The endpoint must not lie on an existing edge, but may coincide with // and existing vertex vh1. - CGAL_precondition_msg(std::get(&obj1) == nullptr, + CGAL_precondition_msg(std::get_if(&obj1) == nullptr, "The curve must not intersect an existing edge."); } @@ -691,7 +691,7 @@ insert_non_intersecting_curve // We have a left end with boundary conditions. Use the accessor to locate // the feature that contains it. obj1 = arr_access.locate_curve_end(c, ARR_MIN_END, bx1, by1); - CGAL_precondition_msg(std::get(&obj1) == nullptr, + CGAL_precondition_msg(std::get_if(&obj1) == nullptr, "The curve must not overlap an existing edge."); } vh1 = Pl_result::template assign(&obj1); @@ -710,7 +710,7 @@ insert_non_intersecting_curve // The endpoint must not lie on an existing edge, but may coincide with // and existing vertex vh2. - CGAL_precondition_msg(std::get(&obj2) == nullptr, + CGAL_precondition_msg(std::get_if(&obj2) == nullptr, "The curve must not intersect an existing edge."); } else { @@ -721,7 +721,7 @@ insert_non_intersecting_curve // << ", by2: " << by2 // << std::endl; obj2 = arr_access.locate_curve_end(c, ARR_MAX_END, bx2, by2); - CGAL_precondition_msg(std::get(&obj2) == nullptr, + CGAL_precondition_msg(std::get_if(&obj2) == nullptr, "The curve must not overlap an existing edge."); } vh2 = Pl_result::template assign(&obj2); @@ -766,8 +766,8 @@ insert_non_intersecting_curve // we must insert the curve in the interior of a face. // In this case insert_in_face_interior() already returns a halfedge // directed from left to right. - const Face_const_handle* fh1 = std::get(&obj1); - const Face_const_handle* fh2 = std::get(&obj2); + const Face_const_handle* fh1 = std::get_if(&obj1); + const Face_const_handle* fh2 = std::get_if(&obj2); // std::cout << arr << std::endl; // std::cout << "(*fh1)->number_of_outer_ccbs(): " @@ -1144,14 +1144,14 @@ insert_point(Arrangement_on_surface_2& arr, arr_access.notify_before_global_change(); - const Face_const_handle* fh = std::get(&obj); + const Face_const_handle* fh = std::get_if(&obj); if (fh != nullptr) { // p lies inside a face: Insert it as an isolated vertex it the interior of // this face. vh_for_p = arr.insert_in_face_interior(p, arr.non_const_handle(*fh)); } else { - const Halfedge_const_handle* hh = std::get(&obj); + const Halfedge_const_handle* hh = std::get_if(&obj); if (hh != nullptr) { // p lies in the interior of an edge: Split this edge to create a new // vertex associated with p. @@ -1167,7 +1167,7 @@ insert_point(Arrangement_on_surface_2& arr, } else { // p lies on an existing vertex, so we just update this vertex. - const Vertex_const_handle* vh = std::get(&obj); + const Vertex_const_handle* vh = std::get_if(&obj); CGAL_assertion(vh != nullptr); vh_for_p = arr.modify_vertex (arr.non_const_handle (*vh), p); } @@ -1381,14 +1381,14 @@ is_valid(const Arrangement_on_surface_2& arr) auto obj = def_pl.ray_shoot_down(curr_v->point()); // if (CGAL::assign(he_below, obj)) { - if (auto* he_below_p = std::get(&obj)) { + if (auto* he_below_p = std::get_if(&obj)) { // Hit an edge; take the incident face of the halfedge directed to the // right. auto he_below = *he_below_p; in_face = (he_below->direction() == ARR_RIGHT_TO_LEFT) ? he_below->twin()->face() : he_below->face(); } - else if (auto* v_below_p = std::get(&obj)) { + else if (auto* v_below_p = std::get_if(&obj)) { auto v_below = *v_below_p; // Hit a vertex. if (v_below->is_isolated()) in_face = v_below->face(); @@ -1446,7 +1446,7 @@ is_valid(const Arrangement_on_surface_2& arr) } } else { - auto* in_face_p = std::get(&obj); + auto* in_face_p = std::get_if(&obj); CGAL_assertion(in_face_p); in_face = *in_face_p; // Hit nothing (an unbounded face is returned). @@ -1596,20 +1596,20 @@ do_intersect(Arrangement_on_surface_2& arr, // Insert each x-monotone curve into the arrangement. for (const auto& x_obj : x_objects) { // Act according to the type of the current object. - const X_monotone_curve_2* x_curve = std::get(&x_obj); + const X_monotone_curve_2* x_curve = std::get_if(&x_obj); if (x_curve != nullptr) { // Check if the x-monotone subcurve intersects the arrangement. if (do_intersect(arr, *x_curve, pl) == true) return true; continue; } - const Point_2* iso_p = std::get(&x_obj); + const Point_2* iso_p = std::get_if(&x_obj); CGAL_assertion(iso_p != nullptr); // Check whether the isolated point lies inside a face (otherwise, // it coincides with a vertex or an edge). auto obj = pl.locate(*iso_p); - if (std::get(&x_obj) != nullptr) return true; + if (std::get_if(&x_obj) != nullptr) return true; } // If we reached here, the curve does not intersect the arrangement. diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h index cbadba8f07a..7ac1332586d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h @@ -2253,7 +2253,7 @@ _place_and_set_curve_end(DFace* f, return v; } - DHalfedge** fict_he_p = std::get(&*obj); + DHalfedge** fict_he_p = std::get_if(&*obj); if (fict_he_p != nullptr) { DHalfedge* fict_he = *fict_he_p; CGAL_assertion(fict_he != nullptr); @@ -2273,7 +2273,7 @@ _place_and_set_curve_end(DFace* f, Halfedge_handle((*p_pred)->next())); return v; } - DVertex** v_p = std::get(&*obj); + DVertex** v_p = std::get_if(&*obj); CGAL_assertion(v_p != nullptr); DVertex* v = *v_p; CGAL_assertion(v != nullptr); diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h index 484f2a46efe..5d1e19f73c7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h @@ -103,7 +103,7 @@ void Arrangement_zone_2::compute_zone() const Vertex_const_handle* vh; const Halfedge_const_handle* hh; - if ((vh = std::get(&m_obj)) != nullptr) { + if ((vh = std::get_if(&m_obj)) != nullptr) { CGAL_assertion(m_has_left_pt); // The left endpoint coincides with an existing vertex: @@ -125,7 +125,7 @@ void Arrangement_zone_2::compute_zone() #endif } - else if ((hh = std::get(&m_obj)) != nullptr) { + else if ((hh = std::get_if(&m_obj)) != nullptr) { if (m_has_left_pt) { // Obtain the right halfedge from the halfedge-pair containing m_left_pt // in their interior. @@ -166,7 +166,7 @@ void Arrangement_zone_2::compute_zone() } else { // The left endpoint lies inside a face. - const Face_const_handle* fh = std::get(&m_obj); + const Face_const_handle* fh = std::get_if(&m_obj); CGAL_assertion_msg(fh != nullptr, "Invalid object returned by the point-location query."); @@ -546,7 +546,7 @@ _compute_next_intersection(Halfedge_handle he, // (if the left point exists). while (! inter_list.empty()) { // Compare that current object with m_left_pt (if exists). - ip = std::get(&(inter_list.front())); + ip = std::get_if(&(inter_list.front())); if (ip != nullptr) { // We have an intersection point if (m_left_on_boundary) { @@ -570,7 +570,7 @@ _compute_next_intersection(Halfedge_handle he, } else { // We have an overlapping subcurve. - icv = std::get(&(inter_list.front())); + icv = std::get_if(&(inter_list.front())); CGAL_assertion(icv != nullptr); if (is_closed(*icv, ARR_MIN_END)) { @@ -608,7 +608,7 @@ _compute_next_intersection(Halfedge_handle he, // Discard all intersection lying to the left of m_left_pt (if exists). while (! inter_list.empty()) { // Compare that current object with m_left_pt (if exists). - ip = std::get(&(inter_list.front())); + ip = std::get_if(&(inter_list.front())); if (ip != nullptr) { // We have an intersection point - @@ -638,7 +638,7 @@ _compute_next_intersection(Halfedge_handle he, } else { // We have an overlapping subcurve. - icv = std::get(&(inter_list.front())); + icv = std::get_if(&(inter_list.front())); CGAL_assertion(icv != nullptr); if (is_closed(*icv, ARR_MIN_END)) { @@ -832,7 +832,7 @@ _leftmost_intersection(Ccb_halfedge_circulator he_curr, bool on_boundary, if (iobj) { // We have found an intersection (either a simple point or an // overlapping x-monotone curve). - const Intersection_point* int_p = std::get(&*iobj); + const Intersection_point* int_p = std::get_if(&*iobj); if (int_p != nullptr) { Point_2 ip = int_p->first; @@ -854,7 +854,7 @@ _leftmost_intersection(Ccb_halfedge_circulator he_curr, bool on_boundary, else { // We have located an overlapping curve. Assign ip as its left // endpoint. - const X_monotone_curve_2* icv = std::get(&*iobj); + const X_monotone_curve_2* icv = std::get_if(&*iobj); CGAL_assertion(icv != nullptr); Point_2 ip = min_vertex(*icv); diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h index b7c2907bf58..0abc509bcd5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h @@ -120,13 +120,13 @@ public: // X_monotone_curve_2 for (const auto& xection : xections) { const Intersection_point* - p_p = std::get(&xection); + p_p = std::get_if(&xection); if (p_p != nullptr) { - *oi++ = Intersection_result(xection); + *oi++ = Intersection_result(*p_p); continue; } const Base_x_monotone_curve_2* base_cv_p = - std::get(&xection); + std::get_if(&xection); CGAL_assertion(base_cv_p); // Add halfedge handles to the resulting curve. diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h index e0b85f39390..30c8b38b4a0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h @@ -937,8 +937,8 @@ _map_boundary_vertices(Event* event, Vertex_handle v, boost::mpl::bool_) const Cell_handle_red* red_handle_p = pt.red_cell_handle(); if (red_handle_p) info.first = *red_handle_p; - if (!std::get(&(info.first)) && - !std::get(&(info.second))) + if (!std::get_if(&(info.first)) && + !std::get_if(&(info.second))) { // If both, the red and blue, variants do not represent face handles, // they must represt either vertex or edge handles. In this case it is diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h index e981e532658..3067ba6715d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h @@ -323,14 +323,14 @@ public: /*! Obtain the red vertex handle or nullptr if it doesn't exist. */ const Vertex_handle_red* red_vertex_handle() const { - return m_red_cell ? std::get(&(*m_red_cell)) : nullptr; + return m_red_cell ? std::get_if(&(*m_red_cell)) : nullptr; } /*! Obtain the blue vertex handle or nullptr if it doesn't exist. */ const Vertex_handle_blue* blue_vertex_handle() const { return - m_blue_cell ? std::get(&(*m_blue_cell)) : nullptr; + m_blue_cell ? std::get_if(&(*m_blue_cell)) : nullptr; } }; @@ -440,7 +440,7 @@ public: // the extended X_monotone_curve_2. for (const auto& xection : xections) { const Intersection_base_point* base_ipt = - std::get(&xection); + std::get_if(&xection); if (base_ipt != nullptr) { // We have a red-blue intersection point, so we attach the // intersecting red and blue halfedges to it. @@ -470,7 +470,7 @@ public: } const Base_x_monotone_curve_2* overlap_xcv = - std::get(&xection); + std::get_if(&xection); CGAL_assertion(overlap_xcv != nullptr); // We have a red-blue overlap, so we mark the curve accordingly. diff --git a/Visibility_2/examples/Visibility_2/simple_polygon_visibility_2.cpp b/Visibility_2/examples/Visibility_2/simple_polygon_visibility_2.cpp index 9df70f7f868..dc23e31bfaf 100644 --- a/Visibility_2/examples/Visibility_2/simple_polygon_visibility_2.cpp +++ b/Visibility_2/examples/Visibility_2/simple_polygon_visibility_2.cpp @@ -38,7 +38,7 @@ int main() { CGAL::Arr_naive_point_location pl(env); CGAL::Arr_point_location_result::Type obj = pl.locate(q); // The query point locates in the interior of a face - face = std::get (&obj); + face = std::get_if (&obj); // compute non regularized visibility area // Define visibility object type that computes non-regularized visibility area From 522183bd002fce8c6b013761a094ee959a342fbe Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 15 Jun 2023 16:08:55 +0200 Subject: [PATCH 065/156] add version_enforcer.h to ease the use of forked headers in external code --- Installation/include/CGAL/config.h | 1 + Installation/include/CGAL/version_enforcer.h | 41 ++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 Installation/include/CGAL/version_enforcer.h diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index af4a81c8607..f3753100139 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -117,6 +117,7 @@ #include #include +#include //----------------------------------------------------------------------// // platform specific workaround flags (CGAL_CFG_...) diff --git a/Installation/include/CGAL/version_enforcer.h b/Installation/include/CGAL/version_enforcer.h new file mode 100644 index 00000000000..a07979fb1f6 --- /dev/null +++ b/Installation/include/CGAL/version_enforcer.h @@ -0,0 +1,41 @@ +// Copyright (c) 2023 GeometryFactory. +// 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) : - + +#ifndef CGAL_VERSION_ENFORCER_H +#define CGAL_VERSION_ENFORCER_H + +#include + +// All files including this header are meant to work with a given version of CGAL +// When using forked headers, set the 4 following macros to the version of CGAL +// you want to use. +#define CGAL_AUTHORIZED_VERSION CGAL_VERSION_STR +#define CGAL_AUTHORIZED_VERSION_MAJOR CGAL_VERSION_MAJOR +#define CGAL_AUTHORIZED_VERSION_MINOR CGAL_VERSION_MINOR +#define CGAL_AUTHORIZED_VERSION_PATCH CGAL_VERSION_PATCH + +// Check that the version of CGAL used is the one expected +#if (CGAL_VERSION_MAJOR != CGAL_AUTHORIZED_VERSION_MAJOR) +#pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." +#error This header is meant to be with used with CGAL 5.5 only. +#endif + +#if (CGAL_VERSION_MINOR != CGAL_AUTHORIZED_VERSION_MINOR) +#pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." +#error This header is meant to be with used with CGAL 5.5 only. +#endif + +#if (CGAL_VERSION_PATCH != CGAL_AUTHORIZED_VERSION_PATCH) +#pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." +#error This header is meant to be with used with CGAL 5.5 only. +#endif + +#endif // CGAL_VERSION_ENFORCER_H From 5a7f0252ac2b13481f6d6a0db9dc2150e3a463c5 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 15 Jun 2023 16:27:08 +0200 Subject: [PATCH 066/156] fix error message --- Installation/include/CGAL/version_enforcer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Installation/include/CGAL/version_enforcer.h b/Installation/include/CGAL/version_enforcer.h index a07979fb1f6..c5c1181cee4 100644 --- a/Installation/include/CGAL/version_enforcer.h +++ b/Installation/include/CGAL/version_enforcer.h @@ -17,7 +17,7 @@ // All files including this header are meant to work with a given version of CGAL // When using forked headers, set the 4 following macros to the version of CGAL // you want to use. -#define CGAL_AUTHORIZED_VERSION CGAL_VERSION_STR +#define CGAL_AUTHORIZED_VERSION_STR CGAL_VERSION_STR #define CGAL_AUTHORIZED_VERSION_MAJOR CGAL_VERSION_MAJOR #define CGAL_AUTHORIZED_VERSION_MINOR CGAL_VERSION_MINOR #define CGAL_AUTHORIZED_VERSION_PATCH CGAL_VERSION_PATCH @@ -25,17 +25,17 @@ // Check that the version of CGAL used is the one expected #if (CGAL_VERSION_MAJOR != CGAL_AUTHORIZED_VERSION_MAJOR) #pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." -#error This header is meant to be with used with CGAL 5.5 only. +#error This header is meant to be with used with CGAL "CGAL_AUTHORIZED_VERSION_STR" only." #endif #if (CGAL_VERSION_MINOR != CGAL_AUTHORIZED_VERSION_MINOR) #pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." -#error This header is meant to be with used with CGAL 5.5 only. +#error This header is meant to be with used with CGAL "CGAL_AUTHORIZED_VERSION_STR" only. #endif #if (CGAL_VERSION_PATCH != CGAL_AUTHORIZED_VERSION_PATCH) #pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." -#error This header is meant to be with used with CGAL 5.5 only. +#error This header is meant to be with used with CGAL "CGAL_AUTHORIZED_VERSION_STR" only." #endif #endif // CGAL_VERSION_ENFORCER_H From b994bc35745b424a7480057f96f314c626a3bc1f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 20 Jun 2023 11:47:31 +0200 Subject: [PATCH 067/156] True and on-merge in doc --- .../Combinatorial_map/Concepts/GenericMap.h | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h index 790d378bd07..adccc875cd0 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h @@ -267,12 +267,12 @@ using One_dart_per_cell_const_range = unspecified_type; /// @{ /*! -Returns true iff the generic map is empty, i.e.\ it contains no dart. +Returns `true` iff the generic map is empty, i.e.\ it contains no dart. */ bool is_empty() const; /*! -Returns true iff the generic map is without i-boundary. +Returns `true` iff the generic map is without i-boundary. The map is without i-boundary if there is no `i`-free dart. \pre 1\f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink. @@ -280,7 +280,7 @@ The map is without i-boundary if there is no `i`-free dart. bool is_without_boundary(unsigned int i) const; /*! -Returns true iff the generic map is without boundary in all dimensions. +Returns `true` iff the generic map is without boundary in all dimensions. */ bool is_without_boundary() const; @@ -308,18 +308,18 @@ Returns an upper bound of the id of i-attributes descriptors if indices a template size_type upper_bound_on_attribute_ids() const; -/*! Returns true if `d` is a descriptor of a used dart (i.e.\ valid). +/*! Returns `true` if `d` is a descriptor of a used dart (i.e.\ valid). */ bool is_dart_used(Dart_const_descriptor d) const; /*! -Returns true iff dart `d` is i-free. +Returns `true` iff dart `d` is i-free. \pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink. */ bool is_free(Dart_const_descriptor d, unsigned int i) const; /*! -Returns true iff dart `d` is i-free. +Returns `true` iff dart `d` is i-free. \pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink. */ template @@ -477,7 +477,7 @@ A shortcut for \link GenericMap::dart_of_attribute(typename Attribute_const_desc template Dart_const_descriptor dart(Dart_const_descriptor adart) const; -/*! Returns true if ah points to a used i-attribute (i.e.\ valid). +/*! Returns `true` if ah points to a used i-attribute (i.e.\ valid). \pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, and i-attributes are non `void`. */ template @@ -703,13 +703,13 @@ void correct_invalid_attributes(); /// \cond SKIP_IN_MANUAL boost::function \endcond -/// \name Dynamic Onmerge/Onsplit functors +/// \name Dynamic On-Merge/On-Split functors /// @{ /*! - Return the current dynamic onsplit function associated with i-attributes. + Return the current dynamic on-split function associated with i-attributes. This is a boost::function returning void and having two references to \link GenericMap::Attribute_type `Attribute_type::type`\endlink as parameters. - The onsplit function is returned by reference so that we can modify it. + The on-split function is returned by reference so that we can modify it. */ template boost::function::type&, @@ -717,7 +717,7 @@ void correct_invalid_attributes(); onsplit_function(); /*! - Return the current dynamic onsplit function associated with i-attributes, when *this is const. + Return the current dynamic on-split function associated with i-attributes, when *this is const. This is a boost::function returning void and having two references to \link GenericMap::Attribute_type `Attribute_type::type`\endlink as parameters. */ template @@ -726,9 +726,9 @@ void correct_invalid_attributes(); onsplit_function() const; /*! - Return the current dynamic onmerge function associated with i-attributes. + Return the current dynamic on-merge function associated with i-attributes. This is a boost::function returning void and having two references to \link GenericMap::Attribute_type `Attribute_type::type`\endlink as parameters. - The onmerge function is returned by reference so that we can modify it. + The on-merge function is returned by reference so that we can modify it. */ template boost::function::type&, @@ -736,7 +736,7 @@ void correct_invalid_attributes(); onmerge_function(); /*! - Return the current dynamic onmerge function associated with i-attributes, when *this is const. + Return the current dynamic on-merge function associated with i-attributes, when *this is const. This is a boost::function returning void and having two references to \link GenericMap::Attribute_type `Attribute_type::type`\endlink as parameters. */ template @@ -756,13 +756,13 @@ index. If there is no more available free mark, throw the exception Exception_no size_type get_new_mark() const; /*! -Returns true iff `m` is a reserved mark of the generic map. +Returns `true` iff `m` is a reserved mark of the generic map. \pre 0\f$ \leq \f$ m \f$ < \f$ \link GenericMap::NB_MARKS `NB_MARKS`\endlink. */ bool is_reserved(size_type m) const; /*! -Returns true iff dart `d` is marked for `m`. +Returns `true` iff dart `d` is marked for `m`. \pre \link GenericMap::is_reserved `is_reserved(m)`\endlink and `d`\f$ \in \f$ `darts()`. */ bool is_marked(Dart_const_descriptor d, size_type m) const; @@ -868,7 +868,7 @@ Inserts a 0-cell in the 1-cell containing `d`. Returns `next(d)`, a descriptor o See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_vertex} and for generalized map in \cgalFigureRef{fig_gmap_insert_vertex}. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 1-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<1>::type::On_split`\endlink(a,a') is called, with a the original 1-attribute associated with d and a' the new 1-attribute created during the operation. If set, the dynamic onsplit function of 1-attributes is also called on a and a'. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 1-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<1>::type::On_split`\endlink(a,a') is called, with a the original 1-attribute associated with d and a' the new 1-attribute created during the operation. If set, the dynamic on-split function of 1-attributes is also called on a and a'. \cgalAdvancedBegin If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. @@ -889,7 +889,7 @@ Inserts a 0-cell in the 2-cell containing `d`. The 2-cell is split in triangles, See examples for combinatorial map in \cgalFigureRef{fig_cmap_triangulation} and for generalized map in \cgalFigureRef{fig_gmap_triangulation}. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(a,a') is called, with a the original 2-attribute associated with `d` and a' each new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on a and a'. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(a,a') is called, with a the original 2-attribute associated with `d` and a' each new 2-attribute created during the operation. If set, the dynamic on-split function of 2-attributes is also called on a and a'. \cgalAdvancedBegin If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. @@ -910,7 +910,7 @@ Inserts a 1-cell in the 2-cell containing `d1` and `d2`. Returns `previous(d1)`, See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_edge} and for generalized map in \cgalFigureRef{fig_gmap_insert_edge}. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(a,a') is called, with a the original 2-attribute associated with `d` and a' the new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on a and a'. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(a,a') is called, with a the original 2-attribute associated with `d` and a' the new 2-attribute created during the operation. If set, the dynamic on-split function of 2-attributes is also called on a and a'. \cgalAdvancedBegin If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. @@ -930,7 +930,7 @@ Dart_descriptor insert_cell_1_in_cell_2(Dart_descriptor d1, Dart_descriptor d2); Inserts a 1-cell between the 2-cell containing `d1` and the one containing `d2`. Returns `previous(d1)`, a descriptor on one dart belonging to the new 1-cell. \pre `is_insertable_cell_1_between_two_cells_2(d1,d2)`. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, call \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink(a,a') is called for all enabled i-attributes, for i>=2, with a the original 2-attribute associated with `d` and a' the new 2-attribute created during the operation. If set, the dynamic onmerge function of i-attributes is also called on a and a'. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, call \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink(a,a') is called for all enabled i-attributes, for i>=2, with a the original 2-attribute associated with `d` and a' the new 2-attribute created during the operation. If set, the dynamic on-merge function of i-attributes is also called on a and a'. \cgalAdvancedBegin If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. @@ -959,7 +959,7 @@ Inserts a 2-cell along the path of 1-cells containing darts given by the range ` See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_facet} and for generalized map in \cgalFigureRef{fig_gmap_insert_facet}. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 3-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<3>::type::On_split`\endlink(a,a') is called, with a the original 3-attribute associated with `d` and a' the new 3-attribute created during the operation. If set, the dynamic onsplit function of 3-attributes is also called on a and a'. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 3-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<3>::type::On_split`\endlink(a,a') is called, with a the original 3-attribute associated with `d` and a' the new 3-attribute created during the operation. If set, the dynamic on-split function of 3-attributes is also called on a and a'. \cgalAdvancedBegin If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. @@ -997,7 +997,7 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa Dart_descriptor insert_dangling_cell_1_in_cell_2(Dart_descriptor d); /*! -Returns true iff it is possible to insert a 1-cell in the generic map between `d1` and `d2`. +Returns `true` iff it is possible to insert a 1-cell in the generic map between `d1` and `d2`. This is possible if `d1`\f$ \neq \f$ `d2` and `d1` can be reached from `d2` by using some `previous` and `next` calls. \pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 2, `d1`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink, and `d2`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink. @@ -1009,7 +1009,7 @@ This is possible if `d1`\f$ \neq \f$ `d2` and `d1` can be reached from `d2` by u bool is_insertable_cell_1_in_cell_2(Dart_const_descriptor d1, Dart_const_descriptor d2); /*! -Returns true iff it is possible to insert a 1-cell in the generic map between `d1` and `d2`. +Returns `true` iff it is possible to insert a 1-cell in the generic map between `d1` and `d2`. This is possible if `d1`\f$ \neq \f$ `d2` and `d1` can not be reached from `d2` by using some `previous` and `next` calls. \pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 2, `d1`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink, and `d2`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink. @@ -1020,7 +1020,7 @@ This is possible if `d1`\f$ \neq \f$ `d2` and `d1` can not be reached from `d2` bool is_insertable_cell_1_between_two_cells_2(Dart_const_descriptor d1, Dart_const_descriptor d2); /*! -Returns true iff it is possible to insert a 2-cell in the generic map along the path of darts given by the range `[afirst,alast)`. The 2-cell can be inserted iff the ordered list of darts form a closed path of edges inside a same volume. +Returns `true` iff it is possible to insert a 2-cell in the generic map along the path of darts given by the range `[afirst,alast)`. The 2-cell can be inserted iff the ordered list of darts form a closed path of edges inside a same volume. \pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 3. \sa `insert_cell_2_in_cell_3` @@ -1031,7 +1031,7 @@ template bool is_insertable_cell_2_in_cell_3(InputIterator afirst, InputIterator alast); /*! -Returns true iff the i-cell containing `d` can be removed. +Returns `true` iff the i-cell containing `d` can be removed. An i-cell can be removed if `i`==\link GenericMap::dimension `dimension`\endlink or if `i`==\link GenericMap::dimension `dimension`\endlink-1 or if `i`\f$ < \f$ \link GenericMap::dimension `dimension`\endlink-1 and the i-cell containing `d` is incident to at most two (i+1)-cells. \pre 0\f$ \leq \f$ `i`\f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink and `d`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink. @@ -1047,9 +1047,9 @@ Removes the i-cell containing `d`. Returns the number of darts removed fr See examples in \cgalFigureRef{fig_cmap_insert_vertex}, \cgalFigureRef{fig_cmap_insert_edge} and \cgalFigureRef{fig_cmap_insert_facet}. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if `i`\f$ < \f$ \link GenericMap::dimension `dimension`\endlink, and i+1-attributes are non `void`, and if there are two distinct (i+1)-cells around dart `d`, \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink(a1,a2) is called, with a1 the (i+1)-attribute associated to `d`, and a2 the (i+1)-attribute associated to \f$ \beta_{i+1}\f$(d). If set, the dynamic onmerge function of i+1-attributes is also called on a1 and a2. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if `i`\f$ < \f$ \link GenericMap::dimension `dimension`\endlink, and i+1-attributes are non `void`, and if there are two distinct (i+1)-cells around dart `d`, \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink(a1,a2) is called, with a1 the (i+1)-attribute associated to `d`, and a2 the (i+1)-attribute associated to \f$ \beta_{i+1}\f$(d). If set, the dynamic on-merge function of i+1-attributes is also called on a1 and a2. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if a j-cell is disconnected in two j-cells during the operation, and if j-attributes are non void, \link CellAttribute::On_split `Attribute_type::type::On_split`\endlink(a,a') is called with a the original j-attribute and a' the new j-attribute created due to the disconnection. If set, the dynamic onsplit function of j-attributes is also called on a and a'. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if a j-cell is disconnected in two j-cells during the operation, and if j-attributes are non void, \link CellAttribute::On_split `Attribute_type::type::On_split`\endlink(a,a') is called with a the original j-attribute and a' the new j-attribute created due to the disconnection. If set, the dynamic on-split function of j-attributes is also called on a and a'. \cgalAdvancedBegin If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. From 32655a75b85c77684ce5c09fcd1904b851e4dc69 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 20 Jun 2023 12:03:00 +0200 Subject: [PATCH 068/156] Add () after function names in sa --- .../Combinatorial_map/Concepts/GenericMap.h | 136 +++++++++--------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h index adccc875cd0..c080e2166d4 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h @@ -820,9 +820,9 @@ void free_mark(size_type m) const; Creates a combinatorial hexahedron (six combinatorial quadrangles 2-sewn together), and adds it in the generic map. Returns a descriptor on one dart of this combinatorial hexahedron. \pre `dimension` \f$\geq\f$ 2. -\sa `make_edge` -\sa `make_combinatorial_polygon` -\sa `make_combinatorial_tetrahedron` +\sa `make_edge()` +\sa `make_combinatorial_polygon()` +\sa `make_combinatorial_tetrahedron()` */ Dart_descriptor make_combinatorial_hexahedron(); @@ -831,9 +831,9 @@ Dart_descriptor make_combinatorial_hexahedron(); Creates a combinatorial polygon of length `lg` (a cycle of `lg` edges), and adds it in the generic map. Returns a descriptor on one dart of this combinatorial polygon. \pre `dimension`\f$ \geq\f$ 1 and `lg`\f$ >\f$ 0. -\sa `make_edge` -\sa `make_combinatorial_tetrahedron` -\sa `make_combinatorial_hexahedron` +\sa `make_edge()` +\sa `make_combinatorial_tetrahedron()` +\sa `make_combinatorial_hexahedron()` */ Dart_descriptor make_combinatorial_polygon(unsigned int lg); @@ -841,9 +841,9 @@ Dart_descriptor make_combinatorial_polygon(unsigned int lg); Creates a combinatorial tetrahedron (four combinatorial triangles 2-sewn together), and adds it in the generic map. Returns a descriptor on one dart of this combinatorial tetrahedron. \pre `dimension`\f$ \geq\f$ 2. -\sa `make_edge` -\sa `make_combinatorial_polygon` -\sa `make_combinatorial_hexahedron` +\sa `make_edge()` +\sa `make_combinatorial_polygon()` +\sa `make_combinatorial_hexahedron()` */ Dart_descriptor make_combinatorial_tetrahedron(); @@ -851,9 +851,9 @@ Dart_descriptor make_combinatorial_tetrahedron(); Creates an isolated edge (two darts sewn to represent one edge and two vertices) and adds it in the generic map. Returns a descriptor on one dart of this edge. \pre `dimension`\f$ \geq\f$ 2. -\sa `make_combinatorial_polygon` -\sa `make_combinatorial_tetrahedron` -\sa `make_combinatorial_hexahedron` +\sa `make_combinatorial_polygon()` +\sa `make_combinatorial_tetrahedron()` +\sa `make_combinatorial_hexahedron()` */ Dart_descriptor make_edge(); @@ -874,12 +874,12 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. \cgalAdvancedEnd -\sa `insert_cell_0_in_cell_2` -\sa `insert_cell_1_in_cell_2` -\sa `insert_cell_1_between_two_cells_2` -\sa `insert_dangling_cell_1_in_cell_2` -\sa `insert_cell_2_in_cell_3` -\sa `remove_cell` +\sa `insert_cell_0_in_cell_2()` +\sa `insert_cell_1_in_cell_2()` +\sa `insert_cell_1_between_two_cells_2()` +\sa `insert_dangling_cell_1_in_cell_2()` +\sa `insert_cell_2_in_cell_3()` +\sa `remove_cell()` */ Dart_descriptor insert_cell_0_in_cell_1(Dart_descriptor d); @@ -895,12 +895,12 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. \cgalAdvancedEnd -\sa `insert_cell_0_in_cell_2` -\sa `insert_cell_1_in_cell_2` -\sa `insert_cell_1_between_two_cells_2` -\sa `insert_dangling_cell_1_in_cell_2` -\sa `insert_cell_2_in_cell_3` -\sa `remove_cell` +\sa `insert_cell_0_in_cell_2()` +\sa `insert_cell_1_in_cell_2()` +\sa `insert_cell_1_between_two_cells_2()` +\sa `insert_dangling_cell_1_in_cell_2()` +\sa `insert_cell_2_in_cell_3()` +\sa `remove_cell()` */ Dart_descriptor insert_cell_0_in_cell_2(Dart_descriptor d); @@ -916,13 +916,13 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. \cgalAdvancedEnd -\sa `is_insertable_cell_1_in_cell_2` -\sa `insert_cell_0_in_cell_1` -\sa `insert_cell_0_in_cell_2` -\sa `insert_cell_1_between_two_cells_2` -\sa `insert_dangling_cell_1_in_cell_2` -\sa `insert_cell_2_in_cell_3` -\sa `remove_cell` +\sa `is_insertable_cell_1_in_cell_2()` +\sa `insert_cell_0_in_cell_1()` +\sa `insert_cell_0_in_cell_2()` +\sa `insert_cell_1_between_two_cells_2()` +\sa `insert_dangling_cell_1_in_cell_2()` +\sa `insert_cell_2_in_cell_3()` +\sa `remove_cell()` */ Dart_descriptor insert_cell_1_in_cell_2(Dart_descriptor d1, Dart_descriptor d2); @@ -936,20 +936,20 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. \cgalAdvancedEnd -\sa `is_insertable_cell_1_between_two_cells_2` -\sa `insert_cell_0_in_cell_1` -\sa `insert_cell_0_in_cell_2` -\sa `insert_cell_1_in_cell_2` -\sa `insert_dangling_cell_1_in_cell_2` -\sa `insert_cell_2_in_cell_3` -\sa `remove_cell` +\sa `is_insertable_cell_1_between_two_cells_2()` +\sa `insert_cell_0_in_cell_1()` +\sa `insert_cell_0_in_cell_2()` +\sa `insert_cell_1_in_cell_2()` +\sa `insert_dangling_cell_1_in_cell_2()` +\sa `insert_cell_2_in_cell_3()` +\sa `remove_cell()` */ Dart_descriptor insert_cell_1_between_two_cells_2(Dart_descriptor d1, Dart_descriptor d2); -/*! Call `insert_cell_1_in_cell_2` if `is_insertable_cell_1_in_cell_2(d1, d2)`, otherwise call `insert_cell_1_between_two_cells_2`. -\sa `insert_cell_1_in_cell_2` -\sa `insert_cell_1_between_two_cells_2` -\sa `is_insertable_cell_1_in_cell_2` +/*! Call `insert_cell_1_in_cell_2()` if `is_insertable_cell_1_in_cell_2(d1, d2)`, otherwise call `insert_cell_1_between_two_cells_2()`. +\sa `insert_cell_1_in_cell_2()` +\sa `insert_cell_1_between_two_cells_2()` +\sa `is_insertable_cell_1_in_cell_2()` */ Dart_descriptor insert_cell_1(Dart_descriptor d1, Dart_descriptor d2); @@ -965,13 +965,13 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. \cgalAdvancedEnd -\sa `is_insertable_cell_2_in_cell_3` -\sa `insert_cell_0_in_cell_1` -\sa `insert_cell_0_in_cell_2` -\sa `insert_cell_1_in_cell_2` -\sa `insert_cell_1_between_two_cells_2` -\sa `insert_dangling_cell_1_in_cell_2` -\sa `remove_cell` +\sa `is_insertable_cell_2_in_cell_3()` +\sa `insert_cell_0_in_cell_1()` +\sa `insert_cell_0_in_cell_2()` +\sa `insert_cell_1_in_cell_2()` +\sa `insert_cell_1_between_two_cells_2()` +\sa `insert_dangling_cell_1_in_cell_2()` +\sa `remove_cell()` */ template Dart_descriptor insert_cell_2_in_cell_3(InputIterator afirst, InputIterator alast); @@ -986,12 +986,12 @@ See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_edge} and f If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. \cgalAdvancedEnd -\sa `insert_cell_0_in_cell_1` -\sa `insert_cell_0_in_cell_2` -\sa `insert_cell_1_in_cell_2` -\sa `insert_cell_1_between_two_cells_2` -\sa `insert_cell_2_in_cell_3` -\sa `remove_cell` +\sa `insert_cell_0_in_cell_1()` +\sa `insert_cell_0_in_cell_2()` +\sa `insert_cell_1_in_cell_2()` +\sa `insert_cell_1_between_two_cells_2()` +\sa `insert_cell_2_in_cell_3()` +\sa `remove_cell()` */ Dart_descriptor insert_dangling_cell_1_in_cell_2(Dart_descriptor d); @@ -1002,8 +1002,8 @@ Returns `true` iff it is possible to insert a 1-cell in the generic map between This is possible if `d1`\f$ \neq \f$ `d2` and `d1` can be reached from `d2` by using some `previous` and `next` calls. \pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 2, `d1`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink, and `d2`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink. -\sa `insert_cell_1_in_cell_2` -\sa `is_insertable_cell_2_in_cell_3` +\sa `insert_cell_1_in_cell_2()` +\sa `is_insertable_cell_2_in_cell_3()` */ bool is_insertable_cell_1_in_cell_2(Dart_const_descriptor d1, Dart_const_descriptor d2); @@ -1014,7 +1014,7 @@ Returns `true` iff it is possible to insert a 1-cell in the generic map between This is possible if `d1`\f$ \neq \f$ `d2` and `d1` can not be reached from `d2` by using some `previous` and `next` calls. \pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 2, `d1`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink, and `d2`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink. -\sa `insert_cell_1_between_two_cells_2` +\sa `insert_cell_1_between_two_cells_2()` */ bool is_insertable_cell_1_between_two_cells_2(Dart_const_descriptor d1, Dart_const_descriptor d2); @@ -1023,8 +1023,8 @@ bool is_insertable_cell_1_between_two_cells_2(Dart_const_descriptor d1, Dart_con Returns `true` iff it is possible to insert a 2-cell in the generic map along the path of darts given by the range `[afirst,alast)`. The 2-cell can be inserted iff the ordered list of darts form a closed path of edges inside a same volume. \pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 3. -\sa `insert_cell_2_in_cell_3` -\sa `is_insertable_cell_1_in_cell_2` +\sa `insert_cell_2_in_cell_3()` +\sa `is_insertable_cell_1_in_cell_2()` */ template @@ -1036,7 +1036,7 @@ Returns `true` iff the i-cell containing `d` can be removed. An i-cell can be removed if `i`==\link GenericMap::dimension `dimension`\endlink or if `i`==\link GenericMap::dimension `dimension`\endlink-1 or if `i`\f$ < \f$ \link GenericMap::dimension `dimension`\endlink-1 and the i-cell containing `d` is incident to at most two (i+1)-cells. \pre 0\f$ \leq \f$ `i`\f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink and `d`\f$ \in \f$ \link GenericMap::darts `darts()`\endlink. -\sa `remove_cell` +\sa `remove_cell()` */ template bool is_removable(Dart_const_descriptor d); @@ -1055,13 +1055,13 @@ If \link GenericMap::are_attributes_automatically_managed `are_attributes_automa If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. \cgalAdvancedEnd -\sa `is_removable` -\sa `insert_cell_0_in_cell_1` -\sa `insert_cell_0_in_cell_2` -\sa `insert_cell_1_in_cell_2` -\sa `insert_cell_1_between_two_cells_2` -\sa `insert_dangling_cell_1_in_cell_2` -\sa `insert_cell_2_in_cell_3` +\sa `is_removable()` +\sa `insert_cell_0_in_cell_1()` +\sa `insert_cell_0_in_cell_2()` +\sa `insert_cell_1_in_cell_2()` +\sa `insert_cell_1_between_two_cells_2()` +\sa `insert_dangling_cell_1_in_cell_2()` +\sa `insert_cell_2_in_cell_3()` */ template size_type remove_cell(Dart_descriptor d); From 76f16d7c3850411dc572d64f387b1cf6407ed800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 16 Jun 2023 18:57:15 +0200 Subject: [PATCH 069/156] use std::get_if, get()->value() and remove CGAL::Object usage in Envelope changes in arrangement based packages --- .../Algebraic_kernel_d/Curve_analysis_2.h | 12 +- .../Curve_pair_analysis_2.h | 64 ++--- .../Algebraic_kernel_d/Status_line_CA_1.h | 2 +- .../CGAL/Arr_batched_point_location.h | 12 - .../CGAL/Arr_landmarks_point_location.h | 1 - .../CGAL/Arr_naive_point_location.h | 1 - .../CGAL/Arr_point_location_result.h | 24 -- .../CGAL/Arr_trapezoid_ric_point_location.h | 1 - .../CGAL/Arr_triangulation_point_location.h | 1 - .../CGAL/Arr_walk_along_line_point_location.h | 1 - .../Concepts/ArrangementPointLocation_2.h | 11 - .../Concepts/ArrangementVerticalRayShoot_2.h | 11 - .../PackageDescription.txt | 3 - .../circular_line_arcs.cpp | 3 +- .../incremental_insertion.cpp | 2 +- .../point_location_utils.h | 28 -- .../polycurve_bezier.cpp | 2 +- .../sgm_point_location.cpp | 6 +- .../include/CGAL/Arr_conic_traits_2.h | 50 ++-- .../include/CGAL/Arr_curve_data_traits_2.h | 10 +- .../Arr_geodesic_arc_on_sphere_traits_2.h | 49 ++-- .../Arr_geometry_traits/Bezier_x_monotone_2.h | 10 +- .../Arr_geometry_traits/Circle_segment_2.h | 11 +- .../include/CGAL/Arr_linear_traits_2.h | 8 +- .../CGAL/Arr_point_location/Td_active_edge.h | 6 +- .../Arr_point_location/Td_active_trapezoid.h | 16 +- .../Trapezoidal_decomposition_2.h | 12 +- .../include/CGAL/Arr_point_location_result.h | 55 +--- .../CGAL/Arr_rat_arc/Rational_arc_d_1.h | 8 +- .../include/CGAL/Arr_segment_traits_2.h | 12 +- .../include/CGAL/Arr_simple_point_location.h | 9 - .../Arr_spherical_gaussian_map_3.h | 20 +- .../include/CGAL/Arr_tracing_traits_2.h | 4 +- .../Curved_kernel_via_analysis_2_functors.h | 4 +- .../Point_location_test.h | 5 - .../Arrangement_on_surface_2/cgal_test.cmake | 10 - .../cgal_test_with_cmake | 11 - .../Gps_agg_meta_traits.h | 7 +- .../Gps_simplifier_traits.h | 7 +- .../Envelope_2/Env_divide_and_conquer_2.h | 10 +- .../Env_divide_and_conquer_2_impl.h | 10 +- Envelope_3/include/CGAL/Env_plane_traits_3.h | 88 +++--- Envelope_3/include/CGAL/Env_sphere_traits_3.h | 71 +++-- .../include/CGAL/Env_tracing_traits_3.h | 16 +- .../include/CGAL/Env_triangle_traits_3.h | 268 ++++++++---------- .../Envelope_3/Env_plane_traits_3_functions.h | 140 +++++---- .../Envelope_divide_and_conquer_3.h | 21 +- .../Envelope_3/Envelope_element_visitor_3.h | 69 ++--- Envelope_3/test/Envelope_3/Envelope_test_3.h | 29 +- .../Envelope_3/Envelope_triangles_test_3.h | 40 +-- Installation/CHANGES.md | 8 + .../Minkowski_sum_2/Arr_labeled_traits_2.h | 13 +- 52 files changed, 501 insertions(+), 791 deletions(-) diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h index ef940f96887..c4a8a3a84cd 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h @@ -631,7 +631,7 @@ public: event_coordinates(); CGAL_assertion(this->ptr()->has_vertical_component); } - return this->ptr()->has_vertical_component.get(); + return this->ptr()->has_vertical_component.value(); } public: @@ -1437,7 +1437,7 @@ private: if(! this->ptr()->sturm_habicht_of_primitive) { compute_sturm_habicht_of_primitive(); } - return this->ptr()->sturm_habicht_of_primitive.get(); + return this->ptr()->sturm_habicht_of_primitive.value(); } public: @@ -1558,7 +1558,7 @@ private: if(! this->ptr()->resultant_of_primitive_and_derivative_y) { this->ptr()->resultant_of_primitive_and_derivative_y = stha[0][0]; if(this->ptr()->resultant_of_primitive_and_derivative_y. - get().is_zero()) { + value().is_zero()) { throw internal::Zero_resultant_exception (polynomial_2()); } @@ -1593,7 +1593,7 @@ private: if(! this->ptr()->resultant_of_primitive_and_derivative_x) { compute_resultant_of_primitive_and_derivative_x(); } - return this->ptr()->resultant_of_primitive_and_derivative_x.get(); + return this->ptr()->resultant_of_primitive_and_derivative_x.value(); } private: @@ -2111,7 +2111,7 @@ public: compute_horizontal_asymptotes(); } std::vector& asym_info - = this->ptr()->horizontal_asymptotes_left.get(); + = this->ptr()->horizontal_asymptotes_left.value(); CGAL_precondition(arcno>=0 && arcno(asym_info.size())); return asym_info[arcno]; @@ -2121,7 +2121,7 @@ public: compute_horizontal_asymptotes(); } std::vector& asym_info - = this->ptr()->horizontal_asymptotes_right.get(); + = this->ptr()->horizontal_asymptotes_right.value(); CGAL_precondition(arcno>=0 && arcno(asym_info.size())); return asym_info[arcno]; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index d350a27a2df..e3ef4a0f4bc 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -547,7 +547,7 @@ public: compute_resultant(); } CGAL_assertion(bool(this->ptr()->resultant)); - return this->ptr()->resultant.get(); + return this->ptr()->resultant.value(); } std::vector& resultant_roots() const { @@ -555,7 +555,7 @@ public: compute_resultant_roots_with_multiplicities(); } CGAL_assertion(bool(this->ptr()->resultant_roots)); - return this->ptr()->resultant_roots.get(); + return this->ptr()->resultant_roots.value(); } Algebraic_real_1& resultant_roots(size_type i) const { @@ -569,7 +569,7 @@ public: compute_resultant_roots_with_multiplicities(); } CGAL_assertion(bool(this->ptr()->multiplicities_of_resultant_roots)); - return this->ptr()->multiplicities_of_resultant_roots.get(); + return this->ptr()->multiplicities_of_resultant_roots.value(); } size_type multiplicities_of_resultant_roots(size_type i) const { @@ -586,10 +586,10 @@ public: (kernel(), resultant_roots().begin(), resultant_roots().end(), - std::back_inserter(this->ptr()->stripe_values.get())); + std::back_inserter(this->ptr()->stripe_values.value())); } CGAL_assertion(bool(this->ptr()->stripe_values)); - return this->ptr()->stripe_values.get(); + return this->ptr()->stripe_values.value(); } std::vector& event_x_coordinates() const { @@ -597,7 +597,7 @@ public: compute_event_x_coordinates_with_event_indices(); } CGAL_assertion(bool(this->ptr()->event_x_coordinates)); - return this->ptr()->event_x_coordinates.get(); + return this->ptr()->event_x_coordinates.value(); } std::vector& event_indices() const { @@ -605,7 +605,7 @@ public: compute_event_x_coordinates_with_event_indices(); } CGAL_assertion(bool(this->ptr()->event_indices)); - return this->ptr()->event_indices.get(); + return this->ptr()->event_indices.value(); } public: @@ -633,7 +633,7 @@ private: compute_intermediate_values_and_slices(); } CGAL_assertion(bool(this->ptr()->intermediate_values)); - return this->ptr()->intermediate_values.get(); + return this->ptr()->intermediate_values.value(); } std::vector& intermediate_slices() const { @@ -641,7 +641,7 @@ private: compute_intermediate_values_and_slices(); } CGAL_assertion(bool(this->ptr()->intermediate_slices)); - return this->ptr()->intermediate_slices.get(); + return this->ptr()->intermediate_slices.value(); } @@ -652,7 +652,7 @@ private: compute_subresultants(); } CGAL_assertion(bool(this->ptr()->subresultants)); - return this->ptr()->subresultants.get(); + return this->ptr()->subresultants.value(); } Polynomial_2& subresultants(size_type i) const { @@ -666,7 +666,7 @@ private: compute_subresultants(); } CGAL_assertion(bool(this->ptr()->principal_subresultants)); - return this->ptr()->principal_subresultants.get(); + return this->ptr()->principal_subresultants.value(); } Polynomial_1& principal_subresultants(size_type i) const { @@ -681,7 +681,7 @@ private: compute_subresultants(); } CGAL_assertion(bool(this->ptr()->coprincipal_subresultants)); - return this->ptr()->coprincipal_subresultants.get(); + return this->ptr()->coprincipal_subresultants.value(); } Polynomial_1& coprincipal_subresultants(size_type i) const { @@ -1045,7 +1045,7 @@ public: } - return intermediate_slices()[i].valuen(); + return intermediate_slices()[i].value(); } //! Returns bound representative value at the ith interval @@ -1312,11 +1312,11 @@ void Curve_pair_analysis_2::compute_resultant() compute_subresultants(); this->ptr()->resultant - = this->ptr()->principal_subresultants.get()[0]; + = this->ptr()->principal_subresultants.value()[0]; } - if(this->ptr()->resultant.get().is_zero()) { + if(this->ptr()->resultant.value().is_zero()) { throw CGAL::internal::Zero_resultant_exception (this->ptr()->f, this->ptr()->g); @@ -1345,8 +1345,8 @@ compute_resultant_roots_with_multiplicities() const { solve_1(resultant(), std::back_inserter(res_pairs)); for(int i=0; i < static_cast(res_pairs.size()); i++ ) { - this->ptr()->resultant_roots.get().push_back(res_pairs[i].first); - this->ptr()->multiplicities_of_resultant_roots.get() + this->ptr()->resultant_roots.value().push_back(res_pairs[i].first); + this->ptr()->multiplicities_of_resultant_roots.value() .push_back(res_pairs[i].second); } @@ -1357,13 +1357,13 @@ compute_resultant_roots_with_multiplicities() const { #if CGAL_ACK_DEBUG_FLAG for(size_type i = 0; i - (this->ptr()->resultant_roots.get().size()); + (this->ptr()->resultant_roots.value().size()); i++) { CGAL_ACK_DEBUG_PRINT << "Root at " - << CGAL::to_double(this->ptr()->resultant_roots.get()[i]) + << CGAL::to_double(this->ptr()->resultant_roots.value()[i]) << " with multiplicity " - << this->ptr()->multiplicities_of_resultant_roots.get()[i] + << this->ptr()->multiplicities_of_resultant_roots.value()[i] << std::endl; } #endif @@ -1401,18 +1401,18 @@ compute_event_x_coordinates_with_event_indices() const { one_curve_events.end(), resultant_roots().begin(), resultant_roots().end(), - std::back_inserter(this->ptr()->event_x_coordinates.get()), + std::back_inserter(this->ptr()->event_x_coordinates.value()), std::back_inserter(events_type), compare); std::vector& events - = this->ptr()->event_x_coordinates.get(); + = this->ptr()->event_x_coordinates.value(); typename std::vector::iterator one_curve_it =one_curve_events_type.begin(); size_type inter_count=0, f_count=0,g_count=0; this->ptr()->event_indices = std::vector(); std::vector& event_indices - = this->ptr()->event_indices.get(); + = this->ptr()->event_indices.value(); for(size_type i=0;i(events.size());i++) { /* #if CGAL_ACK_DEBUG_FLAG @@ -1519,8 +1519,8 @@ compute_intermediate_values_and_slices() const { std::size_t size = event_x_coordinates().size()+1; this->ptr()->intermediate_values=std::vector(); this->ptr()->intermediate_slices=std::vector(); - this->ptr()->intermediate_values.get().resize(size); - this->ptr()->intermediate_slices.get().resize(size); + this->ptr()->intermediate_values.value().resize(size); + this->ptr()->intermediate_slices.value().resize(size); #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif @@ -1539,25 +1539,25 @@ compute_subresultants() const { if(CGAL::degree(f,1)ptr()->subresultants.get())); + (g,f,std::back_inserter(this->ptr()->subresultants.value())); #else typename CGAL::Polynomial_traits_d ::Polynomial_subresultants() - (g,f,std::back_inserter(this->ptr()->subresultants.get())); + (g,f,std::back_inserter(this->ptr()->subresultants.value())); #endif } else { #if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS CGAL::internal::bezout_polynomial_subresultants - (f,g,std::back_inserter(this->ptr()->subresultants.get())); + (f,g,std::back_inserter(this->ptr()->subresultants.value())); #else typename CGAL::Polynomial_traits_d ::Polynomial_subresultants() - (f,g,std::back_inserter(this->ptr()->subresultants.get())); + (f,g,std::back_inserter(this->ptr()->subresultants.value())); #endif } std::vector& subresultants - = this->ptr()->subresultants.get(); + = this->ptr()->subresultants.value(); size_type n = static_cast(subresultants.size()); @@ -1584,11 +1584,11 @@ compute_subresultants() const { // This must be corrected, if f and g have same degree: if(CGAL::degree(f,1) == CGAL::degree(g,1)) { if(n>=1) { - this->ptr()->principal_subresultants.get()[n-1] + this->ptr()->principal_subresultants.value()[n-1] = Polynomial_1(CGAL::leading_coefficient(g)); } if(n>=2) { - this->ptr()->coprincipal_subresultants.get()[n-2] + this->ptr()->coprincipal_subresultants.value()[n-2] = Polynomial_1(g[CGAL::degree(g,1)-1]); } } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h index c1260d26a45..a8ecf22eac1 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Status_line_CA_1.h @@ -555,7 +555,7 @@ public: //! Returns the isolator instance Bitstream_descartes& isolator() const { CGAL_assertion(bool(this->ptr()->isolator)); - return this->ptr()->isolator.get(); + return this->ptr()->isolator.value(); } //! Returns whether an isolator has been given for that status line diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h index 82c932fca8b..bafb54b7db7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h @@ -22,19 +22,7 @@ the output sequence. `std::pair::%Type>`. -\cgalHeading{A Note on Backwards Compatibility} -This function used to return `CGAL::Object` up to -\cgal version 4.2. Starting with \cgal version 4.3 the return type -is determined by the metafunction `CGAL::Arr_point_location_result`. -To preserve backwards compatibility -`CGAL::Object` can be constructed from the new return type -implicitly, but switching to the new style is recommended. To enable -the old style without any overhead, the macro -`::CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any -\cgal header is included. - \sa `CGAL::Arr_point_location_result` -\sa `CGAL_ARR_POINT_LOCATION_VERSION` */ template` -\sa `CGAL_ARR_POINT_LOCATION_VERSION` */ template< typename Arrangement, typename Generator > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h index 1ef49902c8c..b79e948e3e7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h @@ -19,7 +19,6 @@ time-consuming process when applied to dense arrangements. \sa `ArrangementPointLocation_2` \sa `ArrangementVerticalRayShoot_2` \sa `CGAL::Arr_point_location_result` -\sa `CGAL_ARR_POINT_LOCATION_VERSION` */ template< typename Arrangement > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h index 32b4e443326..ed8cc09f5d0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h @@ -1,25 +1,4 @@ /*! -\ingroup PkgArrangementOnSurface2PointLocation - -The macro `CGAL_ARR_POINT_LOCATION_VERSION` can be used to configure -the point-location query API. In particular, it determines which version -of the result type of the point-location and vertical ray-shooting queries -should be used by models of the concepts `ArrangementPointLocation_2` -and `ArrangementVerticalRayShoot_2`, and by the free function -`locate`. The `CGAL_ARR_POINT_LOCATION_VERSION` should be defined before any \cgal header -is included. - -- `CGAL_ARR_POINT_LOCATION_VERSION` == 1, the result type is set to be `CGAL::Object`. -- `CGAL_ARR_POINT_LOCATION_VERSION` == 2, the result type is set to be -`std::variant`, where `Vertex_const_handle`, `Halfedge_const_handle`, and -`Face_const_handle` are the corresponding nested types in a `CGAL::Arrangement_2` instance. - - -\sa `ArrangementPointLocation_2` -\sa `ArrangementVerticalRayShoot_2` -\sa `CGAL::Arr_point_location_result` -*/ -#define CGAL_ARR_POINT_LOCATION_VERSION namespace CGAL { @@ -37,7 +16,6 @@ or vertical ray-shoot query. \sa `CGAL::Arr_walk_along_line_point_location` \sa `CGAL::Arr_landmarks_point_location` \sa `CGAL::Arr_trapezoid_ric_point_location` -\sa `CGAL_ARR_POINT_LOCATION_VERSION` */ template struct Arr_point_location_result @@ -45,8 +23,6 @@ struct Arr_point_location_result /*! The type of the arrangement feature that is the result of a * point-location query or a vertical ray-shoot query, namely, * `std::variant` - * if `::CGAL_ARR_POINT_LOCATION_VERSION` == 2, which is the default, otherwise - * `CGAL::Object`. */ typedef unspecified_type Type; }; /* end Arr_point_location_result */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h index 0027ec53409..45c0d8c8470 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h @@ -32,7 +32,6 @@ This strategy supports arbitrary subdivisions, including unbounded ones. \sa `ArrangementPointLocation_2` \sa `ArrangementVerticalRayShoot_2` \sa `CGAL::Arr_point_location_result` -\sa `CGAL_ARR_POINT_LOCATION_VERSION` */ template< typename Arrangement > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h index ed9c1e12e3d..4ad6dfeb8eb 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h @@ -21,7 +21,6 @@ namespace CGAL { * \sa `ArrangementPointLocation_2` * \sa `ArrangementVerticalRayShoot_2` * \sa `CGAL::Arr_point_location_result` - * \sa `CGAL_ARR_POINT_LOCATION_VERSION` */ template diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_walk_along_line_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_walk_along_line_point_location.h index ed5df33be96..e6141a6779d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_walk_along_line_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_walk_along_line_point_location.h @@ -29,7 +29,6 @@ of issued queries is not large. \sa `ArrangementPointLocation_2` \sa `ArrangementVerticalRayShoot_2` \sa `CGAL::Arr_point_location_result` -\sa `CGAL_ARR_POINT_LOCATION_VERSION` */ template< typename Arrangement > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h index c2f6a0437f2..b2fa1c3aae4 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h @@ -10,16 +10,6 @@ containing it. In the general case, the query point is contained inside an arrangement face, but in degenerate situations it may lie on an edge or coincide with an arrangement vertex. -\cgalHeading{A note on Backwards compatibility} -The `locate` member function used to return `CGAL::Object` up to -\cgal version 4.2. Starting with \cgal version 4.3 the return type -is determined by a metafunction. To preserve backwards compatibility -`CGAL::Object` can be constructed from the new return types -implicitly, but switching to the new style is recommended. To enable -the old style without any overhead, the macro -`CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any -\cgal header is included. - \cgalHasModel `CGAL::Arr_naive_point_location` \cgalHasModel `CGAL::Arr_walk_along_line_point_location` \cgalHasModel `CGAL::Arr_trapezoid_ric_point_location` @@ -30,7 +20,6 @@ the old style without any overhead, the macro \sa `CGAL::Arr_trapezoid_ric_point_location` \sa `CGAL::Arr_landmarks_point_location` \sa `CGAL::Arr_point_location_result` -\sa `CGAL_ARR_POINT_LOCATION_VERSION` */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h index 4a1febdc2d2..e676fefcf16 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h @@ -18,16 +18,6 @@ emanating from the query point goes to infinity without hitting any arrangement feature on its way. In this case the unbounded face is returned. -\cgalHeading{A Note on Backwards Compatibility} -The `ray_shoot_up` and `ray_shoot_down` member functions used -to return `CGAL::Object` up to \cgal version 4.2. Starting with -\cgal version 4.3 the return type is determined by a metafunction. To -preserve backwards compatibility `CGAL::Object` can be constructed -from the new return types implicitly, but switching to the new style -is recommended. To enable the old style without any overhead, the macro -`CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any -\cgal header is included. - \cgalHasModel `CGAL::Arr_naive_point_location` \cgalHasModel `CGAL::Arr_walk_along_line_point_location` \cgalHasModel `CGAL::Arr_trapezoid_ric_point_location` @@ -38,7 +28,6 @@ is recommended. To enable the old style without any overhead, the macro \sa `CGAL::Arr_trapezoid_ric_point_location` \sa `CGAL::Arr_landmarks_point_location` \sa `CGAL::Arr_point_location_result` -\sa `CGAL_ARR_POINT_LOCATION_VERSION` */ class ArrangementVerticalRayShoot_2 { diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt index 04ce3c47c28..4427a20e151 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt @@ -239,9 +239,6 @@ implemented as peripheral classes or as free (global) functions. - `CGAL::Arr_unb_planar_topology_traits_2` - `CGAL::Arr_spherical_topology_traits_2` -\cgalCRPSection{Macros} -- \link CGAL_ARR_POINT_LOCATION_VERSION `CGAL_ARR_POINT_LOCATION_VERSION` \endlink - \cgalCRPSection{Functions} - `CGAL::is_valid()` diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp index 73540335257..750986dda1e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp @@ -72,7 +72,8 @@ int main() { Point_location _pl(arr); for (ArcContainer::const_iterator it = ac.begin(); it != ac.end(); ++it) { //insert(arr,_pl,*it); - insert(arr, *it, _pl); + //DONOTCOMMIT + //~ insert(arr, *it, _pl); }; return 0; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp index 425b187d17e..59a0203a4b4 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp @@ -32,7 +32,7 @@ int main() { // the boundary of the face that contains it. Point q(4, 1); auto obj = pl.locate(q); - auto* f = std::get(&obj); + auto* f = std::get_if(&obj); std::cout << "The query point (" << q << ") is located in: "; print_face(*f); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h index d6c29e08bac..d5a729edc6d 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h @@ -4,33 +4,6 @@ //----------------------------------------------------------------------------- // Print the result of a point-location query. // -#if CGAL_ARR_POINT_LOCATION_VERSION < 2 -template -void print_point_location(const typename Arrangement_::Point_2& q, - CGAL::Object obj) -{ - typedef Arrangement_ Arrangement_2; - typename Arrangement_2::Vertex_const_handle v; - typename Arrangement_2::Halfedge_const_handle e; - typename Arrangement_2::Face_const_handle f; - - std::cout << "The point (" << q << ") is located "; - if (CGAL::assign(f, obj)) { // q is located inside a face - if (f->is_unbounded()) - std::cout << "inside the unbounded face." << std::endl; - else std::cout << "inside a bounded face." << std::endl; - } - else if (CGAL::assign(e, obj)) { // q is located on an edge - std::cout << "on an edge: " << e->curve() << std::endl; - } - else if (CGAL::assign(v, obj)) { // q is located on a vertex - if (v->is_isolated()) - std::cout << "on an isolated vertex: " << v->point() << std::endl; - else std::cout << "on a vertex: " << v->point() << std::endl; - } - else CGAL_error_msg( "Invalid object."); -} -#else template void print_point_location (const typename Arrangement_::Point_2& q, @@ -57,7 +30,6 @@ void print_point_location << " vertex: " << (*v)->point() << std::endl; else CGAL_error_msg("Invalid object."); } -#endif //----------------------------------------------------------------------------- // Perform a point-location query and print the result. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp index bc4168f2da0..70184f7f4bb 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp @@ -58,7 +58,7 @@ int main() { // convert it into x-monotone bezier curve. std::vector obj_vector; bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(obj_vector)); - auto* x_seg_p = std::get(&obj_vector[0]); + auto* x_seg_p = std::get_if(&obj_vector[0]); x_curves.push_back(*x_seg_p); } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp index 5cd1a8367c2..98515d5d0c9 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp @@ -99,15 +99,15 @@ protected: for (auto it = results.begin(); it != results.end(); ++it) { std::cout << "The point (" << it->first << ") is located "; if (const Face_const_handle* f = - std::get(&(it->second))) // inside a face + std::get_if(&(it->second))) // inside a face std::cout << "inside " << (((*f)->is_unbounded()) ? "the unbounded" : "a bounded") << " face.\n"; else if (const Halfedge_const_handle* e = - std::get(&(it->second))) // on an edge + std::get_if(&(it->second))) // on an edge std::cout << "on an edge: " << (*e)->curve() << std::endl; else if (const Vertex_const_handle* v = - std::get(&(it->second))) // on a vertex + std::get_if(&(it->second))) // on a vertex std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a") << " vertex: " << (*v)->point() << std::endl; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h index 2445f06cfa3..462101d028e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h @@ -862,8 +862,6 @@ public: */ template OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { - typedef std::variant - Make_x_monotone_result; auto ctr_xcv = m_traits.construct_x_monotone_curve_2_object(); @@ -877,7 +875,7 @@ public: auto n_vtan_ps = m_traits.vertical_tangency_points(cv, vtan_ps); if (n_vtan_ps == 0) { // In case the given curve is already x-monotone: - *oi++ = Make_x_monotone_result(ctr_xcv(cv, conic_id)); + *oi++ = ctr_xcv(cv, conic_id); return oi; } @@ -889,19 +887,15 @@ public: // In case the curve is a full conic, split it into two x-monotone // arcs, one going from ps[0] to ps[1], and the other from ps[1] to // ps[0]. - *oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[0], vtan_ps[1], - conic_id)); - *oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[1], vtan_ps[0], - conic_id)); + *oi++ = ctr_xcv(cv, vtan_ps[0], vtan_ps[1], conic_id); + *oi++ = ctr_xcv(cv, vtan_ps[1], vtan_ps[0], conic_id); } else { if (n_vtan_ps == 1) { // Split the arc into two x-monotone sub-curves: one going from the // arc source to ps[0], and the other from ps[0] to the target. - *oi++ = Make_x_monotone_result(ctr_xcv(cv, cv.source(), vtan_ps[0], - conic_id)); - *oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[0], cv.target(), - conic_id)); + *oi++ = ctr_xcv(cv, cv.source(), vtan_ps[0], conic_id); + *oi++ = ctr_xcv(cv, vtan_ps[0], cv.target(), conic_id); } else { CGAL_assertion(n_vtan_ps == 2); @@ -931,16 +925,16 @@ public: } // Split the arc into three x-monotone sub-curves. - *oi++ = Make_x_monotone_result(ctr_xcv(cv, cv.source(), - vtan_ps[ind_first], - conic_id)); + *oi++ = ctr_xcv(cv, cv.source(), + vtan_ps[ind_first], + conic_id); - *oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[ind_first], - vtan_ps[ind_second], - conic_id)); + *oi++ = ctr_xcv(cv, vtan_ps[ind_first], + vtan_ps[ind_second], + conic_id); - *oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[ind_second], - cv.target(), conic_id)); + *oi++ = ctr_xcv(cv, vtan_ps[ind_second], + cv.target(), conic_id); } } @@ -1314,17 +1308,15 @@ public: OutputIterator intersect(const X_monotone_curve_2& xcv1, const X_monotone_curve_2& xcv2, Intersection_map& inter_map, - OutputIterator oi) const { - typedef std::variant - Intersection_result; - + OutputIterator oi) const + { if (m_traits.has_same_supporting_conic(xcv1, xcv2)) { // Check for overlaps between the two arcs. X_monotone_curve_2 overlap; if (compute_overlap(xcv1, xcv2, overlap)) { // There can be just a single overlap between two x-monotone arcs: - *oi++ = Intersection_result(overlap); + *oi++ = overlap; return oi; } @@ -1337,22 +1329,22 @@ public: auto eq = alg_kernel->equal_2_object(); if (eq(xcv1.left(), xcv2.left())) { Intersection_point ip(xcv1.left(), 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } if (eq(xcv1.right(), xcv2.right())) { Intersection_point ip(xcv1.right(), 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } if (eq(xcv1.left(), xcv2.right())) { Intersection_point ip(xcv1.left(), 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } if (eq(xcv1.right(), xcv2.left())) { Intersection_point ip(xcv1.right(), 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } return oi; @@ -1395,7 +1387,7 @@ public: if (m_traits.is_between_endpoints(xcv1, (*iter).first) && m_traits.is_between_endpoints(xcv2, (*iter).first)) { - *oi++ = Intersection_result(*iter); + *oi++ = *iter; } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h index e8bb9a70703..d0a68b2885b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h @@ -208,8 +208,6 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef std::variant - Intersection_result; typedef std::variant Intersection_base_result; @@ -223,19 +221,19 @@ public: // Go over all intersection objects and prepare the output. for (const auto& item : base_objects) { const Base_x_monotone_curve_2* base_cv = - std::get(&item); + std::get_if(&item); if (base_cv != nullptr) { // The current intersection object is an overlapping x-monotone // curve: Merge the data fields of both intersecting curves and // associate the result with the overlapping curve. X_monotone_curve_2 cv(*base_cv, Merge()(cv1.data(), cv2.data())); - *oi++ = Intersection_result(cv); + *oi++ = cv; continue; } // The current intersection object is an intersection point: // Copy it as is. - const Intersection_point* ip = std::get(&item); - *oi++ = Intersection_result(*ip); + const Intersection_point* ip = std::get_if(&item); + *oi++ = *ip; } return oi; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h index 5c07971538e..7d94b289992 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h @@ -2321,8 +2321,7 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef std::variant - Intersection_result; + const Kernel& kernel = m_traits; typename Kernel::Equal_2 equal = kernel.equal_2_object(); @@ -2337,14 +2336,14 @@ public: if (equal(l1, r1)) { bool is_full = equal(l2, r2); X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true, is_full); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } if (equal(l2, r2)) { CGAL_assertion(! equal(l1, r1)); // already handled above X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } @@ -2358,19 +2357,19 @@ public: // 5. l1 = r2 < r1 < l2 = l1 | One overlap (handled above) if (in_between(r1, r2, l2)) { // Case 1. - *oi++ = Intersection_result(Intersection_point(l1_3, 1)); + *oi++ = Intersection_point(l1_3, 1); return oi; } if (equal(r1, l2)) { // Case 2. - *oi++ = Intersection_result(Intersection_point(l1_3, 1)); - *oi++ = Intersection_result(Intersection_point(l2_3, 1)); + *oi++ = Intersection_point(l1_3, 1); + *oi++ = Intersection_point(l2_3, 1); return oi; } CGAL_assertion(in_between(r1, l2, r2)); // Case 3. X_monotone_curve_2 xc(l2_3, r1_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } @@ -2383,12 +2382,12 @@ public: // 5. l1 < l1 = r1 = l2 < r2 | One overlap (handled above) if (in_between(r2, r1, l1)) { // Case 1. - *oi++ = Intersection_result(Intersection_point(l2_3, 1)); + *oi++ = Intersection_point(l2_3, 1); return oi; } // Case 3. X_monotone_curve_2 xc(l1_3, r2_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } @@ -2400,13 +2399,13 @@ public: if (in_between(r1, l2, r2) || equal(r1, r2)) { // Cases 1 & 2 X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } // Case 3 CGAL_assertion(in_between(r2, l2, r1)); X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } @@ -2418,13 +2417,13 @@ public: if (in_between(l1, r2, l2)) { // Cases 1 X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } // Case 3 CGAL_assertion(in_between(l1, l2, l2)); X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } @@ -2442,12 +2441,12 @@ public: if (in_between(l2, r2, l1)) { // Case 2 X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } // Case 3 X_monotone_curve_2 xc(l2_3, r1_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } @@ -2457,12 +2456,12 @@ public: // Case 4 if (in_between(l1, r1, l2)) { X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } // Case 5 X_monotone_curve_2 xc(l1_3, r2_3, normal, vertical, true); - *oi++ = Intersection_result(xc); + *oi++ = xc; return oi; } @@ -2560,8 +2559,6 @@ public: typedef typename Kernel::Equal_3 Equal_3; typedef std::pair Intersection_point; - typedef std::variant - Intersection_result; const Kernel& kernel = m_traits; @@ -2584,9 +2581,9 @@ public: (res && (xc1.is_directed_right() != xc2.is_directed_right()))) { if (xc1.left().is_min_boundary() && xc2.left().is_min_boundary()) - *oi++ = Intersection_result(Intersection_point(xc1.left(), 1)); + *oi++ = Intersection_point(xc1.left(), 1); if (xc1.right().is_max_boundary() && xc2.right().is_max_boundary()) - *oi++ = Intersection_result(Intersection_point(xc1.right(), 1)); + *oi++ = Intersection_point(xc1.right(), 1); return oi; } @@ -2594,11 +2591,11 @@ public: * the other arc is completely overlapping. */ if (xc1.left().is_min_boundary() && xc1.right().is_max_boundary()) { - *oi++ = Intersection_result(xc2); + *oi++ = xc2; return oi; } if (xc2.left().is_min_boundary() && xc2.right().is_max_boundary()) { - *oi++ = Intersection_result(xc1); + *oi++ = xc1; return oi; } /*! Find an endpoint that does not coincide with a pole, and project @@ -2646,12 +2643,12 @@ public: // Observe that xc1 and xc2 may share two endpoints. Point_2 ed = m_traits.construct_point_2_object()(v.direction()); if (is_in_between(ed, xc1) && is_in_between(ed, xc2)) - *oi++ = Intersection_result(Intersection_point(ed, 1)); + *oi++ = Intersection_point(ed, 1); Vector_3 vo(kernel.construct_opposite_vector_3_object()(v)); Point_2 edo = m_traits.construct_point_2_object()(vo.direction()); if (is_in_between(edo, xc1) && is_in_between(edo, xc2)) - *oi++ = Intersection_result(Intersection_point(edo, 1)); + *oi++ = Intersection_point(edo, 1); return oi; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h index 12f3f3a7c66..f8589b2953b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h @@ -318,13 +318,11 @@ public: Bezier_cache& cache, OutputIterator oi) const { - typedef std::variant Intersection_result; - // In case we have two x-monotone subcurves of the same Bezier curve, // check if they have a common left endpoint. if (_curve.is_same(cv._curve)) { if (left().is_same(cv.left()) || left().is_same(cv.right())) - *oi++ = Intersection_result(Intersection_point(left(), 0)); + *oi++ = Intersection_point(left(), 0); } // Compute the intersections of the two sucurves. Note that for caching @@ -341,7 +339,7 @@ public: // In case of overlap, just report the overlapping subcurve. if (do_ovlp) { - *oi++ = Intersection_result(ovlp_cv); + *oi++ = ovlp_cv; return oi; } @@ -349,14 +347,14 @@ public: // xy-lexicorgraphical order, and insert them to the output iterator. std::sort(ipts.begin(), ipts.end(), Less_intersection_point(cache)); for (auto ip_it = ipts.begin(); ip_it != ipts.end(); ++ip_it) { - *oi++ = Intersection_result(*ip_it); + *oi++ = *ip_it; } // In case we have two x-monotone subcurves of the same Bezier curve, // check if they have a common right endpoint. if (_curve.is_same(cv._curve)) { if (right().is_same(cv.left()) || right().is_same(cv.right())) { - *oi++ = Intersection_result(Intersection_point(right(), 0)); + *oi++ = Intersection_point(right(), 0); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h index 051390155d5..f46489ba969 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h @@ -995,9 +995,6 @@ public: OutputIterator intersect(const Self& cv, OutputIterator oi, Intersection_map* inter_map = nullptr) const { - typedef std::pair Intersection_point; - typedef std::variant Intersection_result; - // First check whether the two arcs have the same supporting curve. if (has_same_supporting_curve(cv)) { // Check for overlaps between the two arcs. @@ -1005,7 +1002,7 @@ public: if (_compute_overlap(cv, overlap)) { // There can be just a single overlap between two x-monotone arcs: - *oi++ = Intersection_result(overlap); + *oi++ = overlap; return oi; } @@ -1016,11 +1013,11 @@ public: // intersection points we report. Multiplicity mult = 0; if (left().equals(cv.left()) || left().equals(cv.right())) { - *oi++ = Intersection_result(std::make_pair(left(), mult)); + *oi++ = std::make_pair(left(), mult); } if (right().equals(cv.right()) || right().equals(cv.left())) { - *oi++ = Intersection_result(std::make_pair(right(), mult)); + *oi++ = std::make_pair(right(), mult); } return oi; @@ -1072,7 +1069,7 @@ public: if (this->_is_between_endpoints (iter->first) && cv._is_between_endpoints (iter->first)) { - *oi++ = Intersection_result(*iter); + *oi++ = *iter; } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h index ef830934d74..f712190f0df 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h @@ -1326,8 +1326,6 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef std::variant - Intersection_result; CGAL_precondition(! cv1.is_degenerate()); CGAL_precondition(! cv2.is_degenerate()); @@ -1354,7 +1352,7 @@ public: // Create a pair representing the point with its multiplicity, // which is always 1 for line segments. Intersection_point ip_mult(*ip, 1); - *oi++ = Intersection_result(ip_mult); + *oi++ = ip_mult; } } return oi; @@ -1398,14 +1396,14 @@ public: if (cmp_res == SMALLER) { // We have discovered a true overlapping subcurve: - *oi++ = Intersection_result(ovlp); + *oi++ = ovlp; } else if (cmp_res == EQUAL) { // The two objects have the same supporting line, but they just share // a common endpoint. Thus we have an intersection point, but we leave // the multiplicity of this point undefined. Intersection_point ip_mult(ovlp.left(), 0); - *oi++ = Intersection_result(ip_mult); + *oi++ = ip_mult; } return oi; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h index b026673d4a6..c1a177e5ab6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h @@ -145,13 +145,13 @@ public: //Dag_node* m_dag_node; //pointer to the search structure (DAG) node /*! Initialize the trapezoid's neighbors. */ - inline void init_neighbors(std::optional next) + inline void init_neighbors(std::optional> next) { set_next((next) ? *next : Td_map_item(0)); } /*! \copydoc init_neighbors * \deprecated please use #init_neighbors */ - CGAL_DEPRECATED inline void init_neighbours(std::optional next) + CGAL_DEPRECATED inline void init_neighbours(std::optional> next) { init_neighbors(next); } /*! Set the DAG node. */ @@ -199,7 +199,7 @@ public: /*! Constructor given Vertex & Halfedge handles. */ Td_active_edge (Halfedge_const_handle he , Dag_node* node = 0, - std::optional next = std::nullopt) + std::optional> next = std::nullopt) { PTR = new Data(he, (next) ? *next : Td_map_item(0), node); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h index d8a775c4179..f226db992d9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h @@ -163,8 +163,8 @@ private: //Dag_node* m_dag_node; //pointer to the search structure (DAG) node /*! Initialize the trapezoid's neighbors. */ - inline void init_neighbors(std::optional lb, std::optional lt, - std::optional rb, std::optional rt) + inline void init_neighbors(std::optional> lb, std::optional> lt, + std::optional> rb, std::optional> rt) { set_lb((lb) ? *lb : Td_map_item(0)); set_lt((lt) ? *lt : Td_map_item(0)); @@ -173,8 +173,8 @@ private: } /*! \copydoc init_neighbors * \deprecated please use #init_neighbors */ - CGAL_DEPRECATED inline void init_neighbours(std::optional lb, std::optional lt, - std::optional rb, std::optional rt) + CGAL_DEPRECATED inline void init_neighbours(std::optional> lb, std::optional> lt, + std::optional> rb, std::optional> rt) { init_neighbors(lb, lt, rb, rt); } /*! Set the DAG node. */ @@ -267,10 +267,10 @@ private: /*! Constructor given Vertex & Halfedge handles. */ Td_active_trapezoid (Vertex_const_handle l, Vertex_const_handle r, Halfedge_const_handle b, Halfedge_const_handle t, - std::optional lb = std::nullopt, - std::optional lt = std::nullopt, - std::optional rb = std::nullopt, - std::optional rt = std::nullopt, + std::optional> lb = std::nullopt, + std::optional> lt = std::nullopt, + std::optional> rb = std::nullopt, + std::optional> rt = std::nullopt, Dag_node* node = 0) { PTR = new Data (l, r, b, t, (lb) ? *lb : Td_map_item(0), (lt) ? *lt : Td_map_item(0), diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index 3888b097bb8..e461b86a443 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -272,7 +272,7 @@ public: Base_map_item_iterator() : traits(0), m_cur_item(Td_map_item(0)){ } Base_map_item_iterator(const Traits* traits_, - std::optional curr = std::nullopt) + std::optional> curr = std::nullopt) :traits(traits_), m_cur_item((curr) ? *curr : Td_map_item(0) ) { } Base_map_item_iterator(const Base_map_item_iterator &it) @@ -332,12 +332,12 @@ public: public: //constructors In_face_iterator(const Traits* traits_, Halfedge_const_handle sep, - std::optional curr = std::nullopt) + std::optional> curr = std::nullopt) :Base_map_item_iterator(traits_,curr), m_sep(sep->curve()) { } In_face_iterator(const Traits* traits_, const X_monotone_curve_2& sep, - std::optional curr = std::nullopt) + std::optional> curr = std::nullopt) :Base_map_item_iterator(traits_,curr), m_sep(sep) { } @@ -879,20 +879,20 @@ public: class cv_for_edge_visitor { public: - std::optional + std::optional> operator()(Td_active_edge& t) const { return t.halfedge()->curve(); } - std::optional + std::optional> operator()(Td_inactive_edge& t) const { return t.curve(); } template - std::optional operator()(T& /* t */) const + std::optional> operator()(T& /* t */) const { CGAL_assertion(false); return std::nullopt; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h index 15320d02bcd..4651b64c4dd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h @@ -16,41 +16,9 @@ #include -// The macro CGAL_ARR_POINT_LOCATION_VERSION controls which version of the -// point location is used. Currently two values are supported: -// 1. Point location with CGAL::Object -// 2. Point location with std::optional > -// The default value is 2. - -#if !defined(CGAL_ARR_POINT_LOCATION_VERSION) -#define CGAL_ARR_POINT_LOCATION_VERSION 2 -#endif - -#include - #include #include -#ifdef CGAL_CFG_BOOST_VARIANT_SWAP_BUG -#if CGAL_ARR_POINT_LOCATION_VERSION > 1 -#include -// workaround for this bug: -// https://svn.boost.org/trac/boost/ticket/2839 -namespace boost{ namespace detail { namespace variant { - -template -inline void move_swap( - ::CGAL::I_Filtered_const_iterator& lhs, - ::CGAL::I_Filtered_const_iterator& rhs) -{ - ::CGAL::I_Filtered_const_iterator tmp( boost::detail::variant::move(lhs) ); - lhs = boost::detail::variant::move(rhs); - rhs = boost::detail::variant::move(tmp); -} -} } } -#endif -#endif - namespace CGAL { template @@ -61,34 +29,16 @@ struct Arr_point_location_result { typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Face_const_handle Face_const_handle; -#if CGAL_ARR_POINT_LOCATION_VERSION < 2 - typedef CGAL::Object Type; -#else typedef typename std::variant Type; -#endif typedef Type type; - // This function returns either make_object() or a result_type constructor - // to generate return values. The Object version takes a dummy template - // argument, which is needed for the return of the other option, e.g., - // std::optional >. + // This function returns a result_type constructor + // to generate return values. // In theory a one parameter variant could be returned, but this _could_ // lead to conversion overhead, and so we rather go for the real type. // Overloads for empty returns are also provided. -#if CGAL_ARR_POINT_LOCATION_VERSION < 2 - template - static - inline Type make_result(T t) { return CGAL::make_object(t); } - - static - inline CGAL::Object empty_optional_result() { return CGAL::Object(); } - - template - static - inline const T* assign(const Type* obj) { return CGAL::object_cast(obj); } -#else template static inline Type make_result(T t) { return Type(t); } @@ -100,7 +50,6 @@ struct Arr_point_location_result { template static inline const T* assign(const Type* obj) { return std::get_if(obj); } -#endif // CGAL_ARR_POINT_LOCATION_VERSION < 2 //this one is only to remove warnings in functions static diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h index bb418c5d87b..345d9d89caf 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h @@ -2047,7 +2047,7 @@ public: if (this->equals(arc)) { Self overlap_arc(*this); - *oi++ = Intersection_result(overlap_arc); + *oi++ = overlap_arc; return oi; } @@ -2170,7 +2170,7 @@ public: (this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0) { Intersection_point ip(p_left, 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } return oi; @@ -2189,7 +2189,7 @@ public: this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS | this->IS_VALID); - *oi++ = Intersection_result(overlap_arc); + *oi++ = overlap_arc; return oi; } @@ -2221,7 +2221,7 @@ public: Algebraic_point_2 p(this->_f, *x_iter); // Output the intersection point: Intersection_point ip(p, *m_iter); - *oi++ = Intersection_result(ip); + *oi++ = ip; } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h index 15a3cffe63d..b080305c6f8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h @@ -706,8 +706,6 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef std::variant - Intersection_result; // Early ending with Bbox overlapping test if (! do_bboxes_overlap(cv1, cv2)) return oi; @@ -733,7 +731,7 @@ public: m_traits.is_in_y_range_2_object()(cv2, *ip) : m_traits.is_in_x_range_2_object()(cv2, *ip)); Intersection_point ip_mult(*ip, 1); - *oi++ = Intersection_result(ip_mult); + *oi++ = ip_mult; return oi; } @@ -754,7 +752,7 @@ public: // a common endpoint. Thus we have an intersection point, but we leave // the multiplicity of this point undefined. Intersection_point ip_mult(p_r, 0); - *oi++ = Intersection_result(ip_mult); + *oi++ = ip_mult; return oi; } @@ -765,17 +763,17 @@ public: // in the overlap segment if (cv1.is_directed_right()) { X_monotone_curve_2 overlap_seg(cv1.line(), p_l, p_r); - *oi++ = Intersection_result(overlap_seg); + *oi++ = overlap_seg; return oi; } X_monotone_curve_2 overlap_seg(cv1.line(), p_r, p_l); - *oi++ = Intersection_result(overlap_seg); + *oi++ = overlap_seg; return oi; } // cv1 and cv2 have opposite directions, the overlap segment // will be directed from left to right X_monotone_curve_2 overlap_seg(cv1.line(), p_l, p_r); - *oi++ = Intersection_result(overlap_seg); + *oi++ = overlap_seg; return oi; } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h index efdaa8d65d9..ab14028c080 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h @@ -57,11 +57,7 @@ public: typedef Result_type result_type; protected: -#if CGAL_ARR_POINT_LOCATION_VERSION < 2 - typedef Result_type Optional_result_type; -#else typedef typename std::optional Optional_result_type; -#endif typedef typename Topology_traits::Dcel Dcel; typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; @@ -71,13 +67,8 @@ protected: const Traits_adaptor_2* m_geom_traits; // Its associated geometry traits. const Topology_traits* m_topol_traits; // Its associated topology traits. -#if CGAL_ARR_POINT_LOCATION_VERSION < 2 - inline bool optional_empty(const CGAL::Object& obj) const { return obj.empty(); } - inline const Result_type& optional_assign(const CGAL::Object& t) const { return t; } -#else inline bool optional_empty(const std::optional& t) const { return (!t); } inline const Result_type& optional_assign(const std::optional& t) const { return *t; } -#endif template Result_type make_result(T t) const { return Result::make_result(t); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h index a042f80a584..f9f58734738 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h @@ -161,7 +161,7 @@ public: make_x_monotone(normal1, normal2, std::back_inserter(x_objects)); auto it = x_objects.begin(); - const auto* xc = std::get(&(*it)); + const auto* xc = std::get_if(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "1.a. insert_in_face_interior(" << *xc << ")" << std::endl; #endif @@ -172,7 +172,7 @@ public: ++it; if (it == x_objects.end()) return oi; - xc = std::get(&(*it)); + xc = std::get_if(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "1.b. insert_from_vertex(" << *xc << ")" << std::endl; #endif @@ -202,7 +202,7 @@ public: make_x_monotone(normal1, normal2, std::back_inserter(x_objects)); auto it = x_objects.begin(); - const auto* xc = std::get(&(*it)); + const auto* xc = std::get_if(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "2.a. insert_from_vertex(" << *xc << ", " << vertex1->point() << ")" << std::endl; @@ -216,7 +216,7 @@ public: ++it; if (it == x_objects.end()) return oi; - xc = std::get(&(*it)); + xc = std::get_if(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "2.b. insert_from_vertex(" << *xc << ")" << std::endl; #endif @@ -247,7 +247,7 @@ public: auto it = x_objects.begin(); if (x_objects.size() == 1) { - const auto* xc = std::get(&(*it)); + const auto* xc = std::get_if(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "3. insert_from_vertex(" << *xc << ")" << std::endl; #endif @@ -258,8 +258,8 @@ public: return oi; } - const X_monotone_curve_2* xc1 = std::get(&(*it++)); - const X_monotone_curve_2* xc2 = std::get(&(*it)); + const X_monotone_curve_2* xc1 = std::get_if(&(*it++)); + const X_monotone_curve_2* xc2 = std::get_if(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "3.a. insert_from_vertex(" << *xc2 << ")" << std::endl; @@ -300,7 +300,7 @@ public: make_x_monotone(normal1, normal2, std::back_inserter(x_objects)); auto it = x_objects.begin(); if (x_objects.size() == 1) { - const auto* xc = std::get(&(*it)); + const auto* xc = std::get_if(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "4. insert_at_vertices(" << *xc << ")" << std::endl; #endif @@ -308,8 +308,8 @@ public: return oi; } - const X_monotone_curve_2 * xc1 = std::get(&(*it++)); - const X_monotone_curve_2 * xc2 = std::get(&(*it)); + const X_monotone_curve_2 * xc1 = std::get_if(&(*it++)); + const X_monotone_curve_2 * xc2 = std::get_if(&(*it)); #if CGAL_ARR_SPHERICAL_GAUSSIAN_MAP_3_DEBUG==1 std::cout << "4.a. insert_from_vertex(" << *xc1 diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h index 4778a4fe913..66dd1834a8c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h @@ -635,6 +635,7 @@ public: const X_monotone_curve_2* xcv = std::get_if(&item); if (xcv != nullptr) { std::cout << " result[" << i++ << "]: xcv: " << *xcv << std::endl; + *oi++ = *xcv; continue; } @@ -642,12 +643,11 @@ public: if (ip != nullptr) { std::cout << " result[" << i++ << "]: p: " << ip->first << ", multiplicity: " << ip->second << std::endl; + *oi++ = *ip; continue; } } - for (auto it = container.begin(); it != container.end(); ++it) *oi++ = *it; - container.clear(); return oi; } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h index a26e51a1e4b..8fe1efa48c7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h @@ -1469,13 +1469,13 @@ public: // point-wise intersections std::vector arcs; if (cv1._trim_if_overlapped(cv2, std::back_inserter(arcs))) { - for (const auto& item : arcs) *oi++ = Intersection_result(item); + for (const auto& item : arcs) *oi++ = item; return oi; } // process non-ov erlapping case std::vector vec; Arc_2::_intersection_points(cv1, cv2, std::back_inserter(vec)); - for (const auto& item : vec) *oi++ = Intersection_result(item); + for (const auto& item : vec) *oi++ = item; return oi; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h index 6b7628a0519..eedde5108af 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h @@ -901,12 +901,7 @@ bool Point_location_test::attach_pl_strategies() template bool Point_location_test::perform() { -#if ((CGAL_ARR_POINT_LOCATION_VERSION < 2) || \ - defined(CGAL_ARR_POINT_LOCATION_CONVERSION)) - Objects_vector objs[NUM_PL_STRATEGIES]; -#else Variants_vector objs[NUM_PL_STRATEGIES]; -#endif // Locate the points in the list using all point location strategies. diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index 898b96445fe..783ba994ab8 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -706,15 +706,6 @@ function(test_point_location_segments) compile_and_run_with_flags(test_point_location segments "${flags}" segments) endfunction() -# For backward compatibility -function(test_point_location_segments_version) - set(nt ${CGAL_GMPQ_NT}) - set(kernel ${CARTESIAN_KERNEL}) - set(geom_traits ${SEGMENT_GEOM_TRAITS}) - set(flags "-DTEST_NT=${nt} -DTEST_KERNEL=${kernel} -DTEST_GEOM_TRAITS=${geom_traits} -DCGAL_ARR_POINT_LOCATION_VERSION=1") - compile_and_run_with_flags(test_point_location segments "${flags}" segments_version) -endfunction() - # For backward compatibility function(test_point_location_segments_conversion) set(nt ${CGAL_GMPQ_NT}) @@ -1366,7 +1357,6 @@ test_overlay_segments() test_overlay_spherical_arcs() test_point_location_segments() -test_point_location_segments_version() test_point_location_segments_conversion() test_point_location_circle_segments() test_point_location_linear() diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake index ee92d955c82..4d62ce61777 100755 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake @@ -911,16 +911,6 @@ test_point_location_segments() compile_and_run_with_flags test_point_location segments "$flags" } -# For backward compatibility -test_point_location_segments_version() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DCGAL_ARR_POINT_LOCATION_VERSION=1"; - compile_and_run_with_flags test_point_location segments "$flags" -} - # For backward compatibility test_point_location_segments_conversion() { @@ -1706,7 +1696,6 @@ test_overlay_segments test_overlay_spherical_arcs test_point_location_segments -test_point_location_segments_version test_point_location_segments_conversion test_point_location_circle_segments test_point_location_linear diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h index d5372d0be79..06606b65915 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h @@ -162,9 +162,6 @@ public: Intersection_base_point; typedef std::variant Intersection_base_result; - typedef const std::pair Intersection_point; - typedef std::variant - Intersection_result; const auto* base_traits = m_traits.m_base_traits; auto base_cmp_xy = base_traits->compare_xy_2_object(); @@ -187,7 +184,7 @@ public: if (base_pt != nullptr) { Point_2 point_plus(base_pt->first); // the extended point *oi++ = - Intersection_result(std::make_pair(point_plus, base_pt->second)); + std::make_pair(point_plus, base_pt->second); continue; } @@ -214,7 +211,7 @@ public: Curve_data cv_data(cv1.data().arr(), Halfedge_handle(), ov_bc, ov_twin_bc); - *oi++ = Intersection_result(X_monotone_curve_2(*overlap_cv, cv_data)); + *oi++ = X_monotone_curve_2(*overlap_cv, cv_data); } return oi; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h index 0776b833613..24b69369a43 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h @@ -135,9 +135,6 @@ public: Intersection_base_point; typedef std::variant Intersection_base_result; - typedef const std::pair Intersection_point; - typedef std::variant - Intersection_result; const auto* base_traits = m_traits.m_base_traits; auto base_cmp_xy = base_traits->compare_xy_2_object(); @@ -175,7 +172,7 @@ public: Point_data pt_data(m_traits.invalid_index()); Point_2 point_plus(base_pt->first, pt_data); // the extended point *oi++ = - Intersection_result(std::make_pair(point_plus, base_pt->second)); + std::make_pair(point_plus, base_pt->second); continue; } @@ -202,7 +199,7 @@ public: } Curve_data cv_data(ov_bc, ov_twin_bc, m_traits.invalid_index()); - *oi++ = Intersection_result(X_monotone_curve_2(*overlap_cv, cv_data)); + *oi++ = X_monotone_curve_2(*overlap_cv, cv_data); } return oi; diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2.h index 433a6a4949c..4e17e189b11 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2.h @@ -116,9 +116,7 @@ public: { // Subdivide the curves into x-monotone subcurves. CurvesIterator it; - std::list objects; - std::list::iterator obj_it; - X_monotone_curve_2 xcv; + std::list> objects; std::list x_curves; for (it = begin; it != end; it++) @@ -127,10 +125,10 @@ public: objects.clear(); traits->make_x_monotone_2_object()(*it, std::back_inserter(objects)); - for (obj_it = objects.begin(); obj_it != objects.end(); ++obj_it) + for (auto obj_it = objects.begin(); obj_it != objects.end(); ++obj_it) { - if(CGAL::assign (xcv, *obj_it)) - x_curves.push_back (xcv); + if(const X_monotone_curve_2* xcv_ptr = std::get_if(&(*obj_it))) + x_curves.push_back (*xcv_ptr); } } diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h index f813f8ccc9a..657bb0168ea 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h @@ -630,9 +630,7 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, // Find the next intersection of the envelopes to the right of the current // rightmost point in the merged diagram. - // \todo Use the faster object_cast. - std::list objects; - CGAL::Object obj; + std::list> objects; const X_monotone_curve_2* intersection_curve; const Intersection_point* intersection_point; @@ -641,10 +639,10 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, while (! objects.empty()) { // Pop the xy-lexicographically smallest intersection object. - obj = objects.front(); + auto obj = objects.front(); objects.pop_front(); - if ((intersection_point = CGAL::object_cast(&obj)) != + if ((intersection_point = std::get_if(&obj)) != nullptr) { // We have a simple intersection point. @@ -725,7 +723,7 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, else { // We have an x-monotone curve representing an overlap of the two // curves. - intersection_curve = CGAL::object_cast(&obj); + intersection_curve = std::get_if(&obj); if (intersection_curve == nullptr) CGAL_error_msg("unrecognized intersection object."); diff --git a/Envelope_3/include/CGAL/Env_plane_traits_3.h b/Envelope_3/include/CGAL/Env_plane_traits_3.h index 1bf7f790a10..85fbbf161be 100644 --- a/Envelope_3/include/CGAL/Env_plane_traits_3.h +++ b/Envelope_3/include/CGAL/Env_plane_traits_3.h @@ -47,7 +47,6 @@ public: typedef typename Kernel::Ray_2 Ray_2; typedef typename Kernel::Line_2 Line_2; typedef typename Kernel::Line_3 Line_3; - typedef typename Kernel::Object_3 Object_3; typedef std::pair Intersection_curve; typedef typename Base::Left_side_category Left_side_category; @@ -326,8 +325,8 @@ public: const Plane_3& h = s.plane(); Line_2 proj_line(h.a(), h.b(), h.d()); - *o++ = make_object(std::make_pair(X_monotone_curve_2(proj_line), - ON_ORIENTED_BOUNDARY)); + *o++ = std::make_pair(X_monotone_curve_2(proj_line), + ON_ORIENTED_BOUNDARY); return o; } @@ -339,7 +338,7 @@ public: Oriented_side side = (res == SMALLER) ? ON_POSITIVE_SIDE : ON_NEGATIVE_SIDE; - *o++ = make_object(std::make_pair(X_monotone_curve_2(s.line()), side)); + *o++ = std::make_pair(X_monotone_curve_2(s.line()), side); return o; } }; @@ -369,11 +368,10 @@ public: { Line_2 l1(h1.a(), h1.b(), h1.d()); Line_2 l2(h2.a(), h2.b(), h2.d()); - Object obj = k.intersect_2_object()(l1, l2); + auto obj = k.intersect_2_object()(l1, l2); - Point_2 p; - if(assign(p, obj)) - *o++ = make_object(p); + if(const Point_2* p = std::get_if(&(*obj))) + *o++ = *p; // otherwise, the vertical planes are parallel or overlap, so we return // nothing. @@ -382,90 +380,82 @@ public: if(s1.is_all_plane() && s2.is_all_plane()) { - Object obj = k.intersect_3_object()(h1, h2); - Line_3 l; - if(assign(l, obj)) - *o++ = make_object(Intersection_curve(project_xy(l, k), 1)); + auto obj = k.intersect_3_object()(h1, h2); + CGAL_assertion(obj != std::nullopt); + if(const Line_3* l = std::get_if(&(*obj))) + *o++ = Intersection_curve(project_xy(*l, k), 1); return o; } if(s1.is_all_plane() && !s2.is_all_plane()) { - Object obj = plane_half_plane_proj_intersection(h1, - h2, - s2.line(), - k); - if(obj.is_empty()) + auto obj = plane_half_plane_proj_intersection(h1, + h2, + s2.line(), + k); + if(obj ==std::nullopt) return o; - Line_2 temp_l; - if(assign(temp_l, obj)) + if(const Line_2* line = std::get_if(&(*obj))) { - *o++ = make_object(Intersection_curve(temp_l, 1)); + *o++ = Intersection_curve(*line, 1); return o; } - Ray_2 ray; - if(assign(ray, obj)) + if(const Ray_2* ray = std::get_if(&(*obj))) { - *o++ = make_object(Intersection_curve(ray, 1)); + *o++ = Intersection_curve(*ray, 1); return o; } return o; } if(!s2.is_all_plane() && s2.is_all_plane()) { - Object obj = plane_half_plane_proj_intersection(h2, - h1, - s1.line(), - k); - if(obj.is_empty()) + auto obj = plane_half_plane_proj_intersection(h2, + h1, + s1.line(), + k); + if(obj == std::nullopt) return o; - Line_2 line; - if(assign(line, obj)) + if(const Line_2* line = std::get_if(&(*obj))) { - *o++ = make_object(Intersection_curve(line, 1)); + *o++ = Intersection_curve(*line, 1); return o; } - Ray_2 ray; - if(assign(ray, obj)) + if(const Ray_2* ray = std::get_if(&(*obj))) { - *o++ = make_object(Intersection_curve(ray, 1)); + *o++ = Intersection_curve(*ray, 1); return o; } return o; - } CGAL_assertion(!s2.is_all_plane() && !s2.is_all_plane()); - Object obj = + auto obj = half_plane_half_plane_proj_intersection(h1, s1.line(), h2, s2.line(), k); - if(obj.is_empty()) + if(obj ==std::nullopt ) return o; - Line_2 line; - if(assign(line, obj)) + + if(const Line_2* line = std::get_if(&(*obj))) { - *o++ = make_object(Intersection_curve(line, 1)); + *o++ = Intersection_curve(*line, 1); return o; } - Ray_2 ray; - if(assign(ray, obj)) + if(const Ray_2* ray = std::get_if(&(*obj))) { - *o++ = make_object(Intersection_curve(ray, 1)); + *o++ = Intersection_curve(*ray, 1); return o; } - Segment_2 seg; - if(assign(seg, obj)) + if(const Segment_2* seg = std::get_if(&(*obj))) { - *o++ = make_object(Intersection_curve(seg, 1)); + *o++ = Intersection_curve(*seg, 1); return o; } - Point_2 p; - if(assign(p, obj)) + if(const Point_2* p = std::get_if(&(*obj))) { - *o++ = make_object(p); + *o++ = *p; return o; } return o; diff --git a/Envelope_3/include/CGAL/Env_sphere_traits_3.h b/Envelope_3/include/CGAL/Env_sphere_traits_3.h index 9dcfa59fe5c..bec2a5b72a9 100644 --- a/Envelope_3/include/CGAL/Env_sphere_traits_3.h +++ b/Envelope_3/include/CGAL/Env_sphere_traits_3.h @@ -18,7 +18,6 @@ #include -#include #include #include #include @@ -109,28 +108,28 @@ public: Rat_point_2 proj_center = parent.project(s.center()); Rat_circle_2 circ(proj_center, s.squared_radius()); Curve_2 curve = gt_2->construct_curve_2_object()(circ); - Object objs[2]; - CGAL_assertion_code(Object *p = ) + typedef std::variant Variant; + Variant objs[2]; + + CGAL_assertion_code(Variant* p = ) parent.make_x_monotone_2_object()(curve, objs); CGAL_assertion(p == objs + 2); - X_monotone_curve_2 cv1, cv2; + const X_monotone_curve_2* cv1 = std::get_if(&(objs[0])); + const X_monotone_curve_2* cv2 = std::get_if(&(objs[1])); - CGAL_assertion(assign(cv1, objs[0])); - CGAL_assertion(assign(cv2, objs[1])); + CGAL_assertion(cv1!=nullptr); + CGAL_assertion(cv2!=nullptr); - assign(cv1, objs[0]); - assign(cv2, objs[1]); - - if (cv1.is_lower()) { - CGAL_assertion(cv2.is_upper()); - *o++ = make_object(std::make_pair(cv1, ON_POSITIVE_SIDE)); - *o++ = make_object(std::make_pair(cv2, ON_NEGATIVE_SIDE)); + if (cv1->is_lower()) { + CGAL_assertion(cv2->is_upper()); + *o++ = std::make_pair(*cv1, ON_POSITIVE_SIDE); + *o++ = std::make_pair(*cv2, ON_NEGATIVE_SIDE); } else { - CGAL_assertion(cv2.is_lower()); - *o++ = make_object(std::make_pair(cv1, ON_NEGATIVE_SIDE)); - *o++ = make_object(std::make_pair(cv2, ON_POSITIVE_SIDE)); + CGAL_assertion(cv2->is_lower()); + *o++ = std::make_pair(*cv1, ON_NEGATIVE_SIDE); + *o++ = std::make_pair(*cv2, ON_POSITIVE_SIDE); } return o; @@ -237,7 +236,7 @@ public: if (n_ys == 1) { // intersection is a point Point_2 inter_point(xs , ys[0]); - *o++ = make_object(inter_point); + *o++ = inter_point; return o; } @@ -254,7 +253,7 @@ public: Curve_2 res = ctr_cv(0, 0, 0, 2*a_diff, 0, -m, COLLINEAR, end1, end2); parent.add_curve_to_output(res, o); - //*o++ = make_object(Intersection_curve(res, TRANSVERSAL)); + //*o++ = Intersection_curve(res, TRANSVERSAL); } else { // here we have c1 == c2, b1 != b2. @@ -308,7 +307,7 @@ public: if (n_xs == 1) { // intersection is a point Point_2 inter_point(xs[0], (-2*a_diff*xs[0] + m)/(2*b_diff) ); - *o++ = make_object(inter_point); + *o++ = inter_point; return o; } @@ -328,7 +327,7 @@ public: Curve_2 res = ctr_cv(0,0,0, 2*a_diff, 2*b_diff, -m, COLLINEAR, end1, end2); parent.add_curve_to_output(res, o); - //*o++ = make_object(Intersection_curve(res, TRANSVERSAL)); + //*o++ = Intersection_curve(res, TRANSVERSAL); } } // now the potential intersection is (a part of) a circle, @@ -439,7 +438,7 @@ public: // should check if the point is in the non-negative side of the // line if (CGAL_NTS sign(la*px + lb*py +lc) != NEGATIVE) - *o++ = make_object(Point_2(px, py)); + *o++ = Point_2(px, py); return o; } @@ -460,7 +459,7 @@ public: if (sign_lc != NEGATIVE) { Curve_2 res = ctr_cv(R, S, T, U, V, W); parent.add_curve_to_output(res, o); - //*o++ = make_object(Intersection_curve(res, TRANSVERSAL)); + //*o++ = Intersection_curve(res, TRANSVERSAL); } return o; } @@ -609,13 +608,13 @@ public: if (lval_sign == POSITIVE) { // the full ellipse is in the positive side parent.add_curve_to_output(inter_cv, o); - //*o++ = make_object(Intersection_curve(inter_cv, TRANSVERSAL)); + //*o++ = Intersection_curve(inter_cv, TRANSVERSAL); return o; } else if (lval_sign == NEGATIVE) { // the full ellipse is in the negative side, except maybe the point // source in the case n_inter_points = 1 (which lies on the line) - if (n_inter_points == 1) *o++ = make_object(Point_2(source)); + if (n_inter_points == 1) *o++ = Point_2(source); return o; } @@ -630,8 +629,8 @@ public: CGAL_assertion(lval_sign != ZERO); if (lval_sign == POSITIVE) parent.add_curve_to_output(inter_cv, o); - //*o++ = make_object(Intersection_curve(inter_cv, TRANSVERSAL)); - else *o++ = make_object(Point_2(source)); + //*o++ = Intersection_curve(inter_cv, TRANSVERSAL); + else *o++ = Point_2(source); return o; } @@ -651,7 +650,7 @@ public: Curve_2 res = ctr_cv(R, S, T, U, V, W, orient, source, target); CGAL_assertion(res.is_valid()); parent.add_curve_to_output(res, o); - //*o++ = make_object(Intersection_curve(res, TRANSVERSAL)); + //*o++ = Intersection_curve(res, TRANSVERSAL); } return o; @@ -1118,16 +1117,16 @@ public: template OutputIterator add_curve_to_output(const Curve_2& c, OutputIterator oi) const { - Object objs[2]; - Object* p_obj = this->make_x_monotone_2_object()(c, objs); - for(Object* o = objs; o != p_obj; ++o) { - X_monotone_curve_2 cv; - if(assign(cv, *o)) *oi++ = make_object(Intersection_curve(cv, 1)); + std::variant objs[2]; + + std::variant* p_obj = this->make_x_monotone_2_object()(c, objs); + for(std::variant* o = objs; o != p_obj; ++o) { + if(const X_monotone_curve_2* cv = std::get_if(o)) + *oi++ = Intersection_curve(*cv, 1); else { - Point_2 pt; - CGAL_assertion(assign(pt, *o)); - assign(pt, *o); - *oi++ = make_object(pt); + const Point_2* pt = std::get_if(o); + CGAL_assertion(pt!=nullptr); + *oi++ = *pt; } } return oi; diff --git a/Envelope_3/include/CGAL/Env_tracing_traits_3.h b/Envelope_3/include/CGAL/Env_tracing_traits_3.h index 06171831a1a..471299a7484 100644 --- a/Envelope_3/include/CGAL/Env_tracing_traits_3.h +++ b/Envelope_3/include/CGAL/Env_tracing_traits_3.h @@ -194,14 +194,15 @@ public: Base base; std::cerr << "Construct_projected_boundary_2: JUST FIRST" << std::endl; std::cerr << "Surface: " << s << std::endl; - std::list l; + // TODO UPDATE CONCEPT + CHANGES.md + std::list< std::variant, Point_2 > > l; base.construct_projected_boundary_2_object() (s, std::back_inserter(l)); if (l.size() > 0) { - std::pair i; - if (CGAL::assign(i, l.front())) - std::cerr << "First: " << i.first << std::endl; + if (const std::pair* i = + std::get_if>(&l.front())) + std::cerr << "First: " << i->first << std::endl; else std::cerr << "First intersection is a point" << std::endl; } @@ -232,15 +233,14 @@ public: << std::endl; std::cerr << "Surface1: " << s1 << std::endl; std::cerr << "Surface2: " << s2 << std::endl; - std::list l; + std::list< std::variant > l; base.construct_projected_intersections_2_object() (s1, s2, std::back_inserter(l)); if (l.size() > 0) { - Intersection_curve i; - if (CGAL::assign(i, l.front())) - std::cerr << "First: " << i.first << std::endl; + if (const Intersection_curve* i = std::get_if(&l.front())) + std::cerr << "First: " << i->first << std::endl; else std::cerr << "First intersection is not a point" << std::endl; } diff --git a/Envelope_3/include/CGAL/Env_triangle_traits_3.h b/Envelope_3/include/CGAL/Env_triangle_traits_3.h index 3587d922415..00ccc69e8fa 100644 --- a/Envelope_3/include/CGAL/Env_triangle_traits_3.h +++ b/Envelope_3/include/CGAL/Env_triangle_traits_3.h @@ -20,8 +20,6 @@ #include - -#include #include #include #include @@ -546,9 +544,9 @@ public: s2 != ON_ORIENTED_BOUNDARY && s3 != ON_ORIENTED_BOUNDARY); - *o++ = make_object(std::make_pair(A, s1)); - *o++ = make_object(std::make_pair(B, s2)); - *o++ = make_object(std::make_pair(C, s3)); + *o++ = std::make_pair(A, s1); + *o++ = std::make_pair(B, s2); + *o++ = std::make_pair(C, s3); } else { @@ -561,8 +559,8 @@ public: b2 = parent->project(a2); CGAL_assertion(b1 != b2); - *o++ = make_object(std::make_pair(X_monotone_curve_2(b1, b2), - ON_ORIENTED_BOUNDARY)); + *o++ = std::make_pair(X_monotone_curve_2(b1, b2), + ON_ORIENTED_BOUNDARY); } return o; } @@ -611,32 +609,30 @@ public: return o; } - Object inter_obj = parent->intersection(s1,s2); - if (inter_obj.is_empty()) + std::optional> inter_obj + = parent->intersection(s1,s2); + if (inter_obj == std::nullopt) { return o; } - Point_3 point; - Segment_3 curve; - if (k.assign_3_object()(point, inter_obj)) - *o++ = make_object(parent->project(point)); + if (const Point_3* point = std::get_if(&(*inter_obj))) + *o++ = parent->project(*point); else { - CGAL_assertion_code(bool b = ) - k.assign_3_object()(curve, inter_obj); - CGAL_assertion(b); + const Segment_3* curve = std::get_if(&(*inter_obj)); + CGAL_assertion(curve != nullptr); - Segment_2 proj_seg = parent->project(curve); + Segment_2 proj_seg = parent->project(*curve); if (! k.is_degenerate_2_object() (proj_seg)) { Intersection_curve inter_cv (proj_seg, 1); - *o++ = make_object(inter_cv); + *o++ = inter_cv; } else { const Point_2& p = k.construct_point_on_2_object() (proj_seg, 0); - *o++ = make_object(p); + *o++ = p; } } @@ -1044,8 +1040,9 @@ public: // intersect two xy-monotone surfaces (3D-triangles or segments) // if the triangles overlap, the result is empty // the result can be a segment or a point - Object intersection(const Xy_monotone_surface_3& s1, - const Xy_monotone_surface_3& s2) const + std::optional< std::variant> + intersection(const Xy_monotone_surface_3& s1, + const Xy_monotone_surface_3& s2) const { CGAL_precondition(s1.is_xy_monotone()); CGAL_precondition(s2.is_xy_monotone()); @@ -1054,14 +1051,13 @@ public: // first, try to intersect the bounding boxes of the triangles, // efficiently return empty object when the triangles are faraway if (!CGAL::do_overlap(s1.bbox(), s2.bbox())) - return Object(); + return std::nullopt; // if intersecting two segment - alculate the intersection // as in the case of dimension 2 if (s1.is_segment() && s2.is_segment()) { - Object res = intersection_of_segments(s1, s2); - return res; + return intersection_of_segments(s1, s2); } // if both triangles lie on the same (non-vertical) plane, they overlap @@ -1070,96 +1066,92 @@ public: Plane_3 p1 = s1.plane(); Plane_3 p2 = s2.plane(); if (p1 == p2 || p1 == p2.opposite()) - return Object(); + return std::nullopt; // calculate intersection between a triangle and the other triangle's // supporting plane // if there is no intersection - then the triangles have no intersection // between them. - Object inter_obj = intersection(p1, s2); + auto inter_obj = intersection(p1, s2); - if (inter_obj.is_empty()) - return Object(); + if (inter_obj == std::nullopt) + return std::nullopt; // otherwise, if the intersection in a point, we should check if it lies // inside the first triangle - Assign_3 assign_obj = k.assign_3_object(); - Point_3 inter_point; - if (assign_obj(inter_point, inter_obj)) + if (const Point_3* inter_point = std::get_if(&(*inter_obj))) { - Object res = intersection_on_plane_3(p1, s1, inter_point); - return res; + std::optional res = intersection_on_plane_3(p1, s1, *inter_point); + if (res != std::nullopt) + return res.value(); } else { // if the intersection is a segment, we check the intersection of the // other plane-triangle pair - Segment_3 inter_seg; - CGAL_assertion(assign_obj(inter_seg, inter_obj)); - assign_obj(inter_seg, inter_obj); + const Segment_3* inter_seg = std::get_if(&(*inter_obj)); + CGAL_assertion(inter_seg != nullptr); - inter_obj = intersection(p2, s1); + auto inter_obj2 = intersection(p2, s1); // if there is no intersection - then the triangles have no intersection // between them. - if (inter_obj.is_empty()) - return Object(); + if (inter_obj2 == std::nullopt) + return std::nullopt; - if (assign_obj(inter_point, inter_obj)) + if (const Point_3* inter_point = std::get_if(&(*inter_obj2))) { - // if the intersection is a point, which lies on the segment, - // than it is the result, - // otherwise, empty result - if (k.has_on_3_object()(inter_seg, inter_point)) - return make_object(inter_point); - else - return Object(); + // if the intersection is a point, which lies on the segment, + // than it is the result, + // otherwise, empty result + if (k.has_on_3_object()(*inter_seg, *inter_point)) + return *inter_point; + else + return std::nullopt; } else { - // both plane-triangle intersections are segments, which are collinear, - // and lie on the line which is the intersection of the two supporting - // planes - Segment_3 inter_seg2; - CGAL_assertion(assign_obj(inter_seg2, inter_obj)); - assign_obj(inter_seg2, inter_obj); + // both plane-triangle intersections are segments, which are collinear, + // and lie on the line which is the intersection of the two supporting + // planes + const Segment_3* inter_seg2 = std::get_if(&(*inter_obj)); + CGAL_assertion(inter_seg2 != nullptr); - Point_3 min1 = k.construct_min_vertex_3_object()(inter_seg), - max1 = k.construct_max_vertex_3_object()(inter_seg); - Point_3 min2 = k.construct_min_vertex_3_object()(inter_seg2), - max2 = k.construct_max_vertex_3_object()(inter_seg2); + Point_3 min1 = k.construct_min_vertex_3_object()(*inter_seg), + max1 = k.construct_max_vertex_3_object()(*inter_seg); + Point_3 min2 = k.construct_min_vertex_3_object()(*inter_seg2), + max2 = k.construct_max_vertex_3_object()(*inter_seg2); - CGAL_assertion((k.collinear_3_object()(min1, min2, max1) && + CGAL_assertion((k.collinear_3_object()(min1, min2, max1) && k.collinear_3_object()(min1, max2, max1))); - // we need to find the overlapping part, if exists - Point_3 min, max; - if (k.less_xyz_3_object()(min1, min2)) - min = min2; - else - min = min1; - if (k.less_xyz_3_object()(max1, max2)) - max = max1; - else - max = max2; + // we need to find the overlapping part, if exists + Point_3 min, max; + if (k.less_xyz_3_object()(min1, min2)) + min = min2; + else + min = min1; + if (k.less_xyz_3_object()(max1, max2)) + max = max1; + else + max = max2; - Object res; - Comparison_result comp_res = k.compare_xyz_3_object()(min, max); - if (comp_res == EQUAL) - res = make_object(min); - else if (comp_res == SMALLER) - res = make_object(Segment_3(min, max)); - // else - empty result - - return res; + Comparison_result comp_res = k.compare_xyz_3_object()(min, max); + if (comp_res == EQUAL) + return min; + else if (comp_res == SMALLER) + return Segment_3(min, max); + // else - empty result } } + return std::nullopt; } // calculate intersection between triangle & point on the same plane plane - Object intersection_on_plane_3(const Plane_3& plane, - const Xy_monotone_surface_3& triangle, - const Point_3& point) const + std::optional + intersection_on_plane_3(const Plane_3& plane, + const Xy_monotone_surface_3& triangle, + const Point_3& point) const { Kernel k; CGAL_precondition( triangle.is_xy_monotone() ); @@ -1177,14 +1169,15 @@ public: else has_on = k.has_on_3_object()(static_cast(triangle), point); if (has_on) - return make_object(point); + return point; else - return Object(); + return std::nullopt; } // calculate intersection between 2 segments on the same vertical plane plane - Object intersection_of_segments(const Xy_monotone_surface_3& s1, - const Xy_monotone_surface_3& s2) const + std::optional< std::variant> + intersection_of_segments(const Xy_monotone_surface_3& s1, + const Xy_monotone_surface_3& s2) const { Kernel k; CGAL_precondition( s1.is_xy_monotone() && s1.is_segment()); @@ -1193,14 +1186,14 @@ public: // if the segments are not coplanar, they cannot intersect if (!k.coplanar_3_object()(s1.vertex(0), s1.vertex(1), s2.vertex(0), s2.vertex(1))) - return Object(); + return std::nullopt; const Plane_3& plane = s1.plane(); if (s2.plane() != plane && s2.plane() != plane.opposite()) // todo: this case is not needed in the algorithm, // so we don't implement it - return Object(); + return std::nullopt; CGAL_precondition( !k.is_degenerate_3_object()(plane) ); CGAL_precondition( s2.plane() == plane || @@ -1212,30 +1205,24 @@ public: v2 = plane.to_2d(s1.vertex(1)); Segment_2 seg1_t(v1, v2); - Point_2 u1 = plane.to_2d(s2.vertex(0)), + Point_2 u1 = plane.to_2d(s2.vertex(0)), u2 = plane.to_2d(s2.vertex(1)); - Segment_2 seg2_t(u1, u2); + Segment_2 seg2_t(u1, u2); - Object inter_obj = k.intersect_2_object()(seg1_t, seg2_t); - Assign_2 assign_2 = k.assign_2_object(); - if (inter_obj.is_empty()) - return inter_obj; + auto inter_obj = k.intersect_2_object()(seg1_t, seg2_t); + if (inter_obj == std::nullopt) + return std::nullopt; - Point_2 inter_point; - Segment_2 inter_segment; - - if (assign_2(inter_point, inter_obj)) - return make_object(plane.to_3d(inter_point)); + if (const Point_2* inter_point = std::get_if(&(*inter_obj))) + return plane.to_3d(*inter_point); else { - CGAL_assertion_code(bool b = ) - assign_2(inter_segment, inter_obj); - CGAL_assertion(b); + const Segment_2* inter_segment = std::get_if(&(*inter_obj)); + CGAL_assertion(inter_segment!=nullptr); - return make_object - (Segment_3 - (plane.to_3d(k.construct_vertex_2_object()(inter_segment, 0)), - plane.to_3d(k.construct_vertex_2_object()(inter_segment, 1)))); + return Segment_3 + (plane.to_3d(k.construct_vertex_2_object()(*inter_segment, 0)), + plane.to_3d(k.construct_vertex_2_object()(*inter_segment, 1))); } } @@ -1244,8 +1231,9 @@ public: // and a (non degenerate) plane in 3d // the result object can be empty, a point, a segment or the original // triangle - Object intersection(const Plane_3& pl, - const Xy_monotone_surface_3& tri) const + std::optional> + intersection(const Plane_3& pl, + const Xy_monotone_surface_3& tri) const { Kernel k; CGAL_precondition( tri.is_xy_monotone() ); @@ -1278,24 +1266,23 @@ public: points_on_plane[n_points_on_plane++] = i; } - CGAL_assertion(n_points_on_plane + - n_points_on_positive + n_points_on_negative == 3); + CGAL_assertion(n_points_on_plane + n_points_on_positive + n_points_on_negative == 3); // if all vertices of tri lie on the same size (positive/negative) of pl, // there is no intersection if (n_points_on_positive == 3 || n_points_on_negative == 3) - return Object(); + return std::nullopt; // if all vertices of tri lie on pl then we return tri if (n_points_on_plane == 3) - return make_object(tri); + return tri; // if 2 vertices lie on pl, then return the segment between them if (n_points_on_plane == 2) { int point_idx1 = points_on_plane[0], point_idx2 = points_on_plane[1]; - return make_object (Segment_3(tri.vertex(point_idx1), - tri.vertex(point_idx2))); + return Segment_3(tri.vertex(point_idx1), + tri.vertex(point_idx2)); } // if only 1 lie on pl, should check the segment opposite to it on tri @@ -1306,7 +1293,7 @@ public: // if the other 2 vertices are on the same side of pl, // then the answer is just this vertex if (n_points_on_negative == 2 || n_points_on_positive == 2) - return make_object(tri.vertex(point_on_plane_idx)); + return tri.vertex(point_on_plane_idx); // now it is known that one vertex is on pl, and the segment of tri // opposite to it should intersect pl @@ -1315,15 +1302,14 @@ public: Segment_3 tri_segment(tri.vertex(point_on_plane_idx+1), tri.vertex(point_on_plane_idx+2)); - Object inter_result = k.intersect_3_object()(pl, tri_segment); - Point_3 inter_point; - CGAL_assertion( k.assign_3_object()(inter_point, inter_result) ); - k.assign_3_object()(inter_point, inter_result); + auto inter_result = k.intersect_3_object()(pl, tri_segment); + const Point_3* inter_point = std::get_if(&(*inter_result)); + CGAL_assertion( inter_point != nullptr ); // create the resulting segment // (between tri[point_on_plane_idx] and inter_point) - return make_object(Segment_3(tri.vertex(point_on_plane_idx), - inter_point)); + return Segment_3(tri.vertex(point_on_plane_idx), + *inter_point); } @@ -1341,16 +1327,14 @@ public: { Segment_3 seg(tri.vertex(points_on_positive[pos_it]), tri.vertex(points_on_negative[neg_it])); - Object inter_result = k.intersect_3_object()(pl, seg); - Point_3 inter_point; - // the result of the intersection must be a point - CGAL_assertion( k.assign_3_object()(inter_point, inter_result) ); - k.assign_3_object()(inter_point, inter_result); - inter_points[n_inter_points++] = inter_point; + auto inter_result = k.intersect_3_object()(pl, seg); + const Point_3* inter_point = std::get_if(&(*inter_result)); + CGAL_assertion( inter_point != nullptr ); + inter_points[n_inter_points++] = *inter_point; } CGAL_assertion( n_inter_points == 2 ); - return make_object(Segment_3(inter_points[0], inter_points[1])); + return Segment_3(inter_points[0], inter_points[1]); } // compare the value of s1 in p1 to the value of s2 in p2 @@ -1394,13 +1378,12 @@ public: Line_3 vl = k.construct_line_3_object() (point, dir); const Plane_3& plane = s.plane(); - Object res = k.intersect_3_object()(plane, vl); - CGAL_assertion(!res.is_empty()); - Point_3 ip; - CGAL_assertion(k.assign_3_object()(ip, res)); - k.assign_3_object()(ip, res); + auto res = k.intersect_3_object()(plane, vl); + CGAL_assertion(res != std::nullopt); + const Point_3* ip = std::get_if(&(*res)); + CGAL_assertion(ip != nullptr); - return ip; + return *ip; } } @@ -1438,12 +1421,10 @@ public: Line_2 l(tvl_point1, tvl_point2); Segment_2 seg(t1, t2); - Object inter_obj = k.intersect_2_object()(seg, l); - Point_2 inter_point; - CGAL_assertion_code(bool is_inter_point =) - k.assign_2_object()(inter_point, inter_obj); - CGAL_assertion(is_inter_point); - return plane.to_3d(inter_point); + auto inter_obj = k.intersect_2_object()(seg, l); + const Point_2* inter_point = std::get_if(&(*inter_obj)); + CGAL_assertion(inter_point != nullptr); + return plane.to_3d(*inter_point); } Point_2 construct_middle_point(const Point_2& p1, const Point_2& p2) const @@ -1495,14 +1476,11 @@ public: typename Kernel::Line_2 vl = k.construct_line_2_object() (pt, dir); // Compute the intersetion between the vertical line and the given curve. - Object res = k.intersect_2_object()(seg, vl); - Point_2 ip; - bool ray_shoot_successful = k.assign_2_object()(ip, res); + auto res = k.intersect_2_object()(seg, vl); + const Point_2* ip = std::get_if(&(*res)); + CGAL_assertion (ip != nullptr); - if (! ray_shoot_successful) - CGAL_assertion (ray_shoot_successful); - - return (ip); + return *ip; } }; diff --git a/Envelope_3/include/CGAL/Envelope_3/Env_plane_traits_3_functions.h b/Envelope_3/include/CGAL/Envelope_3/Env_plane_traits_3_functions.h index e0caf43d5cd..8ca94fb2049 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Env_plane_traits_3_functions.h +++ b/Envelope_3/include/CGAL/Envelope_3/Env_plane_traits_3_functions.h @@ -16,65 +16,62 @@ #include -#include #include namespace CGAL { template -Object plane_half_plane_proj_intersection(const typename K::Plane_3 &h1, - const typename K::Plane_3 &h2, - const typename K::Line_2 &l, - const K& k) +std::optional< std::variant > +plane_half_plane_proj_intersection(const typename K::Plane_3 &h1, + const typename K::Plane_3 &h2, + const typename K::Line_2 &l, + const K& k) { typedef typename K::Line_3 Line_3; typedef typename K::Line_2 Line_2; typedef typename K::Plane_3 Plane_3; // intersect the two planes - Object h_obj = k.intersect_3_object()(h1, h2); - if(h_obj.is_empty()) - return Object(); // no intersection at all (parallel planes) + auto h_obj = k.intersect_3_object()(h1, h2); + if(h_obj == std::nullopt) + return std::nullopt; // no intersection at all (parallel planes) Plane_3 p; - if(assign(p, h_obj)) - return Object(); + if(std::get_if(&(*h_obj))==nullptr) + return std::nullopt; // if two planes are not parallel they must intersect at a 3D line - Line_3 l3; - CGAL_assertion_code(bool b =) - assign(l3, h_obj); - CGAL_assertion(b); + const Line_3* l3 = std::get_if(&(*h_obj)); + CGAL_assertion(l3!=nullptr); - const Line_2& proj_inter_line = project_xy(l3, k); + const Line_2& proj_inter_line = project_xy(*l3, k); - return line_under_linear_constraint(proj_inter_line, l, k); + return line_under_linear_constraint(proj_inter_line, l, k); //LR } template -Object half_plane_half_plane_proj_intersection(const typename K::Plane_3 &h1, - const typename K::Line_2 &l1, - const typename K::Plane_3 &h2, - const typename K::Line_2 &l2, - const K& k) +std::optional< std::variant > +half_plane_half_plane_proj_intersection(const typename K::Plane_3 &h1, + const typename K::Line_2 &l1, + const typename K::Plane_3 &h2, + const typename K::Line_2 &l2, + const K& k) { typedef typename K::Ray_2 Ray_2; typedef typename K::Line_2 Line_2; - Object obj = plane_half_plane_proj_intersection(h1, h2, l2, k); - if(obj.is_empty()) - return Object(); + auto obj = plane_half_plane_proj_intersection(h1, h2, l2, k); + if(obj == std::nullopt) + return std::nullopt; - Line_2 l; - if(assign(l, obj)) - return line_under_linear_constraint(l, l1, k); + if(const Line_2* line = std::get_if(&(*obj))) + return line_under_linear_constraint(*line, l1, k); - Ray_2 ray; - if(assign(ray, obj)) - return ray_under_linear_constraint(ray, l1, k); + if(const Ray_2* ray = std::get_if(&(*obj))) + return ray_under_linear_constraint(*ray, l1, k); CGAL_error(); // doesn't suppose to reach here - return Object(); + return std::nullopt; } template @@ -97,96 +94,91 @@ typename K::Line_2 project_xy(const typename K::Line_3& l, // l1 is a line, l2 is a linear constraint (determined by the direction // of the line). template -Object line_under_linear_constraint(const typename K::Line_2& l1, - const typename K::Line_2& l2, - const K& k) +std::optional< std::variant > +line_under_linear_constraint(const typename K::Line_2& l1, + const typename K::Line_2& l2, + const K& k) { typedef typename K::Ray_2 Ray_2; - typedef typename K::Line_2 Line_2; typedef typename K::Vector_2 Vector_2; typedef typename K::Point_2 Point_2; - Object obj = k.intersect_2_object()(l1, l2); - Point_2 p; - if(assign(p, obj)) - { - const Vector_2& vec = k.construct_vector_2_object()(l1); - const Point_2& s = k.construct_translated_point_2_object()(p, vec); - const Ray_2& ray = k.construct_ray_2_object()(p, s); - Oriented_side side = k.oriented_side_2_object()(l2, s); - if(side == ON_NEGATIVE_SIDE) - { - return make_object(k.construct_opposite_ray_2_object()(ray)); - } + auto obj = k.intersect_2_object()(l1, l2); - CGAL_assertion(side == ON_POSITIVE_SIDE); //the two lines are not parallel - return make_object(ray); - } - - if(obj.is_empty()) // the two lines are parallel + if(obj == std::nullopt)// the two lines are parallel { const Point_2& s = k.construct_point_on_2_object()(l1, 0); Oriented_side side = k.oriented_side_2_object()(l2, s); if(side == ON_NEGATIVE_SIDE) - return Object(); + return std::nullopt; CGAL_assertion(side == ON_POSITIVE_SIDE); // the two lines are parallel - return make_object(l1); + return l1; + } + + if(const Point_2* p = std::get_if(&(*obj))) + { + const Vector_2& vec = k.construct_vector_2_object()(l1); + const Point_2& s = k.construct_translated_point_2_object()(*p, vec); + const Ray_2& ray = k.construct_ray_2_object()(*p, s); + Oriented_side side = k.oriented_side_2_object()(l2, s); + if(side == ON_NEGATIVE_SIDE) + { + return k.construct_opposite_ray_2_object()(ray); + } + + CGAL_assertion(side == ON_POSITIVE_SIDE); //the two lines are not parallel + return ray; } // the two lines overlap - CGAL_USE_TYPE(Line_2); - CGAL_assertion_code(Line_2 dummy;); - CGAL_assertion_code(bool b = assign(dummy, obj);); - CGAL_assertion(b); - - return make_object(l1); + return l1; } template -Object ray_under_linear_constraint(const typename K::Ray_2& ray, - const typename K::Line_2& l, - const K& k) +std::optional< std::variant > +ray_under_linear_constraint(const typename K::Ray_2& ray, + const typename K::Line_2& l, + const K& k) { typedef typename K::Vector_2 Vector_2; typedef typename K::Point_2 Point_2; const Point_2& s = k.construct_point_on_2_object()(ray, 0); Oriented_side side = k.oriented_side_2_object()(l, s); - Object obj = k.intersect_2_object()(ray, l); - if(obj.is_empty()) + auto obj = k.intersect_2_object()(ray, l); + if(obj == std::nullopt) { if(side == ON_NEGATIVE_SIDE) - return Object(); + return std::nullopt; CGAL_assertion(side == ON_POSITIVE_SIDE); - return make_object(ray); + return ray; } - Point_2 p; - if(assign(p, obj)) + if(const Point_2* p = std::get_if(&(*obj))) { if(side == ON_POSITIVE_SIDE) - return make_object(k.construct_segment_2_object()(s, p)); + return k.construct_segment_2_object()(s, *p); Vector_2 vec = k.construct_vector_2_object()(ray); if(side == ON_NEGATIVE_SIDE) - return make_object(k.construct_ray_2_object()(p, vec)); + return k.construct_ray_2_object()(*p, vec); CGAL_assertion(side == ON_ORIENTED_BOUNDARY); const Vector_2& vec_of_l = k.construct_vector_2_object()(l); Orientation orient = k.orientation_2_object()(vec_of_l, vec); if(orient == LEFT_TURN) - return make_object(ray); + return ray; CGAL_assertion(orient == RIGHT_TURN); - return make_object(s); + return s; } // the ray and the line overlap - return make_object(ray); + return ray; } diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h index 35b172c6233..a15422a19d2 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -307,9 +306,8 @@ protected: void deal_with_one_surface(Xy_monotone_surface_3& surf, Minimization_diagram_2& result) { - typedef std::list Boundary_list; typedef std::pair Boundary_xcurve; - typedef Boundary_list::iterator Boundary_iterator; + typedef std::list> Boundary_list; Boundary_list boundary; m_geom_traits-> @@ -325,17 +323,15 @@ protected: return; } - for (Boundary_iterator boundary_it = boundary.begin(); + for (auto boundary_it = boundary.begin(); boundary_it != boundary.end(); ++boundary_it) { - const Object& obj = *boundary_it; - Boundary_xcurve boundary_cv; - if (assign(boundary_cv, obj)) + if (const Boundary_xcurve* boundary_cv = std::get_if(&(*boundary_it))) { - Oriented_side side = boundary_cv.second; + Oriented_side side = boundary_cv->second; Halfedge_handle he = - insert_non_intersecting_curve(result, boundary_cv.first); + insert_non_intersecting_curve(result, boundary_cv->first); if (side == ON_ORIENTED_BOUNDARY) { @@ -408,10 +404,9 @@ protected: else { // the xy-surface is an isolated point - Point_2 p; - CGAL_assertion(assign(p, obj)); - assign(p, obj); - insert_point(result, p); + const Point_2* p = std::get_if(&(*boundary_it)); + CGAL_assertion(p!=nullptr); + insert_point(result, *p); } } diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h index 0376a0c1119..e5184ba9a2a 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h @@ -131,7 +131,8 @@ protected: Vertices_to_edges_map; typedef std::pair Intersection_curve; - typedef std::list Intersections_list; + typedef std::list> Intersections_list; // this is used in the resolve edge process typedef Triple Point_2_with_info; @@ -199,7 +200,8 @@ public: // find the projected intersections of the surfaces. if none - we have // a simple case: // need only resolve non-intersecting and return - std::list inter_objs; + std::list> inter_objs; + get_projected_intersections(surf1, surf2, std::back_inserter(inter_objs)); if (inter_objs.size() == 0) @@ -243,11 +245,6 @@ public: map_copied_to_orig_faces[copied_face] = face; - // insert the projected intersections into the temporary minimization diagram - Point_2 point; - Intersection_curve curve; - Object cur_obj; - // we use our zone visitor, which only inserts into the arrangement the // points and curves which are inside the copied face // it updates the result arrangement at the same time (action after action @@ -287,12 +284,10 @@ public: this); Md_point_location pl(copied_face_arr); - std::list::iterator inter_objs_it = inter_objs.begin(); - for (; inter_objs_it != inter_objs.end(); ++inter_objs_it) + for (auto inter_objs_it = inter_objs.begin(); + inter_objs_it != inter_objs.end(); ++inter_objs_it) { - cur_obj = *inter_objs_it; - CGAL_assertion(!cur_obj.is_empty()); - if (assign(point, cur_obj)) + if (const Point_2* point = std::get_if(&(*inter_objs_it))) { // intersection can be a point when the surfaces only touch each other. // we are only interested in the points that are inside the face or @@ -302,12 +297,12 @@ public: // should use observer for split_edge // if not in a sub-face of "face", shouldn't insert it // the above information is available in zone_visitor - insert_point(copied_face_arr, point, pl, zone_visitor); + insert_point(copied_face_arr, *point, pl, zone_visitor); } - else if (assign(curve, cur_obj)) + else if (const Intersection_curve* curve = std::get_if(&(*inter_objs_it))) { - zone_visitor.set_current_intersection_type(curve.second); - insert(copied_face_arr, curve.first, pl, zone_visitor); + zone_visitor.set_current_intersection_type(curve->second); + insert(copied_face_arr, curve->first, pl, zone_visitor); CGAL_assertion(copied_face_arr.is_valid()); CGAL_assertion(result.is_valid()); } @@ -485,7 +480,7 @@ public: const Xy_monotone_surface_3& surf2 = get_aux_surface(edge, 1); // find the projected intersections - std::list inter_objs; + std::list> inter_objs; get_projected_intersections(surf1, surf2, std::back_inserter(inter_objs)); if (inter_objs.size() == 0) @@ -522,48 +517,38 @@ public: bool is_min_end_at_inf = false; bool is_max_end_at_inf = false; - Point_2 point; - Intersection_curve icurve; - Object cur_obj; - - std::list::iterator inter_objs_it = inter_objs.begin(); - for (; inter_objs_it != inter_objs.end(); ++inter_objs_it) + for (auto inter_objs_it = inter_objs.begin(); + inter_objs_it != inter_objs.end(); ++inter_objs_it) { - cur_obj = *inter_objs_it; - CGAL_assertion(!cur_obj.is_empty()); - if (assign(point, cur_obj)) + if (const Point_2* point = std::get_if(&(*inter_objs_it))) { // if the point is on the curve, should add it the split points // list, otherwise, it is irrelevant and should be ignored - if (is_point_on_curve(point, original_cv)) - split_points.push_back(Point_2_with_info(point, false, false)); + if (is_point_on_curve(*point, original_cv)) + split_points.push_back(Point_2_with_info(*point, false, false)); } - else if (assign(icurve, cur_obj)) + else if (const Intersection_curve* icurve = std::get_if(&(*inter_objs_it))) { - const X_monotone_curve_2& x_curve = icurve.first; + const X_monotone_curve_2& x_curve = icurve->first; // find the intersection points and overlapping segments with the // original curve and insert them to the list of split points // intersect the x-monotone curve with the edge's curve typedef std::pair Intersect_point_2; - std::list intersections_list; - const Intersect_point_2* ip; - const X_monotone_curve_2* icv; + std::list> intersections_list; m_traits->intersect_2_object()(x_curve, original_cv, std::back_inserter(intersections_list)); - std::list::iterator inter_it = intersections_list.begin(); - for (; inter_it != intersections_list.end(); ++inter_it) + for (auto inter_it = intersections_list.begin(); inter_it != intersections_list.end(); ++inter_it) { - ip = object_cast(&(*inter_it)); - if (ip != nullptr) + if (const Intersect_point_2* ip = std::get_if(&(*inter_it))) { split_points.push_back(Point_2_with_info(ip->first, false, false)); } else { - icv = object_cast(&(*inter_it)); + const X_monotone_curve_2* icv = std::get_if(&(*inter_it)); CGAL_assertion(icv != nullptr); // we will add the *icv end points to the split_points, unless @@ -791,15 +776,15 @@ protected: const Vertex_const_handle* vh; Vertex_handle vh_for_p; - CGAL::Object obj = pl.locate(p); + auto obj = pl.locate(p); visitor.init(&arr); - if ((fh = object_cast(&obj)) + if ((fh = std::get_if(&obj)) != nullptr) { vh_for_p = visitor.found_point_in_face(p, arr.non_const_handle(*fh)); } - else if ((hh = object_cast(&obj)) != nullptr) + else if ((hh = std::get_if(&obj))) { vh_for_p = visitor.found_point_on_edge(p , arr.non_const_handle(*hh)); } @@ -807,7 +792,7 @@ protected: { // In this case p lies on an existing vertex, so we just update this // vertex. - vh = object_cast(&obj); + vh = std::get_if(&obj); CGAL_assertion(vh != nullptr); vh_for_p = visitor.found_point_on_vertex(p, arr.non_const_handle(*vh)); } diff --git a/Envelope_3/test/Envelope_3/Envelope_test_3.h b/Envelope_3/test/Envelope_3/Envelope_test_3.h index 997c4aced68..80656676ca7 100644 --- a/Envelope_3/test/Envelope_3/Envelope_test_3.h +++ b/Envelope_3/test/Envelope_3/Envelope_test_3.h @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -116,49 +115,41 @@ public: Xy_monotone_surface_3 &cur_surface = surfaces[i]; // first insert all the projected curves of the boundary of the current surface // collect the curve in this list, and use sweepline at the end - std::list boundary_list; typedef std::pair Boundary_xcurve; + std::list> boundary_list; - typedef std::list::const_iterator Boundary_iterator; traits.construct_projected_boundary_2_object()(cur_surface, std::back_inserter(boundary_list)); - for(Boundary_iterator boundary_it = boundary_list.begin(); + for(auto boundary_it = boundary_list.begin(); boundary_it != boundary_list.end(); ++boundary_it) { - const Object& obj = *boundary_it; - Boundary_xcurve boundary_cv; - assert(assign(boundary_cv, obj)); - assign(boundary_cv, obj); - curves_col.push_back(boundary_cv.first); + const Boundary_xcurve* boundary_cv = std::get_if(&(*boundary_it)); + assert(boundary_cv!=nullptr); + curves_col.push_back(boundary_cv->first); } // second, intersect it with all surfaces before it - Object cur_obj; for(j=0; j inter_objs; + std::vector> inter_objs; traits.construct_projected_intersections_2_object()(cur_surface, prev_surface, std::back_inserter(inter_objs)); // we collect all intersections and use sweep to insert them - Point_2 point; - Intersection_curve curve; for(std::size_t k=0; k(&inter_objs[k])) { #ifdef CGAL_DEBUG_ENVELOPE_TEST_3 std::cout << "intersection between surfaces is a point: " << point << std::endl; #endif //insert_vertex(result, point, pl); - points_col.push_back(point); + points_col.push_back(*point); } - else if (CGAL::assign(curve, cur_obj)) + else if (const Intersection_curve* curve = std::get_if(&inter_objs[k])) { - curves_col.push_back(curve.first); + curves_col.push_back(curve->first); /*#ifdef CGAL_DEBUG_ENVELOPE_TEST_3 std::cout << "intersection between surfaces is a curve: " << curve.first << std::endl; #endif diff --git a/Envelope_3/test/Envelope_3/Envelope_triangles_test_3.h b/Envelope_3/test/Envelope_3/Envelope_triangles_test_3.h index 29577fefa43..194b9fb7a12 100644 --- a/Envelope_3/test/Envelope_3/Envelope_triangles_test_3.h +++ b/Envelope_3/test/Envelope_3/Envelope_triangles_test_3.h @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -130,48 +129,40 @@ public: #endif // collect the curve in this list, and use sweepline at the end - std::list boundary_list; typedef std::pair Boundary_xcurve; + std::list> boundary_list; traits.construct_projected_boundary_2_object() (cur_surface, std::back_inserter(boundary_list)); - std::list::const_iterator bit; - for (bit = boundary_list.begin(); bit != boundary_list.end(); ++bit) { - const Object& obj = *bit; - Boundary_xcurve boundary_cv; - assert(assign(boundary_cv, obj)); - assign(boundary_cv, obj); - curves_col.push_back(boundary_cv.first); + for (auto bit = boundary_list.begin(); bit != boundary_list.end(); ++bit) { + const Boundary_xcurve* boundary_cv = std::get_if(&(*bit)); + assert(boundary_cv!=nullptr); + curves_col.push_back(boundary_cv->first); } // second, intersect it with all surfaces before it - Object cur_obj; for (unsigned int j = 0; j < i; ++j) { Xy_monotone_surface_3& prev_surface = surfaces[j]; - std::vector inter_objs; + std::vector> inter_objs; traits.construct_projected_intersections_2_object() (cur_surface, prev_surface, std::back_inserter(inter_objs)); // we collect all intersections and use sweep to insert them - Point_2 point; - Intersection_curve curve; for(std::size_t k=0; k(&inter_objs[k])) { #ifdef CGAL_DEBUG_ENVELOPE_TRIANGLES_TEST_3 std::cout << "intersection between surfaces is a point: " << point << std::endl; #endif //insert_vertex(result, point, pl); - points_col.push_back(point); + points_col.push_back(*point); } - else if (CGAL::assign(curve, cur_obj)) { + else if (const Intersection_curve* curve = std::get_if(&inter_objs[k])) { #ifdef CGAL_DEBUG_ENVELOPE_TRIANGLES_TEST_3 std::cout << "intersection between surfaces is a curve: " << curve.first << std::endl; #endif - curves_col.push_back(curve.first); + curves_col.push_back(curve->first); //insert(result, curve.first, pl); } else @@ -262,20 +253,17 @@ public: // foreach face in the test envelope, compute a point inside the face, // locate it in the other envelope and compare the surfaces over the 2 faces Md_point_location pl(env); - Object pl_obj; - Face_const_handle pl_fh; - Face_iterator fi = test_env.faces_begin(); bool eq, result = true; for (; fi != test_env.faces_end(); ++fi) { Face_handle fh = fi; if (!fh->is_unbounded()) { Point_2 inside_test = compute_point_inside_face(test_env, fh); - pl_obj = pl.locate(inside_test); + auto pl_obj = pl.locate(inside_test); // faces of env must contain the faces of test - bool located_in_face = assign(pl_fh, pl_obj); - assert(located_in_face); - eq = fh->is_equal_data(pl_fh->begin_data(), pl_fh->end_data()); + const Face_const_handle* pl_fh = std::get_if(&pl_obj); + assert(pl_fh!=nullptr); + eq = fh->is_equal_data((*pl_fh)->begin_data(), (*pl_fh)->end_data()); assert(eq); result &= eq; } diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 3d9dc82938a..55f5daa8da7 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -14,6 +14,14 @@ Release date: October 2023 - **Breaking change**: The usage of `boost::optional` has been replaced by `std::optional`. Packages affected are 2D Straight Line Skeleton, 3D Fast Intersection and Distance Computation (AABB Tree), and the Kernel intersection. - **Breaking change**: The usage of `boost::variant` has been replaced by `std::variant`. Packages affected are 2D Arrangements, and the Kernel intersection. +#### 2D Arrangements + +- **Breaking change**: The type of the result of point location queries changed to + `std::variant`. The support for the old macro `CGAL_ARR_POINT_LOCATION_VERSION` + has been removed. + +#### Envelopes of Surfaces in 3D +- ** Breaking change**: Construct_projected_boundary_2 in `EnvelopeTraits_3` is now using `std::variant` instead of `Object` [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) ----------- diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h index 1cb47858c42..72a3c3758ac 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h @@ -299,9 +299,6 @@ public: typedef std::pair Intersection_base_point; typedef std::variant Intersection_base_result; - typedef std::pair Intersection_point; - typedef std::variant - Intersection_result; // In case the curves are adjacent in their curve sequence, we do // not have to compute their intersection (we already know that they @@ -321,8 +318,7 @@ public: if (base_pt != nullptr) { // Attach an invalid label to an itersection point. - *oi++ = Intersection_result(std::make_pair(Point_2(base_pt->first), - base_pt->second)); + *oi++ = std::make_pair(Point_2(base_pt->first), base_pt->second); continue; } @@ -331,10 +327,9 @@ public: CGAL_assertion(base_xcv != nullptr); // Attach a merged label to the overlapping curve. - *oi++ = - Intersection_result(X_monotone_curve_2(*base_xcv, - X_curve_label(cv1.label(), - cv2.label()))); + *oi++ = X_monotone_curve_2(*base_xcv, + X_curve_label(cv1.label(), + cv2.label())); } return oi; From fb2f2c6642c73b3421860025d736d018e4fd3c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Jun 2023 19:11:00 +0200 Subject: [PATCH 070/156] remove Object from Minkowski_sum_2 --- .../CGAL/Arr_circle_segment_traits_2.h | 87 +++++++++---------- .../Minkowski_sum_2/Approx_offset_base_2.h | 26 +++--- .../Minkowski_sum_2/Exact_offset_base_2.h | 22 ++--- 3 files changed, 61 insertions(+), 74 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h index dbb909f1e52..f6fbe621739 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h @@ -584,9 +584,6 @@ public: template OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const { - typedef std::variant - Make_x_monotone_result; - // Increment the serial number of the curve cv, which will serve as its // unique identifier. unsigned int index = 0; @@ -594,10 +591,10 @@ public: if (cv.orientation() == COLLINEAR) { // The curve is a line segment. - *oi++ = Make_x_monotone_result(X_monotone_curve_2(cv.supporting_line(), - cv.source(), - cv.target(), - index)); + *oi++ = X_monotone_curve_2(cv.supporting_line(), + cv.source(), + cv.target(), + index); return oi; } @@ -608,8 +605,8 @@ public: if (sign_rad == ZERO) { // Create an isolated point. - *oi++ = Make_x_monotone_result(Point_2(circ.center().x(), - circ.center().y())); + *oi++ = Point_2(circ.center().x(), + circ.center().y()); return oi; } @@ -622,59 +619,59 @@ public: CGAL_assertion (n_vpts == 2); // Subdivide the circle into two arcs (an upper and a lower half). - *oi++ = Make_x_monotone_result(X_monotone_curve_2(circ, - vpts[0], vpts[1], - cv.orientation(), - index)); + *oi++ = X_monotone_curve_2(circ, + vpts[0], vpts[1], + cv.orientation(), + index); - *oi++ = Make_x_monotone_result(X_monotone_curve_2(circ, - vpts[1], vpts[0], - cv.orientation(), - index)); + *oi++ = X_monotone_curve_2(circ, + vpts[1], vpts[0], + cv.orientation(), + index); } else { // Act according to the number of vertical tangency points. if (n_vpts == 2) { // Subdivide the circular arc into three x-monotone arcs. - *oi++ = Make_x_monotone_result(X_monotone_curve_2(circ, - cv.source(), vpts[0], - cv.orientation(), - index)); + *oi++ = X_monotone_curve_2(circ, + cv.source(), vpts[0], + cv.orientation(), + index); - *oi++ = Make_x_monotone_result(X_monotone_curve_2(circ, - vpts[0], vpts[1], - cv.orientation(), - index)); + *oi++ = X_monotone_curve_2(circ, + vpts[0], vpts[1], + cv.orientation(), + index); - *oi++ = Make_x_monotone_result(X_monotone_curve_2(circ, - vpts[1], - cv.target(), - cv.orientation(), - index)); + *oi++ = X_monotone_curve_2(circ, + vpts[1], + cv.target(), + cv.orientation(), + index); } else if (n_vpts == 1) { // Subdivide the circular arc into two x-monotone arcs. - *oi++ = Make_x_monotone_result(X_monotone_curve_2(circ, - cv.source(), - vpts[0], - cv.orientation(), - index)); + *oi++ = X_monotone_curve_2(circ, + cv.source(), + vpts[0], + cv.orientation(), + index); - *oi++ = Make_x_monotone_result(X_monotone_curve_2(circ, - vpts[0], - cv.target(), - cv.orientation(), - index)); + *oi++ = X_monotone_curve_2(circ, + vpts[0], + cv.target(), + cv.orientation(), + index); } else { CGAL_assertion(n_vpts == 0); // The arc is already x-monotone: - *oi++ = Make_x_monotone_result(X_monotone_curve_2(circ, - cv.source(), - cv.target(), - cv.orientation(), - index)); + *oi++ = X_monotone_curve_2(circ, + cv.source(), + cv.target(), + cv.orientation(), + index); } } diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Approx_offset_base_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Approx_offset_base_2.h index ffbb4e4249f..8a9ed4a7455 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Approx_offset_base_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Approx_offset_base_2.h @@ -168,12 +168,10 @@ protected: typename Kernel::Orientation_2 f_orient = ker.orientation_2_object(); Traits_2 traits; - std::list xobjs; - std::list::iterator xobj_it; + std::list> xobjs; typename Traits_2::Make_x_monotone_2 f_make_x_monotone = traits.make_x_monotone_2_object(); Curve_2 arc; - X_monotone_curve_2 xarc; do { @@ -517,12 +515,11 @@ protected: // convolution cycle. xobjs.clear(); f_make_x_monotone (arc, std::back_inserter(xobjs)); - for (xobj_it = xobjs.begin(); xobj_it != xobjs.end(); ++xobj_it) { - assign_success = CGAL::assign (xarc, *xobj_it); - CGAL_assertion (assign_success); - CGAL_USE(assign_success); - *oi++ = Labeled_curve_2 (xarc, - X_curve_label (xarc.is_directed_right(), + for (auto xobj_it = xobjs.begin(); xobj_it != xobjs.end(); ++xobj_it) { + const X_monotone_curve_2* xarc = std::get_if(&(*xobj_it)); + CGAL_assertion(xarc!=nullptr); + *oi++ = Labeled_curve_2 (*xarc, + X_curve_label (xarc->is_directed_right(), cycle_id, curve_index++)); } } @@ -571,18 +568,17 @@ protected: xobjs.clear(); f_make_x_monotone (arc, std::back_inserter(xobjs)); - xobj_it = xobjs.begin(); + auto xobj_it = xobjs.begin(); while (xobj_it != xobjs.end()) { - assign_success = CGAL::assign (xarc, *xobj_it); - CGAL_assertion (assign_success); - CGAL_USE(assign_success); + const X_monotone_curve_2* xarc = std::get_if(&(*xobj_it)); + CGAL_assertion (xarc != nullptr); ++xobj_it; bool is_last = (xobj_it == xobjs.end()); - *oi++ = Labeled_curve_2 (xarc, - X_curve_label (xarc.is_directed_right(), + *oi++ = Labeled_curve_2 (*xarc, + X_curve_label (xarc->is_directed_right(), cycle_id, curve_index++, is_last)); } diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Exact_offset_base_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Exact_offset_base_2.h index ca77157ec5c..2220f1f536e 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Exact_offset_base_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Exact_offset_base_2.h @@ -117,7 +117,7 @@ protected: Algebraic a, b, c; unsigned int curve_index(0); - std::list xobjs; + std::list> xobjs; Traits_2 traits; auto nt_traits = traits.nt_traits(); @@ -127,8 +127,6 @@ protected: auto alg_ker = traits.alg_kernel(); auto f_equal = alg_ker->equal_2_object(); - bool assign_success; - do { // Get a circulator for the next vertex (in the proper orientation). if (forward) ++next; @@ -185,13 +183,11 @@ protected: f_make_x_monotone(arc, std::back_inserter(xobjs)); for (auto xobj_it = xobjs.begin(); xobj_it != xobjs.end(); ++xobj_it) { - X_monotone_curve_2 xarc; - assign_success = CGAL::assign(xarc, *xobj_it); - CGAL_assertion (assign_success); - CGAL_USE(assign_success); + const X_monotone_curve_2* xarc = std::get_if(&(*xobj_it)); + CGAL_assertion (xarc!=nullptr); - *oi++ = Labeled_curve_2(xarc, X_curve_label(xarc.is_directed_right(), - cycle_id, curve_index)); + *oi++ = Labeled_curve_2(*xarc, X_curve_label(xarc->is_directed_right(), + cycle_id, curve_index)); curve_index++; } } @@ -237,15 +233,13 @@ protected: auto xobj_it = xobjs.begin(); while (xobj_it != xobjs.end()) { - X_monotone_curve_2 xarc; - assign_success = CGAL::assign(xarc, *xobj_it); - CGAL_assertion (assign_success); - CGAL_USE(assign_success); + const X_monotone_curve_2* xarc = std::get_if(&(*xobj_it)); + CGAL_assertion (xarc!=nullptr); ++xobj_it; is_last = (xobj_it == xobjs.end()); - *oi++ = Labeled_curve_2(xarc, X_curve_label(xarc.is_directed_right(), + *oi++ = Labeled_curve_2(*xarc, X_curve_label(xarc->is_directed_right(), cycle_id, curve_index, is_last)); curve_index++; From 9969210023349623cb0d6670b68abd78fc8231f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Jun 2023 11:17:55 +0200 Subject: [PATCH 071/156] make is compatible with back inserter --- Boolean_set_operations_2/include/CGAL/General_polygon_2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Boolean_set_operations_2/include/CGAL/General_polygon_2.h b/Boolean_set_operations_2/include/CGAL/General_polygon_2.h index 93469d5e93b..f43a41e2709 100644 --- a/Boolean_set_operations_2/include/CGAL/General_polygon_2.h +++ b/Boolean_set_operations_2/include/CGAL/General_polygon_2.h @@ -38,6 +38,7 @@ public: typedef std::list Containter; typedef typename Containter::iterator Curve_iterator; typedef typename Containter::const_iterator Curve_const_iterator; + typedef X_monotone_curve_2 value_type; protected: std::list m_xcurves; From 7d0dd109b3ce554bd62550e59c0865a76d28717b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Jun 2023 11:19:58 +0200 Subject: [PATCH 072/156] fix for variant/optional --- STL_Extension/include/CGAL/iterator.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index 95295f89f83..e8651c07293 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -1457,6 +1457,19 @@ public: template Self& operator=(const T&) { return *this; } + template + Self& operator=(const std::variant< T ... >& t) { + internal::Output_visitor visitor(this); + std::visit(visitor, t); + return *this; + } + + template + Self& operator=(const std::optional< std::variant< T ... > >& t) { + internal::Output_visitor visitor(this); + if(t) std::visit(visitor, *t); + return *this; + } }; From f65aa68bd23f6e26fbbf0966d3c13db2ee00d526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Jun 2023 11:20:31 +0200 Subject: [PATCH 073/156] use dispatch_or_drop_output to replace Object --- .../bezier_traits_adapter2.cpp | 12 ++----- .../circle_segment.cpp | 18 ++++------ .../conic_traits_adapter.cpp | 11 ++---- .../Boolean_set_operations_2/set_union.cpp | 16 +++------ .../include/CGAL/IO/Dxf_bsop_reader.h | 36 +++++-------------- 5 files changed, 24 insertions(+), 69 deletions(-) diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter2.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter2.cpp index 853340f86d2..d99e287d40b 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter2.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter2.cpp @@ -3,6 +3,7 @@ */ #include +#include #ifndef CGAL_USE_CORE #include @@ -108,22 +109,13 @@ bool read_bezier(char const* aFileName, Bezier_polygon_set& rSet) for (unsigned int k = 0; k < n_curves; ++k) { // Read the current curve and subdivide it into x-monotone subcurves. - std::list x_objs; - std::list::const_iterator xoit; - Bezier_X_monotone_curve xcv; Bezier_traits traits; Bezier_traits::Make_x_monotone_2 make_x_monotone = traits.make_x_monotone_2_object(); Bezier_curve B = read_bezier_curve(in_file, lDoubleFormat); if (B.number_of_control_points() >= 2) { - - make_x_monotone(B, std::back_inserter(x_objs)); - - for (xoit = x_objs.begin(); xoit != x_objs.end(); ++xoit) { - if (CGAL::assign(xcv, *xoit)) - xcvs.push_back(xcv); - } + make_x_monotone(B, CGAL::dispatch_or_drop_output(std::back_inserter(xcvs))); } } diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp index 7cf3ec3dc7b..02bf08f58ca 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -24,22 +25,15 @@ typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2; // Construct a polygon from a circle. Polygon_2 construct_polygon (const Circle_2& circle) { - // Subdivide the circle into two x-monotone arcs. + // Subdivide the circle into two x-monotone arcs and construct the polygon. Traits_2 traits; Curve_2 curve (circle); - std::list objects; - traits.make_x_monotone_2_object() (curve, std::back_inserter(objects)); - assert(objects.size() == 2); - - // Construct the polygon. Polygon_2 pgn; - X_monotone_curve_2 arc; - std::list::iterator iter; - for (iter = objects.begin(); iter != objects.end(); ++iter) { - CGAL::assign (arc, *iter); - pgn.push_back (arc); - } + traits.make_x_monotone_2_object() (curve, + CGAL::dispatch_or_drop_output(std::back_inserter(pgn))); + std::cout << "size: " << pgn.size() << "\n"; + assert(pgn.size() == 2); return pgn; } diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/conic_traits_adapter.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/conic_traits_adapter.cpp index a35c90e29c6..f215b1a5267 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/conic_traits_adapter.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/conic_traits_adapter.cpp @@ -3,6 +3,7 @@ */ #include +#include #ifndef CGAL_USE_CORE #include @@ -42,14 +43,8 @@ typedef Traits_2::Point_2 Point_2; // sub-arcs and append these sub-arcs as polygon edges. void append_conic_arc(Polygon_2& polygon, const Curve_2& arc) { Conic_traits_2 traits; - std::list objects; - X_monotone_curve_2 xarc; - - traits.make_x_monotone_2_object() (arc, std::back_inserter(objects)); - for (auto it = objects.begin(); it != objects.end(); ++it) { - if (CGAL::assign (xarc, *it)) - polygon.push_back (xarc); - } + traits.make_x_monotone_2_object() (arc, + CGAL::dispatch_or_drop_output(std::back_inserter(polygon))); } int main() { diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp index cecacc9a107..8ff0ced217f 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp @@ -25,22 +25,14 @@ typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2; // Construct a polygon from a circle. Polygon_2 construct_polygon (const Circle_2& circle) { - // Subdivide the circle into two x-monotone arcs. + // Subdivide the circle into two x-monotone arcs and construct the polygon Traits_2 traits; Curve_2 curve (circle); - std::list objects; - traits.make_x_monotone_2_object() (curve, std::back_inserter(objects)); - assert(objects.size() == 2); - - // Construct the polygon. Polygon_2 pgn; - X_monotone_curve_2 arc; - std::list::iterator iter; - for (iter = objects.begin(); iter != objects.end(); ++iter) { - CGAL::assign (arc, *iter); - pgn.push_back (arc); - } + traits.make_x_monotone_2_object() (curve, + CGAL::dispatch_or_drop_output(std::back_inserter(pgn))); + assert(pgn.size() == 2); return pgn; } diff --git a/Boolean_set_operations_2/include/CGAL/IO/Dxf_bsop_reader.h b/Boolean_set_operations_2/include/CGAL/IO/Dxf_bsop_reader.h index 1645afc1354..986ba9e86e1 100644 --- a/Boolean_set_operations_2/include/CGAL/IO/Dxf_bsop_reader.h +++ b/Boolean_set_operations_2/include/CGAL/IO/Dxf_bsop_reader.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace CGAL { @@ -97,29 +98,19 @@ public: typename Traits_2::Make_x_monotone_2 make_x_monotone = traits.make_x_monotone_2_object(); typename Dxf_circles_list::iterator circ_it; - CGAL::Object obj_vec[3]; - CGAL::Object *obj_begin = (obj_vec + 0); - CGAL::Object *obj_end; - X_monotone_curve_2 cv1, cv2; for (circ_it = circles.begin(); circ_it != circles.end(); ++circ_it) { // Break the circle into two x-monotone circular arcs. const Dxf_circle_2& dxf_circ = *circ_it; Curve_2 circ (dxf_circ.first, dxf_circ.second); - - obj_end = make_x_monotone (circ, obj_begin); - CGAL_assertion(obj_end - obj_begin == 2); - - CGAL::assign(cv1, obj_vec[0]); - CGAL::assign(cv2, obj_vec[1]); - - // Generate the corresponding polygon. Circ_polygon_2 pgn; - pgn.push_back (cv1); - pgn.push_back (cv2); - *pgns = pgn; - ++pgns; + + make_x_monotone (circ, + CGAL::dispatch_or_drop_output(std::back_inserter(pgn))); + CGAL_assertion(pgn.size() == 2); + + *pgns++ = pgn; } circles.clear(); @@ -131,8 +122,6 @@ public: typename Dxf_polygon_2::iterator curr, next; Point_2 ps, pt; Circle_2 supp_circ; - std::size_t n_subarcs; - std::size_t i; for (pgn_it = polygons.begin(); pgn_it != polygons.end(); ++pgn_it) { @@ -184,15 +173,8 @@ public: // Break the arc into x-monotone subarcs (there can be at most // three subarcs) and add them to the polygon. - obj_end = make_x_monotone (circ_arc, obj_begin); - n_subarcs = (obj_end - obj_begin); - CGAL_assertion (n_subarcs <= 3); - - for (i = 0; i < n_subarcs; i++) - { - if (CGAL::assign (cv1, obj_vec[i])) - pgn.push_back (cv1); - } + make_x_monotone (circ_arc, + CGAL::dispatch_or_drop_output(std::back_inserter(pgn))); } else { From e4d98ef92a1dcc81e0fae1cfe7ad5f0cd6652040 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 21 Jun 2023 15:32:58 +0200 Subject: [PATCH 074/156] add an example for cmap insert cell 1 between two cells 2 --- .../Combinatorial_map/map_3_insert.cpp | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Combinatorial_map/examples/Combinatorial_map/map_3_insert.cpp diff --git a/Combinatorial_map/examples/Combinatorial_map/map_3_insert.cpp b/Combinatorial_map/examples/Combinatorial_map/map_3_insert.cpp new file mode 100644 index 00000000000..4963fcb23a7 --- /dev/null +++ b/Combinatorial_map/examples/Combinatorial_map/map_3_insert.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +typedef CGAL::Combinatorial_map<3> CMap_3; +typedef CMap_3::Dart_descriptor Dart_descriptor; + +int main() +{ + CMap_3 cm; + + // Create one combinatorial hexahedron + Dart_descriptor d1 = cm.make_combinatorial_hexahedron(); + + // Create one square face + Dart_descriptor d2=cm.make_combinatorial_polygon(4); + + assert(cm.is_insertable_cell_1_between_two_cells_2(d1,d2)); + + // Insert the square face as a hole of the face of the hexahedron containing d1 + cm.insert_cell_1_between_two_cells_2(d1, d2); + + // Display the combinatorial map characteristics. + cm.display_characteristics(std::cout)<<", valid=" + <(dh)) ++nb; } + std::cout<<"Number of 2-free darts: "< Date: Wed, 21 Jun 2023 15:33:03 +0200 Subject: [PATCH 075/156] add one example in the user manual --- .../doc/Combinatorial_map/Combinatorial_map.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 2e36037ea23..0ff995a3cdd 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -393,6 +393,8 @@ Example of \link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\e `cm.`\link GenericMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2(d0)`\endlink adds a 1-cell in the 2-cell containing dart `d0`, the 1-cell being attached by only one of its vertex to the 0-cell containing dart `d0`. This operation is possible if `d0`\f$ \in \f$ \link GenericMap::darts `cm.darts()`\endlink. +`cm.`\link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2(d1,d2)`\endlink adds a 1-cell between the two faces containing containing darts `d1` and `d2`, between the two 0-cells containing darts `d1` and `d2`. The 2-cells are merged in one. This operation is possible if d1\f$ \not \in \f$ \f$ \langle{}\f$\f$ \beta_1\f$\f$ \rangle{}\f$(d2) which can be tested thanks to `cm.`\link GenericMap::is_insertable_cell_1_between_two_cells_2 `is_insertable_cell_1_between_two_cells_2(d1,d2)`\endlink. + `cm.`\link GenericMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3(itbegin,itend)`\endlink adds a 2-cell in the 3-cell containing all the darts between `itbegin` and `itend`, along the path of 1-cells containing darts in [`itbegin`,`itend`). The 3-cell is split in two. This operation is possible if all the darts in [`itbegin`,`itend`) form a closed path inside a same 3-cell which can be tested thanks to `cm.`\link GenericMap::is_insertable_cell_2_in_cell_3 `is_insertable_cell_2_in_cell_3(itbegin,itend)`\endlink (see example on \cgalFigureRef{fig_cmap_insert_facet}). \cgalFigureBegin{fig_cmap_insert_facet,cmap_insert_facet.svg} @@ -456,6 +458,20 @@ The second line is the result after the removal operations. We retrieve the orig Example of high level operations. Left: Initial 3D combinatorial map after the creation of the combinatorial hexahedron. Middle: Combinatorial map obtained after the two 1-cell insertions. The two 2-cells were split in two. Right: Combinatorial map obtained after the 2-cell insertion. The 3-cell was split in two. \cgalFigureEnd +\subsection Combinatorial_mapHighLevelOperations Insert an edge between two different faces + +\anchor ssecexempleinsertion + +This example shows the use of \link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2`\endlink operation. First we create a combinatorial hexahedron and a face with 4 edges. This face is inserted in the face of the hexahedron containing dart d1. We display the characteristics of the combinatorial map and check its validity. Then we count and display the number of 2-free darts. + +The output is: +\verbatim +#Darts=30, #0-cells=12, #1-cells=17, #2-cells=6, #3-cells=1, #ccs=1, valid=1 +Number of 2-free darts: 4 +\endverbatim + +We can verify that there are 6 2-cells after the insertion since the squared face was inserted as a hole in one face of the hexahedron. We can also see that there are 4 2-free darts, which are the 4 darts of the squared face. Since they bounded an hole, there is no face filling the hole and thus there 4 darts are 2-free. + \subsection Combinatorial_mapA4DGenericMap A 4D Combinatorial Map In this example, a 4-dimensional combinatorial map is used. Two tetrahedral cells are created and sewn by \f$ \beta_4\f$. Then the numbers of cells of the combinatorial map are displayed, and its validity is checked. From 24b38f2d93cef2236193dced6b51864d2344231d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 21 Jun 2023 15:34:39 +0200 Subject: [PATCH 076/156] add example --- Combinatorial_map/doc/Combinatorial_map/examples.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Combinatorial_map/doc/Combinatorial_map/examples.txt b/Combinatorial_map/doc/Combinatorial_map/examples.txt index ce72b6a64a2..c77e4e6c522 100644 --- a/Combinatorial_map/doc/Combinatorial_map/examples.txt +++ b/Combinatorial_map/doc/Combinatorial_map/examples.txt @@ -6,4 +6,5 @@ \example Combinatorial_map/map_3_with_colored_facets.cpp \example Combinatorial_map/map_3_dynamic_onmerge.cpp \example Combinatorial_map/map_3_index.cpp +\example Combinatorial_map/map_3_insert.cpp */ From 8fb08a14055a3bf515398136edff281c736c5cac Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 21 Jun 2023 15:37:11 +0200 Subject: [PATCH 077/156] Update changes.md --- Installation/CHANGES.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index c4ce7a51d6d..229d1145c8a 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,6 +1,15 @@ Release History =============== +[Release 6.0](https://github.com/CGAL/cgal/releases/tag/v6.0) +----------- + +Release date: XXX + +### [Combinatorial Maps](https://doc.cgal.org/6.0/Manual/packages.html#PkgCombinatorialMaps) + +- Added the function `insert_cell_1_between_two_cells_2()` to the `GenericMap` concept, which enables users to insert an edge between two different faces in order to create faces with holes. + [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) ----------- From 4798874609572913e41a863919132855437e9caa Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 21 Jun 2023 15:44:56 +0200 Subject: [PATCH 078/156] add the example and update the anchor --- Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 0ff995a3cdd..6b95790b57b 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -458,12 +458,14 @@ The second line is the result after the removal operations. We retrieve the orig Example of high level operations. Left: Initial 3D combinatorial map after the creation of the combinatorial hexahedron. Middle: Combinatorial map obtained after the two 1-cell insertions. The two 2-cells were split in two. Right: Combinatorial map obtained after the 2-cell insertion. The 3-cell was split in two. \cgalFigureEnd -\subsection Combinatorial_mapHighLevelOperations Insert an edge between two different faces +\subsection Combinatorial_mapInsertion Insert an edge between two different faces \anchor ssecexempleinsertion This example shows the use of \link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2`\endlink operation. First we create a combinatorial hexahedron and a face with 4 edges. This face is inserted in the face of the hexahedron containing dart d1. We display the characteristics of the combinatorial map and check its validity. Then we count and display the number of 2-free darts. +\cgalExample{Combinatorial_map/map_3_insert.cpp} + The output is: \verbatim #Darts=30, #0-cells=12, #1-cells=17, #2-cells=6, #3-cells=1, #ccs=1, valid=1 From a2ab7a2090532ff7f75f0ef7ae9934dad9ea2007 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 10:47:28 +0200 Subject: [PATCH 079/156] Small corrections in the doc --- Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt | 2 +- Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 6b95790b57b..08afd508587 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -472,7 +472,7 @@ The output is: Number of 2-free darts: 4 \endverbatim -We can verify that there are 6 2-cells after the insertion since the squared face was inserted as a hole in one face of the hexahedron. We can also see that there are 4 2-free darts, which are the 4 darts of the squared face. Since they bounded an hole, there is no face filling the hole and thus there 4 darts are 2-free. +We can verify that there are 6 2-cells after the insertion since the squared face was inserted as a hole in one face of the hexahedron. We can also see that there are 4 2-free darts, which are the 4 darts of the squared face. Since they bound an hole, there is no face filling the hole and thus 4 darts are 2-free. \subsection Combinatorial_mapA4DGenericMap A 4D Combinatorial Map diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h index c080e2166d4..2439a614f03 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h @@ -910,7 +910,7 @@ Inserts a 1-cell in the 2-cell containing `d1` and `d2`. Returns `previous(d1)`, See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_edge} and for generalized map in \cgalFigureRef{fig_gmap_insert_edge}. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(a,a') is called, with a the original 2-attribute associated with `d` and a' the new 2-attribute created during the operation. If set, the dynamic on-split function of 2-attributes is also called on a and a'. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(a,a') is called, with a the original 2-attribute associated with `d1` and a' the new 2-attribute created during the operation. If set, the dynamic on-split function of 2-attributes is also called on a and a'. \cgalAdvancedBegin If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. @@ -930,7 +930,7 @@ Dart_descriptor insert_cell_1_in_cell_2(Dart_descriptor d1, Dart_descriptor d2); Inserts a 1-cell between the 2-cell containing `d1` and the one containing `d2`. Returns `previous(d1)`, a descriptor on one dart belonging to the new 1-cell. \pre `is_insertable_cell_1_between_two_cells_2(d1,d2)`. -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, call \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink(a,a') is called for all enabled i-attributes, for i>=2, with a the original 2-attribute associated with `d` and a' the new 2-attribute created during the operation. If set, the dynamic on-merge function of i-attributes is also called on a and a'. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, call \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink(a,a') is called for all enabled i-attributes, for i>=2, with a the original 2-attribute associated with `d1` and a' the original 2-attribute associated with `d2`. If set, the dynamic on-merge function of i-attributes is also called on a and a'. \cgalAdvancedBegin If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation. From 28ea0d42e02985677056b3b8b28c7fcb6fbe656c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 12:11:57 +0200 Subject: [PATCH 080/156] Using --- Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 08afd508587..6e7960fe4b0 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -168,7 +168,7 @@ Considering these different advantages and drawbacks, you can choose to use gene The diagram in \cgalFigureRef{fig_cmap_diagramme_class} shows the different classes of the package. `Combinatorial_map` is the main class (see Section \ref sseccombinatorialmap "Combinatorial Maps"). It allows to manage darts and attributes (see Section \ref ssecattributes "Cell Attributes"). Users can customize a combinatorial map thanks to an items class (see Section \ref ssecitem "Combinatorial Map Items"), which defines the information associated with darts and the attribute types. These types may be different for different dimensions, and they may also be void (note that the main concepts of `GenericMap`, `GenericMapItems` and `CellAttribute` are shared between combinatorial maps and generalized maps). -The darts and attributes are accessed through descriptors (either Indices or Handles). A handle is a model of the `Handle` concept, thus supporting the two dereference operators `operator*` and `operator->`. All handles are model of `LessThanComparable` and `Hashable`, that is they can be used as keys in containers such as `std::map` and `std::unordered_map`. An index is a model of the `Index` concept, which is mainly an integer which is convertible from and to std::size_t. Indices can be used as index into vectors which store properties (cf. one example in Section \ref ssecexample3DCMWI "3D Combinatorial Map using Indices"). +The darts and attributes are accessed through descriptors (either Indices or Handles). A handle is a model of the `Handle` concept, thus supporting the two dereference operators `operator*` and `operator->`. All handles are model of `LessThanComparable` and `Hashable`, that is they can be used as keys in containers such as `std::map` and `std::unordered_map`. An index is a model of the `Index` concept, which is mainly an integer which is convertible from and to std::size_t. Indices can be used as index into vectors which store properties (cf. one example in Section \ref ssecexample3DCMWI "3D Combinatorial Map Using Indices"). \cgalFigureBegin{fig_cmap_diagramme_class,cmap_diagramme_class.svg} UML diagram of the main classes of the package. k is the number of non void attributes. @@ -520,7 +520,7 @@ Lastly we remove the dynamic onmerge functor (step 7). This is done by initializ \cgalExample{Combinatorial_map/map_3_dynamic_onmerge.cpp} -\subsection ssecexample3DCMWI 3D Combinatorial Map using Indices +\subsection ssecexample3DCMWI 3D Combinatorial Map Using Indices In this example, a 3-dimensional combinatorial map is used, but using indices instead of handles. Two vectors are created to store some external information associated with darts and 3-attributes. Since descriptors are indices, they can directly be used to access elements of the vector. From 571536f09c2b0afc7f42485276d95f74d1e159ca Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 22 Jun 2023 14:38:23 +0200 Subject: [PATCH 081/156] fix version checker the 3 major/minor/patch are needed to compare integrals if they are defined, the version check is done and warning or error are displayed --- Installation/include/CGAL/config.h | 2 +- Installation/include/CGAL/version_checker.h | 53 ++++++++++++++++++++ Installation/include/CGAL/version_enforcer.h | 41 --------------- 3 files changed, 54 insertions(+), 42 deletions(-) create mode 100644 Installation/include/CGAL/version_checker.h delete mode 100644 Installation/include/CGAL/version_enforcer.h diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index f3753100139..13379cf2a3c 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -117,7 +117,7 @@ #include #include -#include +#include //----------------------------------------------------------------------// // platform specific workaround flags (CGAL_CFG_...) diff --git a/Installation/include/CGAL/version_checker.h b/Installation/include/CGAL/version_checker.h new file mode 100644 index 00000000000..9061ee89c54 --- /dev/null +++ b/Installation/include/CGAL/version_checker.h @@ -0,0 +1,53 @@ +// Copyright (c) 2023 GeometryFactory. +// 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) : - + +#ifndef CGAL_VERSION_CHECKER_H +#define CGAL_VERSION_CHECKER_H + +#include + +// All files including this header are meant to work with a given version of CGAL +// When using forked headers, set the following macro to the version of CGAL +// you want to use. + +//// Set the 3 following macros to the version of CGAL you want to use +//#define CGAL_AUTHORIZED_VERSION_MAJOR 6 +//#define CGAL_AUTHORIZED_VERSION_MINOR 0 +//#define CGAL_AUTHORIZED_VERSION_PATCH 0 + +// Set the following macros to 1 to get a warning/an error +// when using a bad version of CGAL +#define CGAL_VERSION_CHECKER_ERROR 0 +#define CGAL_VERSION_CHECKER_WARNING 0 + +#define CGAL_AUTHORIZED_VERSION_STR CGAL_STR(CGAL_AUTHORIZED_VERSION_MAJOR) "." \ + CGAL_STR(CGAL_AUTHORIZED_VERSION_MINOR) "." \ + CGAL_STR(CGAL_AUTHORIZED_VERSION_PATCH) + + +// Check that the version of CGAL used is the one expected +#if CGAL_AUTHORIZED_VERSION_MAJOR != CGAL_VERSION_MAJOR \ + || CGAL_AUTHORIZED_VERSION_MINOR != CGAL_VERSION_MINOR \ + || CGAL_AUTHORIZED_VERSION_PATCH != CGAL_VERSION_PATCH + + #if CGAL_VERSION_CHECKER_WARNING || CGAL_VERSION_CHECKER_ERROR + #pragma message("These headers are meant to be used with CGAL " CGAL_AUTHORIZED_VERSION_STR " only."\ + " You are using CGAL version: " CGAL_STR(CGAL_VERSION) ".") + + #ifdef CGAL_VERSION_CHECKER_ERROR + #error "Wrong version of CGAL" + #endif + + #endif + +#endif + +#endif // CGAL_VERSION_CHECKER_H diff --git a/Installation/include/CGAL/version_enforcer.h b/Installation/include/CGAL/version_enforcer.h deleted file mode 100644 index c5c1181cee4..00000000000 --- a/Installation/include/CGAL/version_enforcer.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2023 GeometryFactory. -// 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) : - - -#ifndef CGAL_VERSION_ENFORCER_H -#define CGAL_VERSION_ENFORCER_H - -#include - -// All files including this header are meant to work with a given version of CGAL -// When using forked headers, set the 4 following macros to the version of CGAL -// you want to use. -#define CGAL_AUTHORIZED_VERSION_STR CGAL_VERSION_STR -#define CGAL_AUTHORIZED_VERSION_MAJOR CGAL_VERSION_MAJOR -#define CGAL_AUTHORIZED_VERSION_MINOR CGAL_VERSION_MINOR -#define CGAL_AUTHORIZED_VERSION_PATCH CGAL_VERSION_PATCH - -// Check that the version of CGAL used is the one expected -#if (CGAL_VERSION_MAJOR != CGAL_AUTHORIZED_VERSION_MAJOR) -#pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." -#error This header is meant to be with used with CGAL "CGAL_AUTHORIZED_VERSION_STR" only." -#endif - -#if (CGAL_VERSION_MINOR != CGAL_AUTHORIZED_VERSION_MINOR) -#pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." -#error This header is meant to be with used with CGAL "CGAL_AUTHORIZED_VERSION_STR" only. -#endif - -#if (CGAL_VERSION_PATCH != CGAL_AUTHORIZED_VERSION_PATCH) -#pragma message "You are using CGAL version: " CGAL_STR(CGAL_VERSION) "." -#error This header is meant to be with used with CGAL "CGAL_AUTHORIZED_VERSION_STR" only." -#endif - -#endif // CGAL_VERSION_ENFORCER_H From 3ed60dc64908e65c1ae2d003585b576bd979b67a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 23 Jun 2023 08:22:00 +0200 Subject: [PATCH 082/156] Examples for insert between two different 2-cells --- .../Generalized_map/gmap_3_insert.cpp | 34 ++++++++++++++++++ .../Linear_cell_complex/CMakeLists.txt | 4 ++- .../linear_cell_complex_3_insert.cpp | 35 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 Generalized_map/examples/Generalized_map/gmap_3_insert.cpp create mode 100644 Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_insert.cpp diff --git a/Generalized_map/examples/Generalized_map/gmap_3_insert.cpp b/Generalized_map/examples/Generalized_map/gmap_3_insert.cpp new file mode 100644 index 00000000000..56c4a5cbd2f --- /dev/null +++ b/Generalized_map/examples/Generalized_map/gmap_3_insert.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +typedef CGAL::Generalized_map<3> GMap_3; +typedef GMap_3::Dart_descriptor Dart_descriptor; + +int main() +{ + GMap_3 gm; + + // Create one combinatorial hexahedron + Dart_descriptor d1 = gm.make_combinatorial_hexahedron(); + + // Create one square face + Dart_descriptor d2=gm.make_combinatorial_polygon(4); + + assert(gm.is_insertable_cell_1_between_two_cells_2(d1,d2)); + + // Insert the square face as a hole of the face of the hexahedron containing d1 + gm.insert_cell_1_between_two_cells_2(d1, d2); + + // Display the combinatorial map characteristics. + gm.display_characteristics(std::cout)<<", valid=" + <(dh)) ++nb; } + std::cout<<"Number of 2-free darts: "< +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC1; +typedef CGAL::Linear_cell_complex_for_generalized_map<3> LCC2; + +template +void test() +{ + LCC lcc; + using Point=typename LCC::Point; + + typename LCC::Dart_descriptor d1= + lcc.make_hexahedron(Point(0,0,0), Point(5,0,0), + Point(5,5,0), Point(0,5,0), + Point(0,5,4), Point(0,0,4), + Point(5,0,4), Point(5,5,4)); + typename LCC::Dart_descriptor d2= + lcc.make_quadrangle(Point(5,2,2), Point(5,1,2), + Point(5,1,1), Point(5,2,1)); + + lcc.insert_cell_1_between_two_cells_2 + (lcc.template opposite<2>(lcc.next(lcc.next(d1))), + lcc.next(lcc.next(d2))); + + CGAL::draw(lcc); +} + +int main() +{ + test(); + test(); + return EXIT_SUCCESS; +} From edc11a8bc002d47f1d57da3cfe313bb9817b6af0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 23 Jun 2023 08:43:36 +0200 Subject: [PATCH 083/156] Example of insert edge between two different 2-cells, for cmap, gmap and lcc --- .../Combinatorial_map/Combinatorial_map.txt | 6 ++++-- .../doc/Generalized_map/Generalized_map.txt | 20 ++++++++++++++++++ .../doc/Generalized_map/examples.txt | 1 + .../Linear_cell_complex.txt | 11 +++++++++- .../doc/Linear_cell_complex/examples.txt | 1 + .../fig/lcc_insert_example.png | Bin 0 -> 19200 bytes 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 Linear_cell_complex/doc/Linear_cell_complex/fig/lcc_insert_example.png diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 6e7960fe4b0..d1216129f48 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -458,7 +458,7 @@ The second line is the result after the removal operations. We retrieve the orig Example of high level operations. Left: Initial 3D combinatorial map after the creation of the combinatorial hexahedron. Middle: Combinatorial map obtained after the two 1-cell insertions. The two 2-cells were split in two. Right: Combinatorial map obtained after the 2-cell insertion. The 3-cell was split in two. \cgalFigureEnd -\subsection Combinatorial_mapInsertion Insert an edge between two different faces +\subsection Combinatorial_mapInsertion Insert an Edge Between Two Different Faces \anchor ssecexempleinsertion @@ -472,7 +472,9 @@ The output is: Number of 2-free darts: 4 \endverbatim -We can verify that there are 6 2-cells after the insertion since the squared face was inserted as a hole in one face of the hexahedron. We can also see that there are 4 2-free darts, which are the 4 darts of the squared face. Since they bound an hole, there is no face filling the hole and thus 4 darts are 2-free. +We can verify that there are 6 2-cells after the insertion since the squared face was inserted as a hole in one face of the hexahedron. We can also see that there are 4 2-free darts, which are the darts of the squared face. Since they bound an hole, there is no face filling the hole and thus 4 darts are 2-free. + +See also a similar example for Linear cell complex \ref Linear_cell_complexInsert "Insert an Edge Between Two Different Faces". \subsection Combinatorial_mapA4DGenericMap A 4D Combinatorial Map diff --git a/Generalized_map/doc/Generalized_map/Generalized_map.txt b/Generalized_map/doc/Generalized_map/Generalized_map.txt index 491a8c9ed3d..39aa3e1b2e0 100644 --- a/Generalized_map/doc/Generalized_map/Generalized_map.txt +++ b/Generalized_map/doc/Generalized_map/Generalized_map.txt @@ -399,6 +399,8 @@ Example of \link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\e `gm.`\link GenericMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2(d0)`\endlink adds a 1-cell in the 2-cell containing dart `d0`, the 1-cell being attached by only one of its vertex to the 0-cell containing dart `d0`. This operation is possible if `d0` \f$ \in \f$ \link GenericMap::darts `gm.darts()`\endlink. +`gm.`\link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2(d1,d2)`\endlink adds a 1-cell between the two faces containing containing darts `d1` and `d2`, between the two 0-cells containing darts `d1` and `d2`. The 2-cells are merged in one. This operation is possible if d1\f$ \not \in \f$ \f$ \langle{}\f$\f$ \alpha_0, \alpha_1\f$\f$ \rangle{}\f$(d2) which can be tested thanks to `gm.`\link GenericMap::is_insertable_cell_1_between_two_cells_2 `is_insertable_cell_1_between_two_cells_2(d1,d2)`\endlink. + `gm.`\link GenericMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3(itbegin,itend)`\endlink adds a 2-cell in the 3-cell containing all the darts between `itbegin` and `itend`, along the path of 1-cells containing darts in [`itbegin`,`itend`). The 3-cell is split in two. This operation is possible if all the darts in [`itbegin`,`itend`) form a closed path inside a same 3-cell which can be tested thanks to `gm.`\link GenericMap::is_insertable_cell_2_in_cell_3 `is_insertable_cell_2_in_cell_3(itbegin,itend)`\endlink (see example on \cgalFigureRef{fig_gmap_insert_facet}). \cgalFigureBegin{fig_gmap_insert_facet,gmap_insert_facet.svg} @@ -478,6 +480,24 @@ The second line is the result after the removal operations. We retrieve the orig Example of high level operations. Left: Initial 3D generalized map after the creation of the generalized hexahedron. Middle: Generalized map obtained after the two 1-cell insertions. The two 2-cells were split in two. Right: Generalized map obtained after the 2-cell insertion. The 3-cell was split in two. \cgalFigureEnd +\subsection Generalized_mapInsertion Insert an edge between two different faces + +\anchor ssecexempleinsertiongmap + +This example shows the use of \link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2`\endlink operation. First we create a combinatorial hexahedron and a face with 4 edges. This face is inserted in the face of the hexahedron containing dart d1. We display the characteristics of the generalized map and check its validity. Then we count and display the number of 2-free darts. + +\cgalExample{Generalized_map/gmap_3_insert.cpp} + +The output is: +\verbatim +#Darts=60, #0-cells=12, #1-cells=17, #2-cells=6, #3-cells=1, #ccs=1, orientable=true, valid=1 +Number of 2-free darts: 8 +\endverbatim + +We can verify that there are 6 2-cells after the insertion since the squared face was inserted as a hole in one face of the hexahedron. We can also see that there are 8 2-free darts, which are the darts of the squared face. Since they bound an hole, there is no face filling the hole and thus 8 darts are 2-free. + +See also a similar example for Linear cell complex \ref Linear_cell_complexInsert "Insert an Edge Between Two Different Faces". + \subsection Generalized_mapA4DGeneralizedMap A 4D Generalized Map In this example, a 4-dimensional generalized map is used. Two tetrahedral cells are created and sewn by \f$ \alpha_4\f$. Then the numbers of cells of the generalized map are displayed, and its validity is checked. diff --git a/Generalized_map/doc/Generalized_map/examples.txt b/Generalized_map/doc/Generalized_map/examples.txt index c38131ac9fb..1ea597a3975 100644 --- a/Generalized_map/doc/Generalized_map/examples.txt +++ b/Generalized_map/doc/Generalized_map/examples.txt @@ -7,4 +7,5 @@ \example Generalized_map/gmap_3_with_colored_facets.cpp \example Generalized_map/gmap_3_dynamic_onmerge.cpp \example Generalized_map/gmap_3_index.cpp +\example Generalized_map/gmap_3_insert.cpp */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index 6eae9275a75..0cb7753c302 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -76,7 +76,7 @@ The class `Linear_cell_complex_min_items` is a model of `LinearCellComplexIte \section Linear_cell_complexOperations Operations -Several operations defined in the combinatorial maps or generalized maps package can be used on a linear cell complex. This is the case for all the iteration operations that do not modify the model (see example in Section \ref ssec3Dlcc "A 3D Linear Cell Complex"). This is also the case for all the operations that do not create new 0-cells: `sew`, `unsew`, \link GenericMap::remove_cell `remove_cell`\endlink, \link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\endlink or \link GenericMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3`\endlink. Indeed, all these operations update non `void` attributes, and thus update vertex attributes of a linear cell complex. Note that some existing 0-attributes can be duplicated by the `unsew` method, but these 0-attributes are not new but copies of existing old 0-attributes. +Several operations defined in the combinatorial maps or generalized maps package can be used on a linear cell complex. This is the case for all the iteration operations that do not modify the model (see example in Section \ref ssec3Dlcc "A 3D Linear Cell Complex"). This is also the case for all the operations that do not create new 0-cells: `sew`, `unsew`, \link GenericMap::remove_cell `remove_cell`\endlink, \link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\endlink, \link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2`\endlink or \link GenericMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3`\endlink. Indeed, all these operations update non `void` attributes, and thus update vertex attributes of a linear cell complex. Note that some existing 0-attributes can be duplicated by the `unsew` method, but these 0-attributes are not new but copies of existing old 0-attributes. However, operations that create a new 0-cell can not be directly used since the new 0-cell would not be associated with a vertex attribute. Indeed, it is not possible for these operations to automatically decide which point to create. These operations are: \link GenericMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1`\endlink, \link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink, \link GenericMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2`\endlink, plus all the creation operations. For these operations, new versions are proposed taking some points as additional parameters. Lastly, some new operations are defined, which use the geometry (see sections \ref ssecconstructionsop "Construction Operations" and \ref ssecmodifop "Modification Operations"). @@ -278,6 +278,15 @@ The following example shows the incremental builder. \cgalExample{Linear_cell_complex/linear_cell_complex_3_incremental_builder.cpp} +\subsection Linear_cell_complexInsert Insert an Edge Between Two Different Faces + +The following example shows the use of \link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2`\endlink operation that inserts an edge between two different faces, thus creating an hole in the first face. + +\cgalExample{Linear_cell_complex/linear_cell_complex_3_insert.cpp} + +\cgalFigureBegin{fig_lcc_insert,lcc_insert_example.png} +Result of the run of the linear_cell_complex_3_insert program. A window shows the 3D cube where one face has a hole. +\cgalFigureEnd \section Linear_cell_complexDesign Design and Implementation History diff --git a/Linear_cell_complex/doc/Linear_cell_complex/examples.txt b/Linear_cell_complex/doc/Linear_cell_complex/examples.txt index 4f178f666d1..def1f1a28fe 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/examples.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/examples.txt @@ -5,4 +5,5 @@ \example Linear_cell_complex/linear_cell_complex_3_attributes_management.cpp \example Linear_cell_complex/linear_cell_complex_3_incremental_builder.cpp \example Linear_cell_complex/draw_linear_cell_complex.cpp +\example Linear_cell_complex/linear_cell_complex_3_insert.cpp */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/fig/lcc_insert_example.png b/Linear_cell_complex/doc/Linear_cell_complex/fig/lcc_insert_example.png new file mode 100644 index 0000000000000000000000000000000000000000..959598345aaa333b01be13f721ce70577bf7e52a GIT binary patch literal 19200 zcmagGbyQT}7dAfR&!5(&O^0FVZ zxcV|KffSB`&wyD0&S-k}q><4!!TKEj<5J_~O7M$a5ROLp>;6*eY)T@$#haK`F7WXj z_FU2YZ1S3jKj?{I(HN<-GeHbBm+#NDIg=gNt21@i0BP{0i=U=T79-#md`lHYdC(o^ zS4K--0x&}8tYqj40zGEM{K4|dk@f%v!EOjO1@IdFeSB)c_c8M7z!06A!gDt{Cr3w{ zH*O#~7aI#V8*8Yio!cv@B0^2mAeihv2m}Qotl&ZYJaYdu?m>`)tOQt5`#- z7S-OLI)tAKW1(dcN+S<=_H0^YQmWOI(vT@L4lMwu67Q%akA*(uM%B*+l@q%|T0)x*z=G-T5mR6I@0_KYi ztEO|+Q^jgBGc$wR9sw&=laP{yxacNg$D()|ua{}XjJ~`E*LE)VOu9Fm!fU z`gs?Jl-JG4q?uI=*8vCcos!T*!&;iJkCW40d#+ka8Z&~jc}IkW(1ij=Wn@f8L-J&# z#JDb?si2_X^CSZR?Ee@k`B#96 zp~iwjLTZ;2b*(4-2x47Bv-SEktv;CECr;7?4e6U>0fREr7IYFF@TTtzucfd@8ltNo z1caJB;zxNX-!FY<;YO4gnE9XBB-&_s0`sBZ+ynOYf0G>oG&+g@YdpPSC*Oc0v`u3T6JU@R{#n3wP=b`#Yu%?xp$Qi*T>0zQ$jFn}BpN`vrkLYZQekb)RqR-y zY#AYXP%kgCY$LwuPC%1y;sL=+N3+O;QKtcMZ-{3f50nyX87Jd1{=IHg>a`LS~ z&B?r({j$}N-P*1x;{;pHph@AV{);Tn7p`pVP@ZIVm>j11s-FX_=o|+mwyqS>@2C%AR4N5_R|X zu-w80_~!MD)Ctq}q{4b@$T!?#LuZ=ZbC*iG6CD%$!Vq z{n_cVx~yJJWqY|9D?Ksjk|HK``t*{w3Y!T`^u1=% z)cEKi#i>=4M)dr0vaJ*VzlOs^ae>!%2bg&*k;nM>ATCgX8&U2G8hy^nlP@Yw3Dv6F z^_KOVJ?3$o6%yH1XN{=d^BmfU@78huy*eP_sPkR3jw#TuE_^KONb1Wrs2;6`csDiQF{Bz|z<<(!O5pq1_g-!kj4UdjhV{eLZ(Z zcGD{9^QvEUXQSUUO_v#@2R<)*?Q7a3<%X1U+l^^7%^PVZyE)K{sHw4ypD5lRwln4t zvs(R}d^*FkIa8w-ce6{xWAwzHz-DLq@{=heT6yP@+b!46heEg#WYlCFgw6>O<>lNe zYw3ZlZ`y7=0OGNmYjj6vFI@k9I$dsoEN$E@^jVd8%oQ@eURk9?0rmIzRn&94>H%oZ zsb*OG{;X9a=}Uu52`SF>Rnz?%ojm)}Rg3?wp38!-e(rzVczUO7%=Yo6Y4P2uXJD~T zF_UA{-okN$nRG#^zoKBljeJS{igJs?4q@_3#KX2s#l1%3wt&CvEsa+}WTZlNm*46( zhi*4b#2SXzj(ABuoh7fxVrIMM*4rn{HZwiBCv&QJ?AGr&Hm}j0q%8HkKi$?Ti=QsR zlJq=#dfcg2X7A+G7M^S*xYy-+d@Ai%r_b|=?W5Un_sp#xd26*wlkcTl{cJJak;X(r z(u;ye`j1CGB&Q$ax2%#+Y&F)DRKDLG&2k&$wz2xHmi1daQsT@P>Lu05FOyZ##`;3VKPDY=y;y$KQ>oQ6Y^Vm>DzHDpMzMb z&s;lVOC`*|6w5>!WJ7b)Dzpb|B?=>aOeen@H@SaDFGozq@wR1^7@Liwl#_jTFT^Ue zMzm6vKlmQc@&;xzJNYS#`-Tg;4(7ihA%A*Z72s=KJAb;-HsKq$=lW)7=n9u;DD1u|C!+D@ zbcP)f8yk!Hi~G2q0V7qo*eK385f(jTXgf~;NNJFq>{>rnr zo@5`NCK|*O$<)#r5oYtL)V!LSq8!7@>0Af&WzCM_(~Z5onVhfozp}a1#E!eGE>9T6 ztB)4*P6`&xin|ZDd@5awY8eyhIW#7Z|6-jaJ#cu|cX!16H`0gvSmmMJvl+LOlkHz+ z%u|`s^S1OI3Cb@Y0h3tw*(Q^rPw5y+OS`p|hsxJ(DkN`mw%-td1++$kY}v_D5<}7PqNt2b3Xgd zckeN&Q0*&yf48vwJ7P{-(@gPT}g}Rt5BF0r0D)rg1CvvFxO}t?|m?_)^Ac z?_-J71T;kj9=uU%A=pU`%|2jN26*SC&AYXwHNQ^0++8TdnP4!vt`#_5Nj-Bo>o8^HR(UA2&J%cCcR9_>INmXj zq!%gIs|(yQJK0X*UH^XbOvSh-ZMiWnz;I8}LT2V}=fT`@^qZFbXy4=QY4TT}mqos7 zNj5F{_`7vZaeaNO9#Pu39ZCVu_uu~R@3i?7&RTRqZF14qHrDu={c|SlGd@C*<9bsv zZk^-I!$D@W=DJX0Q*P_816s8B_G`lHP3~m3kp!6b*C#k{@4&!DkPSG z6nx*F7R2TC$hc=7m7C`1$9LQ`T+}7t-tk*t9BQ}Qf8;*WCiRu$vgzc|!KUQ-iyI32 z*RKg~XMeyLC3F*u5y_3_HG^hv%hCeY3FkZwzLH5w=jT#Q+Rbg?_#8Y&;DFsf2PaV_w(jnN;%{-goeU&wWt)XS&wN zucaHGMOYaUK7W<0CR)PPVQ-i%F)o+VZ+(_$z<9%quFf;lWE1Xr0aQhqY887 zldZWH6JBz9Lmu0WETJQzKD4#k1U1;(?zvy^V~HiEn^#v-lBd1GEo-<4l|qKL z9>rs?BLt>?4JM7bclCZ^Y}|5^E^X?T)Ss?0_8riknYA(Un2j5+*|OPLpDzf%e`T%q zx$tjincdatTyn#W-p7(YvDM;)@%p2?hB^))7C?Fv3^8Qet3RXMK}VKjn=+m zs7d19q4QCjsoj~}8%ozZ$vvr5OHRLY9{W`$ck`_Bfy3qpF0q>|V)xnH^sVpUr-%u` zlKNL4|EkVq^(9*ON4T$-Yu#0OZq}Mf6d`pq#u`1%vJ*J=#&D#Y4S1OfELcfnJ2|ke ztov)yypf5mH>{mP1Wz^teUNXipXHrO+ypUs`+t1w^K*6TC&!j#`sIhe3rECrXTNl& zD=s*u56-C?|0JXji{DrO@bz$il#xTHM#HnJ#(rnx^7nfVx5a~n^`&JMpXNMnhi;-0 z@up{3tG#cF|0;;B{aL-|&NWe;AXvrLXOyuz@OOQ!Y}F3l+L#L4Hj zz<2C=Bty`yVNlFHs=8CoSI#dyRjG43xVkUcER-GF<#XyI?zDI}^ECL$ehkeO~^!{?EOe?cB2U9^RHLjzT{~*-!YQX z(_3DzDfMWPsI!ra5aP3DD?+HnqKiL^-JLxiAI*7O^Tjt_{Y@gbP*ERRSE~57lf8z= zu$V3qae;DS}r5`==KZ^JFIj(J+NVprxLaYXmrdh(e%lAg^nFu zVr$oR`8BU49G7pF1r_pI_NW?9`;Xkd6(hvNG$&SmI}PLQwWu@uM%0k4ohsO*)goTE@q5kF z&U~7INAiT4=abm(@@t_YM~~?K2r`w?znjO=ck;|PNF5vB3P&~VndS!j)RBzL+nedS zGDYx!j-bOZUE^YZ+b`Q&%aWH#D?Zzqhq^z--xLBh^vK}CPSUjcFK>g}&$mYn!dn#2 z1>8;pZ$3y}zjt-FywcrpPQNUn`RTwF+x*}(uj+y^Y4ZnHXI|-qEAQ}yfQh=rgd0!b zUEayCXW4}D-`aeO{R}cDN9~z!IrdIsPlO-p7!`kfbic6Uq1{BKjnRurL8}X*)LH93 zdr_79-2YuLHrIj|wJ1X*Xc9SrZ5F%jTs2bGg{P|LM#3T@=X=);peKXF94ABREru!J z>62QGz>6tvQV=KE&!0b&RD6^>@9{6U^|Rj5BUaJIT|jpZ3d{WCF@*VxUM`uHZC|7R7f8#4)%yLld$}dd+zU#%pd=td* z|MQQ3(_54CZou`a@c+%gBHH`p|5>Tt%COT+itm5JS(@C4fBJ08cMQB_BDz=gkRrAj zkR3$leBM9^Y_z}(Wgt+U*QQMq2Nin%Jw3$6k~u##SA_+-htmSD&9Zgu_K3e#-uLAZXfnm}0?XleVWFU)4@8#0v*mez}1;;TXpuW#o_r<{ZA!NB zY5a))*G5`x`K-c#EGngo&b!>7C2U#5>m!nMLF&?>}#P$44I#^Wb)2;wKKIEb8^ zZgeqr>=VF@?0PaJ5F|q`p1x&zf(1XSIF;B^gIqiHkHC*0sEqyya!ost9*W;bsDP^- zp9Kp&R(f{1+FlS_pMaOJJktdu(EJsO#m{-E8oo^q3w?xFBra~1!cMV@#;KXMrX&af zg{hE30QG*_!HsgD7h|wpwgrRD#r>5i-3ZOB|3Y4K;OqO%_)gD7oqG~AYP9r3ZFy1b zY!!(X4K7EFKa+4Y6kprwPIRFB7@A$S%`q%aqTpAGrA5&|@wlik(w`nLUc}_$+kJdj z&(5~8W;j(1W#TILV0x+@XkOjAH!-EJg$uma;Re&NM4kFqa^tJM#Rb+`-oUa%sq-rp zwnBOB;4Yq+!3^^PU{I95cZ^R~Y7`rv1_Td^$pO0$T63ymu~=$0S7+ST7N_=XJl%P^ zc58|a_`Gxly46V-33qe_U%pvlVg1^_>C?o27{4b1E z**D;c5mZEcKZm0>pBpAcz0So0)bEtJ#kr?*l7mm|LQDt22C} zSVw@jve{(v_t>6~i2)BpEFrDt&&Ah7XgF_u7AXd`fRC^@unOSVmgZGvkH14T>b%u0 zZ*b5!z@mhr&yQu_>mW%;IiUDqD#Tv`x;EbdA55QMVX)G5aScIEWw)O|*0F#XE+ zrFy>KB4IHb2)YdA&c?eZy_?pFjR1JP0B)g!-v#Y?hYaM}$8H3KV*A9D&4t%{@H$*~ zg07rTJKKe^+#C4-us}9GhQOl4jzdSWF>XUKVcb59al3inW?D(a^j(KeB9M$^u(Xk1 z$NU3RK@6FB@g~TYp-zG zV0=B59kc=fQi)pi;(z3ShLQwgsI>c=L?`$H0V`E*ZNTAq zVlM+ku=pd}LdOIfD(wo(E_Zn=*ZxnmL^*}*YB6$aTfEZ z4F??^ilRS(LL*=lM;k{QDX6TF)&-r_qf)c}4<`h)c-5s~A4JPm@3d`+THSc>p~FxC z#8tb2PdRc78n2$RgxdveuKl0y4?|(ATyjg=K*E@@G+%f>E~%3;<8%;DkUbleZU-56I~0gBpk7 z0n%hlS<1KoUt9ADMK(BUBainYXhY`{>*z>68kg)f>2*UX0a1P)L&0)H`u%C-mKoN> zkRwiftDWa_j?=RN(Yy*WctAafu}|oCXx|t#?#!rMA_sdgj@}J`)P4dW6^g#A+$=Yo zs`BY-e2O4o&|WM6OhL5g+jk9^$bj_qMZoa7p!T9NBv}+B|L}FLPHxH~6xo6^cr^CC zc!JK_n52-Hx+Nc!3`pDM^NmG_^Ce(}Y%czN@z+5Q0r*LcB0rFESyw_TpwVnF{C82o z#^b?9YRQ@yvWrCkgwdgmES{vZwlcJ7`|m4&tDuPEAXwOnm?L0_b~9sr&myKbZ8?R= zGhrka0HA7itbkfxRhVTr#%)47^*pgF5=blsz^E@qal)w&d8rT>UUAv^6j=x4HxyDg z7hg*{sW}HQf+PY+ zN&Cr!B7t!n+|4IzXItpXy`b|2k+)E9x#V(ys{Y?tf5$Gi!AWnQ*JFRwaZV;dtKY#vs zgRc&LH9$ur$f;Gp3e|NX$OjnQfWJ5a zcsm=v;6AdtH|)-%aErWo$XtdPaLr2TL_E$45V-ms`vOSdL>o8w7+^JXrGJE|!n9dK zsC*9#4i%LFz)zV3xbL;-zP_6I<||SVyw}c0rUl-bfZrAf)<#N129Hb1#Z?E6%6Y!| z7p$6P4AwRCK|p*U|3r3N8Z-e1lmEL5aPDEx0S*uk1dtudvLP!m^CTN}EtQQ=;ofUV zi*`=y&{V;k#@M+V>LFK^7 zM_z!I)*M8Mi$=D)XlDB$t!=rAcQKvPdqOl{-sOi@>!$^9eQlga&1>IC03L(N_{i{E z3a_*`9ML|0#*i4S#>m(c5U{t*p;tE|IdikpX03r;07o0#T--zU?|z{p!6cK^CnxxQ z{qi3fyw-sFdp2%jj!6dkX%6*;_IyUPn2rRaW`i2};bX99b57OjSmw}hEYIZnd{3wM zP(30vMTSJB%TyaFuY=RKX-`)wO)&PZi36OEu_1mhoZkAI@{oA1F%ka&QhuBGTI`MK zp?VLGzWZJFFH1=CK-~qQ04)%c${5k-SK2qz68g{5p1%9EAqTBA4gK_m7WZ?<;w=H@ zB^fdla>e>v|C#TYKWC>QRG4Q&Dc4Fvl`KR$4k|#aI;RMfB9&Rh6z-aCr*(8?LI6Q6kIfjR_wHE1-j8z=Ih^a&cj6K7gEPm|4n-UC^st~ zfD;|?24}Wd=0w&7EdWG$UgoPKU(YkVh?OI%|{9QDovq%MsfxPt+q0xR8*is;8 z6i&50Q_$Q^?tqW{)B!Zn7wY6$XdG?)p{wUwOyH(Ekdi3gv zy>Oyc==nBbQIn+eTg&-yy6}kmWT9u?gnr~#1GCJYiYF|6 z@Jg0cJpTMV*Q6~Xu=+wKI0$OJ6WW8V)bIi6GlG-9wwFjQ8fk@(1Nf@(ID>!~%GEMs z%PBfFHk>)0+Sy5Bm>6r`N&H=jG<=J^H7EJ0*?uw}9}*};&;T8(xj=4EAxS==emVEN z<8jIy&s&VKF>%&w=o7@iR_p&m;NCZS)8}))y^9&^PVEWhYgb?!urM|U((NSu_xAWW z*jWGK0)ogxm0ETgQKGCb7yZ35UlqX1aiO!Kq?`bC5axl!1s;GEzI4-?azONb%7M=I zm)P!c9{G1w(!x#hO-h0*I+ARlw}OIu;qV0Hb{_djFMLoN=S)nYCl&jrc{|X|Dj|8G zU8M z2=Os9|I3>|=0qVI8+|xZomEINMbsa4a+*DPGNK3ISx?wQQBD-?Cum=q4jA5aP^Rjj1MY&1!^on-MvYkwY?eZa2fY-)~ z?Z@>`IW2VY$m~fWzBH#Q-KwH9eq@KIE>;kfS`w%*Lbf~iWfR5EtaXsn(GOCH{0Us~ zada49ob09{e1I@PEA4lBo)z+6=Y5dd{Xmxwrw!#tE{#;xxw3$PWCzp;OrlfGD<*nz zuZ>1vc1^qf*KG5bhfkU@wZY2~m4Rfbk)wcSdIae=0GHnbQ#~`_ zos{UfS_UW^P>$^(81J%cCBusR>SodL-Kq#sjzI|uL@r=p?|3ATdC~F`;vq--vS=4n z=?O(~Y2UpQFhI{DKfLm-@H^L^45&Kb;=<6!&}c>}7f83%%f9)g5^-C^X7yaR<2v-N zlejn7M7-lApO*?QK&U`Gz)2V%xbVg60Y|HjPKn#DZ%TY$Lf>-M(ykbj&AMXWeF}1T zQu?o#APRzp0vovC-r$I)*W4?!5HDzQnPGXi?c&sga8B8A{gMmpT& zz3>v@hd{T$Q}G&`4d2u?d>9+3+A~pHI4-E4Rw8@0iN|9~Oh!}`5lc&9tt12R=7QiP zbmt}(Rzy+2E})d`1mHK2D1jN-Y(fOn?*(4VXZZ!4T{+&odJ)1~E{KuB)Vuc#V_^ql z(GmQ}U~B~$2ns-5#d|3!(fpb?Lzj$an~+io>mncQT$d0_z4DG5FiHH?6S z-?~!g8Q=r273l4Ip(_`@7lHdbzYejMm##Mb>%l+}^XGyMRdJ$3K2nHA%8@t znvZ5V_OlhJq6=z#P;&0fnxM9;@@PK57K2>CUO^09kHIfD;D#onC}jNc_swLt;@kEG z$^oiC%6W{mSn$Ya%z*ttqRzjceqsyNDnqRbQO10QIFkcF(oV-94#-{ZW`Stb*^C7E zk&xTWpqHuhJ30~wSuql|NoKa;@E>54`kz&I!V=sS4Brn2s5!9-W%D<%irBhmC|H5u z!8xObEx4GwtBp)Vosh@mMPZ-4i=O?LTaeXtj_emNP)Kez@E}?d(ojr8z^Up zs56;}M7zxYuMntK|529v7S&YUlmqh#1l1rVh;}MN_J;R!3aJvoQm;scP)~`#EB#yo zZ$nmC^I3g?gE*$4g1GviYRIG=RXFoXsuao4{%IB^ai~;_cNLd7YlDqx*x!MA5Ma(I zCNfCqiRf=6*^WMu&m1?(}4bwQYDc_ixib0lE$B_Eqzh_oCBumF zkQ4mT;B1(u;ziSkcuc@4v468m(W8tJSfq)xK5O3XW*QRV=@&nj~g1@(>#+zv-6FumtR{) z)#**u@{v(ocIJdOD^Q!OiNw(3f#5UTb_Y7k6OWpt=PxmBAU~oL`zmhtkAYsj1;GmR z(i&+IMvq42d?pHLd>N<04gNrZiJo$c@$T67aV53f#;|=BQuROPG<*Fr;9c9vW)dnk z6gCtLyPF%~1)rXP$C(!Em^!A!BF=!;jv&OWO!!%%&Bp1(f7q!a+oRzZ!Xx`eQDT*x zc>*+&gfe8`<~_L;M80GK9a@ucYpsXRY-@{=04=~+xS4Md`FCuVyrez9nP>DFDkZF7 zye_DAsa`lKLWH}>!6g+9DPx#gNU4}l;lE0u?UMx9o@ASd-&h%G1#b;u1qXyq+wl0=P?5FLgfW0<0fR=?owvY{` zt|g+Mw zShffnr^-!6e==K)4VFB#+JzO8A%|;0q7Nhpt`DL8>cTgG(()D(3!dDOuj}H&Tkz1x z3^gbieoFqBaLJFx#OW8c49Rxg(Nn+ub?6CDuV$N4{(*#9^$;|ucWlV(7v(6wrKNkl zk)|g{e<(=JZy~(`)fQE%C2iaB;*}7r^$va70wiT90o{kt=L+xxQfaT>hgXhf)d>2R zzxOJv&4@(08)Bk=4v|7YQcGZl@=)$XUBD>sQM^WWRA(8>WWU=S`WWrU)FlR^Ahs5?=I zHr^Re>S%Z^{RmL^<{{(qtUT2zSd_@Pc~jpqsBjxFBQaF!@_~hog-CgCA8F7Xjnvbj z_sL2^zSvDV9&fwzFJgx&i|$|9?WZu%rYpikffdfsn%?%D%BiycJwnUb9fivDMmuMs z56HaJ2R|u@<}XWns#4-xeZY|}qN)GL_=s z?L7Cy86r519J7~XLJd9`DuWJPY`b5rwEHw5;(p$~SF?3uxN_E!BM5n15rYr3eK17i z;aK8}R9Wo;S^tnf9$&;?6SLTQp~6{IZGTiUJb$7Bws9AljAwaXs?m3TUH7=?w3r;g zdKCN85ygBg?4_1wYdCZB_KqG9A>2D^Z*5J+=!lmM3`rgmCidj%1_oPB0X)y>hfd%J z8kMBb3i3B@m8d!~yubokkxp{c{KWA1HoHl;xRG|Z?$_JQ3JC#CSMO#nfQvCk2QwxDni&B2NCV`Ma$B*BhTYkp4 z;0Xue1w~lBPM9D7Ezwg(N3+U3-9{rnB^(#X-`jb1Sl2XV5BB#>B0O<-g2r}Az!HXt ze44O)>r9_>*i6AToPF@iLVG3Lj%{$i5cjUhR_SA z7{Z1bpv@P;1gbUWT`iBGp$H`Szy#31BoCdDGn$hLKG16>xIZ-Wi+2=p`7{RV-p zsi-WfNZFMFS#%ae;_f_n2NISl$k5+D9_Z2s&jIQ*SIEoYEY}oM8pSM3TAj@$Q0MsI zrv;IEDh38BkzUJIj{x9vkbi4yMn-M0}n_)N9`cxjkD(}+3?9cD=;y&|Bu4}4b< zAKuvzk5nRUdhg&zr7aG?E0evWm6$_MN#iUfOt+&+F*TCA;s<714HZhz=p4@cZCi7BcXRafLy;OWErxJ|$S>3~^s?&A z#eCBRZ8H45dG!-N{?*i+L2R=VmlwT_llAhj_rB6ydSgn3kU>{I))8|(cG86HIx{gy z6N5+|0Yz&Z&miB*Lrz@2 zGNs(4ikT8FYY8-SSHuv2LNwj<@myVNu6dwejJs z!GZ58sF(7s6!)eIQj9L(tE}BGRod{P0FPPdgl-k7r)Z_OFaH;y)R-Ty3!^h6NPBor z0WK=)t6e@zW_Z21{_ADS$&`jL&*rb7R(6Daz%EjFuEkhgbK%kI7fxCXQFGR^O{GuK z1?(TppdOC7UuP5jhip}@9octDu(E_~+0Lx`KkS*s1`f%3*g9@M^zF+%FOZ#8h|MN4 zH6~r=T@jJDU?oeTamQ_L^$g%H4ol*YdWNxyQpgsUz~xdzMdH!thuIc|Yz49O@(#uxaUPyI?|@q#SC9ak=^%u&lpgva>Y=r?p0iU!+OmhV zyWRJ@yMx=d;fdc1r>J}9yqd+fMP*V2PG=h zFOTRgx%7&Vo{}t0r6BH7{cfgJaF%gjmM>zt%TbE}*zQk!^d(y!5c{UG9TIxxS#wYk zF<|*KEfXLQ+(@W`v$R_G+mQ!)kwsfJ1S}GUe3=qBfirZ9KS4?%l)P{cwx!LqvVP8( z^QSH8sEu&GJ>(R&x%U|#eNZTNvxiwnbzBPy9 z?d!f-w|KYuE(Nd)8^NL|qQ2(j67_B8`o0kQVV6)4WM1ICxE?{;{W0T5=Gaoe?p{zd zTc|5#ng0{pLhGRAm1=$1APxEhUeB(ybMT)on%E-z44@8?;Y34r35B?{pnAREgnTG$ zGH z4U7EXaU_-WT=)slx`u#;5dh7-)xo<9^tA5q_1yD^z={<fqD*ke90a zTZ(q#m~P*Co(jF%mrry%Y!X(!pV;zL!dc+ ziiLv8gdo1HNtiqhm%f%Mg!C8DT3LLpqZvg#JRgz`*;%?)7f6fyds=q0Wm(ttpWh{_ApZ>UG2zlEl zD{=&Beq5o7i3Z5qD9AST=Nny%Vt4H@&ZfC)Qg|1Pc;2a9cZhNTKt3Cka6{!@*0%n# z>b*ljlaava3v}4KR9|(G)XaFUK?&?P z$~;7eF6RAp%OM)>mpzW=)4OFn6vbUC8Lu9Dr20XDS5ZJn0N+WLznK&-3PtnjyQU1{ zoGRrvX-Cobgmf&5H&^OBJ>obln^!Wr43EMMA-8wWmIf^dM*4wzW2|2?kV%uPSuI$w z)fzVlbHjvkv+a^aFH#ElZK!kxk=O2%-3N9WQlzIBm~M-dy4Q&Z31jIH2HDgz|7Ak|!g zY$CWd%q%SSUQgks*4N>(*VIpa`f$6qf_(q}>pW1hi1XKrI;;gDSMCA3+IZh}$`;Kw zza`=Ay$d=T>CeUk>_W!YaW~Fc5R#;8u}$!uK7?TJ95Ma~_a33N3U}Nam0*@^!d%gB z{D|{}v^)N#<9m}`f=<5SPcH^rbLt<^bn}~NS2o${QtCX&;mlKgcC&jOFmu1ge#op> zBRFgBnKhwI2uM_!a(6mtVw~-X_f6FBXkyh{4>d|=8cu{YXw{$bkdl#v`gaSHo zE6cvfvkdeNpIN2OE9Wm|?QUq5ZQj!?!;50W1g!;I=B+Nw-murDkgs*CHtSZrhm-j2 zTwT%MO$Uw%&@&<^{b z8{V^Z%y5af6v*DpsZkbuJ6C60kb`WP#c=)D@@E58VpY+$>rvji&2Hld*1bFwPmyqV z8WZJ8Bj5Zqwo*Fl-I^Ewf<%AG_+Fhqyy(nt$}BkRAP)z#`-Q!t$RJ_%ZdFvz`S#{e z3>W^^3Z>f-K!z)d4crQfrndN_iM$)+^RFRV@>oHT!@GEiy~_;t4|fanGG6&nb7}_y zVY#AD8InUZud)4G^&T1>#xnUxo`cww3TN5X7YG_67~yT%kA&x;T!e;^fdrO*lc|%i zND&)Y@%#BVm{T557&`PgmuSA}RX7wC1|8}&qfA_wJyIw_Nl-6;uduCN4)XQ^vA(Lo z$#7|frthl!vK70+ztCh*`DTlq{%TazWaR4L@Ch!zDb1h%LLzM+$U7S5uTfFfc7Q+x z?U?@;pj+)WZ~^)oBcmuP^iuu!t!mQo9Z9qZvE?>_cacH9SGrzH#!1_^?w&_6Ou$=s z38Bs!m4>Fquos5qEE3Q7Z2%%E)}g`F)>!SXXiYPN?Y6Mvk}2B3M~eYJ>JuL+XPLtM zD;IhBY3HIaw3?kjNjG1Zu)v?&G+}4IUJ~cj@kRG^|8(1$LIrg$5$q0#Ah!YMo+GIj6dYd07vee zZc&Q?dIJ#o`c9nh1qS)oj#g>H8_RDeqyRT%gtOIq>XN{__;D#(QQ2}d+j(l;Ib5fB zQKqKM7`uVkIt(IGCUs#Zm5?b(~J?Ce<-`V`rFj9$fR=hw&C(PW$@MwlLYOi|ehJPB0ZNTiJ5(Mx zgyh$*r=7PGC>ju-1fZZlE8_8iEzyVUQa}((2?FvfrY$d>P`xqCZv0{~;agvYYc&o#5FofWAJB#}b$(=||T&im2KNbaLMtv*i zo;5m{0xmPW3h4auOZ|WZUcbj^^47{G`t3r*uzYrEw+*|38-TPRKJ^Bw(o*h$N{a9X zev{>JR$?uU&+;_r`2RCjaA0UO7%WNVP^##fxcAX98+Gn)UJyI<*4)}*xb@J4uZkVN z=A{N{o2P|{^?ZNQ@CRh3j4DqducOOV+2gTyB=+g3nCEVqrc(p*)9ufOwg#`?XTOPG z%K}ai6Os}qh-8SmzY?7^p|xbq#sF`zH(VmUdsMiAMT*0!7R8<^inU+4UQTP>vCLOZ z5iHsm#J2v>gn3o1500O{?9-u=a`5l+!~Ni9tb=2#;_I(mC!BWdN?7%eyFr0LBu?U! z3U?silqZ2=bEbeNa2N#G`ekzkyQKHpA6|3vPyDzh6yc-b2m-cH&Y;U66@nhsuI8fcHlmQ78RaLH?sNz#m(Jriaw7O(*hN4Anh9s zESB3bMx!4HGN#3>7-Bo0O1uy~a@`R26NQ(^hpfA{F!`+dLU{+ih` z+d+fVEDRo<1}VVQ<-ZBMvX23{Qqw_f(bU$Dy8UO97l2iqm|&p5{qPjH{$Ox;*8+5= zHN+zgb2ty%q$s*XLKHekaA|RG-x{~x`&*sU_jAAOp8%K5F)$oz& zS|@(^B>^lS7&x3`4^5DbT%i*%1zZ*~D2OF`Y}UDR>zC!;-1q9G=hyuAtpl0l5Oiq5 z(iGs*JO&022Z>86+~BmrFu^I&qg}_~09Z*@t0HHlL@U@~3_&_Pmp)|m7oKGL30$26 z+`=KiW}PXq-=<{7rVr=W&cA&7d!3j0wwS~6Oh7j`tnqBVyuszlNhXk^CKM({yx3*4 zWqay$U~LR^v*V{Je{t6yKxIB7P>e1~_f3%e$@^Lm18{G`fq%vZ?E)T;gnkhdTLI4o?a@66Ky^oT>< z(F3I&iAe_!9eEElMM1tvq22C&p;+_fb0B{@>=R-MKF#RGXRXK%)OvJMOV_`BD*4$8 z;3H;!PG&y7Rp5=77kDd7jDP`SeIo^P-FiVU5{weQ|Bqu?81uL~x-w(RUx7m}&Yw~iGKgvpkh<=X z8FTA_JILP(Hi-qZGYkw}HFm3Tg*x;2O*4uUGx1~U@ojpb!sY?;pGl^ZZlK2QKl_u{ zCN6f)F`Rc%B=Jjic9Y5#FW{^_(5ed6gQvr9J}orud;KK4(<$S9OZ-SfT&>QztvsaJ8< V@pu|;^a&`;;OXk;vd$@?2>{a8I)wlL literal 0 HcmV?d00001 From 21f945ef99c05a070c1ffd0b8ad0413f2def27be Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 23 Jun 2023 08:48:00 +0200 Subject: [PATCH 084/156] Update change (insert concerns both cmap and gmap) --- Installation/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 02f9b3654ec..72aa6cf6103 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -11,7 +11,7 @@ Release date: October 2023 - **Breaking change**: C++17 is now required - Support for Visual `C++` 14.0 (Visual studio 2015) is dropped. -### [Combinatorial Maps](https://doc.cgal.org/6.0/Manual/packages.html#PkgCombinatorialMaps) +### [Combinatorial Maps](https://doc.cgal.org/6.0/Manual/packages.html#PkgCombinatorialMaps) and [Generalized Maps](https://doc.cgal.org/6.0/Manual/packages.html#PkgGeneralizedMaps) - Added the function `insert_cell_1_between_two_cells_2()` to the `GenericMap` concept, which enables users to insert an edge between two different faces in order to create faces with holes. From 518c32e193d80b74c0bfded1fbffb42d9b38b2cc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 24 Jun 2023 10:21:22 +0100 Subject: [PATCH 085/156] Update change log --- Installation/CHANGES.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 3c60725161c..e909d9ea8f5 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,6 +1,15 @@ Release History =============== +### [3D Mesh Generation](https://doc.cgal.org/6.0/Manual/packages.html#PkgMesh3) + +- **Breaking change**: Removed the concept `TriangleAccessor`, the template parameter `TriangleAccessor`, as well + as the class `Triangle_accessor`. They were no longer used for several releases. + +- Removed the class templates `Gray_image_mesh_domain_3` and `Labeled_image_mesh_domain_3` + which are deprecated since CGAL-4.13. + + [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) ----------- From 28dbd6b8eef13b78c6318efda196e423548e1aec Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 24 Jun 2023 10:37:39 +0100 Subject: [PATCH 086/156] allow -> enable --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 24 +++++++++---------- Mesh_3/doc/Mesh_3/Mesh_3.txt | 4 ++-- Mesh_3/doc/Mesh_3/PackageDescription.txt | 2 +- .../include/CGAL/Compact_mesh_cell_base_3.h | 2 +- Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h | 2 +- .../Mesh_domain_with_polyline_features_3.h | 2 +- Mesh_3/include/CGAL/Mesh_triangulation_3.h | 2 +- .../include/CGAL/Polyhedral_mesh_domain_3.h | 2 +- Mesh_3/include/CGAL/refine_mesh_3.h | 6 ++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 65fa962d512..acfb0b6efd8 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -60,9 +60,9 @@ unspecified_type manifold_with_boundary(); /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::exude()` allows the user to trigger a call to `exude_mesh_3()` in the + * The function `parameters::exude()` enables 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 + * It also enables 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" @@ -131,9 +131,9 @@ unspecified_type features(); /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::lloyd()` allows the user to trigger a call of + * The function `parameters::lloyd()` enables 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 + * `make_mesh_3()` and `refine_mesh_3()`. It also enables the user to pass * parameters to the optimization function * `lloyd_optimize_mesh_3()` through these mesh generation functions. * @@ -210,7 +210,7 @@ unspecified_type lloyd(const Named_function_parameters& np = parameters::default /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::no_exude()` allows the user to tell the mesh generation functions + * The function `parameters::no_exude()` enables the user to tell the mesh generation functions * `make_mesh_3()` and `refine_mesh_3()` that no exudation must be done. * * \cgalHeading{Example} @@ -246,7 +246,7 @@ unspecified_type no_features(); /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::no_lloyd()` allows the user to tell the mesh generation functions + * The function `parameters::no_lloyd()` enables the user to tell the mesh generation functions * `make_mesh_3()` and `refine_mesh_3()` that no lloyd optimization must be done. * * \cgalHeading{Example} @@ -269,7 +269,7 @@ unspecified_type no_lloyd(); /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::no_odt()` allows the user to tell the mesh generation functions + * The function `parameters::no_odt()` enables the user to tell the mesh generation functions * `make_mesh_3()` and `refine_mesh_3()` that no ODT optimization must be done. * * \cgalHeading{Example} @@ -292,7 +292,7 @@ unspecified_type no_odt(); /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::no_perturb()` allows the user to tell mesh generation global functions + * The function `parameters::no_perturb()` enables the user to tell mesh generation global functions * `make_mesh_3()` and `refine_mesh_3()` that no perturbation must be done. * * \cgalHeading{Example} @@ -315,10 +315,10 @@ unspecified_type no_perturb(); /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::odt()` allows the user to trigger a call to + * The function `parameters::odt()` enables 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 + * enables 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" @@ -395,10 +395,10 @@ unspecified_type odt(const Named_function_parameters& np = parameters::default_v /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::perturb()` allows the user to trigger a call to + * The function `parameters::perturb()` enables 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 + * enables 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" diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index a802ac4df08..43660034018 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -494,7 +494,7 @@ protecting ball centers that are consecutive on a 1-feature. This parameter has The four additional parameters are optimization parameters. They control which optimization processes are performed -and allow the user to tune the parameters of the activated optimization processes. +and enables the user to tune the parameters of the activated optimization processes. These parameters have internal types which are not described but the library provides global functions to generate appropriate values of these types: @@ -679,7 +679,7 @@ View of 3D meshes produced from a polyhedral domain with a nested surface. The following code creates a polyhedral domain, with only one polyhedron, and no "bounding polyhedron", so the volumetric part of the domain will be empty. -This allows to remesh a surface, and is equivalent to the function `make_surface_mesh()`. +This enables to remesh a surface, and is equivalent to the function `make_surface_mesh()`. \cgalExample{Mesh_3/remesh_polyhedral_surface.cpp} diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 63141c257e0..c4221f3cfbf 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -27,7 +27,7 @@ /// \defgroup PkgMesh3Functions Mesh Generation Functions /// \ingroup PkgMesh3Ref /// The two main functions to generate a mesh are `make_mesh_3()` and `refine_mesh_3()`. -/// The other functions allow to optimize an existing mesh. +/// The other functions enable to optimize an existing mesh. /// \defgroup PkgMesh3Parameters Parameter Functions /// \ingroup PkgMesh3Ref 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 d30acbcb141..1e5ee765731 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -437,7 +437,7 @@ public: // CHECKING - // the following trivial is_valid allows + // the following trivial is_valid enables // the user of derived cell base classes // to add their own purpose checking bool is_valid(bool = false, int = 0) const 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 2abcb9f3241..dad06a5540b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h @@ -673,7 +673,7 @@ scan_triangulation_impl() typedef typename Tr::All_cells_iterator All_cells_iterator; // WITH PARALLEL_FOR - // Copy cells into an std::vector to allow the use of tbb::parallel_for + // Copy cells into an std::vector to enable the use of tbb::parallel_for // which requires random-access. // Note that we're using all_cells_begin() instead of finite_cells_begin() // because it's faster to do the is_infinite() test in parallel. 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 f6de5e1a078..7e5a82c03bf 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 @@ -517,7 +517,7 @@ struct Display_incidences_to_curves_aux { /*! \ingroup PkgMesh3Domains -The class `Mesh_domain_with_polyline_features_3` is designed to allow the user +The class `Mesh_domain_with_polyline_features_3` enables the user to add some 0- and 1-dimensional features into any model of the `MeshDomain_3` concept. The 1-dimensional features are described as polylines diff --git a/Mesh_3/include/CGAL/Mesh_triangulation_3.h b/Mesh_3/include/CGAL/Mesh_triangulation_3.h index a63c09a0782..db6db640c79 100644 --- a/Mesh_3/include/CGAL/Mesh_triangulation_3.h +++ b/Mesh_3/include/CGAL/Mesh_triangulation_3.h @@ -77,7 +77,7 @@ public: // because of Periodic_3_mesh_3: they are functions for which both triangulations // have fundamentally different implementations (usually, Periodic_3_mesh_3 // does not know the offset of a point and must brute-force check for all - // possibilities). To allow Periodic_3_mesh_3 to use Mesh_3's files, + // possibilities). To enable Periodic_3_mesh_3 to use Mesh_3's files, // each mesh triangulation implements its own version. const Bare_point& get_closest_point(const Bare_point& /*p*/, const Bare_point& q) const diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 2abd37c3d77..8ffc5d6f93a 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -262,7 +262,7 @@ public: Construction from a polyhedral surface, and a bounding polyhedral surface. The first polyhedron must be entirely included inside `bounding_polyhedron`, which must be closed and free of intersections. - Using this constructor allows to mesh a polyhedral surface which is not closed, or has holes. + Using this constructor enables to mesh a polyhedral surface which is not closed, or has holes. The inside of `bounding_polyhedron` will be meshed. */ Polyhedral_mesh_domain_3(const Polyhedron& p, diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 3f11e81ce8a..78778059d35 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -170,11 +170,11 @@ private: * 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. + * and enable 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. + * that enable to enable or disable the optimizer. * * \cgalNamedParamsBegin * \cgalParamSectionBegin{Topological options (manifoldness)} @@ -310,7 +310,7 @@ void refine_mesh_3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria& cri * done at the end of refinement process * @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 + * dimension and Index) of the triangulation. That enables to refine a mesh * which has been exuded. * @param mesh_3_options is a struct object used to pass non-documented options, * for debugging purpose. From 11a5bfc84f6e2e73282569f246c491f4661f6929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 10:42:25 +0200 Subject: [PATCH 087/156] fix warnings --- AABB_tree/test/AABB_tree/AABB_test_util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AABB_tree/test/AABB_tree/AABB_test_util.h b/AABB_tree/test/AABB_tree/AABB_test_util.h index 61ddd98f3bd..fae5abfe17c 100644 --- a/AABB_tree/test/AABB_tree/AABB_test_util.h +++ b/AABB_tree/test/AABB_tree/AABB_test_util.h @@ -98,6 +98,9 @@ void test_all_intersection_query_types(Tree& tree) std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > r = tree.any_intersection(ray); std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > l = tree.any_intersection(line); std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > s = tree.any_intersection(segment); + CGAL_USE(r); + CGAL_USE(l); + CGAL_USE(s); // any_intersected_primitive std::optional optional_primitive; From 84abdc75822c3c153ad922a0daf9701b6b3918c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 10:43:21 +0200 Subject: [PATCH 088/156] add partial specialization of Output_rep for optional and variant --- Stream_support/include/CGAL/IO/io.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index e287fe8e16f..8634c38f88d 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -32,6 +32,8 @@ #include #include #include +#include +#include namespace CGAL { @@ -186,6 +188,30 @@ public: std::ostream& operator()( std::ostream& os) const { return (os << t); } }; +template +class Output_rep, F> +{ + const std::optional& t; + +public: + Output_rep( const std::optional& tt) : t(tt) {} + std::ostream& operator()( std::ostream& os) const { + if (t==std::nullopt) return (os << "--"); + return (os << t.value()); } +}; + +template +class Output_rep, F> +{ + const std::variant& t; + +public: + Output_rep( const std::variant& tt) : t(tt) {} + std::ostream& operator()( std::ostream& os) const { + return (os << "--"); + } +}; + /*! \relates Output_rep \brief stream output of the \c Output_rep calls its \c operator(). From 62f22e9a6cbf09081c31e882552a011b30a99933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 10:43:56 +0200 Subject: [PATCH 089/156] use oformat for optional --- Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h | 4 ++-- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 5d242c1a604..ef64b75890f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -1149,9 +1149,9 @@ number_of_bad_elements_impl() const Subdomain mc_subdomain = this->r_oracle_.is_in_domain_object()(this->r_tr_.dual(mc)); std::cerr << "*** Is in complex? c is marked in domain: " << this->r_c3t3_.is_in_complex(c) - << " / c is really in subdomain: " << c_subdomain + << " / c is really in subdomain: " << oformat(c_subdomain) << " / mc is marked in domain: " << this->r_c3t3_.is_in_complex(mc) - << " / mc is really in subdomain: " << mc_subdomain + << " / mc is really in subdomain: " << oformat(mc_subdomain) << std::endl; diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index a9c545a7555..8450754a767 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -333,13 +333,13 @@ struct Tester else { std::cerr << "\nc1 circumcenter: " << tr.dual(c1); std::cerr << "\nc1 is in domain: " - << domain.is_in_domain_object()(tr.dual(c1)); + << CGAL::oformat(domain.is_in_domain_object()(tr.dual(c1))); } if(tr.is_infinite(c2)) std::cerr << "\nc2 is infinite"; else { std::cerr << "\nc2 circumcenter: "<< tr.dual(c2); std::cerr << "\nc2 is in domain: " - << domain.is_in_domain_object()(tr.dual(c2)); + << CGAL::oformat(domain.is_in_domain_object()(tr.dual(c2))); } std::cerr << std::endl; assert(false); From 209549df22409830954a666ae79cd99cd2149242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 10:44:25 +0200 Subject: [PATCH 090/156] use value instead of get_ptr --- Triangulation/include/CGAL/Delaunay_triangulation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation/include/CGAL/Delaunay_triangulation.h b/Triangulation/include/CGAL/Delaunay_triangulation.h index a2203ee762e..8fa25e4d08c 100644 --- a/Triangulation/include/CGAL/Delaunay_triangulation.h +++ b/Triangulation/include/CGAL/Delaunay_triangulation.h @@ -416,7 +416,7 @@ Delaunay_triangulation Dark_triangulation dark_side( maximal_dimension(), flat_orientation_ ? - std::pair(current_dimension(), flat_orientation_.get_ptr()) + std::pair(current_dimension(), &flat_orientation_.value()) : std::pair((std::numeric_limits::max)(), (Flat_orientation_d*) nullptr) ); Dark_s_handle dark_s; From 39878ed33a458eb1c7b7502198c456f3241c0b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 10:48:36 +0200 Subject: [PATCH 091/156] fix typos --- .../Point_location_test.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h index eedde5108af..72f8306f698 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h @@ -1083,11 +1083,11 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) // Assign and check results for (size_t qi = 0; qi < size; ++qi) { // Assign object to a face - Face_const_handle* fh_ref = std::get_ifFace_const_handle>(&(objs[0][qi])); + Face_const_handle* fh_ref = std::get_if(&(objs[0][qi])); if (fh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { Face_const_handle* fh_cur = - std::get_ifFace_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (fh_cur) { if ((*fh_cur) != (*fh_ref)) { std::cout << "Error: point location number " << pl << std::endl; @@ -1102,13 +1102,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) std::cout << "Expected: a face." << std::endl; result += -1; Halfedge_const_handle* hh_cur = - std::get_ifHalfedge_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (hh_cur) { std::cout << "Actual: a halfedge." << std::endl; continue; } Vertex_const_handle* vh_cur = - std::get_ifVertex_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (vh_cur) { std::cout << "Actual: a vertex." << std::endl; continue; @@ -1124,11 +1124,11 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) // Assign object to a halfedge Halfedge_const_handle* hh_ref = - std::get_ifHalfedge_const_handle>(&(objs[0][qi])); + std::get_if(&(objs[0][qi])); if (hh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { Halfedge_const_handle* hh_cur = - std::get_ifHalfedge_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (hh_cur) { if (((*hh_cur) != (*hh_ref)) && ((*hh_cur)->twin() != (*hh_ref))) { std::cout << "Error: point location number " << pl << std::endl; @@ -1145,13 +1145,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) << std::endl; result += -1; Face_const_handle* fh_cur = - std::get_ifFace_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (fh_cur) { std::cout << "Actual: a face." << std::endl; continue; } Vertex_const_handle* vh_cur = - std::get_ifVertex_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (vh_cur) { std::cout << "Actual: a vertex." << std::endl; continue; @@ -1163,11 +1163,11 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) // Assign object to a vertex Vertex_const_handle* vh_ref = - std::get_ifVertex_const_handle>(&(objs[0][qi])); + std::get_if(&(objs[0][qi])); if (vh_ref) { for (size_t pl = 1; pl < pls_num; ++pl) { Vertex_const_handle* vh_cur = - std::get_ifVertex_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (vh_cur) { if ((*vh_cur) != (*vh_ref)) { std::cout << "Error: point location number " << pl << std::endl; @@ -1183,13 +1183,13 @@ verify(Variants_vector objs[NUM_PL_STRATEGIES], size_t size, size_t pls_num) std::cout << "Expected: a vertex: "<< (*vh_ref)->point() << std::endl; result += -1; Face_const_handle* fh_cur = - std::get_ifFace_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (fh_cur) { std::cout << "Actual: a face." << std::endl; continue; } Halfedge_const_handle* hh_cur = - std::get_ifHalfedge_const_handle>(&(objs[pl][qi])); + std::get_if(&(objs[pl][qi])); if (hh_cur) { std::cout << "Actual: a halfedge." << std::endl; continue; From 9526dc8661b74598d74f4a2ad5970f7ad779bde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 10:49:26 +0200 Subject: [PATCH 092/156] use oformat --- .../include/CGAL/Curved_kernel_via_analysis_2/Point_2.h | 9 ++++----- .../test/Arrangement_on_surface_2/Traits_base_test.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index a3c07a48690..c134c8cc901 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -700,14 +700,13 @@ public: default: // ASCII os << "Point_2("; - - os << this->ptr()->_m_xy; + os << oformat(this->ptr()->_m_xy); os << ","; - os << this->ptr()->_m_x; + os << oformat(this->ptr()->_m_x); os << ","; - os << this->ptr()->_m_curve; + os << oformat(this->ptr()->_m_curve); os << ","; - os << this->ptr()->_m_arcno; + os << oformat(this->ptr()->_m_arcno); os << ","; os << this->ptr()->_m_location; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h index 9bfe463e3bf..696c03ebb69 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h @@ -136,8 +136,8 @@ protected: typename Traits::Equal_2 equal = this->m_geom_traits.equal_2_object(); if (equal(exp_answer, real_answer)) return true; - std::string exp_answer_str = boost::lexical_cast(exp_answer); - std::string real_answer_str = boost::lexical_cast(real_answer); + std::string exp_answer_str = boost::lexical_cast( oformat(exp_answer) ); + std::string real_answer_str = boost::lexical_cast( oformat(real_answer) ); this->print_answer(exp_answer_str, real_answer_str, "x-monotone curve"); return false; } From f8323e7df8e4d646b9f8e2cbb757f27e78a2ca60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 10:52:25 +0200 Subject: [PATCH 093/156] use std API --- .../Algebraic_curve_kernel_2.h | 2 +- ...gebraic_real_quadratic_refinement_rep_bfi.h | 18 +++++++++--------- .../Arr_trapezoid_ric_pl_impl.h | 4 ++-- .../CGAL/Arrangement_2/Arr_traits_adaptor_2.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) 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 b249fbf4629..01798000c55 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 @@ -368,7 +368,7 @@ public: result_type operator() (const argument_type& arg) const { CGAL_assertion(bool(_inner)); CGAL_assertion(bool(_outer)); - return _outer.get()(_inner.get()(arg)); + return _outer.value()(_inner.value()(arg)); } private: ::std::optional _inner; 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 9e1cff2083b..06effd6b5dd 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 @@ -113,8 +113,8 @@ private: low_bfi_ = CGAL::convert_to_bfi(this->low()); high_bfi_ = CGAL::convert_to_bfi(this->high()); - f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get()); - f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get()); + f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value()); + f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value()); } @@ -125,7 +125,7 @@ private: } m_bfi = CGAL::convert_to_bfi(m); - f_m_bfi = f_bfi_.get().evaluate(m_bfi); + f_m_bfi = f_bfi_.value().evaluate(m_bfi); if(CGAL::zero_in(f_m_bfi)) { @@ -329,25 +329,25 @@ private: low_bfi_ = CGAL::convert_to_bfi(this->low()); } if(! f_low_bfi_) { - f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get()); + f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value()); } if(! high_bfi_) { high_bfi_ = CGAL::convert_to_bfi(this->high()); } if(! f_high_bfi_) { - f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get()); + f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value()); } Integer i; while(true) { - if(CGAL::zero_in(f_low_bfi_.get() - f_high_bfi_.get())) { + if(CGAL::zero_in(f_low_bfi_.value() - f_high_bfi_.value())) { _set_prec(2*prec_); continue; } - BFI denom = f_low_bfi_.get()-f_high_bfi_.get(); + BFI denom = f_low_bfi_.value()-f_high_bfi_.value(); - BFI z = f_low_bfi_.get() / denom; + BFI z = f_low_bfi_.value() / denom; std::pair int_pair = _to_integer_interval(z,N); Integer i_low = int_pair.first; @@ -458,7 +458,7 @@ protected: f_bfi_ = _convert_polynomial_to_bfi(this->polynomial()); } - BFI eval = f_bfi_.get().evaluate(convert_to_bfi(m)); + BFI eval = f_bfi_.value().evaluate(convert_to_bfi(m)); CGAL::Sign s = CGAL::sign(CGAL::lower(eval)); 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 a52086ce117..188343887bc 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 @@ -184,7 +184,7 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, Td_map_item& left_v_item = td.locate(tr.left(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; - if (std::get(&left_v_item) != nullptr) { + if (std::get_if(&left_v_item) != nullptr) { Td_active_vertex v(std::get(left_v_item)); he = v.cw_he(); } @@ -216,7 +216,7 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, Td_map_item& right_v_item = td.locate(tr.right(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; - if (std::get(&right_v_item)!= nullptr) { + if (std::get_if(&right_v_item)!= nullptr) { Td_active_vertex v(std::get(right_v_item)); he = v.cw_he(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h index 9c74e4ef9d7..8f88642aed8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h @@ -3580,7 +3580,7 @@ public: // Verify the first intersection is an overlap, remove it, and // recursively call. const X_monotone_curve_2* xcv = - std::get(&(intersections.front())); + std::get_if(&(intersections.front())); if (! xcv) { CGAL_error_msg("The first intersection is not an overlap!"); return SMALLER; From 65680a428b1c1733b64be4f5e51ad7bd0d303560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 11:19:21 +0200 Subject: [PATCH 094/156] more oformat use --- .../Arrangement_on_surface_2/Traits_test.h | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h index fb912860f59..fe340b4a88c 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h @@ -733,7 +733,7 @@ min_vertex_wrapper(std::istringstream& str_stream) unsigned int id1, id2; str_stream >> id1 >> id2; Point_2& exp_answer = this->m_points[id2]; - std::cout << "Test: min_vertex( " << this->m_xcurves[id1] << " ) ? " + std::cout << "Test: min_vertex( " << CGAL::oformat(this->m_xcurves[id1]) << " ) ? " << exp_answer << " "; Point_2 real_answer = @@ -751,7 +751,7 @@ max_vertex_wrapper(std::istringstream& str_stream) unsigned int id1, id2; str_stream >> id1 >> id2; Point_2& exp_answer = this->m_points[id2]; - std::cout << "Test: max_vertex( " << this->m_xcurves[id1] << " ) ? " + std::cout << "Test: max_vertex( " << CGAL::oformat(this->m_xcurves[id1]) << " ) ? " << exp_answer << " "; Point_2 real_answer = @@ -767,7 +767,7 @@ is_vertical_wrapper(std::istringstream& str_stream) unsigned int id; str_stream >> id; bool exp_answer = this->get_expected_boolean(str_stream); - std::cout << "Test: is_vertical( " << this->m_xcurves[id] << " ) ? " + std::cout << "Test: is_vertical( " << CGAL::oformat(this->m_xcurves[id]) << " ) ? " << exp_answer << " "; bool real_answer = @@ -789,7 +789,7 @@ compare_y_at_x_wrapper(std::istringstream& str_stream) str_stream >> id1 >> id2; unsigned int exp_answer = this->get_expected_enum(str_stream); std::cout << "Test: compare_y_at_x( " << this->m_points[id1] << "," - << this->m_xcurves[id2] << " ) ? " << exp_answer << " "; + << CGAL::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; unsigned int real_answer = this->m_geom_traits.compare_y_at_x_2_object()(this->m_points[id1], @@ -853,8 +853,8 @@ compare_y_at_x_right_wrapper(std::istringstream& str_stream) unsigned int id1, id2, id3; str_stream >> id1 >> id2 >> id3; unsigned int exp_answer = this->get_expected_enum(str_stream); - std::cout << "Test: compare_y_at_x_right( " << this->m_xcurves[id1] << "," - << this->m_xcurves[id2] << ", " << this->m_points[id3] << " ) ? " + std::cout << "Test: compare_y_at_x_right( " << CGAL::oformat(this->m_xcurves[id1]) << "," + << CGAL::oformat(this->m_xcurves[id2]) << ", " << this->m_points[id3] << " ) ? " << exp_answer << " "; unsigned int real_answer = @@ -891,8 +891,8 @@ equal_curves_wrapper(std::istringstream& str_stream) unsigned int id1, id2; str_stream >> id1 >> id2; bool exp_answer = this->get_expected_boolean(str_stream); - std::cout << "Test: equal( " << this->m_xcurves[id1] << ", " - << this->m_xcurves[id2] << " ) ? " << exp_answer << " "; + std::cout << "Test: equal( " << CGAL::oformat(this->m_xcurves[id1]) << ", " + << CGAL::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; bool real_answer = this->m_geom_traits.equal_2_object()(this->m_xcurves[id1], this->m_xcurves[id2]); @@ -918,7 +918,7 @@ make_x_monotone_wrapper(std::istringstream& str_stream) unsigned int id; str_stream >> id; - std::cout << "Test: make_x_monotone( " << this->m_curves[id] << " ) ? "; + std::cout << "Test: make_x_monotone( " << CGAL::oformat(this->m_curves[id]) << " ) ? "; std::vector objs; this->m_geom_traits.make_x_monotone_2_object()(this->m_curves[id], std::back_inserter(objs)); @@ -979,8 +979,8 @@ intersect_wrapper(std::istringstream& str_stream) this->m_xcurves[id2], std::back_inserter(xections)); - std::cout << "Test: intersect( " << this->m_xcurves[id1] << "," - << this->m_xcurves[id2] << " ) ? "; + std::cout << "Test: intersect( " << CGAL::oformat(this->m_xcurves[id1]) << "," + << CGAL::oformat(this->m_xcurves[id2]) << " ) ? "; size_t num; str_stream >> num; if (! this->compare(num, xections.size(), "size")) return false; @@ -1031,7 +1031,7 @@ bool Traits_test::split_wrapper(std::istringstream& str_stream) unsigned int id1, id2, id3, id4; str_stream >> id1 >> id2 >> id3 >> id4; X_monotone_curve_2 cv1, cv2; - std::cout << "Test: split( " << this->m_xcurves[id1] << "," + std::cout << "Test: split( " << CGAL::oformat(this->m_xcurves[id1]) << "," << this->m_points[id2] << " ) ? "; this->m_geom_traits.split_2_object()(this->m_xcurves[id1], @@ -1069,8 +1069,8 @@ are_mergeable_wrapper_imp(std::istringstream& str_stream, CGAL::Tag_true) unsigned int id1, id2; str_stream >> id1 >> id2; bool exp_answer = this->get_expected_boolean(str_stream); - std::cout << "Test: are_mergeable( " << this->m_xcurves[id1] << ", " - << this->m_xcurves[id2] << " ) ? " << exp_answer << " "; + std::cout << "Test: are_mergeable( " << CGAL::oformat(this->m_xcurves[id1]) << ", " + << CGAL::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; bool real_answer = this->m_geom_traits.are_mergeable_2_object()(this->m_xcurves[id1], @@ -1107,8 +1107,8 @@ Traits_test::merge_wrapper_imp(std::istringstream& str_stream, unsigned int id1, id2, id; str_stream >> id1 >> id2 >> id; X_monotone_curve_2 cv; - std::cout << "Test: merge( " << this->m_xcurves[id1] << ", " - << this->m_xcurves[id2] << " ) ? " << this->m_xcurves[id] << " "; + std::cout << "Test: merge( " << CGAL::oformat(this->m_xcurves[id1]) << ", " + << CGAL::oformat(this->m_xcurves[id2]) << " ) ? " << CGAL::oformat(this->m_xcurves[id]) << " "; this->m_geom_traits.merge_2_object()(this->m_xcurves[id1], this->m_xcurves[id2], cv); @@ -1181,7 +1181,7 @@ parameter_space_in_x_wrapper_imp(std::istringstream& str_stream, CGAL::Arr_curve_end cv_end = CGAL::ARR_MIN_END; if (curves_op) { cv_end = static_cast(next_input.second); - std::cout << "Test: parameter_space_x( " << this->m_xcurves[id] << " , " + std::cout << "Test: parameter_space_x( " << CGAL::oformat(this->m_xcurves[id]) << " , " << (cv_end == CGAL::ARR_MIN_END ? "MIN_END" : "MAX_END") << " ) ? "; next_input = this->get_next_input(str_stream); @@ -1248,8 +1248,8 @@ compare_y_near_boundary_wrapper_imp(std::istringstream& str_stream, assert(next_input.first == Base::CURVE_END); CGAL::Arr_curve_end cv_end = static_cast(next_input.second); - std::cout << "Test: compare_y_near_boundary( " << this->m_xcurves[id1] - << " , " << this->m_xcurves[id2] << " , " + std::cout << "Test: compare_y_near_boundary( " << CGAL::oformat(this->m_xcurves[id1]) + << " , " << CGAL::oformat(this->m_xcurves[id2]) << " , " << (cv_end == CGAL::ARR_MIN_END ? "MIN_END" : "MAX_END") << " ) ? "; next_input = this->get_next_input(str_stream); @@ -1309,7 +1309,7 @@ parameter_space_in_y_wrapper_imp(std::istringstream& str_stream, CGAL::Arr_curve_end cv_end = CGAL::ARR_MIN_END; if (curves_op) { cv_end = static_cast(next_input.second); - std::cout << "Test: parameter_space_y( " << this->m_xcurves[id] << " , " + std::cout << "Test: parameter_space_y( " << CGAL::oformat(this->m_xcurves[id]) << " , " << (cv_end == CGAL::ARR_MIN_END ? "MIN_END" : "MAX_END") << " ) ? "; next_input = this->get_next_input(str_stream); @@ -1381,8 +1381,8 @@ compare_x_near_boundary_wrapper_imp(std::istringstream& str_stream, CGAL::Arr_curve_end cv_end = static_cast(next_input.second); - std::cout << this->m_xcurves[id1] << ", " - << this->m_xcurves[id2] << " , " + std::cout << CGAL::oformat(this->m_xcurves[id1]) << ", " + << CGAL::oformat(this->m_xcurves[id2]) << " , " << this->curve_end_str(cv_end) << " ) ? "; next_input = this->get_next_input(str_stream); From e759fb46fab445fd269c6cf835c213a94aeda5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 12:57:53 +0200 Subject: [PATCH 095/156] remove usage of old Object API --- .../include/CGAL/Arr_circular_arc_traits_2.h | 6 +- .../CGAL/Arr_circular_line_arc_traits_2.h | 14 +- .../CGAL/Arr_non_caching_segment_traits_2.h | 8 +- .../include/CGAL/Arr_polycurve_traits_2.h | 28 +- .../CGAL/Arr_rat_arc/Rational_arc_d_1.h | 2 - .../test_polycurve_intersection.cpp | 13 +- .../function_objects_polynomial_circular.h | 2 +- .../internal_functions_on_circle_2.h | 8 +- .../internal_functions_on_circular_arc_2.h | 226 +++++----- .../internal_functions_on_line_arc_2.h | 71 ++- .../CGAL/_test_circles_constructions.h | 163 +++---- .../include/CGAL/_test_circles_extention.h | 25 +- .../test/Circular_kernel_2/test_Line_arc.cpp | 220 +++++----- .../functor_compare_theta_3.cpp | 18 +- .../intersecting_spheres.cpp | 12 +- .../Circular_kernel_3/Intersection_traits.h | 21 - .../internal_functions_on_circular_arc_3.h | 52 ++- .../internal_functions_on_line_arc_3.h | 33 +- .../internal_functions_on_sphere_3.h | 64 +-- .../CGAL/_test_functionalities_on_sphere.h | 76 ++-- .../include/CGAL/_test_sphere_constructions.h | 403 ++++++++++-------- 21 files changed, 717 insertions(+), 748 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h index f790bcac246..151bcf5644a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_arc_traits_2.h @@ -181,14 +181,14 @@ public: typedef std::variant Make_x_monotone_result; - std::vector objs; + std::vector objs; CircularKernel().make_x_monotone_2_object()(arc, std::back_inserter(objs)); for (const auto& obj : objs) { - if (const auto* p = CGAL::object_cast(&obj)) { + if (const auto* p = std::get_if(&obj)) { *oi++ = Make_x_monotone_result(*p); continue; } - if (const auto* xcv = CGAL::object_cast(&obj)) { + if (const auto* xcv = std::get_if(&obj)) { *oi++ = Make_x_monotone_result(*xcv); continue; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h index ba387ee0804..5fb30dd0bd7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -251,19 +251,13 @@ namespace CGAL { OutputIterator res) const { if ( const Arc1* arc1 = std::get_if( &A ) ) { - std::vector container; - CircularKernel(). - make_x_monotone_2_object()(*arc1,std::back_inserter(container)); - return object_to_object_variant - (container, res); + return CircularKernel(). + make_x_monotone_2_object()(*arc1, res); } else { const Arc2* arc2 = std::get_if( &A ); - std::vector container; - CircularKernel(). - make_x_monotone_2_object()(*arc2,std::back_inserter(container)); - return object_to_object_variant - (container, res); + return CircularKernel(). + make_x_monotone_2_object()(*arc2, res); } } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h index d3397599ae6..58acefda211 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h @@ -224,8 +224,6 @@ public: OutputIterator oi) const { typedef std::pair Intersection_point; - typedef std::variant - Intersection_result; const Kernel& kernel = m_traits; auto res = kernel.intersect_2_object()(cv1, cv2); @@ -241,7 +239,7 @@ public: // If the two segments intersect at their endpoints, then the // multiplicity is undefined, but we deliberately ignore it for // efficiency reasons. - *oi++ = Intersection_result(Intersection_point(*p_p, 1)); + *oi++ = Intersection_point(*p_p, 1); return oi; } @@ -257,11 +255,11 @@ public: // in the overlap segment if (m_traits.compare_endpoints_xy_2_object()(*cv_p) != cmp1) { auto ctr_opposite = kernel.construct_opposite_segment_2_object(); - *oi++ = Intersection_result(ctr_opposite(*cv_p)); + *oi++ = ctr_opposite(*cv_p); return oi; } } - *oi++ = Intersection_result(*cv_p); + *oi++ = *cv_p; return oi; } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h index a7aa0c32786..488ed21dea7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h @@ -698,8 +698,7 @@ public: typedef std::pair Intersection_point; typedef std::variant Intersection_base_result; - typedef std::variant - Intersection_result; + const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2(); auto cmp_y_at_x = m_poly_traits.compare_y_at_x_2_object(); @@ -744,7 +743,7 @@ public: // cv1's right endpoint equals cv2's left endpoint // Thus we can return this single(!) intersection point Intersection_point p(max_vertex(cv1[i1]), 0); - *oi++ = Intersection_result(p); + *oi++ = p; return oi; } dir1 == SMALLER ? @@ -767,7 +766,7 @@ public: // cv2's right endpoint equals cv1's left endpoint // Thus we can return this single(!) intersection point Intersection_point p(max_vertex(cv2[i2]), 0); - *oi++ = Intersection_result(p); + *oi++ = p; return oi; } @@ -833,7 +832,7 @@ public: const Intersection_point* p_p = std::get_if(&xection); - if (p_p != nullptr) *oi++ = Intersection_result(*p_p); + if (p_p != nullptr) *oi++ = *p_p; } } else if (right_coincides && left_coincides) { @@ -871,7 +870,7 @@ public: // will be taken care of as the min_vertex of in the next // iteration. if (! equal(p_ptr->first, max_vertex(cv1[i1]))) - *oi++ = Intersection_result(*p_ptr); + *oi++ = *p_ptr; } } } @@ -896,11 +895,11 @@ public: // it multiplicity 0. if (left_res == SMALLER) { Intersection_point p(min_vertex(cv2[i2]), 0); - *oi++ = Intersection_result(p); + *oi++ = p; } else { Intersection_point p(min_vertex(cv1[i1]), 0); - *oi++ = Intersection_result(p); + *oi++ = p; } } } @@ -941,7 +940,7 @@ public: (i1 != Polycurve_traits_2::INVALID_INDEX) ? return_point(max_vertex(cv1[i1+1]), 0) : return_point(max_vertex(cv1[0]), 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } else if (right_res == LARGER) { ip = (dir2 == SMALLER) ? @@ -949,7 +948,7 @@ public: (i2 != Polycurve_traits_2::INVALID_INDEX) ? return_point(max_vertex(cv2[i2+1]), 0) : return_point(max_vertex(cv2[0]), 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } else if (((i1 > 0) && (dir1 == SMALLER)) || ((i1 < n1) && (dir1 != SMALLER)) || @@ -961,7 +960,7 @@ public: (i1 != Polycurve_traits_2::INVALID_INDEX) ? return_point(max_vertex(cv1[i1+1]), 0) : return_point(max_vertex(cv1[0]), 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } else { CGAL_assertion_msg((dir2 == SMALLER && i2 > 0) || @@ -976,7 +975,7 @@ public: (i2 != Polycurve_traits_2::INVALID_INDEX) ? return_point(max_vertex(cv2[i2+1]), 0) : return_point(max_vertex(cv2[0]), 0); - *oi++ = Intersection_result(ip); + *oi++ = ip; } } @@ -989,15 +988,12 @@ public: inline OutputIterator output_ocv (std::vector& ocv, bool invert_ocv, OutputIterator oi) const { - typedef std::pair Intersection_point; - typedef std::variant - Intersection_result; X_monotone_curve_2 curve; if (invert_ocv) std::reverse (ocv.begin(), ocv.end()); for (X_monotone_subcurve_2& sc : ocv) curve.push_back (sc); - *(oi ++) = Intersection_result(curve); + *(oi ++) = curve; ocv.clear(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h index 345d9d89caf..c71c4f4f268 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h @@ -2038,8 +2038,6 @@ public: OutputIterator intersect(const Self& arc, OutputIterator oi, const Cache& cache) const { - typedef std::variant Intersection_result; - CGAL_precondition(this->is_valid()); CGAL_precondition(this->is_continuous()); CGAL_precondition(arc.is_valid()); diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_polycurve_intersection.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_polycurve_intersection.cpp index 2c0a68510c7..dda2f0c27c9 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_polycurve_intersection.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_polycurve_intersection.cpp @@ -26,18 +26,19 @@ struct Test_functor Test_functor (const X_monotone_polyline& reference) : reference (&reference) { } - void operator() (const CGAL::Object& obj) const + void operator()(std::pair) { - const X_monotone_polyline* poly - = CGAL::object_cast(&obj); - assert(poly != nullptr); // Intersection is not a polyline + assert(!"This overload should not be called"); + } + void operator() (const X_monotone_polyline& poly) const + { typename X_monotone_polyline::Point_const_iterator itref = reference->points_begin(), - itpoly = poly->points_begin(); + itpoly = poly.points_begin(); for (; itref != reference->points_end() - && itpoly != poly->points_end(); + && itpoly != poly.points_end(); ++ itref, ++ itpoly) assert(*itref == *itpoly); } diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h index 09696e5069c..b68746e4a3d 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h @@ -308,7 +308,7 @@ namespace CircularFunctors { operator()(const Circular_arc_2 &A, OutputIterator res) const { typedef std::pair relat_pos; - typedef std::pair< CGAL::Object, relat_pos> Obj_descr_2; + typedef std::pair< Circular_arc_2, relat_pos> Obj_descr_2; std::vector vec; CircularFunctors::advanced_make_xy_monotone (A, std::back_inserter(vec)); diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circle_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circle_2.h index 9ced0754a2c..9e799e497f0 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circle_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circle_2.h @@ -120,8 +120,6 @@ namespace CircularFunctors { const typename CK::Circle_2 & c2, OutputIterator res ) { - typedef typename CK2_Intersection_traits - ::type result_type; typedef typename CK::Algebraic_kernel AK; typedef typename CK::Polynomial_for_circles_2_2 Equation; typedef typename CK::Root_for_circles_2_2 Root_for_circles_2_2; @@ -129,7 +127,7 @@ namespace CircularFunctors { Equation e2 = CircularFunctors::get_equation(c2); if (e1 == e2) { - *res++ = CGAL::internal::ck2_intersection_return(c1); + *res++ = c1; return res; } @@ -145,9 +143,7 @@ namespace CircularFunctors { for ( typename solutions_container::iterator it = solutions.begin(); it != solutions.end(); ++it ) { - *res++ = CGAL::internal::ck2_intersection_return - (std::make_pair(Circular_arc_point_2(it->first), - it->second )); + *res++ = std::make_pair(Circular_arc_point_2(it->first), it->second ); } return res; diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h index 61fdc75b4b6..1e577eea5b3 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h @@ -536,17 +536,15 @@ namespace CircularFunctors { const typename CK::Circular_arc_2 &a2, OutputIterator res ) { - typedef typename CK2_Intersection_traits::type result_type; - - typedef std::vector solutions_container; typedef typename CK::Circular_arc_2 Circular_arc_2; + typedef typename CK::Circle_2 Circle_2; #ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE + typedef std::vector solutions_container; // same curve if(a1.number() == a2.number()) { - *res++ = result_type(a1); + *res++ = a1; return res; } @@ -571,14 +569,14 @@ namespace CircularFunctors { if((a1s_a2s && a1t_a2t) || (a1s_a2t && a1t_a2s)){ // Case 1 if( (a1.supporting_circle() == a2.supporting_circle()) && ((a1.on_upper_part() && a2.on_upper_part())|| (! a1.on_upper_part() && (! a2.on_upper_part())))){ - *res++ = result_type(a1); + *res++ = a1; } else { if(compare_x(a1.source(), a1.target()) == SMALLER){ - *res++ = result_type(std::make_pair(a1.source(),1u)); - *res++ = result_type(std::make_pair(a1.target(),1u)); + *res++ = std::make_pair(a1.source(),1u); + *res++ = std::make_pair(a1.target(),1u); } else { - *res++ = result_type(std::make_pair(a1.target(),1u)); - *res++ = result_type(std::make_pair(a1.source(),1u)); + *res++ = std::make_pair(a1.target(),1u); + *res++ = std::make_pair(a1.source(),1u); } } return res; @@ -625,7 +623,7 @@ namespace CircularFunctors { if(return_q){ - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); return res; } @@ -634,16 +632,14 @@ namespace CircularFunctors { const bool sqr1_eq_sqr2 = (a1.squared_radius() == a2.squared_radius()); const bool c1_eq_c2 = (a1.center() == a2.center()); - typedef typename CK2_Intersection_traits::type result_type; if(sqr1_eq_sqr2 && c1_eq_c2) { if(a1.is_full()) { - *res++ =CGAL::internal::ck2_intersection_return(a2); + *res++ = a2; //return res; } else if(a2.is_full()) { - *res++ =CGAL::internal::ck2_intersection_return(a1); + *res++ = a1; //return res; } else { bool t2_in_a1 = has_on(a1,a2.target(),true); @@ -656,66 +652,66 @@ namespace CircularFunctors { CircularFunctors::compare_xy(a1.source(), a2.source()); if(comp < 0) { if(a1.source() == a2.target()) { - *res++ =CGAL::internal::ck2_intersection_return(std::make_pair(a1.source(),1u)); + *res++ = std::make_pair(a1.source(),1u); } else { const Circular_arc_2 & arc = Circular_arc_2(a1.supporting_circle(),a1.source(),a2.target()); - *res++ =CGAL::internal::ck2_intersection_return(arc); + *res++ = arc; } if(a2.source() == a1.target()) { - *res++ =CGAL::internal::ck2_intersection_return(std::make_pair(a2.source(),1u)); + *res++ = std::make_pair(a2.source(),1u); } else { const Circular_arc_2 & arc = Circular_arc_2(a1.supporting_circle(),a2.source(),a1.target()); - *res++ =CGAL::internal::ck2_intersection_return(arc); + *res++ = arc; } } else if (comp > 0) { if(a2.source() == a1.target()) { - *res++ =CGAL::internal::ck2_intersection_return(std::make_pair(a2.source(),1u)); + *res++ = std::make_pair(a2.source(),1u); } else { const Circular_arc_2 & arc = Circular_arc_2(a1.supporting_circle(),a2.source(),a1.target()); - *res++ =CGAL::internal::ck2_intersection_return(arc); + *res++ = arc; } if(a1.source() == a2.target()) { - *res++ =CGAL::internal::ck2_intersection_return(std::make_pair(a1.source(),1u)); + *res++ = std::make_pair(a1.source(),1u); } else { const Circular_arc_2 & arc = Circular_arc_2(a1.supporting_circle(),a1.source(),a2.target()); - *res++ =CGAL::internal::ck2_intersection_return(arc); + *res++ = arc; } } else { - *res++ =CGAL::internal::ck2_intersection_return(a1); + *res++ = a1; } } else { - *res++ =CGAL::internal::ck2_intersection_return(a2); + *res++ = a2; //return res; } } else if(t2_in_a1) { if(a1.source() == a2.target()) - *res++ =CGAL::internal::ck2_intersection_return(std::make_pair(a1.source(),1u)); + *res++ = std::make_pair(a1.source(),1u); else { const Circular_arc_2 & arc = Circular_arc_2(a1.supporting_circle(),a1.source(),a2.target()); - *res++ =CGAL::internal::ck2_intersection_return(arc); + *res++ = arc; } //return res; } else if(s2_in_a1) { if(a2.source() == a1.target()) { - *res++ =CGAL::internal::ck2_intersection_return(std::make_pair(a2.source(),1u)); + *res++ = std::make_pair(a2.source(),1u); } else { const Circular_arc_2 & arc = Circular_arc_2(a1.supporting_circle(),a2.source(),a1.target()); - *res++ =CGAL::internal::ck2_intersection_return(arc); + *res++ = arc; } //return res; } else if(has_on(a2,a1.source(),true)) { - *res++ =CGAL::internal::ck2_intersection_return(a1); + *res++ = a1; //return res; } //return res; } } else if(!c1_eq_c2) { - solutions_container solutions; + std::vector< std::variant> > solutions; #ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES if(!Circular_arc_2::template @@ -736,24 +732,23 @@ namespace CircularFunctors { if(solutions.size() == 0) return res; else { // The supporting circles are not the same and intersects - for (typename solutions_container::iterator it = solutions.begin(); - it != solutions.end(); ++it) { + for (const auto& v : solutions) { const std::pair - *result = CGAL::object_cast - > (&(*it)); + *result = std::get_if + > (&v); #ifdef CGAL_CK_TEST_BBOX_BEFORE_HAS_ON Bbox_2 rb = result->first.bbox(); if(do_overlap(a1.bbox(), rb) && do_overlap(a2.bbox(),rb)){ if (has_on(a1,result->first,true) && has_on(a2,result->first,true)) { - *res++ =CGAL::internal::ck2_intersection_return(*result); + *res++ = *result; } } #else if (has_on(a1,result->first,true) && has_on(a2,result->first,true)) { - *res++ =CGAL::internal::ck2_intersection_return(*result); + *res++ = *result; } #endif } @@ -1069,7 +1064,7 @@ template < class CK, class OutputIterator > A.circle_number(); #endif - *res++ = make_object(A); + *res++ = A; return res; } @@ -1101,8 +1096,8 @@ template < class CK, class OutputIterator > ca2.set_circle_number(cn); #endif - *res++ = make_object(ca1); - *res++ = make_object(ca2); + *res++ = ca1; + *res++ = ca2; #ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE intersecs1.push_back(make_object(std::make_pair(x_extremal_point1,1u))); @@ -1131,7 +1126,7 @@ template < class CK, class OutputIterator > unsigned int cn = ca1.circle_number(); #endif - *res++ = make_object(ca1); + *res++ = ca1; if (cmp_end > 0) { // We must cut in 3 parts. const Circular_arc_2 &ca2 = Circular_arc_2(A.supporting_circle(), @@ -1148,8 +1143,8 @@ template < class CK, class OutputIterator > ca3.set_circle_number(cn); #endif - *res++ = make_object(ca2); - *res++ = make_object(ca3); + *res++ = ca2; + *res++ = ca3; #ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE intersecs1.push_back(make_object(std::make_pair(x_extremal_point1,1u))); intersecs2.push_back(make_object(std::make_pair(x_extremal_point2,1u))); @@ -1171,7 +1166,7 @@ template < class CK, class OutputIterator > ca2.set_circle_number(cn); #endif - *res++ = make_object(ca2); + *res++ = ca2; #ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE intersecs1.push_back(make_object(std::make_pair(x_extremal_point1,1u))); @@ -1191,7 +1186,7 @@ template < class CK, class OutputIterator > unsigned int cn = ca1.circle_number(); #endif - *res++ = make_object(ca1); + *res++ = ca1; if (cmp_end < 0) { const Circular_arc_2 &ca2 = Circular_arc_2(A.supporting_circle(), x_extremal_point2, @@ -1207,8 +1202,8 @@ template < class CK, class OutputIterator > ca3.set_circle_number(cn); #endif - *res++ = make_object(ca2); - *res++ = make_object(ca3); + *res++ = ca2; + *res++ = ca3; #ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE intersecs1.push_back(make_object(std::make_pair(x_extremal_point2,1u))); @@ -1232,7 +1227,7 @@ template < class CK, class OutputIterator > ca2.set_circle_number(cn); #endif - *res++ = make_object(ca2); + *res++ = ca2; #ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE intersecs1.push_back(make_object(std::make_pair(x_extremal_point2,1u))); @@ -1259,8 +1254,8 @@ template < class CK, class OutputIterator > ca2.set_circle_number(cn); #endif - *res++ = make_object(ca1); - *res++ = make_object(ca2); + *res++ = ca1; + *res++ = ca2; #ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE intersecs1.push_back(make_object(std::make_pair(x_extremal_point2,1u))); @@ -1287,8 +1282,8 @@ template < class CK, class OutputIterator > ca2.set_circle_number(cn); #endif - *res++ = make_object(ca1); - *res++ = make_object(ca2); + *res++ = ca1; + *res++ = ca2; #ifdef CGAL_INTERSECTION_MAP_FOR_XMONOTONIC_ARC_WITH_SAME_SUPPORTING_CIRCLE intersecs1.push_back(make_object(std::make_pair(x_extremal_point1,1u))); @@ -1317,7 +1312,7 @@ template < class CK, class OutputIterator > OutputIterator res ) { typedef typename CK::Circular_arc_2 Circular_arc_2; - typedef std::pair S_pair; + typedef std::pair S_pair; int cmp_begin_y = CGAL::compare @@ -1332,13 +1327,13 @@ template < class CK, class OutputIterator > ((((cmp_begin_y > 0) || (cmp_end_y > 0)) && (cmp_x > 0)) || (((cmp_begin_y < 0) || (cmp_end_y < 0)) && (cmp_x < 0)))) { - *res++ = S_pair(make_object(A),(cmp_begin_y>0 || cmp_end_y>0) ); + *res++ = S_pair(A,(cmp_begin_y>0 || cmp_end_y>0) ); return res; } // Half circles if (cmp_begin_y == 0 && cmp_end_y == 0 && cmp_x != 0) { - *res++ = std::make_pair(make_object(A), cmp_x>0 ); + *res++ = std::make_pair(A, cmp_x>0 ); return res; } @@ -1347,67 +1342,67 @@ template < class CK, class OutputIterator > if (cmp_begin_y > 0) { *res++ = S_pair - (make_object(Circular_arc_2(A.supporting_circle(), A.source(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),true))), + (Circular_arc_2(A.supporting_circle(), A.source(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),true)), true); if (cmp_end_y > 0) { // We must cut in 3 parts. *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),true), - CircularFunctors::x_extremal_point - (A.supporting_circle(),false))), + (Circular_arc_2 (A.supporting_circle(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),true), + CircularFunctors::x_extremal_point + (A.supporting_circle(),false)), false); *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),false), - A.target())), + (Circular_arc_2 (A.supporting_circle(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),false), + A.target()), true); } else { *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),true), - A.target())), + (Circular_arc_2 (A.supporting_circle(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),true), + A.target()), false); } } else if (cmp_begin_y < 0) { // Very similar to the previous case. *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - A.source(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),false))), + (Circular_arc_2 (A.supporting_circle(), + A.source(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),false)), false); if (cmp_end_y < CGAL::EQUAL) { // We must cut in 3 parts. *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),false), - CircularFunctors::x_extremal_point - (A.supporting_circle(),true))) , + (Circular_arc_2 (A.supporting_circle(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),false), + CircularFunctors::x_extremal_point + (A.supporting_circle(),true)) , true ); *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),true), - A.target())), + (Circular_arc_2 (A.supporting_circle(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),true), + A.target()), false); } else { *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),false), - A.target())), + (Circular_arc_2 (A.supporting_circle(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),false), + A.target()), true); } } @@ -1415,34 +1410,34 @@ template < class CK, class OutputIterator > if ( compare(A.source().x(),A.supporting_circle().center().x())< 0) { CGAL_assertion(cmp_end_y >= 0); *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - A.source(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),false))), + (Circular_arc_2 (A.supporting_circle(), + A.source(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),false)), false); *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),false), - A.target())), + (Circular_arc_2 (A.supporting_circle(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),false), + A.target()), true); } else { CGAL_assertion( compare(A.source().x(),A.supporting_circle().center().x())< 0); CGAL_assertion(cmp_end_y != LARGER); *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - A.source(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),true))), + (Circular_arc_2 (A.supporting_circle(), + A.source(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),true)), true); *res++ = std::make_pair - (make_object(Circular_arc_2 (A.supporting_circle(), - CircularFunctors::x_extremal_point - (A.supporting_circle(),true), - A.target())), + (Circular_arc_2 (A.supporting_circle(), + CircularFunctors::x_extremal_point + (A.supporting_circle(),true), + A.target()), false); } } @@ -1469,8 +1464,8 @@ advanced_make_xy_monotone( const typename CK::Circular_arc_2 &a, typedef typename CK::Circular_arc_2 Circular_arc_2; typedef std::pair relat_pos; - typedef std::pair< CGAL::Object, bool> Obj_descr_1; - typedef std::pair< CGAL::Object, relat_pos> Obj_descr_2; + typedef std::pair< Circular_arc_2, bool> Obj_descr_1; + typedef std::pair< Circular_arc_2, relat_pos> Obj_descr_2; typedef std::vector Obj_vector_1; typedef std::vector Obj_vector_2; @@ -1481,8 +1476,7 @@ advanced_make_xy_monotone( const typename CK::Circular_arc_2 &a, advanced_make_x_monotone(a,std::back_inserter(vec)); for(unsigned int i=0;i(&vec.at(i).first); + const Circular_arc_2 *tmp_arc = (&vec.at(i).first); int cmp_begin_x = CGAL::compare (tmp_arc->source().x(), tmp_arc->supporting_circle().center().x()); @@ -1501,22 +1495,21 @@ advanced_make_xy_monotone( const typename CK::Circular_arc_2 &a, Obj_descr_1 tmp=vec.at(i); Obj_descr_2 tmp1,tmp2; - const Circular_arc_2 *tmp_arc = - CGAL::object_cast(&tmp.first); + const Circular_arc_2 *tmp_arc = &tmp.first; - tmp1.first = make_object - (Circular_arc_2(a.supporting_circle(),tmp_arc->source(), + tmp1.first = + Circular_arc_2(a.supporting_circle(),tmp_arc->source(), CircularFunctors::y_extremal_point - (a.supporting_circle(),!tmp.second))); + (a.supporting_circle(),!tmp.second)); tmp1.second.first=tmp.second; tmp1.second.second= (tmp.second)? false : true ; - tmp2.first = make_object - (Circular_arc_2(a.supporting_circle(), + tmp2.first = + Circular_arc_2(a.supporting_circle(), CircularFunctors::y_extremal_point (a.supporting_circle(),!tmp.second), - tmp_arc->target())); + tmp_arc->target()); tmp2.second.first=tmp.second; tmp2.second.second= (tmp.second)? true : false ; @@ -1528,7 +1521,6 @@ advanced_make_xy_monotone( const typename CK::Circular_arc_2 &a, } return res; - } template diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h index ce3bb2e507f..6b3d632cbfb 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h @@ -377,8 +377,6 @@ namespace CircularFunctors { const typename CK::Circle_2 & c, OutputIterator res ) { - typedef typename CK2_Intersection_traits - ::type result_type; typedef typename CK::Algebraic_kernel AK; typedef typename CK::Polynomial_1_2 Equation_line; typedef typename CK::Polynomial_for_circles_2_2 Equation_circle; @@ -399,8 +397,7 @@ namespace CircularFunctors { for ( typename solutions_container::iterator it = solutions.begin(); it != solutions.end(); ++it ) { - *res++ = CGAL::internal::ck2_intersection_return - (std::make_pair(Circular_arc_point_2(it->first), it->second )); + *res++ = std::make_pair(Circular_arc_point_2(it->first), it->second ); } return res; @@ -412,8 +409,6 @@ namespace CircularFunctors { const typename CK::Line_arc_2 &a2, OutputIterator res ) { - typedef typename CK2_Intersection_traits - ::type result_type; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Point_2 Point_2; @@ -427,13 +422,13 @@ namespace CircularFunctors { if((a1s_a2s && a1t_a2t) || (a1s_a2t && a1t_a2s)){ - *res++ = result_type(a1); + *res++ = a1; return res; } if(a1s_a2s || a1s_a2t || a1t_a2s || a1t_a2t) { if(! LinearFunctors::non_oriented_equal(a1.supporting_line(),a2.supporting_line())){ - if(a1s_a2s || a1s_a2t) *res++ = CGAL::internal::ck2_intersection_return(std::make_pair(a1.source(), 1u)); - if(a1t_a2s || a1t_a2t) *res++ = CGAL::internal::ck2_intersection_return(std::make_pair(a1.target(), 1u)); + if(a1s_a2s || a1s_a2t) *res++ = std::make_pair(a1.source(), 1u); + if(a1t_a2s || a1t_a2t) *res++ = std::make_pair(a1.target(), 1u); return res; } } @@ -445,16 +440,13 @@ namespace CircularFunctors { int comparison = compare_xy(a2.left(),a1.right()); if(comparison < 0){ if(compare_xy(a1.right(),a2.right()) <= 0){ - *res++ = CGAL::internal::ck2_intersection_return - (Line_arc_2(a1.supporting_line(), a2.left(), a1.right() )); + *res++ = Line_arc_2(a1.supporting_line(), a2.left(), a1.right() ); } else{ - *res++ = CGAL::internal::ck2_intersection_return - (Line_arc_2(a1.supporting_line(), a2.left(), a2.right() )); + *res++ = Line_arc_2(a1.supporting_line(), a2.left(), a2.right() ); } } else if (comparison == 0){ - *res++ =CGAL::internal::ck2_intersection_return - ( std::make_pair(a2.left(),1u)); + *res++ = std::make_pair(a2.left(),1u); } return res; } @@ -462,17 +454,14 @@ namespace CircularFunctors { int comparison = compare_xy(a1.left(),a2.right()); if(comparison < 0){ if(compare_xy(a1.right(),a2.right()) <= 0){ - *res++ = CGAL::internal::ck2_intersection_return - (Line_arc_2(a1.supporting_line(), a1.left(), a1.right() )); + *res++ = Line_arc_2(a1.supporting_line(), a1.left(), a1.right() ); } else{ - *res++ = CGAL::internal::ck2_intersection_return - (Line_arc_2(a1.supporting_line(), a1.left(), a2.right() )); + *res++ = Line_arc_2(a1.supporting_line(), a1.left(), a2.right() ); } } else if (comparison == 0){ - *res++ = CGAL::internal::ck2_intersection_return - ( std::make_pair(a1.left(),1u)); + *res++ = std::make_pair(a1.left(),1u); } return res; } @@ -491,7 +480,7 @@ namespace CircularFunctors { CircularFunctors::compare_xy(intersect_point, a1.target())) && (CircularFunctors::compare_xy(intersect_point, a2.source()) != CircularFunctors::compare_xy(intersect_point, a2.target()))) - *res++ = CGAL::internal::ck2_intersection_return(std::make_pair(intersect_point, 1u)); + *res++ = std::make_pair(intersect_point, 1u); return res; } @@ -528,7 +517,7 @@ namespace CircularFunctors { for (typename solutions_container::iterator it = solutions.begin(); it != solutions.end(); ++it) { if(std::visit(Has_on_visitor(&l), *it)) - *res++ = *it; + *res++ = std::get>(*it); } return res; @@ -565,11 +554,11 @@ namespace CircularFunctors { if((ls_cs && lt_ct) || (ls_ct && lt_cs)){ // Case 0 if (compare_xy(l.source(), l.target()) == SMALLER){ - *res++ = result_type(std::make_pair(l.source(), 1u)); - *res++ = result_type(std::make_pair(l.target(), 1u)); + *res++ = std::make_pair(l.source(), 1u); + *res++ = std::make_pair(l.target(), 1u); } else { - *res++ = result_type(std::make_pair(l.target(), 1u)); - *res++ = result_type(std::make_pair(l.source(), 1u)); + *res++ = std::make_pair(l.target(), 1u); + *res++ = std::make_pair(l.source(), 1u); } return res; } else if (ls_cs || lt_ct || ls_ct || lt_cs) { @@ -594,20 +583,20 @@ namespace CircularFunctors { } if( (CircularFunctors::compare_x(p,q) == EQUAL) || CircularFunctors::point_in_x_range(p,r,q)){ // Case 1 - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); return res; } else if(c.on_upper_part()){ // Case 2 if(CircularFunctors::compare_x(r,q) == LARGER){ if(CircularFunctors::orientation(q,r,p) == RIGHT_TURN // Case 2 || CircularFunctors::compare_y_to_right(l,c,q) == LARGER){ // Case 3a - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); return res; } } else { if(CircularFunctors::orientation(r,q,p) == RIGHT_TURN // Case 2 || CircularFunctors::compare_y_to_left(l,c,q) == LARGER){ // Case 3c - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); return res; } } @@ -615,13 +604,13 @@ namespace CircularFunctors { if(CircularFunctors::compare_x(r,q) == LARGER){ if (CircularFunctors::orientation(q,r,p) == LEFT_TURN // Case 2 || CircularFunctors::compare_y_to_right(l,c,q) == SMALLER){ // Case 3b - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); return res; } } else { if(CircularFunctors::orientation(r,q,p) == LEFT_TURN || CircularFunctors::compare_y_to_left(l,c,q) == SMALLER){ // Case 3d - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); return res; } } @@ -629,7 +618,7 @@ namespace CircularFunctors { typename CK::Linear_kernel::Bounded_side bs = CircularFunctors::bounded_side(c.supporting_circle(),p); if(bs == ON_BOUNDED_SIDE){ - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); return res; } else { //Case 4b typedef std::vector::type> @@ -639,12 +628,12 @@ namespace CircularFunctors { std::back_inserter(solutions) ); if(CircularFunctors::compare_x(r,q) == LARGER){ - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); *res++ = solutions.back(); return res; } else { *res++ = solutions.front(); - *res++ = result_type(std::make_pair(q,1u)); + *res++ = std::make_pair(q,1u); return res; } @@ -684,7 +673,7 @@ namespace CircularFunctors { if(std::visit(Has_on_visitor(&l), *it) && std::visit(Has_on_visitor(&c), *it) ) { - *res++ = *it; + *res++ = std::get>(*it); } } return res; @@ -746,11 +735,9 @@ namespace CircularFunctors { typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Point_2 Point_2; typedef typename CK::Line_2 Line_2; - typedef typename CK::Line_arc_2 Line_arc_2; - typedef typename CK2_Intersection_traits::type result_type; if(LinearFunctors::non_oriented_equal(l, la.supporting_line())) { - *res++ = result_type(la); + *res++ = la; } typename Intersection_traits::result_type @@ -764,7 +751,7 @@ namespace CircularFunctors { if (CircularFunctors::compare_xy(intersect_point, la.source()) != CircularFunctors::compare_xy(intersect_point, la.target())) - *res++ = result_type(std::make_pair(intersect_point, 1u)); + *res++ = std::make_pair(intersect_point, 1u); return res; } @@ -791,7 +778,7 @@ namespace CircularFunctors { for (typename solutions_container::const_iterator it = solutions.begin(); it != solutions.end(); ++it) { if(std::visit(Has_on_visitor(&c), *it)) - *res++ = *it; + *res++ = std::get>(*it); } return res; } @@ -810,7 +797,7 @@ namespace CircularFunctors { make_x_monotone( const typename CK::Line_arc_2 &A, OutputIterator res ) { - *res++ = make_object(A); + *res++ = A; return res; } diff --git a/Circular_kernel_2/test/Circular_kernel_2/include/CGAL/_test_circles_constructions.h b/Circular_kernel_2/test/Circular_kernel_2/include/CGAL/_test_circles_constructions.h index 6755d363444..dfc1c688ea8 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/include/CGAL/_test_circles_constructions.h +++ b/Circular_kernel_2/test/Circular_kernel_2/include/CGAL/_test_circles_constructions.h @@ -19,6 +19,17 @@ #include #include +template +bool assign_variant(Expected& e, const V& v) +{ + if (std::get_if(&v) != nullptr) + { + e = std::get(v); + return true; + } + return false; +} + //#define typename template void _test_circle_construct(CK ck) @@ -33,8 +44,9 @@ void _test_circle_construct(CK ck) typedef typename CK::FT FT; typedef typename CK::Construct_circle_2 Construct_circle_2; typedef typename CK::Intersect_2 Intersect_2; + typedef std::variant> Intersection_result; typedef typename CK::Make_x_monotone_2 Make_x_monotone_2; - typedef typename CK::Make_xy_monotone_2 Make_xy_monotone_2; + typedef typename CK::Make_xy_monotone_2 Make_xy_monotone_2; typedef typename CK::Split_2 Split_2; typedef typename CK::Get_equation Get_equation; typedef typename CK::Compare_xy_2 Compare_xy_2; @@ -107,8 +119,7 @@ void _test_circle_construct(CK ck) Circle_2 circ_intersections_2_2(center_circ_intersections_2_2, circ_intersection_2_1_r); - std::vector< CGAL::Object > - vector_for_intersection_1, vector_for_intersection_1l; + std::vector< Intersection_result > vector_for_intersection_1, vector_for_intersection_1l; theConstruct_intersect_2(circ_intersections_2_1, circ_intersections_2_2, @@ -120,12 +131,12 @@ void _test_circle_construct(CK ck) assert(theDo_intersect_2(circ_intersections_2_1, circ_intersections_2_1)); assert(do_intersect(circ_intersections_2_1, circ_intersections_2_1)); std::pair the_pair; - assert(assign(the_pair, vector_for_intersection_1[0])); - assert(assign(the_pair, vector_for_intersection_1l[0])); + assert(assign_variant(the_pair, vector_for_intersection_1[0])); + assert(assign_variant(the_pair, vector_for_intersection_1l[0])); Circular_arc_point_2 first = the_pair.first; std::cout << first << std::endl; - assert(assign(the_pair, vector_for_intersection_1[1])); - assert(assign(the_pair, vector_for_intersection_1l[1])); + assert(assign_variant(the_pair, vector_for_intersection_1[1])); + assert(assign_variant(the_pair, vector_for_intersection_1l[1])); Circular_arc_point_2 second = the_pair.first; std::cout << second << std::endl; Compare_xy_2 theCompare_xy_2 = ck.compare_xy_2_object(); @@ -146,14 +157,13 @@ void _test_circle_construct(CK ck) CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_3, false); - std::vector< CGAL::Object > - vector_for_intersection_2; + std::vector< Intersection_result > vector_for_intersection_2; theConstruct_intersect_2(circ_intersections_2_1, circ_intersections_2_3, std::back_inserter(vector_for_intersection_2)); assert(theDo_intersect_2(circ_intersections_2_1, circ_intersections_2_3)); assert(vector_for_intersection_2.size() == 1); - assign(the_pair, vector_for_intersection_2[0]); + assign_variant(the_pair, vector_for_intersection_2[0]); assert(the_pair.first == the_intersection_point_1); assert(the_pair.first == the_intersection_point_2); @@ -163,14 +173,13 @@ void _test_circle_construct(CK ck) Circle_2 circ_intersections_2_3_bis(center_circ_intersections_2_3_bis, circ_intersection_2_1_r * circ_intersection_2_1_r * 4); - std::vector< CGAL::Object > - vector_for_intersection_2_bis; + std::vector< Intersection_result > vector_for_intersection_2_bis; theConstruct_intersect_2(circ_intersections_2_1, circ_intersections_2_3_bis, std::back_inserter(vector_for_intersection_2_bis)); assert(theDo_intersect_2(circ_intersections_2_1, circ_intersections_2_3_bis)); assert(vector_for_intersection_2_bis.size() == 1); - assign(the_pair, vector_for_intersection_2_bis[0]); + assign_variant(the_pair, vector_for_intersection_2_bis[0]); assert(the_pair.second == 2u); @@ -202,8 +211,7 @@ void _test_circle_construct(CK ck) ////////////// std::cout << "OH NO!" << std::endl; //////////////} else std::cout << "OK" << std::endl; - std::vector< CGAL::Object > - vector_for_intersection_3; + std::vector< Intersection_result > vector_for_intersection_3; theConstruct_intersect_2(circ_arc_2_1_part_low, circ_arc_2_1_low_part_high, std::back_inserter(vector_for_intersection_3)); @@ -211,12 +219,12 @@ void _test_circle_construct(CK ck) /////////////std::cout << "The size: " << vector_for_intersection_3.size() << std::endl; assert(vector_for_intersection_3.size() == 2); - assign(the_pair, vector_for_intersection_3[0]); + assign_variant(the_pair, vector_for_intersection_3[0]); assert(the_pair.second == 1u); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_1_low, true)); - assign(the_pair, vector_for_intersection_3[1]); + assign_variant(the_pair, vector_for_intersection_3[1]); assert(the_pair.second == 1u); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_1_low, @@ -270,23 +278,21 @@ void _test_circle_construct(CK ck) ); std::cout << "Intersection : same circular arc" << std::endl; - std::vector< CGAL::Object > - vector_for_intersection_the_same_arc; + std::vector< Intersection_result > vector_for_intersection_the_same_arc; theConstruct_intersect_2(circ_arc_overlap_1, circ_arc_overlap_1, std::back_inserter(vector_for_intersection_the_same_arc)); assert(theDo_intersect_2(circ_arc_overlap_1, circ_arc_overlap_1)); assert(vector_for_intersection_the_same_arc.size() == 1); Circular_arc_2 res_same; - assert(assign(res_same, vector_for_intersection_the_same_arc[0])); + assert(assign_variant(res_same, vector_for_intersection_the_same_arc[0])); assert(res_same.source() == circ_arc_overlap_1.source()); assert(res_same.target() == circ_arc_overlap_1.target()); std::cout << "Intersection : overlap on a circular arc" << std::endl; Circular_arc_2 circ_arc_in_overlap; Circular_arc_2 circ_arc_in_overlap_2; - std::vector< CGAL::Object > - vector_for_intersection_overlap_1_1; + std::vector< Intersection_result > vector_for_intersection_overlap_1_1; theConstruct_intersect_2(circ_arc_overlap_2, circ_arc_overlap_1, std::back_inserter(vector_for_intersection_overlap_1_1)); @@ -295,30 +301,29 @@ void _test_circle_construct(CK ck) line_arc_overlap_low_left, true, line_arc_overlap_low_right, false); assert(vector_for_intersection_overlap_1_1.size() == 1); - assign(circ_arc_in_overlap, vector_for_intersection_overlap_1_1[0]); + assign_variant(circ_arc_in_overlap, vector_for_intersection_overlap_1_1[0]); assert(circ_arc_in_overlap.source() == circ_arc_overlap_result.source()); assert(circ_arc_in_overlap.target() == circ_arc_overlap_result.target()); - std::vector< CGAL::Object > - vector_for_intersection_overlap_1_2; + std::vector< Intersection_result > vector_for_intersection_overlap_1_2; theConstruct_intersect_2(circ_arc_overlap_2, circ_arc_overlap_1, std::back_inserter(vector_for_intersection_overlap_1_2)); assert(theDo_intersect_2(circ_arc_overlap_2, circ_arc_overlap_1)); assert(vector_for_intersection_overlap_1_2.size() == 1); - assign(circ_arc_in_overlap, vector_for_intersection_overlap_1_2[0]); + assign_variant(circ_arc_in_overlap, vector_for_intersection_overlap_1_2[0]); assert(circ_arc_in_overlap.source() == circ_arc_overlap_result.source()); assert(circ_arc_in_overlap.target() == circ_arc_overlap_result.target()); std::cout << "Intersection : overlap in one point" << std::endl; - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_overlap_2_1; theConstruct_intersect_2(circ_arc_overlap_1, circ_arc_overlap_3, std::back_inserter(vector_for_intersection_overlap_2_1)); assert(theDo_intersect_2(circ_arc_overlap_1, circ_arc_overlap_3)); assert(vector_for_intersection_overlap_2_1.size() == 1); - assign(the_pair, vector_for_intersection_overlap_2_1[0]); + assign_variant(the_pair, vector_for_intersection_overlap_2_1[0]); std::cout << "x = " << the_pair.first.x() << " the result must be = " << center_circ_intersection_2_1_x + circ_intersection_2_1_r * sqrt2 << std::endl; @@ -337,14 +342,14 @@ void _test_circle_construct(CK ck) assert(square(the_pair.first.y() - RT(center_circ_intersection_2_1_y)) == (circ_intersection_2_1_r * circ_intersection_2_1_r / typename CK::RT(2))); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_overlap_2_2; theConstruct_intersect_2(circ_arc_overlap_3, circ_arc_overlap_1, std::back_inserter(vector_for_intersection_overlap_2_2)); assert(theDo_intersect_2(circ_arc_overlap_3, circ_arc_overlap_1)); assert(vector_for_intersection_overlap_2_2.size() == 1); - assign(the_pair, vector_for_intersection_overlap_2_2[0]); + assign_variant(the_pair, vector_for_intersection_overlap_2_2[0]); std::cout << "x = " << the_pair.first.x() << " the result must be = " << center_circ_intersection_2_1_x + circ_intersection_2_1_r * sqrt2 << std::endl; @@ -362,7 +367,7 @@ void _test_circle_construct(CK ck) std::cout << "Intersection : overlap in two points: " << "lower_part_arc , upper_part_arc" << std::endl; - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_overlap_3_1; theConstruct_intersect_2(circ_arc_overlap_upper_part, circ_arc_overlap_lower_part, @@ -370,13 +375,13 @@ void _test_circle_construct(CK ck) assert(theDo_intersect_2(circ_arc_overlap_upper_part, circ_arc_overlap_lower_part)); assert(vector_for_intersection_overlap_3_1.size() == 2); - assign(the_pair, vector_for_intersection_overlap_3_1[0]); + assign_variant(the_pair, vector_for_intersection_overlap_3_1[0]); assert(the_pair.first == circ_arc_overlap_lower_part.source()); //assert(the_pair.first.is_left()); - assign(the_pair, vector_for_intersection_overlap_3_1[1]); + assign_variant(the_pair, vector_for_intersection_overlap_3_1[1]); assert(the_pair.first == circ_arc_overlap_lower_part.target()); //assert(!the_pair.first.is_left()); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_overlap_3_2; theConstruct_intersect_2(circ_arc_overlap_lower_part, circ_arc_overlap_upper_part, @@ -384,10 +389,10 @@ void _test_circle_construct(CK ck) assert(theDo_intersect_2(circ_arc_overlap_lower_part, circ_arc_overlap_upper_part)); assert(vector_for_intersection_overlap_3_2.size() == 2); - assign(the_pair, vector_for_intersection_overlap_3_2[0]); + assign_variant(the_pair, vector_for_intersection_overlap_3_2[0]); assert(the_pair.first == circ_arc_overlap_lower_part.source()); //assert(the_pair.first.is_left()); - assign(the_pair, vector_for_intersection_overlap_3_2[1]); + assign_variant(the_pair, vector_for_intersection_overlap_3_2[1]); assert(the_pair.first == circ_arc_overlap_lower_part.target()); //assert(!the_pair.first.is_left()); @@ -404,20 +409,20 @@ void _test_circle_construct(CK ck) Circle_2 circ_intersections_2_4(center_circ_intersections_2_4, circ_intersection_2_1_r * circ_intersection_2_1_r); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_1_1; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_4, std::back_inserter(vector_for_intersection_no_x_monotone_1_1)); assert(theDo_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_4)); assert(vector_for_intersection_no_x_monotone_1_1.size() == 2); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_1_1[0])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_1_1[0])); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_4, true)); assert(the_pair.second == 1u); //assert(the_pair.first.is_left()); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_1_1[1])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_1_1[1])); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_4, false)); @@ -432,14 +437,14 @@ void _test_circle_construct(CK ck) Circle_2 circ_intersections_2_5(center_circ_intersections_2_5, circ_intersection_2_1_r * circ_intersection_2_1_r); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_1_2; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_5, std::back_inserter(vector_for_intersection_no_x_monotone_1_2)); assert(theDo_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_5)); assert(vector_for_intersection_no_x_monotone_1_2.size() == 1); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_1_2[0])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_1_2[0])); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_5, true)); @@ -454,14 +459,14 @@ void _test_circle_construct(CK ck) Circle_2 circ_intersections_2_6(center_circ_intersections_2_6, circ_intersection_2_1_r * circ_intersection_2_1_r); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_1_3; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_6, std::back_inserter(vector_for_intersection_no_x_monotone_1_3)); assert(theDo_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_6)); assert(vector_for_intersection_no_x_monotone_1_3.size() == 1); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_1_3[0])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_1_3[0])); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_6, true)); @@ -475,14 +480,14 @@ void _test_circle_construct(CK ck) Circle_2 circ_intersections_2_7(center_circ_intersections_2_7, circ_intersection_2_1_r * circ_intersection_2_1_r); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_1_4; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_7, std::back_inserter(vector_for_intersection_no_x_monotone_1_4)); assert(theDo_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_7)); assert(vector_for_intersection_no_x_monotone_1_4.size() == 1); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_1_4[0])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_1_4[0])); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_7, true)); @@ -495,14 +500,14 @@ void _test_circle_construct(CK ck) Circle_2 circ_intersections_2_8(center_circ_intersections_2_8, circ_intersection_2_1_r * circ_intersection_2_1_r * 4); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_1_5; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_8, std::back_inserter(vector_for_intersection_no_x_monotone_1_5)); assert(theDo_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_8)); assert(vector_for_intersection_no_x_monotone_1_5.size() == 1); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_1_5[0])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_1_5[0])); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_8, true)); @@ -515,14 +520,14 @@ void _test_circle_construct(CK ck) Circle_2 circ_intersections_2_9(center_circ_intersections_2_9, circ_intersection_2_1_r * circ_intersection_2_1_r * 4); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_1_6; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_9, std::back_inserter(vector_for_intersection_no_x_monotone_1_6)); assert(theDo_intersect_2(circ_arc_no_x_monotone_1, circ_intersections_2_9)); assert(vector_for_intersection_no_x_monotone_1_6.size() == 1); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_1_6[0])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_1_6[0])); assert(the_pair.first == CGAL::circle_intersect(circ_intersections_2_1, circ_intersections_2_9, true)); @@ -535,14 +540,14 @@ void _test_circle_construct(CK ck) Circular_arc_2 circ_arc_no_x_monotone_2(circ_intersections_2_1, line_arc_overlap_low_left, true, line_arc_overlap_low_left, false); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_2_1; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_arc_no_x_monotone_2, std::back_inserter(vector_for_intersection_no_x_monotone_2_1)); assert(theDo_intersect_2(circ_arc_no_x_monotone_1, circ_arc_no_x_monotone_2)); assert(vector_for_intersection_no_x_monotone_2_1.size() == 1); - assert(assign(circ_arc_in_overlap, vector_for_intersection_no_x_monotone_2_1[0])); + assert(assign_variant(circ_arc_in_overlap, vector_for_intersection_no_x_monotone_2_1[0])); assert(circ_arc_in_overlap.is_x_monotone()); assert(circ_arc_in_overlap.source() == circ_arc_overlap_result.source()); assert(circ_arc_in_overlap.target() == circ_arc_overlap_result.target()); @@ -556,14 +561,14 @@ void _test_circle_construct(CK ck) line_arc_overlap_low_left, true); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_2_2; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_arc_no_x_monotone_3, std::back_inserter(vector_for_intersection_no_x_monotone_2_2)); assert(theDo_intersect_2(circ_arc_no_x_monotone_1, circ_arc_no_x_monotone_3)); assert(vector_for_intersection_no_x_monotone_2_2.size() == 1); - assert(assign(circ_arc_in_overlap, vector_for_intersection_no_x_monotone_2_2[0])); + assert(assign_variant(circ_arc_in_overlap, vector_for_intersection_no_x_monotone_2_2[0])); assert(circ_arc_in_overlap.source() == circ_arc_no_x_monotone_1.source()); assert(circ_arc_in_overlap.target() == circ_arc_no_x_monotone_3.target()); @@ -575,7 +580,7 @@ void _test_circle_construct(CK ck) Circular_arc_2 circ_arc_no_x_monotone_4(circ_intersections_2_1, line_arc_overlap_low_left, true, line_arc_overlap_low_right, true); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_2_3; theConstruct_intersect_2(circ_arc_no_x_monotone_1, circ_arc_no_x_monotone_4, @@ -586,9 +591,9 @@ void _test_circle_construct(CK ck) std::cout << vector_for_intersection_no_x_monotone_2_3.size() << std::endl; assert(vector_for_intersection_no_x_monotone_2_3.size() == 2); - assert(assign(circ_arc_in_overlap, + assert(assign_variant(circ_arc_in_overlap, vector_for_intersection_no_x_monotone_2_3[0])); - assert(assign(the_pair, + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_2_3[1])); assert(circ_arc_in_overlap.is_x_monotone()); assert(circ_arc_in_overlap.source() @@ -605,7 +610,7 @@ void _test_circle_construct(CK ck) Circular_arc_2 circ_arc_no_x_monotone_5(circ_intersections_2_1, line_arc_overlap_low_right, true, line_arc_overlap_low_left, true); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_2_4; theConstruct_intersect_2(circ_arc_no_x_monotone_4, circ_arc_no_x_monotone_5, @@ -613,10 +618,10 @@ void _test_circle_construct(CK ck) assert(theDo_intersect_2(circ_arc_no_x_monotone_4, circ_arc_no_x_monotone_5)); std::cout << vector_for_intersection_no_x_monotone_2_4.size() << std::endl; assert(vector_for_intersection_no_x_monotone_2_4.size() == 2); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_2_4[0])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_2_4[0])); assert(the_pair.first == circ_arc_no_x_monotone_5.target()); assert(the_pair.second == 1u); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_2_4[1])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_2_4[1])); assert(the_pair.first == circ_arc_no_x_monotone_5.source()); assert(the_pair.second == 1u); @@ -626,7 +631,7 @@ void _test_circle_construct(CK ck) Circular_arc_2 circ_arc_no_x_monotone_6(circ_intersections_2_1, line_arc_overlap_low_right, false, line_arc_overlap_low_right, true); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_2_5; theConstruct_intersect_2(circ_arc_no_x_monotone_6, circ_arc_no_x_monotone_5, @@ -634,7 +639,7 @@ void _test_circle_construct(CK ck) assert(theDo_intersect_2(circ_arc_no_x_monotone_6, circ_arc_no_x_monotone_5)); std::cout << vector_for_intersection_no_x_monotone_2_5.size() << std::endl; assert(vector_for_intersection_no_x_monotone_2_5.size() == 1); - assert(assign(the_pair, vector_for_intersection_no_x_monotone_2_5[0])); + assert(assign_variant(the_pair, vector_for_intersection_no_x_monotone_2_5[0])); assert(the_pair.first == circ_arc_no_x_monotone_5.source()); assert(the_pair.second == 1u); @@ -644,7 +649,7 @@ void _test_circle_construct(CK ck) Circular_arc_2 circ_arc_no_x_monotone_7(circ_intersections_2_1, line_arc_overlap_low_left, false, line_arc_overlap_low_right, false); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_no_x_monotone_2_6; theConstruct_intersect_2(circ_arc_no_x_monotone_7, circ_arc_no_x_monotone_4, @@ -652,8 +657,8 @@ void _test_circle_construct(CK ck) assert(theDo_intersect_2(circ_arc_no_x_monotone_7, circ_arc_no_x_monotone_4)); std::cout << vector_for_intersection_no_x_monotone_2_6.size() << std::endl; assert(vector_for_intersection_no_x_monotone_2_6.size() == 2); - assign(circ_arc_in_overlap,vector_for_intersection_no_x_monotone_2_6[0]); - assign(circ_arc_in_overlap_2,vector_for_intersection_no_x_monotone_2_6[1]); + assign_variant(circ_arc_in_overlap,vector_for_intersection_no_x_monotone_2_6[0]); + assign_variant(circ_arc_in_overlap_2,vector_for_intersection_no_x_monotone_2_6[1]); assert((circ_arc_in_overlap.source() == circ_arc_no_x_monotone_7.source() && circ_arc_in_overlap.target() == circ_arc_no_x_monotone_4.target()) || (circ_arc_in_overlap_2.source() == circ_arc_no_x_monotone_7.source() && @@ -692,7 +697,7 @@ void _test_circle_construct(CK ck) Point_2 center_circ_monotone(x,y); Circle_2 circ_monotone(center_circ_monotone, r*r); Circular_arc_2 theCircular_arc_2_full(circ_monotone); - std::vector< CGAL::Object > outputIterator1, outputIterator1l; + std::vector< Intersection_result > outputIterator1, outputIterator1l; theMake_x_monotone(theCircular_arc_2_full, std::back_inserter(outputIterator1)); make_x_monotone(theCircular_arc_2_full, std::back_inserter(outputIterator1l)); @@ -701,8 +706,8 @@ void _test_circle_construct(CK ck) << circ_monotone << std::endl; Circular_arc_2 circular_arc_2_full, circular_arc_2_fulll; for(std::size_t i = 0; i < outputIterator1.size(); i++){ - assign(circular_arc_2_full, outputIterator1[i]); - assign(circular_arc_2_fulll, outputIterator1l[i]); + assign_variant(circular_arc_2_full, outputIterator1[i]); + assign_variant(circular_arc_2_fulll, outputIterator1l[i]); std::cout << "Circular_arc_2_" << i << " : " << circular_arc_2_full << std::endl; std::cout << "Circular_arc_2_" << i << "source : " @@ -723,8 +728,8 @@ void _test_circle_construct(CK ck) std::back_inserter(outputIterator1l)); assert(outputIterator1.size() == 4); for(std::size_t i = 0; i < outputIterator1.size(); i++){ - assign(circular_arc_2_full, outputIterator1[i]); - assign(circular_arc_2_fulll, outputIterator1l[i]); + assign_variant(circular_arc_2_full, outputIterator1[i]); + assign_variant(circular_arc_2_fulll, outputIterator1l[i]); assert(circular_arc_2_full.is_x_monotone()); assert(circular_arc_2_full.is_y_monotone()); assert(circular_arc_2_full == circular_arc_2_fulll); @@ -767,7 +772,7 @@ void _test_circle_construct(CK ck) std::cout << "T: " << i << " " << j << std::endl; assert(outputIterator1.size() == isize[i][j]); for(std::size_t k = 0; k < outputIterator1.size(); k++) { - assign(circular_arc_2_full, outputIterator1[k]); + assign_variant(circular_arc_2_full, outputIterator1[k]); assert(circular_arc_2_full.is_x_monotone()); assert(circular_arc_2_full.is_y_monotone()); } @@ -782,7 +787,7 @@ void _test_circle_construct(CK ck) Circular_arc_2 theCircular_arc_2_quarter(circ_monotone, theLine_2_1, true, theLine_2_2, true); - std::vector< CGAL::Object > vector_of_object_1; + std::vector< Intersection_result > vector_of_object_1; theMake_x_monotone(theCircular_arc_2_quarter, std::back_inserter(vector_of_object_1)); std::cout << std::endl; @@ -791,7 +796,7 @@ void _test_circle_construct(CK ck) std::cout << vector_of_object_1.size() << std::endl; Circular_arc_2 circular_arc_2_quarter; for(std::size_t i = 0; i < vector_of_object_1.size(); i++){ - assign(circular_arc_2_quarter, vector_of_object_1[i]); + assign_variant(circular_arc_2_quarter, vector_of_object_1[i]); std::cout << "Circular_arc_2_" << i << " : " << circular_arc_2_quarter << std::endl; assert(circular_arc_2_quarter.is_x_monotone()); @@ -801,13 +806,13 @@ void _test_circle_construct(CK ck) Circular_arc_2 theCircular_arc_2_half(circ_monotone, theLine_2_2, false, theLine_2_2, true); - std::vector< CGAL::Object > vector_of_object_1_half; + std::vector< Intersection_result > vector_of_object_1_half; theMake_x_monotone(theCircular_arc_2_half, std::back_inserter(vector_of_object_1_half)); std::cout << std::endl; std::cout << "x_monotone a half circle" << std::endl; assert(vector_of_object_1_half.size() == 1); - assign(circular_arc_2_quarter, vector_of_object_1_half[0]); + assign_variant(circular_arc_2_quarter, vector_of_object_1_half[0]); assert(circular_arc_2_quarter.is_x_monotone()); assert(circular_arc_2_quarter.source() == theCircular_arc_2_half.source()); assert(circular_arc_2_quarter.target() == theCircular_arc_2_half.target()); @@ -837,7 +842,7 @@ void _test_circle_construct(CK ck) Circular_arc_2 theCircular_arc_2_random(circ_monotone, theLine_2_3, true, theLine_2_4, true); - std::vector< CGAL::Object > vector_of_object_2; + std::vector< Intersection_result > vector_of_object_2; theMake_x_monotone(theCircular_arc_2_random, std::back_inserter(vector_of_object_2)); std::cout << std::endl; @@ -845,7 +850,7 @@ void _test_circle_construct(CK ck) << circ_monotone << std::endl; Circular_arc_2 circular_arc_2_random; for(std::size_t i = 0; i < vector_of_object_2.size(); i++){ - assign(circular_arc_2_random, vector_of_object_2[i]); + assign_variant(circular_arc_2_random, vector_of_object_2[i]); std::cout << "Circular_arc_2_" << i << " : " << circular_arc_2_random << std::endl; assert(circular_arc_2_random.is_x_monotone()); @@ -911,7 +916,7 @@ void _test_circle_construct(CK ck) Circular_arc_2 cao8 = Circular_arc_2(Point_2(11,10), Point_2(1,0), Point_2(11,-10)); // = no intersection std::cout << "Testing intersect with lines" << std::endl; - std::vector< CGAL::Object > v_ll1, v_ll2, v_ll3, v_ll4, v_ll5, v_ll6, v_ll7, v_ll8; + std::vector< Intersection_result > v_ll1, v_ll2, v_ll3, v_ll4, v_ll5, v_ll6, v_ll7, v_ll8; theConstruct_intersect_2(lo1, cao1, std::back_inserter(v_ll1)); theConstruct_intersect_2(lo1, cao2, std::back_inserter(v_ll2)); theConstruct_intersect_2(lo1, cao3, std::back_inserter(v_ll3)); @@ -942,7 +947,7 @@ void _test_circle_construct(CK ck) Line_arc_2 llu3 = Line_arc_2(Point_2(-2,-1), Point_2(-2,1)); Circle_2 ccu = Circle_2(Point_2(0,-1), Point_2(-1,0), Point_2(0,1)); - std::vector< CGAL::Object > v_llc1, v_llc2, v_llc3; + std::vector< Intersection_result > v_llc1, v_llc2, v_llc3; theConstruct_intersect_2(llu1, ccu, std::back_inserter(v_llc1)); theConstruct_intersect_2(llu2, ccu, std::back_inserter(v_llc2)); theConstruct_intersect_2(llu3, ccu, std::back_inserter(v_llc3)); @@ -957,7 +962,7 @@ void _test_circle_construct(CK ck) assert(!theDo_intersect_2(llu3, ccu)); assert(!CGAL::do_intersect(llu3, ccu)); - std::vector< CGAL::Object > v_rllc1, v_rllc2, v_rllc3, v_rllc1l, v_rllc2l, v_rllc3l; + std::vector< Intersection_result > v_rllc1, v_rllc2, v_rllc3, v_rllc1l, v_rllc2l, v_rllc3l; theConstruct_intersect_2(llu1.supporting_line(), ccu, std::back_inserter(v_rllc1)); theConstruct_intersect_2(llu2.supporting_line(), ccu, std::back_inserter(v_rllc2)); theConstruct_intersect_2(llu3.supporting_line(), ccu, std::back_inserter(v_rllc3)); diff --git a/Circular_kernel_2/test/Circular_kernel_2/include/CGAL/_test_circles_extention.h b/Circular_kernel_2/test/Circular_kernel_2/include/CGAL/_test_circles_extention.h index 2329bca2acb..02471d6f61d 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/include/CGAL/_test_circles_extention.h +++ b/Circular_kernel_2/test/Circular_kernel_2/include/CGAL/_test_circles_extention.h @@ -24,7 +24,9 @@ void _test_circle_bbox(CK ck) typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Point_2 Point_2; + typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Intersect_2 Intersect_2; + typedef std::variant> Intersection_result; CGAL::Random generatorOfgenerator; int random_seed = generatorOfgenerator.get_int(0, 123456); @@ -55,7 +57,7 @@ void _test_circle_bbox(CK ck) bool box_overlap = do_overlap(box1, box2); Intersect_2 theConstruct_intersect_2 = ck.intersect_2_object(); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_1; theConstruct_intersect_2(arc1, arc2, @@ -143,6 +145,7 @@ template typedef typename CK::Intersect_2 Intersect_2; typedef typename CK::Make_x_monotone_2 Make_x_monotone_2; typedef typename CK::Line_arc_2 Line_arc_2; + typedef std::variant, Circular_arc_2> Intersection_result; Point_2 center_circ(0,0); Circle_2 circ(center_circ, 100); @@ -151,7 +154,7 @@ template Point_2(0, -15)); Intersect_2 theConstruct_intersect_2 = ck.intersect_2_object(); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_1; theConstruct_intersect_2(arc, line_vertical, @@ -159,18 +162,18 @@ template Circular_arc_point_2 point_top; Circular_arc_point_2 point_down; std::pair< Circular_arc_point_2, unsigned int> aux; - assign(aux, vector_for_intersection_1[0]); + assign_variant(aux, vector_for_intersection_1[0]); point_down = aux.first; - assign(aux, vector_for_intersection_1[1]); + assign_variant(aux, vector_for_intersection_1[1]); point_top = aux.first; Make_x_monotone_2 theMake_x_monotone = ck.make_x_monotone_2_object(); - std::vector< CGAL::Object > outputIterator1; + std::vector< Intersection_result > outputIterator1; theMake_x_monotone(arc, std::back_inserter(outputIterator1)); Circular_arc_2 arc_top; Circular_arc_2 arc_down; - assign(arc_top,outputIterator1[1]); - assign(arc_down, outputIterator1[0]); + assign_variant(arc_top,outputIterator1[1]); + assign_variant(arc_down, outputIterator1[0]); assert(!ck.has_on_2_object()(arc_top, line_vertical.source())); assert(ck.has_on_2_object()(arc_top, @@ -195,7 +198,7 @@ template typedef typename CK::Point_2 Point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Intersect_2 Intersect_2; - + typedef std::variant> Intersection_result; int test_suite_cases[3][2][3] = {{{-7,-8,113},{9,9,162}}, @@ -213,20 +216,20 @@ template Intersect_2 theConstruct_intersect_2 = ck.intersect_2_object(); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_1; theConstruct_intersect_2(arc, arc2, std::back_inserter(vector_for_intersection_1)); std::pair< Circular_arc_point_2, unsigned int> aux; - assign(aux, vector_for_intersection_1[0]); + assign_variant(aux, vector_for_intersection_1[0]); CGAL::Bbox_2 box1 = aux.first.bbox(); assert(typename CK::FT(box1.xmin()) <= aux.first.x()); assert(typename CK::FT(box1.xmax()) >= aux.first.x()); assert(typename CK::FT(box1.ymin()) <= aux.first.y()); assert(typename CK::FT(box1.ymax()) >= aux.first.y()); std::cout << "Ok" << std::endl; - assign(aux, vector_for_intersection_1[1]); + assign_variant(aux, vector_for_intersection_1[1]); CGAL::Bbox_2 box2 = aux.first.bbox(); assert(typename CK::FT(box2.xmin()) <= aux.first.x()); assert(typename CK::FT(box2.xmax()) >= aux.first.x()); diff --git a/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp b/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp index 38a2174b586..b1633d4b08f 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp +++ b/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp @@ -27,6 +27,17 @@ #include +template +bool assign_variant(Expected& e, const V& v) +{ + if (std::get_if(&v) != nullptr) + { + e = std::get(v); + return true; + } + return false; +} + template void _test_Line_arc(CK ck) { @@ -87,41 +98,42 @@ void _test_Line_arc(CK ck) //////////////Intersection Line_arc Line_arc////////////////// Intersect_2 theConstruct_intersect_2 = ck.intersect_2_object(); + typedef std::variant, Line_arc_2> Intersection_result; - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_1; theConstruct_intersect_2(line_arc_horizontal, line_arc_vertical, std::back_inserter(vector_for_intersection_1)); std::pair the_pair; - assert(assign(the_pair, vector_for_intersection_1[0])); + assert(assign_variant(the_pair, vector_for_intersection_1[0])); Circular_arc_point_2 first = the_pair.first; assert(first.x() == 0); assert(first.y() == 0); Line_arc_2 line_arc_3(Point_2(-1, -2), Point_2(2,1)); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_2; theConstruct_intersect_2(line_arc_horizontal, line_arc_3, std::back_inserter(vector_for_intersection_2)); - assert(assign(the_pair, vector_for_intersection_2[0])); + assert(assign_variant(the_pair, vector_for_intersection_2[0])); first = the_pair.first; assert(first.x() == 1); assert(first.y() == 0); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_3; theConstruct_intersect_2(line_arc_vertical, line_arc_3, std::back_inserter(vector_for_intersection_3)); - assert(assign(the_pair, vector_for_intersection_3[0])); + assert(assign_variant(the_pair, vector_for_intersection_3[0])); first = the_pair.first; assert(first.x() == 0); assert(first.y() == -1); Line_arc_2 line_arc_4(Point_2(20, -2), Point_2(20,10)); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_4; theConstruct_intersect_2(line_arc_horizontal, line_arc_4, @@ -131,14 +143,14 @@ void _test_Line_arc(CK ck) ////////////intersection in overlap/////////////// - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_5; theConstruct_intersect_2(line_arc_horizontal, line_arc_horizontal, std::back_inserter(vector_for_intersection_5)); Line_arc_2 line_arc_tmp; assert(vector_for_intersection_5.size() == 1); - assert(assign(line_arc_tmp, vector_for_intersection_5[0])); + assert(assign_variant(line_arc_tmp, vector_for_intersection_5[0])); assert(line_arc_tmp == line_arc_horizontal); Line_arc_2 line_arc_horizontal2(Line_2(center_circle1, p2_line_horizontal), @@ -146,25 +158,25 @@ void _test_Line_arc(CK ck) true, circle1, false); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_6; theConstruct_intersect_2(line_arc_horizontal, line_arc_horizontal2, std::back_inserter(vector_for_intersection_6)); assert(vector_for_intersection_6.size() == 1); - assert(assign(line_arc_tmp, vector_for_intersection_6[0])); + assert(assign_variant(line_arc_tmp, vector_for_intersection_6[0])); assert(line_arc_tmp.source() == line_arc_horizontal.source()); assert(line_arc_tmp.target() == line_arc_horizontal2.target()); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_6_reverse; theConstruct_intersect_2(line_arc_horizontal2, line_arc_horizontal, std::back_inserter(vector_for_intersection_6_reverse)); assert(vector_for_intersection_6_reverse.size() == 1); - assert(assign(line_arc_tmp, vector_for_intersection_6_reverse[0])); + assert(assign_variant(line_arc_tmp, vector_for_intersection_6_reverse[0])); assert(line_arc_tmp.source() == line_arc_horizontal.source()); assert(line_arc_tmp.target() == line_arc_horizontal2.target()); @@ -175,43 +187,43 @@ void _test_Line_arc(CK ck) true, circle1, false); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_7; theConstruct_intersect_2(line_arc_horizontal, line_arc_horizontal3, std::back_inserter(vector_for_intersection_7)); assert(vector_for_intersection_7.size() == 1); - assert(assign(line_arc_tmp, vector_for_intersection_7[0])); + assert(assign_variant(line_arc_tmp, vector_for_intersection_7[0])); assert(line_arc_tmp.source() == line_arc_horizontal.source()); assert(line_arc_tmp.target() == line_arc_horizontal3.target()); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_8; theConstruct_intersect_2(line_arc_horizontal3, line_arc_horizontal, std::back_inserter(vector_for_intersection_8)); assert(vector_for_intersection_8.size() == 1); - assert(assign(line_arc_tmp, vector_for_intersection_8[0])); + assert(assign_variant(line_arc_tmp, vector_for_intersection_8[0])); assert(line_arc_tmp.source() == line_arc_horizontal.source()); assert(line_arc_tmp.target() == line_arc_horizontal3.target()); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_8_bis_1; theConstruct_intersect_2(line_arc_horizontal3, line_arc_horizontal2, std::back_inserter(vector_for_intersection_8_bis_1)); assert(vector_for_intersection_8_bis_1.size() == 1); - assert(assign(line_arc_tmp, vector_for_intersection_8_bis_1[0])); + assert(assign_variant(line_arc_tmp, vector_for_intersection_8_bis_1[0])); assert(line_arc_tmp.source() == line_arc_horizontal2.source()); assert(line_arc_tmp.target() == line_arc_horizontal3.target()); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_8_bis_2; theConstruct_intersect_2(line_arc_horizontal2, line_arc_horizontal3, std::back_inserter(vector_for_intersection_8_bis_2)); assert(vector_for_intersection_8_bis_2.size() == 1); - assert(assign(line_arc_tmp, vector_for_intersection_8_bis_2[0])); + assert(assign_variant(line_arc_tmp, vector_for_intersection_8_bis_2[0])); assert(line_arc_tmp.source() == line_arc_horizontal2.source()); assert(line_arc_tmp.target() == line_arc_horizontal3.target()); @@ -221,45 +233,45 @@ void _test_Line_arc(CK ck) true, circle1, true); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_9; theConstruct_intersect_2(line_arc_horizontal4, line_arc_horizontal, std::back_inserter(vector_for_intersection_9)); assert(vector_for_intersection_9.size() == 1); - assert(assign(the_pair, vector_for_intersection_9[0])); + assert(assign_variant(the_pair, vector_for_intersection_9[0])); assert(the_pair.second == 1); assert(the_pair.first == line_arc_horizontal.source()); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_10; theConstruct_intersect_2(line_arc_horizontal, line_arc_horizontal4, std::back_inserter(vector_for_intersection_10)); assert(vector_for_intersection_10.size() == 1); - assert(assign(the_pair, vector_for_intersection_10[0])); + assert(assign_variant(the_pair, vector_for_intersection_10[0])); assert(the_pair.second == 1); assert(the_pair.first == line_arc_horizontal.source()); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_11; theConstruct_intersect_2(Line_arc_2(Point_2(-1, -1),Point_2(2, 2)), Line_arc_2(Point_2(0, 0), Point_2(1, 1)), std::back_inserter(vector_for_intersection_11)); assert(vector_for_intersection_11.size() == 1); - assert(assign(line_arc_tmp, vector_for_intersection_11[0])); + assert(assign_variant(line_arc_tmp, vector_for_intersection_11[0])); assert(line_arc_tmp == Line_arc_2(Point_2(0, 0), Point_2(1, 1))); //////Split///////////// - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_split_1; theConstruct_intersect_2(line_arc_horizontal, line_arc_3, std::back_inserter(vector_for_intersection_split_1)); - assert(assign(the_pair, vector_for_intersection_split_1[0])); + assert(assign_variant(the_pair, vector_for_intersection_split_1[0])); Circular_arc_point_2 point_of_split = the_pair.first; Split_2 theSplit_2 = ck.split_2_object(); Line_arc_2 first_part_line_arc_horizontal; @@ -291,6 +303,8 @@ void _test_intersection_Line_arc_Circle(CK ck) typedef CGAL::Line_arc_2 Line_arc_2; typedef CGAL::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Intersect_2 Intersect_2; + typedef std::variant, Line_arc_2> Intersection_result; + CGAL::Random generatorOfgenerator; int random_seed = generatorOfgenerator.get_int(0, 123456); std::cout << "random_seed = " << random_seed << std::endl; @@ -368,53 +382,53 @@ void _test_intersection_Line_arc_Circle(CK ck) false); ////////test horizontal////// - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_1; theConstruct_intersect_2(line_arc_horizontal, circle1, std::back_inserter(vector_for_intersection_1)); std::pair the_pair; assert(vector_for_intersection_1.size() == 2); - assert(assign(the_pair, vector_for_intersection_1[0])); + assert(assign_variant(the_pair, vector_for_intersection_1[0])); Circular_arc_point_2 first = the_pair.first; assert(first == line_arc_horizontal.source()); assert(the_pair.second == 1); - assert(assign(the_pair, vector_for_intersection_1[1])); + assert(assign_variant(the_pair, vector_for_intersection_1[1])); first = the_pair.first; assert(first == line_arc_horizontal2.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_2; theConstruct_intersect_2(line_arc_horizontal, circle2, std::back_inserter(vector_for_intersection_2)); assert(vector_for_intersection_2.size() == 1); - assert(assign(the_pair, vector_for_intersection_2[0])); + assert(assign_variant(the_pair, vector_for_intersection_2[0])); first = the_pair.first; assert(first == line_arc_horizontal.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_3; theConstruct_intersect_2(line_arc_horizontal2, circle2, std::back_inserter(vector_for_intersection_3)); assert(vector_for_intersection_3.size() == 0); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_4; theConstruct_intersect_2(line_arc_horizontal3, circle2, std::back_inserter(vector_for_intersection_4)); assert(vector_for_intersection_4.size() == 1); - assert(assign(the_pair, vector_for_intersection_4[0])); + assert(assign_variant(the_pair, vector_for_intersection_4[0])); first = the_pair.first; assert(first == line_arc_horizontal3.source()); assert(the_pair.second == 1); Line_arc_2 line_arc_aux(p2_high_circle2,p2_high_right_circle2); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_5; theConstruct_intersect_2(Line_arc_2(p2_high_left_circle2,p2_high_right_circle2), circle2, @@ -424,17 +438,17 @@ void _test_intersection_Line_arc_Circle(CK ck) circle2, std::back_inserter(vector_for_intersection_5)); assert(vector_for_intersection_5.size() == 2); - assert(assign(the_pair, vector_for_intersection_5[0])); + assert(assign_variant(the_pair, vector_for_intersection_5[0])); first = the_pair.first; assert(first == line_arc_aux.source()); assert(the_pair.second == 2); - assert(assign(the_pair, vector_for_intersection_5[1])); + assert(assign_variant(the_pair, vector_for_intersection_5[1])); first = the_pair.first; assert(first == line_arc_aux.source()); assert(the_pair.second == 2); line_arc_aux = Line_arc_2(p2_low_circle2,p2_low_right_circle2); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_6; theConstruct_intersect_2(Line_arc_2(p2_low_left_circle2,p2_low_right_circle2), circle2, @@ -444,63 +458,63 @@ void _test_intersection_Line_arc_Circle(CK ck) circle2, std::back_inserter(vector_for_intersection_6)); assert(vector_for_intersection_6.size() == 2); - assert(assign(the_pair, vector_for_intersection_6[0])); + assert(assign_variant(the_pair, vector_for_intersection_6[0])); first = the_pair.first; assert(first == line_arc_aux.source()); assert(the_pair.second == 2); - assert(assign(the_pair, vector_for_intersection_6[1])); + assert(assign_variant(the_pair, vector_for_intersection_6[1])); first = the_pair.first; assert(first == line_arc_aux.source()); assert(the_pair.second == 2); ////////test vertical////// - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_7; theConstruct_intersect_2(line_arc_vertical, circle1, std::back_inserter(vector_for_intersection_7)); assert(vector_for_intersection_7.size() == 2); - assert(assign(the_pair, vector_for_intersection_7[0])); + assert(assign_variant(the_pair, vector_for_intersection_7[0])); first = the_pair.first; assert(first == line_arc_vertical.source()); assert(the_pair.second == 1); - assert(assign(the_pair, vector_for_intersection_7[1])); + assert(assign_variant(the_pair, vector_for_intersection_7[1])); first = the_pair.first; assert(first == line_arc_vertical2.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_8; theConstruct_intersect_2(line_arc_vertical, circle2, std::back_inserter(vector_for_intersection_8)); std::cout << vector_for_intersection_8.size() << std::endl; assert(vector_for_intersection_8.size() == 1); - assert(assign(the_pair, vector_for_intersection_8[0])); + assert(assign_variant(the_pair, vector_for_intersection_8[0])); first = the_pair.first; assert(first == line_arc_vertical.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_9; theConstruct_intersect_2(line_arc_vertical2, circle2, std::back_inserter(vector_for_intersection_9)); assert(vector_for_intersection_9.size() == 0); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_10; theConstruct_intersect_2(line_arc_vertical3, circle2, std::back_inserter(vector_for_intersection_10)); assert(vector_for_intersection_10.size() == 1); - assert(assign(the_pair, vector_for_intersection_10[0])); + assert(assign_variant(the_pair, vector_for_intersection_10[0])); first = the_pair.first; assert(first == line_arc_vertical3.source()); assert(the_pair.second == 1); line_arc_aux = Line_arc_2(p2_right_circle2,p2_high_right_circle2); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_11; theConstruct_intersect_2(Line_arc_2(p2_low_right_circle2,p2_high_right_circle2), circle2, @@ -510,17 +524,17 @@ void _test_intersection_Line_arc_Circle(CK ck) circle2, std::back_inserter(vector_for_intersection_11)); assert(vector_for_intersection_11.size() == 2); - assert(assign(the_pair, vector_for_intersection_11[0])); + assert(assign_variant(the_pair, vector_for_intersection_11[0])); first = the_pair.first; assert(first == line_arc_aux.source()); assert(the_pair.second == 2); - assert(assign(the_pair, vector_for_intersection_11[1])); + assert(assign_variant(the_pair, vector_for_intersection_11[1])); first = the_pair.first; assert(first == line_arc_aux.source()); assert(the_pair.second == 2); line_arc_aux = Line_arc_2(p2_left_circle2,p2_high_left_circle2); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_12; theConstruct_intersect_2(Line_arc_2(p2_low_left_circle2,p2_high_left_circle2), circle2, @@ -530,56 +544,56 @@ void _test_intersection_Line_arc_Circle(CK ck) circle2, std::back_inserter(vector_for_intersection_12)); assert(vector_for_intersection_12.size() == 2); - assert(assign(the_pair, vector_for_intersection_12[0])); + assert(assign_variant(the_pair, vector_for_intersection_12[0])); first = the_pair.first; assert(first == line_arc_aux.source()); assert(the_pair.second == 2); - assert(assign(the_pair, vector_for_intersection_12[1])); + assert(assign_variant(the_pair, vector_for_intersection_12[1])); first = the_pair.first; assert(first == line_arc_aux.source()); assert(the_pair.second == 2); //test diagonal - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_13; theConstruct_intersect_2(line_arc_diagonal, circle1, std::back_inserter(vector_for_intersection_13)); assert(vector_for_intersection_13.size() == 2); - assert(assign(the_pair, vector_for_intersection_13[0])); + assert(assign_variant(the_pair, vector_for_intersection_13[0])); first = the_pair.first; assert(first == line_arc_diagonal.source()); assert(the_pair.second == 1); - assert(assign(the_pair, vector_for_intersection_13[1])); + assert(assign_variant(the_pair, vector_for_intersection_13[1])); first = the_pair.first; assert(first == line_arc_diagonal2.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_14; theConstruct_intersect_2(line_arc_diagonal, circle2, std::back_inserter(vector_for_intersection_14)); assert(vector_for_intersection_14.size() == 1); - assert(assign(the_pair, vector_for_intersection_14[0])); + assert(assign_variant(the_pair, vector_for_intersection_14[0])); first = the_pair.first; assert(first == line_arc_diagonal.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_15; theConstruct_intersect_2(line_arc_diagonal2, circle2, std::back_inserter(vector_for_intersection_15)); assert(vector_for_intersection_15.size() == 0); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_16; theConstruct_intersect_2(line_arc_diagonal3, circle2, std::back_inserter(vector_for_intersection_16)); assert(vector_for_intersection_16.size() == 1); - assert(assign(the_pair, vector_for_intersection_16[0])); + assert(assign_variant(the_pair, vector_for_intersection_16[0])); first = the_pair.first; assert(first == line_arc_diagonal3.source()); assert(the_pair.second == 1); @@ -587,42 +601,42 @@ void _test_intersection_Line_arc_Circle(CK ck) //Diagonal tangent - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_17; theConstruct_intersect_2(Line_arc_2(Point_2(-10, -5), Point_2(5, 15)), circle1, std::back_inserter(vector_for_intersection_17)); assert(vector_for_intersection_17.size() == 1); - assert(assign(the_pair, vector_for_intersection_17[0])); + assert(assign_variant(the_pair, vector_for_intersection_17[0])); assert(the_pair.second == 2); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_18; theConstruct_intersect_2(Line_arc_2(Point_2(10, -5), Point_2(-5, 15)), circle1, std::back_inserter(vector_for_intersection_18)); assert(vector_for_intersection_18.size() == 1); - assert(assign(the_pair, vector_for_intersection_18[0])); + assert(assign_variant(the_pair, vector_for_intersection_18[0])); assert(the_pair.second == 2); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_19; theConstruct_intersect_2(Line_arc_2(Point_2(10, 5), Point_2(-5, -15)), circle1, std::back_inserter(vector_for_intersection_19)); assert(vector_for_intersection_19.size() == 1); - assert(assign(the_pair, vector_for_intersection_19[0])); + assert(assign_variant(the_pair, vector_for_intersection_19[0])); assert(the_pair.second == 2); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_20; theConstruct_intersect_2(Line_arc_2(Point_2(-10, 5), Point_2(5, -15)), circle1, std::back_inserter(vector_for_intersection_20)); assert(vector_for_intersection_20.size() == 1); - assert(assign(the_pair, vector_for_intersection_20[0])); + assert(assign_variant(the_pair, vector_for_intersection_20[0])); assert(the_pair.second == 2); } @@ -638,6 +652,7 @@ void _test_intersection_Line_arc_Circular_arc(CK ck) typedef CGAL::Line_arc_2 Line_arc_2; typedef CGAL::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Intersect_2 Intersect_2; + typedef std::variant, Circular_arc_2> Intersection_result; typedef typename CK::Make_x_monotone_2 Make_x_monotone_2; CGAL::Random generatorOfgenerator; int random_seed = generatorOfgenerator.get_int(0, 123456); @@ -699,58 +714,58 @@ void _test_intersection_Line_arc_Circular_arc(CK ck) Line_2(center_circle1, p2_line_vertical), false); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_1; theConstruct_intersect_2(line_arc_horizontal3, arc_1, std::back_inserter(vector_for_intersection_1)); std::pair the_pair; assert(vector_for_intersection_1.size() == 2); - assert(assign(the_pair, vector_for_intersection_1[0])); + assert(assign_variant(the_pair, vector_for_intersection_1[0])); Circular_arc_point_2 first = the_pair.first; assert(first == line_arc_horizontal3.source()); assert(the_pair.second == 1); - assert(assign(the_pair, vector_for_intersection_1[1])); + assert(assign_variant(the_pair, vector_for_intersection_1[1])); first = the_pair.first; assert(first == line_arc_horizontal3.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_2; theConstruct_intersect_2(line_arc_horizontal, arc_1, std::back_inserter(vector_for_intersection_2)); assert(vector_for_intersection_2.size() == 1); - assert(assign(the_pair, vector_for_intersection_2[0])); + assert(assign_variant(the_pair, vector_for_intersection_2[0])); first = the_pair.first; assert(first == line_arc_horizontal.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_3; theConstruct_intersect_2(line_arc_vertical, arc_1, std::back_inserter(vector_for_intersection_3)); assert(vector_for_intersection_3.size() == 1); - assert(assign(the_pair, vector_for_intersection_3[0])); + assert(assign_variant(the_pair, vector_for_intersection_3[0])); first = the_pair.first; assert(first == arc_1.target()); assert(the_pair.second == 1); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_4; theConstruct_intersect_2(Line_arc_2(Point_2(-10, -5), Point_2(5, 15)), arc_2, std::back_inserter(vector_for_intersection_4)); assert(vector_for_intersection_4.size() == 0); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_5; theConstruct_intersect_2(Line_arc_2(Point_2(10, -5), Point_2(-5, 15)), arc_2, std::back_inserter(vector_for_intersection_5)); assert(vector_for_intersection_5.size() == 1); - assert(assign(the_pair, vector_for_intersection_5[0])); + assert(assign_variant(the_pair, vector_for_intersection_5[0])); assert(the_pair.second == 2); //random @@ -778,31 +793,31 @@ void _test_intersection_Line_arc_Circular_arc(CK ck) false); Circular_arc_point_2 first2; - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_random1; theConstruct_intersect_2(Line_arc_2(Point_2(-p_random1.x(),-p_random1.y()), p_random1), arc_random_1, std::back_inserter(vector_for_intersection_random1)); assert(vector_for_intersection_random1.size() > 0); - assert(assign(the_pair, vector_for_intersection_random1[0])); + assert(assign_variant(the_pair, vector_for_intersection_random1[0])); first = the_pair.first; assert(the_pair.second == 1); assert(first == arc_random_1.source()); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_random2; theConstruct_intersect_2(Line_arc_2(Point_2(-p_random2.x(),-p_random2.y()),p_random2), arc_random_1, std::back_inserter(vector_for_intersection_random2)); assert(vector_for_intersection_random2.size() > 0); - assert(assign(the_pair, vector_for_intersection_random2[0])); + assert(assign_variant(the_pair, vector_for_intersection_random2[0])); first = the_pair.first; assert(the_pair.second == 1); if(vector_for_intersection_random2.size() == 2){ - assert(assign(the_pair, vector_for_intersection_random2[1])); + assert(assign_variant(the_pair, vector_for_intersection_random2[1])); first2 = the_pair.first; assert(the_pair.second == 1); assert((first == arc_random_1.target()) || (first2 == arc_random_1.target())); @@ -825,20 +840,20 @@ void _test_intersection_Line_arc_Circular_arc(CK ck) theRandom.get_int(random_min, random_max)); } while (p_random4 == center_circle_random1 || (p_random3 == p_random4)); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_random3; theConstruct_intersect_2(Line_arc_2(p_random3,p_random4), arc_random_1, std::back_inserter(vector_for_intersection_random3)); for( std::size_t i = 0; i < vector_for_intersection_random3.size(); i++){ - assert(assign(the_pair, vector_for_intersection_random3[i])); + assert(assign_variant(the_pair, vector_for_intersection_random3[i])); first = the_pair.first; - std::vector objects_x_monotone; + std::vector objects_x_monotone; theMake_x_monotone( arc_random_1, std::back_inserter(objects_x_monotone)); bool is_on_arc = false; for(std::size_t j = 0; j < objects_x_monotone.size(); j++){ Circular_arc_2 aux; - assign(aux, objects_x_monotone[j]); + assign_variant(aux, objects_x_monotone[j]); if(CGAL::CircularFunctors::has_on(aux, first)){ is_on_arc = true; break; @@ -860,6 +875,7 @@ void _test_compare_y_to_right(CK ck) typedef CGAL::Line_arc_2 Line_arc_2; typedef CGAL::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Intersect_2 Intersect_2; + typedef std::variant, Line_arc_2> Intersection_result; CGAL::Random generatorOfgenerator; int random_seed = generatorOfgenerator.get_int(0, 123456); @@ -883,13 +899,13 @@ void _test_compare_y_to_right(CK ck) p2_line_diagonal), circle1,true, circle2,false); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_1; theConstruct_intersect_2(line_arc_horizontal, line_arc_diagonal, std::back_inserter(vector_for_intersection_1)); std::pair the_pair; - assert(assign(the_pair, vector_for_intersection_1[0])); + assert(assign_variant(the_pair, vector_for_intersection_1[0])); Circular_arc_point_2 first = the_pair.first; assert(CGAL::CircularFunctors::compare_y_to_right(line_arc_horizontal, @@ -934,22 +950,22 @@ void _test_compare_y_to_right(CK ck) part_low, line_arc_horizontal_low.source()) == CGAL::SMALLER); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_2; theConstruct_intersect_2(part_high, line_arc_diagonal, std::back_inserter(vector_for_intersection_2)); - assert(assign(the_pair, vector_for_intersection_2[0])); + assert(assign_variant(the_pair, vector_for_intersection_2[0])); first = the_pair.first; assert(CGAL::CircularFunctors::compare_y_to_right(line_arc_diagonal, part_high, first) == CGAL::LARGER); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_3; theConstruct_intersect_2(part_low, line_arc_diagonal, std::back_inserter(vector_for_intersection_3)); - assert(assign(the_pair, vector_for_intersection_3[0])); + assert(assign_variant(the_pair, vector_for_intersection_3[0])); first = the_pair.first; assert(CGAL::CircularFunctors::compare_y_to_right(line_arc_diagonal, part_low, @@ -959,22 +975,22 @@ void _test_compare_y_to_right(CK ck) p2_line_diagonal2), circle1,true, circle2,false); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_4; theConstruct_intersect_2(part_high, line_arc_diagonal2, std::back_inserter(vector_for_intersection_4)); - assert(assign(the_pair, vector_for_intersection_4[0])); + assert(assign_variant(the_pair, vector_for_intersection_4[0])); first = the_pair.first; assert(CGAL::CircularFunctors::compare_y_to_right(line_arc_diagonal2, part_high, first) == CGAL::SMALLER); - std::vector< CGAL::Object > + std::vector< Intersection_result > vector_for_intersection_5; theConstruct_intersect_2(part_low, line_arc_diagonal2, std::back_inserter(vector_for_intersection_5)); - assert(assign(the_pair, vector_for_intersection_5[0])); + assert(assign_variant(the_pair, vector_for_intersection_5[0])); first = the_pair.first; assert(CGAL::CircularFunctors::compare_y_to_right(line_arc_diagonal2, part_low, diff --git a/Circular_kernel_3/examples/Circular_kernel_3/functor_compare_theta_3.cpp b/Circular_kernel_3/examples/Circular_kernel_3/functor_compare_theta_3.cpp index d318216621f..439b1a55793 100644 --- a/Circular_kernel_3/examples/Circular_kernel_3/functor_compare_theta_3.cpp +++ b/Circular_kernel_3/examples/Circular_kernel_3/functor_compare_theta_3.cpp @@ -1,4 +1,5 @@ #include +#include typedef CGAL::Exact_spherical_kernel_3 SK; @@ -15,15 +16,20 @@ int main(){ SK::Intersect_3 inter; //create a functor to compare theta-coordinates on sphere s1 SK::Compare_theta_z_3 cmp(s1); - std::vector< CGAL::Object > intersections; - inter(C1,C2,std::back_inserter(intersections)); + + //unsigned integer indicates multiplicity of intersection point - std::pair p1= - CGAL::object_cast< std::pair >(intersections[0]); - std::pair p2= - CGAL::object_cast< std::pair >(intersections[1]); + typedef std::pair Point_and_multiplicity; + // only recover points + std::vector< Point_and_multiplicity > intersections; + inter(C1,C2, + CGAL::dispatch_or_drop_output(std::back_inserter(intersections))); + + + const Point_and_multiplicity& p1=intersections[0]; + const Point_and_multiplicity& p2=intersections[1]; SK::Circular_arc_point_3 t_extreme[2]; //Compute theta extremal points of circle C1 on sphere s1 diff --git a/Circular_kernel_3/examples/Circular_kernel_3/intersecting_spheres.cpp b/Circular_kernel_3/examples/Circular_kernel_3/intersecting_spheres.cpp index 587e53cbe85..a31eef6daf3 100644 --- a/Circular_kernel_3/examples/Circular_kernel_3/intersecting_spheres.cpp +++ b/Circular_kernel_3/examples/Circular_kernel_3/intersecting_spheres.cpp @@ -1,10 +1,12 @@ #include #include -typedef CGAL::Exact_spherical_kernel_3 Spherical_k; +typedef CGAL::Exact_spherical_kernel_3 SK; -typedef CGAL::Point_3 Point_3; -typedef CGAL::Sphere_3 Sphere_3; +typedef CGAL::Point_3 Point_3; +typedef CGAL::Sphere_3 Sphere_3; +typedef CGAL::Circle_3 Circle_3; +typedef CGAL::Circular_arc_point_3 Circular_arc_point_3; int main() { @@ -33,9 +35,9 @@ int main() { Sphere_3 s2 = Sphere_3(Point_3(x2,y2,z2), r); Sphere_3 s3 = Sphere_3(Point_3(x3,y3,z3), r); - std::vector< CGAL::Object > intersecs; + std::vector< std::variant > > intersecs; CGAL::intersection(s1, s2, s3, std::back_inserter(intersecs)); - if(intersecs.size() > 0) count++; + if(intersecs.size() > 0) ++count; } std::cout << "The approximate probability that 3 spheres with radius 1" diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h index 02da04e0897..9612d2ca578 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h @@ -167,25 +167,4 @@ struct SK3_Intersection_traits - inline RT - sk3_intersection_return(T&& t) { return RT(std::forward(t)); } - template - inline RT - sk3_intersection_return() { return RT(); } - -} } //end of namespace CGAL::internal - - #endif // CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h index 33e0451fc3f..56fd4d712ff 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h @@ -189,8 +189,6 @@ namespace CGAL { const typename SK::Circular_arc_3 & ca, OutputIterator res) { - typedef typename SK3_Intersection_traits::type result_type; typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; typedef std::vector< typename SK3_Intersection_traits::type @@ -198,7 +196,7 @@ namespace CGAL { typedef std::pair Solution; if(SK().has_on_3_object()(p,ca.supporting_circle())) { - *res++ = CGAL::internal::sk3_intersection_return(ca); + *res++ = ca; } solutions_container solutions; @@ -208,14 +206,14 @@ namespace CGAL { if(solutions.size() == 1) { const Solution& sol=*CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(ca,sol.first,true)) - *res++ = CGAL::internal::sk3_intersection_return(sol); + *res++ = sol; } else { const Solution& sol1=*CGAL::Intersections::internal::intersect_get(solutions[0]); const Solution& sol2=*CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(ca,sol1.first,true)) - *res++ = CGAL::internal::sk3_intersection_return(sol1); + *res++ = sol1; if(SK().has_on_3_object()(ca,sol2.first,true)) - *res++ = CGAL::internal::sk3_intersection_return(sol2); + *res++ = sol2; } return res; } @@ -261,8 +259,6 @@ namespace CGAL { const typename SK::Circular_arc_3 & a2, OutputIterator res) { - typedef typename SK3_Intersection_traits::type result_type; typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; typedef typename SK::Circular_arc_3 Circular_arc_3; typedef std::vector< typename SK3_Intersection_traits @@ -272,11 +268,11 @@ namespace CGAL { if(non_oriented_equal(a1.supporting_circle(), a2.supporting_circle())) { if(a1.rep().is_full()) { - *res++ = CGAL::internal::sk3_intersection_return(a2); + *res++ = a2; //return res; } else if(a2.rep().is_full()) { - *res++ = CGAL::internal::sk3_intersection_return(a1); + *res++ = a1; //return res; } else { bool t2_in_a1 = SK().has_on_3_object()(a1,a2.target(),true); @@ -289,58 +285,58 @@ namespace CGAL { SK().compare_xyz_3_object()(a1.source(), a2.source()); if(comp < 0) { if(a1.source() == a2.target()) { - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(a1.source(),1u)); + *res++ = std::make_pair(a1.source(),1u); } else { const Circular_arc_3 & arc = Circular_arc_3(a1.supporting_circle(),a1.source(),a2.target()); - *res++ = CGAL::internal::sk3_intersection_return(arc); + *res++ = arc; } if(a2.source() == a1.target()) { - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(a2.source(),1u)); + *res++ = std::make_pair(a2.source(),1u); } else { const Circular_arc_3 & arc = Circular_arc_3(a1.supporting_circle(),a2.source(),a1.target()); - *res++ = CGAL::internal::sk3_intersection_return(arc); + *res++ = arc; } } else if(comp > 0) { if(a2.source() == a1.target()) { - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(a2.source(),1u)); + *res++ = std::make_pair(a2.source(),1u); } else { const Circular_arc_3 & arc = Circular_arc_3(a1.supporting_circle(),a2.source(),a1.target()); - *res++ = CGAL::internal::sk3_intersection_return(arc); + *res++ = arc; } if(a1.source() == a2.target()) { - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(a1.source(),1u)); + *res++ = std::make_pair(a1.source(),1u); } else { const Circular_arc_3 & arc = Circular_arc_3(a1.supporting_circle(),a1.source(),a2.target()); - *res++ = CGAL::internal::sk3_intersection_return(arc); + *res++ = arc; } } else { - *res++ = CGAL::internal::sk3_intersection_return(a1); + *res++ = a1; } } else { - *res++ = CGAL::internal::sk3_intersection_return(a2); + *res++ = a2; } } else if(t2_in_a1) { if(a1.source() == a2.target()) - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(a1.source(),1u)); + *res++ = std::make_pair(a1.source(),1u); else { const Circular_arc_3 & arc = Circular_arc_3(a1.supporting_circle(),a1.source(),a2.target()); - *res++ = CGAL::internal::sk3_intersection_return(arc); + *res++ = arc; } //return res; } else if(s2_in_a1) { if(a2.source() == a1.target()) { - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(a2.source(),1u)); + *res++ = std::make_pair(a2.source(),1u); } else { const Circular_arc_3 & arc = Circular_arc_3(a1.supporting_circle(),a2.source(),a1.target()); - *res++ = CGAL::internal::sk3_intersection_return(arc); + *res++ = arc; } } else if(SK().has_on_3_object()(a2,a1.source(),true)) { - *res++ = CGAL::internal::sk3_intersection_return(a1); + *res++ = a1; } } } else { @@ -353,16 +349,16 @@ namespace CGAL { const Solution& sol=*CGAL::Intersections::internal::intersect_get(solutions[0]); if(SK().has_on_3_object()(a1,sol.first,true) && SK().has_on_3_object()(a2,sol.first,true)) - *res++ = solutions[0]; + *res++ = sol; } else { const Solution& sol1=*CGAL::Intersections::internal::intersect_get(solutions[0]); const Solution& sol2=*CGAL::Intersections::internal::intersect_get(solutions[1]); if(SK().has_on_3_object()(a1,sol1.first,true) && SK().has_on_3_object()(a2,sol1.first,true)) - *res++ = solutions[0]; + *res++ = sol1; if(SK().has_on_3_object()(a1,sol2.first,true) && SK().has_on_3_object()(a2,sol2.first,true)) - *res++ = solutions[1]; + *res++ = sol2; } } return res; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h index f26063282b1..8491e83d5db 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h @@ -83,7 +83,6 @@ namespace CGAL { typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; typedef typename SK::Line_3 Line_3; typedef typename SK::Line_arc_3 Line_arc_3; - typedef typename SK3_Intersection_traits::type result_type; typename Intersection_traits::result_type o = SK().intersect_3_object()(l1.supporting_line(), @@ -96,7 +95,7 @@ namespace CGAL { Circular_arc_point_3 p = *inters_p; if(!SK().has_on_3_object()(l1,p,true)) return res; if(!SK().has_on_3_object()(l2,p,true)) return res; - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(p,1u)); + *res++ = std::make_pair(p,1u); } else if( CGAL::Intersections::internal::intersect_get(o) ) { if(SK().compare_xyz_3_object()(l1.lower_xyz_extremity(), l2.lower_xyz_extremity()) < 0) { @@ -106,15 +105,15 @@ namespace CGAL { if(comparison < 0) { if(SK().compare_xyz_3_object()(l1.higher_xyz_extremity(), l2.higher_xyz_extremity()) <= 0) { - *res++ = CGAL::internal::sk3_intersection_return - (Line_arc_3(l1.supporting_line(), - l2.lower_xyz_extremity(), - l1.higher_xyz_extremity())); + *res++ = + Line_arc_3(l1.supporting_line(), + l2.lower_xyz_extremity(), + l1.higher_xyz_extremity()); } else { - *res++ = CGAL::internal::sk3_intersection_return(l2); + *res++ = l2; } } else if (comparison == 0) { - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(l2.lower_xyz_extremity(),1u)); + *res++ = std::make_pair(l2.lower_xyz_extremity(),1u); } } else { @@ -124,16 +123,16 @@ namespace CGAL { if(comparison < 0){ if(SK().compare_xyz_3_object()(l1.higher_xyz_extremity(), l2.higher_xyz_extremity()) <= 0) { - *res++ = CGAL::internal::sk3_intersection_return(l1); + *res++ = l1; } else { - *res++ = CGAL::internal::sk3_intersection_return - (Line_arc_3(l1.supporting_line(), - l1.lower_xyz_extremity(), - l2.higher_xyz_extremity() )); + *res++ = + Line_arc_3(l1.supporting_line(), + l1.lower_xyz_extremity(), + l2.higher_xyz_extremity() ); } } else if (comparison == 0){ - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(l1.lower_xyz_extremity(),1u)); + *res++ = std::make_pair(l1.lower_xyz_extremity(),1u); } } } @@ -149,8 +148,6 @@ namespace CGAL { typedef typename SK::Point_3 Point_3; typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; typedef typename SK::Line_3 Line_3; - typedef typename SK::Line_arc_3 Line_arc_3; - typedef typename SK3_Intersection_traits::type result_type; typename Intersection_traits::result_type o = SK().intersect_3_object()(l, la.supporting_line()); @@ -159,11 +156,11 @@ namespace CGAL { return res; if(const Line_3* inters_l = CGAL::Intersections::internal::intersect_get(o)) { - *res++ = CGAL::internal::sk3_intersection_return(la); + *res++ = la; } else if(const Point_3* inters_p = CGAL::Intersections::internal::intersect_get(o)) { Circular_arc_point_3 p = *inters_p; if(!SK().has_on_3_object()(la,p,true)) return res; - *res++ = CGAL::internal::sk3_intersection_return(std::make_pair(p,1u)); + *res++ = std::make_pair(p,1u); } return res; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h index f17acf26908..3fb21589539 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h @@ -202,17 +202,10 @@ namespace CGAL { namespace internal { // we need to pass the result_type, to hack around the fact that // object doesn't support operator=(const T&) and so we keep backwards compatibility - template - struct pair_transform { - RT operator()(const std::pair< typename SK::Root_for_spheres_2_3, unsigned >& p) { - return RT(std::make_pair(typename SK::Circular_arc_point_3(p.first), p.second)); - } - }; - template - struct pair_transform { - CGAL::Object operator()(const std::pair< typename SK::Root_for_spheres_2_3, unsigned >& p) { - return CGAL::make_object(std::make_pair(typename SK::Circular_arc_point_3(p.first), p.second)); + struct pair_transform { + auto operator()(const std::pair< typename SK::Root_for_spheres_2_3, unsigned >& p) { + return std::make_pair(typename SK::Circular_arc_point_3(p.first), p.second); } }; @@ -222,15 +215,15 @@ namespace CGAL { // pair, otherwise just dump the value with conversion to RT // (again: converting to RT before assigning to the Iterator is // just to keep object working) - template + template struct Point_conversion_visitor { Point_conversion_visitor(const OutputIterator& it) : it(it) {} template - OutputIterator operator()(const T& t) { *it++ = RT(t); return it; } + OutputIterator operator()(const T& t) { *it++ = t; return it; } OutputIterator operator()(const typename SK::Point_3& p) { // 2 multiplicities - *it++ = RT(std::make_pair(typename SK::Circular_arc_point_3(p), 2u)); + *it++ = std::make_pair(typename SK::Circular_arc_point_3(p), 2u); return it; } OutputIterator it; @@ -244,8 +237,6 @@ namespace CGAL { const typename SK::Line_3 & l, OutputIterator res) { - typedef typename SK3_Intersection_traits - ::type result_type; typedef typename SK::Algebraic_kernel Algebraic_kernel; typedef typename SK::Polynomial_for_spheres_2_3 Equation_sphere; typedef typename SK::Polynomials_for_line_3 Equation_line; @@ -259,7 +250,7 @@ namespace CGAL { solutions_container solutions; Algebraic_kernel().solve_object()(e1, e2, std::back_inserter(solutions)); - return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); + return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); } // The special 3 object functions @@ -278,19 +269,18 @@ namespace CGAL { typedef typename SK::Point_3 Point_3; typedef typename SK::Sphere_3 Sphere_3; typedef typename SK::Algebraic_kernel Algebraic_kernel; - typedef typename SK3_Intersection_traits::type result_type; CGAL_kernel_precondition(!s1.is_degenerate()); CGAL_kernel_precondition(!s2.is_degenerate()); CGAL_kernel_precondition(!s3.is_degenerate()); if(non_oriented_equal(s1,s2) && non_oriented_equal(s2,s3)) { - *res++ = result_type(s1); + *res++ = s1; return res; } if(non_oriented_equal(s1,s2)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(s1, s3)) { - internal::Point_conversion_visitor visitor(res); + internal::Point_conversion_visitor visitor(res); return std::visit(visitor, *v); } @@ -299,7 +289,7 @@ namespace CGAL { if(non_oriented_equal(s1,s3) || non_oriented_equal(s2,s3)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(s1, s2)) { - internal::Point_conversion_visitor visitor(res); + internal::Point_conversion_visitor visitor(res); return std::visit( visitor, *v); @@ -312,13 +302,13 @@ namespace CGAL { if(!v) return res; if(const Point_3* p = CGAL::Intersections::internal::intersect_get(v)) { if(SK().has_on_3_object()(s3, *p)) { - *res++ = result_type(std::make_pair(Circular_arc_point_3(*p),2u)); + *res++ = std::make_pair(Circular_arc_point_3(*p),2u); } return res; } if(const Circle_3* c = CGAL::Intersections::internal::intersect_get(v)) { if(SK().has_on_3_object()(s3, *c)) { - *res++ = result_type(*c); + *res++ = *c; } return res; } @@ -332,7 +322,7 @@ namespace CGAL { algebraic_solutions_container solutions; Algebraic_kernel().solve_object()(e1, e2, e3, std::back_inserter(solutions)); - return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); + return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); } template < class SK, class OutputIterator > @@ -342,8 +332,6 @@ namespace CGAL { const typename SK::Sphere_3 & s2, OutputIterator res) { - typedef typename std::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int>, - typename SK::Circle_3 > result_type; typedef typename SK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename SK::Polynomial_for_spheres_2_3 Equation_sphere; typedef typename SK::Polynomial_1_3 Equation_plane; @@ -356,7 +344,7 @@ namespace CGAL { if(non_oriented_equal(s1,s2)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p, s1)) { - internal::Point_conversion_visitor visitor(res); + internal::Point_conversion_visitor visitor(res); return std::visit( visitor, *v); @@ -367,7 +355,7 @@ namespace CGAL { if(non_oriented_equal(p,radical_p)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p, s1)) { - internal::Point_conversion_visitor visitor(res); + internal::Point_conversion_visitor visitor(res); return std::visit( visitor, *v); @@ -381,7 +369,7 @@ namespace CGAL { algebraic_solutions_container; algebraic_solutions_container solutions; Algebraic_kernel().solve_object()(e1, e2, e3, std::back_inserter(solutions)); - return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); + return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); } template < class SK, class OutputIterator > @@ -391,8 +379,6 @@ namespace CGAL { const typename SK::Sphere_3 & s, OutputIterator res) { - typedef typename std::variant< std::pair< typename SK::Circular_arc_point_3, unsigned int>, - typename SK::Circle_3 > result_type; typedef typename SK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename SK::Polynomial_for_spheres_2_3 Equation_sphere; typedef typename SK::Polynomial_1_3 Equation_plane; @@ -405,7 +391,7 @@ namespace CGAL { if(non_oriented_equal(p1,p2)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p1, s)) { - internal::Point_conversion_visitor visitor(res); + internal::Point_conversion_visitor visitor(res); return std::visit( visitor, *v); @@ -419,7 +405,7 @@ namespace CGAL { algebraic_solutions_container; algebraic_solutions_container solutions; Algebraic_kernel().solve_object()(e1, e2, e3, std::back_inserter(solutions)); - return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); + return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); } template < class SK, class OutputIterator > @@ -449,13 +435,9 @@ namespace CGAL { typedef typename SK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename SK::Polynomials_for_circle_3 Equation_circle; typedef typename SK::Algebraic_kernel Algebraic_kernel; - typedef typename SK::Circle_3 Circle_3; - - typedef typename SK3_Intersection_traits - ::type result_type; if(non_oriented_equal(c1,c2)) { - *res++ = CGAL::internal::sk3_intersection_return(c1); + *res++ = c1; return res; } Equation_circle e1 = get_equation(c1); @@ -464,7 +446,7 @@ namespace CGAL { algebraic_solutions_container; algebraic_solutions_container solutions; Algebraic_kernel().solve_object()(e1, e2, std::back_inserter(solutions)); - return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); + return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); } template < class SK, class OutputIterator > @@ -476,10 +458,6 @@ namespace CGAL { typedef typename SK::Root_for_spheres_2_3 Root_for_spheres_2_3; typedef typename SK::Polynomials_for_circle_3 Equation_circle; typedef typename SK::Polynomials_for_line_3 Equation_line; - typedef typename SK::Circle_3 Circle_3; - - typedef typename SK3_Intersection_traits - ::type result_type; typedef typename SK::Algebraic_kernel Algebraic_kernel; CGAL_kernel_precondition(!l.is_degenerate()); @@ -489,7 +467,7 @@ namespace CGAL { algebraic_solutions_container; algebraic_solutions_container solutions; Algebraic_kernel().solve_object()(e1, e2, std::back_inserter(solutions)); - return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); + return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform()); } // At the moment we dont need those functions diff --git a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_functionalities_on_sphere.h b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_functionalities_on_sphere.h index d02daa9fe8a..a4ba682726d 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_functionalities_on_sphere.h +++ b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_functionalities_on_sphere.h @@ -66,21 +66,21 @@ void test_normal_circle_monotonicity(const typename SK::Circle_3& circle, const typename SK::Sphere_3& ref_sphere) { typename SK::Is_theta_monotone_3 is_t_mon=SK().is_theta_monotone_3_object(ref_sphere); - std::vector vect_obj; + std::vector>> vect_obj; typename SK::FT zcoord = CGAL::SphericalFunctors::extremal_points_z_coordinate(circle,ref_sphere); //create extremal points of circle SK().intersect_3_object()(circle,typename SK::Plane_3(0,0,1,-zcoord),std::back_inserter(vect_obj)); assert(vect_obj.size()==2); typename SK::Circular_arc_point_3 extrems[2]; - extrems[0]=CGAL::object_cast >(&vect_obj[0])->first; - extrems[1]=CGAL::object_cast >(&vect_obj[1])->first; + extrems[0]=std::get_if >(&vect_obj[0])->first; + extrems[1]=std::get_if >(&vect_obj[1])->first; //create non extremal points on circle vect_obj.clear(); SK().intersect_3_object()(circle,typename SK::Plane_3(0,0,1,-zcoord-typename SK::FT(0.1)),std::back_inserter(vect_obj)); assert(vect_obj.size()==2); typename SK::Circular_arc_point_3 other_pts[2]; - other_pts[0]=CGAL::object_cast >(&vect_obj[0])->first; - other_pts[1]=CGAL::object_cast >(&vect_obj[1])->first; + other_pts[0]=std::get_if >(&vect_obj[0])->first; + other_pts[1]=std::get_if >(&vect_obj[1])->first; //Test Make_theta_monotone+[Ii]s_theta_monotone(_3) on monotone arcs test_make_monotone_an_already_monotone_arc(typename SK::Circular_arc_3(circle,extrems[0],extrems[1]),ref_sphere); @@ -122,18 +122,18 @@ void test_threaded_circle_monotonicity(const typename SK::Circle_3& circle, const typename SK::Sphere_3& ref_sphere) { typename SK::Is_theta_monotone_3 is_t_mon=SK().is_theta_monotone_3_object(ref_sphere); - std::vector vect_obj; + std::vector>> vect_obj; SK().intersect_3_object()(circle,typename SK::Plane_3(1,0,0,-ref_sphere.center().x()),std::back_inserter(vect_obj)); assert(vect_obj.size()==2); typename SK::Circular_arc_point_3 pts1[2]; - pts1[0]=CGAL::object_cast >(&vect_obj[0])->first; - pts1[1]=CGAL::object_cast >(&vect_obj[1])->first; + pts1[0]=std::get_if >(&vect_obj[0])->first; + pts1[1]=std::get_if >(&vect_obj[1])->first; vect_obj.clear(); SK().intersect_3_object()(circle,typename SK::Plane_3(1,1,0,-ref_sphere.center().x()-ref_sphere.center().y()),std::back_inserter(vect_obj)); assert(vect_obj.size()==2); typename SK::Circular_arc_point_3 pts2[2]; - pts2[0]=CGAL::object_cast >(&vect_obj[0])->first; - pts2[1]=CGAL::object_cast >(&vect_obj[1])->first; + pts2[0]=std::get_if >(&vect_obj[0])->first; + pts2[1]=std::get_if >(&vect_obj[1])->first; //assertions test_make_monotone_an_already_monotone_arc(typename SK::Circular_arc_3(circle,pts1[0],pts1[1]),ref_sphere); test_make_monotone_an_already_monotone_arc(typename SK::Circular_arc_3(circle,pts2[0],pts2[1]),ref_sphere); @@ -154,12 +154,12 @@ void test_polar_circle_monotonicity(const typename SK::Circle_3& circle, const typename SK::Sphere_3& ref_sphere) { typename SK::Is_theta_monotone_3 is_t_mon=SK().is_theta_monotone_3_object(ref_sphere); - std::vector vect_obj; + std::vector>> vect_obj; SK().intersect_3_object()(circle,typename SK::Plane_3(0,0,1,-circle.center().z()),std::back_inserter(vect_obj)); assert(vect_obj.size()==2); typename SK::Circular_arc_point_3 pts[2]; - pts[0]=CGAL::object_cast >(&vect_obj[0])->first; - pts[1]=CGAL::object_cast >(&vect_obj[1])->first; + pts[0]=std::get_if >(&vect_obj[0])->first; + pts[1]=std::get_if >(&vect_obj[1])->first; @@ -262,11 +262,11 @@ void fill_intersections(const typename SK::Circle_3& circle, typename SK::Circular_arc_point_3* inters,unsigned i) { typename SK::Plane_3 meridians=get_meridians(i,ref.center()); - std::vector objs; + std::vector>> objs; SK().intersect_3_object()(circle,meridians,std::back_inserter(objs)); assert(objs.size()==2); - inters[get_num(i,0)]=CGAL::object_cast >(&objs[0])->first; - inters[get_num(i,1)]=CGAL::object_cast >(&objs[1])->first; + inters[get_num(i,0)]=std::get_if >(&objs[0])->first; + inters[get_num(i,1)]=std::get_if >(&objs[1])->first; } @@ -316,7 +316,7 @@ void test_extremal_points(const typename SK::Circle_3& circle, const typename SK::Circular_arc_point_3& inter2=cut_by_M0?xtrms[0]:xtrms[1]; typename SK::Intersect_3 func=SK().intersect_3_object(); - std::vector intersections; + std::vector>> intersections; std::pair vect_pair=get_bounding_vectors(inter1,ref_sphere); func(circle,typename SK::Plane_3(ref_sphere.center(),ref_sphere.center()+typename SK::Vector_3(0,0,1),ref_sphere.center()+vect_pair.first),std::back_inserter(intersections)); @@ -391,11 +391,11 @@ test_functionalities_on_a_reference_sphere(const typename SK::Point_3& ref_spher assert( cmp_theta(y_xtrems[0],y_xtrems[1])==CGAL::LARGER ); typename SK::FT zcoord=CGAL::SphericalFunctors::extremal_points_z_coordinate(normal_cut_M0,ref_sphere); - CGAL::Object objs[2]; + std::variant> objs[2]; SK().intersect_3_object()(normal_cut_M0,typename SK::Plane_3(0,0,1,-zcoord),objs); typename SK::Circular_arc_point_3 xtrms[2]; - xtrms[0]=CGAL::object_cast >(&objs[0])->first; - xtrms[1]=CGAL::object_cast >(&objs[1])->first; + xtrms[0]=std::get_if >(&objs[0])->first; + xtrms[1]=std::get_if >(&objs[1])->first; assert( cmp_theta(xtrms[0],xtrms[1])==CGAL::LARGER ); assert( cmp_theta(xtrms[0],y_xtrems[0])==CGAL::SMALLER ); @@ -440,11 +440,11 @@ test_functionalities_on_a_reference_sphere(const typename SK::Point_3& ref_spher //polar circle typename SK::Line_3 line_n(ref_sphere_center,north_polar.center()-ref_sphere_center); typename SK::Line_3 line_s(ref_sphere_center,south_polar.center()-ref_sphere_center); - CGAL::Object objs[2]; + std::variant> objs[2]; SK().intersect_3_object()(line_n,ref_sphere,objs); - typename SK::Circular_arc_point_3 cn=CGAL::object_cast >(&objs[1])->first; + typename SK::Circular_arc_point_3 cn=std::get_if >(&objs[1])->first; SK().intersect_3_object()(line_s,ref_sphere,objs); - typename SK::Circular_arc_point_3 cs=CGAL::object_cast >(&objs[1])->first; + typename SK::Circular_arc_point_3 cs=std::get_if >(&objs[1])->first; assert (cmp_z_at_theta(cn,typename SK::Circular_arc_3(north_polar,north_pole))==CGAL::LARGER ); assert (cmp_z_at_theta(cs,typename SK::Circular_arc_3(north_polar,north_pole))==CGAL::SMALLER ); @@ -472,9 +472,9 @@ test_functionalities_on_a_reference_sphere(const typename SK::Point_3& ref_spher typename SK::Line_3 line_1(ref_sphere_center,normal1.center()-ref_sphere_center); typename SK::Line_3 line_2(ref_sphere_center,normal2.center()-ref_sphere_center); SK().intersect_3_object()(line_1,ref_sphere,objs); - typename SK::Circular_arc_point_3 c1=CGAL::object_cast >(&objs[1])->first; + typename SK::Circular_arc_point_3 c1=std::get_if >(&objs[1])->first; SK().intersect_3_object()(line_2,ref_sphere,objs); - typename SK::Circular_arc_point_3 c2=CGAL::object_cast >(&objs[1])->first; + typename SK::Circular_arc_point_3 c2=std::get_if >(&objs[1])->first; typename SK::Circular_arc_point_3 xtrms1[2]; typename SK::Circular_arc_point_3 xtrms2[2]; @@ -541,10 +541,10 @@ test_functionalities_on_a_reference_sphere(const typename SK::Point_3& ref_spher //normal vs normal typename SK::Circle_3 normal3 (ref_sphere,typename SK::Plane_3(0.08,1.1,0.9 ,-1-FT(0.08)*ref_sphere_center.x() -FT(1.1)*ref_sphere_center.y()-FT(0.9)*ref_sphere_center.z())); typename SK::Circle_3 normal4 (ref_sphere,typename SK::Plane_3(0.05,1.1,-0.9 ,-1-FT(0.05)*ref_sphere_center.x() -FT(1.1)*ref_sphere_center.y()+FT(0.9)*ref_sphere_center.z())); - std::vector objs; + std::vector>> objs; SK().intersect_3_object()(normal3,normal4,std::back_inserter(objs)); - typename SK::Circular_arc_point_3 int1=CGAL::object_cast >(&objs[1])->first; - typename SK::Circular_arc_point_3 int2=CGAL::object_cast >(&objs[0])->first; + typename SK::Circular_arc_point_3 int1=std::get_if >(&objs[1])->first; + typename SK::Circular_arc_point_3 int2=std::get_if >(&objs[0])->first; typename SK::Circular_arc_point_3 xtrms3[2]; typename SK::Circular_arc_point_3 xtrms4[2]; CGAL::theta_extremal_points(normal3,ref_sphere,xtrms3); @@ -554,8 +554,8 @@ test_functionalities_on_a_reference_sphere(const typename SK::Point_3& ref_spher //normal vs threaded objs.clear(); SK().intersect_3_object()(threaded,normal4,std::back_inserter(objs)); - int1=CGAL::object_cast >(&objs[1])->first; - int2=CGAL::object_cast >(&objs[0])->first; + int1=std::get_if >(&objs[1])->first; + int2=std::get_if >(&objs[0])->first; assert ( cmp_right(typename SK::Circular_arc_3(threaded),typename SK::Circular_arc_3(normal4,xtrms4[1],xtrms4[0]),int1)==CGAL::SMALLER ); assert ( cmp_right(typename SK::Circular_arc_3(threaded),typename SK::Circular_arc_3(normal4,xtrms4[1],xtrms4[0]),int2)==CGAL::LARGER ); //normal vs polar @@ -563,8 +563,8 @@ test_functionalities_on_a_reference_sphere(const typename SK::Point_3& ref_spher typename SK::Circular_arc_point_3 xtrms2[2]; CGAL::theta_extremal_points(normal2,ref_sphere,xtrms2); SK().intersect_3_object()(south_polar,normal2,std::back_inserter(objs)); - int1=CGAL::object_cast >(&objs[1])->first; - int2=CGAL::object_cast >(&objs[0])->first; + int1=std::get_if >(&objs[1])->first; + int2=std::get_if >(&objs[0])->first; assert ( cmp_right(typename SK::Circular_arc_3(south_polar,south_pole),typename SK::Circular_arc_3(normal2,xtrms2[0],xtrms2[1]),int1)==CGAL::LARGER ); assert ( cmp_right(typename SK::Circular_arc_3(south_polar,south_pole),typename SK::Circular_arc_3(normal2,xtrms2[0],xtrms2[1]),int2)==CGAL::SMALLER ); //polar vs polar @@ -574,15 +574,15 @@ test_functionalities_on_a_reference_sphere(const typename SK::Point_3& ref_spher assert(CGAL::classify(spolar,ref_sphere)==CGAL::POLAR); objs.clear(); SK().intersect_3_object()(npolar,spolar,std::back_inserter(objs)); - int1=CGAL::object_cast >(&objs[1])->first; - int2=CGAL::object_cast >(&objs[0])->first; + int1=std::get_if >(&objs[1])->first; + int2=std::get_if >(&objs[0])->first; assert ( cmp_right(typename SK::Circular_arc_3(npolar,north_pole),typename SK::Circular_arc_3(spolar,south_pole),int1)==CGAL::SMALLER ); assert ( cmp_right(typename SK::Circular_arc_3(npolar,north_pole),typename SK::Circular_arc_3(spolar,south_pole),int2)==CGAL::LARGER ); //polar vs threaded objs.clear(); SK().intersect_3_object()(south_polar,threaded,std::back_inserter(objs)); - int1=CGAL::object_cast >(&objs[1])->first; - int2=CGAL::object_cast >(&objs[0])->first; + int1=std::get_if >(&objs[1])->first; + int2=std::get_if >(&objs[0])->first; assert ( cmp_right(typename SK::Circular_arc_3(south_polar,south_pole),typename SK::Circular_arc_3(threaded),int1)==CGAL::LARGER ); assert ( cmp_right(typename SK::Circular_arc_3(south_polar,south_pole),typename SK::Circular_arc_3(threaded),int2)==CGAL::SMALLER ); //threaded vs threaded @@ -590,8 +590,8 @@ test_functionalities_on_a_reference_sphere(const typename SK::Point_3& ref_spher typename SK::Circle_3 threaded2 (ref_sphere,typename SK::Plane_3(0,1.1,-0.9,-FT(1.1)*ref_sphere_center.y()+FT(0.9)*ref_sphere_center.z())); objs.clear(); SK().intersect_3_object()(threaded1,threaded2,std::back_inserter(objs)); - int1=CGAL::object_cast >(&objs[1])->first; - int2=CGAL::object_cast >(&objs[0])->first; + int1=std::get_if >(&objs[1])->first; + int2=std::get_if >(&objs[0])->first; assert ( cmp_right(typename SK::Circular_arc_3(threaded1),typename SK::Circular_arc_3(threaded2),int1)==CGAL::SMALLER ); assert ( cmp_right(typename SK::Circular_arc_3(threaded1),typename SK::Circular_arc_3(threaded2),int2)==CGAL::LARGER ); //tangency tests global diff --git a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h index 363d4b2087b..cac9217e371 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h +++ b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h @@ -15,6 +15,31 @@ #include #include +#include +#include + +template +bool assign_variant(Expected& e, const V& v) +{ + if (std::get_if(&v) != nullptr) + { + e = std::get(v); + return true; + } + return false; +} + +template +bool assign_variant(Expected& e, const std::optional& ov) +{ + if (ov==std::nullopt) return false; + if (std::get_if(&(ov.value())) != nullptr) + { + e = std::get(ov.value()); + return true; + } + return false; +} template void _test_circular_arc_point_construct(SK sk) { @@ -547,7 +572,7 @@ void _test_intersection_construct(SK sk) { const FT z = FT(vz); Line_3 l1 = theConstruct_line_3(Point_3(-1,0,0), Point_3(x,y,z)); Line_3 l2 = theConstruct_line_3(Point_3(FT(-1)-FT(FT(1) / FT(1000000)),FT(0),FT(0)), Point_3(x,y,z)); - std::vector< CGAL::Object > intersection_1, intersection_2; + std::vector< std::variant< std::pair > > intersection_1, intersection_2; theIntersect_3(s, l1, std::back_inserter(intersection_1)); theIntersect_3(s, l2, std::back_inserter(intersection_2)); @@ -557,7 +582,7 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(s, l1)); assert(intersection_1.size() == 1); std::pair the_pair1; - assert(assign(the_pair1, intersection_1[0])); + assert(assign_variant(the_pair1, intersection_1[0])); assert(theHas_on_3(s,the_pair1.first)); assert(theHas_on_3(l1,the_pair1.first)); @@ -572,8 +597,8 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(s, l1)); std::pair the_pair1; std::pair the_pair2; - assert(assign(the_pair1, intersection_1[0])); - assert(assign(the_pair2, intersection_1[1])); + assert(assign_variant(the_pair1, intersection_1[0])); + assert(assign_variant(the_pair2, intersection_1[1])); assert(theHas_on_3(s,the_pair1.first)); assert(theHas_on_3(l1,the_pair1.first)); assert(theHas_on_3(s,the_pair2.first)); @@ -583,8 +608,8 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(s, l2)); std::pair the_pair3; std::pair the_pair4; - assert(assign(the_pair3, intersection_2[0])); - assert(assign(the_pair4, intersection_2[1])); + assert(assign_variant(the_pair3, intersection_2[0])); + assert(assign_variant(the_pair4, intersection_2[1])); assert(theHas_on_3(s,the_pair3.first)); assert(theHas_on_3(l2,the_pair3.first)); assert(theHas_on_3(s,the_pair4.first)); @@ -604,7 +629,7 @@ void _test_intersection_construct(SK sk) { const FT z = FT(vz); Line_3 l1 = theConstruct_line_3(Point_3(-1,0,0), Point_3(x,y,z)); Line_3 l2 = theConstruct_line_3(Point_3(FT(-1)-FT(FT(1) / FT(1000000)),FT(0),FT(0)), Point_3(x,y,z)); - std::vector< CGAL::Object > intersection_1, intersection_2; + std::vector< std::variant< std::pair > > intersection_1, intersection_2; intersection(s, l1, std::back_inserter(intersection_1)); intersection(s, l2, std::back_inserter(intersection_2)); @@ -614,7 +639,7 @@ void _test_intersection_construct(SK sk) { assert(do_intersect(s, l1)); assert(intersection_1.size() == 1); std::pair the_pair1; - assert(assign(the_pair1, intersection_1[0])); + assert(assign_variant(the_pair1, intersection_1[0])); assert(theHas_on_3(s,the_pair1.first)); assert(theHas_on_3(l1,the_pair1.first)); @@ -629,8 +654,8 @@ void _test_intersection_construct(SK sk) { assert(do_intersect(s, l1)); std::pair the_pair1; std::pair the_pair2; - assert(assign(the_pair1, intersection_1[0])); - assert(assign(the_pair2, intersection_1[1])); + assert(assign_variant(the_pair1, intersection_1[0])); + assert(assign_variant(the_pair2, intersection_1[1])); assert(theHas_on_3(s,the_pair1.first)); assert(theHas_on_3(l1,the_pair1.first)); assert(theHas_on_3(s,the_pair2.first)); @@ -640,8 +665,8 @@ void _test_intersection_construct(SK sk) { assert(do_intersect(s, l2)); std::pair the_pair3; std::pair the_pair4; - assert(assign(the_pair3, intersection_2[0])); - assert(assign(the_pair4, intersection_2[1])); + assert(assign_variant(the_pair3, intersection_2[0])); + assert(assign_variant(the_pair4, intersection_2[1])); assert(theHas_on_3(s,the_pair3.first)); assert(theHas_on_3(l2,the_pair3.first)); assert(theHas_on_3(s,the_pair4.first)); @@ -665,20 +690,20 @@ void _test_intersection_construct(SK sk) { const FT r = 4*FT(vr) / FT(2); Sphere_3 sl = theConstruct_sphere_3( Polynomial_for_spheres_2_3(x,y,z,r*r)); - std::vector< CGAL::Object > intersection_1; - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant > > intersection_1; + std::vector< std::variant > > intersection_2; theIntersect_3(s1, s2, sl, std::back_inserter(intersection_1)); theIntersect_3(s1, s3, sl, std::back_inserter(intersection_2)); if(intersection_1.size() == 1) { assert(theDo_intersect_3(s1, s2, sl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_1[0])) { + if(assign_variant(circle,intersection_1[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(s2,circle)); assert(theHas_on_3(sl,circle)); } - if(assign(cap,intersection_1[0])) { + if(assign_variant(cap,intersection_1[0])) { // This case must never happen assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(s2,cap.first)); @@ -688,8 +713,8 @@ void _test_intersection_construct(SK sk) { if(intersection_1.size() == 2) { assert(theDo_intersect_3(s1, s2, sl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_1[0])); - assert(assign(cap2,intersection_1[1])); + assert(assign_variant(cap1,intersection_1[0])); + assert(assign_variant(cap2,intersection_1[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(s2,cap1.first)); assert(theHas_on_3(sl,cap1.first)); @@ -702,13 +727,13 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(s1, s3, sl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_2[0])) { + if(assign_variant(circle,intersection_2[0])) { // This case must never happen assert(theHas_on_3(s1,circle)); assert(theHas_on_3(s3,circle)); assert(theHas_on_3(sl,circle)); } - if(assign(cap,intersection_2[0])) { + if(assign_variant(cap,intersection_2[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(s3,cap.first)); assert(theHas_on_3(sl,cap.first)); @@ -718,8 +743,8 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(s1, s3, sl)); // This case must never happen std::pair cap1, cap2; - assert(assign(cap1,intersection_2[0])); - assert(assign(cap2,intersection_2[1])); + assert(assign_variant(cap1,intersection_2[0])); + assert(assign_variant(cap2,intersection_2[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(s3,cap1.first)); assert(theHas_on_3(sl,cap1.first)); @@ -743,20 +768,20 @@ void _test_intersection_construct(SK sk) { const FT r = 4*FT(vr) / FT(2); Sphere_3 sl = theConstruct_sphere_3( Polynomial_for_spheres_2_3(x,y,z,r*r)); - std::vector< CGAL::Object > intersection_1; - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant , Circle_3, Sphere_3> > intersection_1; + std::vector< std::variant , Circle_3, Sphere_3> > intersection_2; intersection(s1, s2, sl, std::back_inserter(intersection_1)); intersection(s1, s3, sl, std::back_inserter(intersection_2)); if(intersection_1.size() == 1) { assert(CGAL::do_intersect(s1, s2, sl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_1[0])) { + if(assign_variant(circle,intersection_1[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(s2,circle)); assert(theHas_on_3(sl,circle)); } - if(assign(cap,intersection_1[0])) { + if(assign_variant(cap,intersection_1[0])) { // This case must never happen assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(s2,cap.first)); @@ -766,8 +791,8 @@ void _test_intersection_construct(SK sk) { if(intersection_1.size() == 2) { assert(CGAL::do_intersect(s1, s2, sl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_1[0])); - assert(assign(cap2,intersection_1[1])); + assert(assign_variant(cap1,intersection_1[0])); + assert(assign_variant(cap2,intersection_1[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(s2,cap1.first)); assert(theHas_on_3(sl,cap1.first)); @@ -780,13 +805,13 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(s1, s3, sl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_2[0])) { + if(assign_variant(circle,intersection_2[0])) { // This case must never happen assert(theHas_on_3(s1,circle)); assert(theHas_on_3(s3,circle)); assert(theHas_on_3(sl,circle)); } - if(assign(cap,intersection_2[0])) { + if(assign_variant(cap,intersection_2[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(s3,cap.first)); assert(theHas_on_3(sl,cap.first)); @@ -796,8 +821,8 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(s1, s3, sl)); // This case must never happen std::pair cap1, cap2; - assert(assign(cap1,intersection_2[0])); - assert(assign(cap2,intersection_2[1])); + assert(assign_variant(cap1,intersection_2[0])); + assert(assign_variant(cap2,intersection_2[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(s3,cap1.first)); assert(theHas_on_3(sl,cap1.first)); @@ -823,20 +848,20 @@ void _test_intersection_construct(SK sk) { if(a == 0 && b == 0 && c == 0) continue; Plane_3 pl = theConstruct_plane_3( Polynomial_1_3(a,b,c,d)); - std::vector< CGAL::Object > intersection_1; - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant , Circle_3> > intersection_1; + std::vector< std::variant , Circle_3> > intersection_2; theIntersect_3(s1, s2, pl, std::back_inserter(intersection_1)); theIntersect_3(s1, s3, pl, std::back_inserter(intersection_2)); if(intersection_1.size() == 1) { assert(theDo_intersect_3(s1, s2, pl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_1[0])) { + if(assign_variant(circle,intersection_1[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(s2,circle)); assert(theHas_on_3(pl,circle)); } - if(assign(cap,intersection_1[0])) { + if(assign_variant(cap,intersection_1[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(s2,cap.first)); assert(theHas_on_3(pl,cap.first)); @@ -845,8 +870,8 @@ void _test_intersection_construct(SK sk) { if(intersection_1.size() == 2) { assert(theDo_intersect_3(s1, s2, pl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_1[0])); - assert(assign(cap2,intersection_1[1])); + assert(assign_variant(cap1,intersection_1[0])); + assert(assign_variant(cap2,intersection_1[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(s2,cap1.first)); assert(theHas_on_3(pl,cap1.first)); @@ -858,12 +883,12 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(s1, s3, pl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_2[0])) { + if(assign_variant(circle,intersection_2[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(s3,circle)); assert(theHas_on_3(pl,circle)); } - if(assign(cap,intersection_2[0])) { + if(assign_variant(cap,intersection_2[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(s3,cap.first)); assert(theHas_on_3(pl,cap.first)); @@ -872,8 +897,8 @@ void _test_intersection_construct(SK sk) { if(intersection_2.size() == 2) { assert(theDo_intersect_3(s1, s3, pl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_2[0])); - assert(assign(cap2,intersection_2[1])); + assert(assign_variant(cap1,intersection_2[0])); + assert(assign_variant(cap2,intersection_2[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(s3,cap1.first)); assert(theHas_on_3(pl,cap1.first)); @@ -898,20 +923,20 @@ void _test_intersection_construct(SK sk) { if(a == 0 && b == 0 && c == 0) continue; Plane_3 pl = theConstruct_plane_3( Polynomial_1_3(a,b,c,d)); - std::vector< CGAL::Object > intersection_1; - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant , Circle_3> > intersection_1; + std::vector< std::variant , Circle_3> > intersection_2; intersection(s1, s2, pl, std::back_inserter(intersection_1)); intersection(s1, s3, pl, std::back_inserter(intersection_2)); if(intersection_1.size() == 1) { assert(CGAL::do_intersect(s1, s2, pl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_1[0])) { + if(assign_variant(circle,intersection_1[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(s2,circle)); assert(theHas_on_3(pl,circle)); } - if(assign(cap,intersection_1[0])) { + if(assign_variant(cap,intersection_1[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(s2,cap.first)); assert(theHas_on_3(pl,cap.first)); @@ -920,8 +945,8 @@ void _test_intersection_construct(SK sk) { if(intersection_1.size() == 2) { assert(CGAL::do_intersect(s1, s2, pl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_1[0])); - assert(assign(cap2,intersection_1[1])); + assert(assign_variant(cap1,intersection_1[0])); + assert(assign_variant(cap2,intersection_1[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(s2,cap1.first)); assert(theHas_on_3(pl,cap1.first)); @@ -933,12 +958,12 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(s1, s3, pl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_2[0])) { + if(assign_variant(circle,intersection_2[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(s3,circle)); assert(theHas_on_3(pl,circle)); } - if(assign(cap,intersection_2[0])) { + if(assign_variant(cap,intersection_2[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(s3,cap.first)); assert(theHas_on_3(pl,cap.first)); @@ -947,8 +972,8 @@ void _test_intersection_construct(SK sk) { if(intersection_2.size() == 2) { assert(CGAL::do_intersect(s1, s3, pl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_2[0])); - assert(assign(cap2,intersection_2[1])); + assert(assign_variant(cap1,intersection_2[0])); + assert(assign_variant(cap2,intersection_2[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(s3,cap1.first)); assert(theHas_on_3(pl,cap1.first)); @@ -976,20 +1001,20 @@ void _test_intersection_construct(SK sk) { if(a == 0 && b == 0 && c == 0) continue; Plane_3 pl = theConstruct_plane_3( Polynomial_1_3(a,b,c,d)); - std::vector< CGAL::Object > intersection_1; - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant , Circle_3> > intersection_1; + std::vector< std::variant , Circle_3> > intersection_2; theIntersect_3(s1, p1, pl, std::back_inserter(intersection_1)); theIntersect_3(s1, p2, pl, std::back_inserter(intersection_2)); if(intersection_1.size() == 1) { assert(theDo_intersect_3(s1, p1, pl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_1[0])) { + if(assign_variant(circle,intersection_1[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(p1,circle)); assert(theHas_on_3(pl,circle)); } - if(assign(cap,intersection_1[0])) { + if(assign_variant(cap,intersection_1[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(p1,cap.first)); assert(theHas_on_3(pl,cap.first)); @@ -998,8 +1023,8 @@ void _test_intersection_construct(SK sk) { if(intersection_1.size() == 2) { assert(theDo_intersect_3(s1, p1, pl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_1[0])); - assert(assign(cap2,intersection_1[1])); + assert(assign_variant(cap1,intersection_1[0])); + assert(assign_variant(cap2,intersection_1[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(p1,cap1.first)); assert(theHas_on_3(pl,cap1.first)); @@ -1011,12 +1036,12 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(s1, p2, pl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_2[0])) { + if(assign_variant(circle,intersection_2[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(p2,circle)); assert(theHas_on_3(pl,circle)); } - if(assign(cap,intersection_2[0])) { + if(assign_variant(cap,intersection_2[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(p2,cap.first)); assert(theHas_on_3(pl,cap.first)); @@ -1025,8 +1050,8 @@ void _test_intersection_construct(SK sk) { if(intersection_2.size() == 2) { assert(theDo_intersect_3(s1, p2, pl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_2[0])); - assert(assign(cap2,intersection_2[1])); + assert(assign_variant(cap1,intersection_2[0])); + assert(assign_variant(cap2,intersection_2[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(p2,cap1.first)); assert(theHas_on_3(pl,cap1.first)); @@ -1051,20 +1076,20 @@ void _test_intersection_construct(SK sk) { if(a == 0 && b == 0 && c == 0) continue; Plane_3 pl = theConstruct_plane_3( Polynomial_1_3(a,b,c,d)); - std::vector< CGAL::Object > intersection_1; - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant , Circle_3> > intersection_1; + std::vector< std::variant , Circle_3> > intersection_2; intersection(s1, p1, pl, std::back_inserter(intersection_1)); intersection(s1, p2, pl, std::back_inserter(intersection_2)); if(intersection_1.size() == 1) { assert(CGAL::do_intersect(s1, p1, pl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_1[0])) { + if(assign_variant(circle,intersection_1[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(p1,circle)); assert(theHas_on_3(pl,circle)); } - if(assign(cap,intersection_1[0])) { + if(assign_variant(cap,intersection_1[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(p1,cap.first)); assert(theHas_on_3(pl,cap.first)); @@ -1073,8 +1098,8 @@ void _test_intersection_construct(SK sk) { if(intersection_1.size() == 2) { assert(CGAL::do_intersect(s1, p1, pl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_1[0])); - assert(assign(cap2,intersection_1[1])); + assert(assign_variant(cap1,intersection_1[0])); + assert(assign_variant(cap2,intersection_1[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(p1,cap1.first)); assert(theHas_on_3(pl,cap1.first)); @@ -1086,12 +1111,12 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(s1, p2, pl)); Circle_3 circle; std::pair cap; - if(assign(circle,intersection_2[0])) { + if(assign_variant(circle,intersection_2[0])) { assert(theHas_on_3(s1,circle)); assert(theHas_on_3(p2,circle)); assert(theHas_on_3(pl,circle)); } - if(assign(cap,intersection_2[0])) { + if(assign_variant(cap,intersection_2[0])) { assert(theHas_on_3(s1,cap.first)); assert(theHas_on_3(p2,cap.first)); assert(theHas_on_3(pl,cap.first)); @@ -1100,8 +1125,8 @@ void _test_intersection_construct(SK sk) { if(intersection_2.size() == 2) { assert(CGAL::do_intersect(s1, p2, pl)); std::pair cap1, cap2; - assert(assign(cap1,intersection_2[0])); - assert(assign(cap2,intersection_2[1])); + assert(assign_variant(cap1,intersection_2[0])); + assert(assign_variant(cap2,intersection_2[1])); assert(theHas_on_3(s1,cap1.first)); assert(theHas_on_3(p2,cap1.first)); assert(theHas_on_3(pl,cap1.first)); @@ -1134,27 +1159,27 @@ void _test_intersection_construct(SK sk) { Circle_3 c2 = theConstruct_circle_3(std::make_pair(es2, pol)); Circle_3 c3 = theConstruct_circle_3(std::make_pair(es3, pol)); - std::vector< CGAL::Object > intersection_1; + std::vector< std::variant , Circle_3> > intersection_1; theIntersect_3(c1, c1, std::back_inserter(intersection_1)); assert(intersection_1.size() == 1); assert(theDo_intersect_3(c1, c1)); Circle_3 circle; - assert(assign(circle,intersection_1[0])); + assert(assign_variant(circle,intersection_1[0])); assert(circle == c1); - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant , Circle_3> > intersection_2; theIntersect_3(c1, c2, std::back_inserter(intersection_2)); assert(intersection_2.size() == 2); assert(theDo_intersect_3(c1, c2)); std::pair cap1, cap2; - assert(assign(cap1,intersection_2[0])); - assert(assign(cap2,intersection_2[1])); + assert(assign_variant(cap1,intersection_2[0])); + assert(assign_variant(cap2,intersection_2[1])); assert(theHas_on_3(c1,cap1.first)); assert(theHas_on_3(c2,cap1.first)); assert(theHas_on_3(c1,cap2.first)); assert(theHas_on_3(c2,cap2.first)); - std::vector< CGAL::Object > intersection_3; + std::vector< std::variant , Circle_3> > intersection_3; theIntersect_3(c1, c3, std::back_inserter(intersection_3)); if(a != 0) { assert(!theDo_intersect_3(c1, c3)); @@ -1163,7 +1188,7 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(c1, c3)); assert(intersection_3.size() == 1); std::pair cap; - assert(assign(cap,intersection_3[0])); + assert(assign_variant(cap,intersection_3[0])); assert(theHas_on_3(c1,cap.first)); assert(theHas_on_3(c3,cap.first)); } @@ -1175,12 +1200,12 @@ void _test_intersection_construct(SK sk) { const FT dl = 0; Polynomial_1_3 pol2 = Polynomial_1_3(al,bl,cl,dl); Circle_3 c4 = theConstruct_circle_3(std::make_pair(es1, pol2)); - std::vector< CGAL::Object > intersection_4; + std::vector< std::variant , Circle_3> > intersection_4; theIntersect_3(c1, c4, std::back_inserter(intersection_4)); assert(theDo_intersect_3(c1, c4)); assert(intersection_4.size() == 2); - assert(assign(cap1,intersection_4[0])); - assert(assign(cap2,intersection_4[1])); + assert(assign_variant(cap1,intersection_4[0])); + assert(assign_variant(cap2,intersection_4[1])); assert(theHas_on_3(c1,cap1.first)); assert(theHas_on_3(c4,cap1.first)); assert(theHas_on_3(c1,cap2.first)); @@ -1193,12 +1218,12 @@ void _test_intersection_construct(SK sk) { const FT d_c = -FT(va) / FT(10); Polynomial_1_3 pol2 = Polynomial_1_3(a_c,b_c,c_c,d_c); Circle_3 c5 = theConstruct_circle_3(std::make_pair(es2, pol2)); - std::vector< CGAL::Object > intersection_5; + std::vector< std::variant , Circle_3> > intersection_5; theIntersect_3(c1, c5, std::back_inserter(intersection_5)); assert(theDo_intersect_3(c1, c5)); assert(intersection_5.size() == 2); - assert(assign(cap1,intersection_5[0])); - assert(assign(cap2,intersection_5[1])); + assert(assign_variant(cap1,intersection_5[0])); + assert(assign_variant(cap2,intersection_5[1])); assert(theHas_on_3(c1,cap1.first)); assert(theHas_on_3(c5,cap1.first)); assert(theHas_on_3(c1,cap2.first)); @@ -1217,27 +1242,27 @@ void _test_intersection_construct(SK sk) { Circle_3 c2 = theConstruct_circle_3(std::make_pair(es2, pol)); Circle_3 c3 = theConstruct_circle_3(std::make_pair(es3, pol)); - std::vector< CGAL::Object > intersection_1; + std::vector< std::variant , Circle_3> > intersection_1; intersection(c1, c1, std::back_inserter(intersection_1)); assert(intersection_1.size() == 1); assert(CGAL::do_intersect(c1, c1)); Circle_3 circle; - assert(assign(circle,intersection_1[0])); + assert(assign_variant(circle,intersection_1[0])); assert(circle == c1); - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant , Circle_3> > intersection_2; intersection(c1, c2, std::back_inserter(intersection_2)); assert(intersection_2.size() == 2); assert(CGAL::do_intersect(c1, c2)); std::pair cap1, cap2; - assert(assign(cap1,intersection_2[0])); - assert(assign(cap2,intersection_2[1])); + assert(assign_variant(cap1,intersection_2[0])); + assert(assign_variant(cap2,intersection_2[1])); assert(theHas_on_3(c1,cap1.first)); assert(theHas_on_3(c2,cap1.first)); assert(theHas_on_3(c1,cap2.first)); assert(theHas_on_3(c2,cap2.first)); - std::vector< CGAL::Object > intersection_3; + std::vector< std::variant , Circle_3> > intersection_3; intersection(c1, c3, std::back_inserter(intersection_3)); if(a != 0) { assert(!do_intersect(c1, c3)); @@ -1246,7 +1271,7 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(c1, c3)); assert(intersection_3.size() == 1); std::pair cap; - assert(assign(cap,intersection_3[0])); + assert(assign_variant(cap,intersection_3[0])); assert(theHas_on_3(c1,cap.first)); assert(theHas_on_3(c3,cap.first)); } @@ -1258,12 +1283,12 @@ void _test_intersection_construct(SK sk) { const FT dl = 0; Polynomial_1_3 pol2 = Polynomial_1_3(al,bl,cl,dl); Circle_3 c4 = theConstruct_circle_3(std::make_pair(es1, pol2)); - std::vector< CGAL::Object > intersection_4; + std::vector< std::variant , Circle_3> > intersection_4; intersection(c1, c4, std::back_inserter(intersection_4)); assert(CGAL::do_intersect(c1, c4)); assert(intersection_4.size() == 2); - assert(assign(cap1,intersection_4[0])); - assert(assign(cap2,intersection_4[1])); + assert(assign_variant(cap1,intersection_4[0])); + assert(assign_variant(cap2,intersection_4[1])); assert(theHas_on_3(c1,cap1.first)); assert(theHas_on_3(c4,cap1.first)); assert(theHas_on_3(c1,cap2.first)); @@ -1276,12 +1301,12 @@ void _test_intersection_construct(SK sk) { const FT d_c = -FT(va) / FT(10); Polynomial_1_3 pol2 = Polynomial_1_3(a_c,b_c,c_c,d_c); Circle_3 c5 = theConstruct_circle_3(std::make_pair(es2, pol2)); - std::vector< CGAL::Object > intersection_5; + std::vector< std::variant , Circle_3> > intersection_5; intersection(c1, c5, std::back_inserter(intersection_5)); assert(CGAL::do_intersect(c1, c5)); assert(intersection_5.size() == 2); - assert(assign(cap1,intersection_5[0])); - assert(assign(cap2,intersection_5[1])); + assert(assign_variant(cap1,intersection_5[0])); + assert(assign_variant(cap2,intersection_5[1])); assert(theHas_on_3(c1,cap1.first)); assert(theHas_on_3(c5,cap1.first)); assert(theHas_on_3(c1,cap2.first)); @@ -1310,7 +1335,7 @@ void _test_intersection_construct(SK sk) { Circle_3 c1 = theConstruct_circle_3(std::make_pair(pol_s, pol_pl1)); Circle_3 c2 = theConstruct_circle_3(std::make_pair(pol_s, pol_pl2)); - std::vector< CGAL::Object > intersection_1, intersection_2; + std::vector< std::variant > > intersection_1, intersection_2; theIntersect_3(c1, l1, std::back_inserter(intersection_1)); theIntersect_3(c2, l2, std::back_inserter(intersection_2)); @@ -1320,7 +1345,7 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(c1, l1)); assert(intersection_1.size() == 1); std::pair the_pair1; - assert(assign(the_pair1, intersection_1[0])); + assert(assign_variant(the_pair1, intersection_1[0])); assert(theHas_on_3(c1,the_pair1.first)); assert(theHas_on_3(l1,the_pair1.first)); @@ -1336,8 +1361,8 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(c1, l1)); std::pair the_pair1; std::pair the_pair2; - assert(assign(the_pair1, intersection_1[0])); - assert(assign(the_pair2, intersection_1[1])); + assert(assign_variant(the_pair1, intersection_1[0])); + assert(assign_variant(the_pair2, intersection_1[1])); assert(theHas_on_3(c1,the_pair1.first)); assert(theHas_on_3(l1,the_pair1.first)); assert(theHas_on_3(c1,the_pair2.first)); @@ -1347,8 +1372,8 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(c2, l2)); std::pair the_pair3; std::pair the_pair4; - assert(assign(the_pair3, intersection_2[0])); - assert(assign(the_pair4, intersection_2[1])); + assert(assign_variant(the_pair3, intersection_2[0])); + assert(assign_variant(the_pair4, intersection_2[1])); assert(theHas_on_3(c2,the_pair3.first)); assert(theHas_on_3(l2,the_pair3.first)); assert(theHas_on_3(c2,the_pair4.first)); @@ -1378,7 +1403,7 @@ void _test_intersection_construct(SK sk) { Circle_3 c1 = theConstruct_circle_3(std::make_pair(pol_s, pol_pl1)); Circle_3 c2 = theConstruct_circle_3(std::make_pair(pol_s, pol_pl2)); - std::vector< CGAL::Object > intersection_1, intersection_2; + std::vector< std::variant > > intersection_1, intersection_2; intersection(c1, l1, std::back_inserter(intersection_1)); intersection(c2, l2, std::back_inserter(intersection_2)); @@ -1388,7 +1413,7 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(c1, l1)); assert(intersection_1.size() == 1); std::pair the_pair1; - assert(assign(the_pair1, intersection_1[0])); + assert(assign_variant(the_pair1, intersection_1[0])); assert(theHas_on_3(c1,the_pair1.first)); assert(theHas_on_3(l1,the_pair1.first)); @@ -1404,8 +1429,8 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(c1, l1)); std::pair the_pair1; std::pair the_pair2; - assert(assign(the_pair1, intersection_1[0])); - assert(assign(the_pair2, intersection_1[1])); + assert(assign_variant(the_pair1, intersection_1[0])); + assert(assign_variant(the_pair2, intersection_1[1])); assert(theHas_on_3(c1,the_pair1.first)); assert(theHas_on_3(l1,the_pair1.first)); assert(theHas_on_3(c1,the_pair2.first)); @@ -1415,8 +1440,8 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(c2, l2)); std::pair the_pair3; std::pair the_pair4; - assert(assign(the_pair3, intersection_2[0])); - assert(assign(the_pair4, intersection_2[1])); + assert(assign_variant(the_pair3, intersection_2[0])); + assert(assign_variant(the_pair4, intersection_2[1])); assert(theHas_on_3(c2,the_pair3.first)); assert(theHas_on_3(l2,the_pair3.first)); assert(theHas_on_3(c2,the_pair4.first)); @@ -1444,13 +1469,13 @@ void _test_intersection_construct(SK sk) { for(int t4=t3+1;t4<3;t4++) { Point_3 targetl = Point_3(a*t4,b*t4,c*t4); Line_arc_3 lb = theConstruct_line_arc_3(l,sourcel,targetl); - std::vector< CGAL::Object > intersection_1; + std::vector< std::variant > > intersection_1; theIntersect_3(la, lb, std::back_inserter(intersection_1)); if(t1 == t3) { Line_arc_3 line_a; assert(theDo_intersect_3(la, lb)); assert(intersection_1.size() == 1); - assert(assign(line_a, intersection_1[0])); + assert(assign_variant(line_a, intersection_1[0])); if(t2 <= t4) { assert(theEqual_3(line_a, la)); } else { @@ -1460,7 +1485,7 @@ void _test_intersection_construct(SK sk) { Line_arc_3 line_a; assert(theDo_intersect_3(la, lb)); assert(intersection_1.size() == 1); - assert(assign(line_a, intersection_1[0])); + assert(assign_variant(line_a, intersection_1[0])); if(t1 > t3) { assert(theEqual_3(line_a, la)); } else { @@ -1471,14 +1496,14 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(la, lb)); std::pair pair; assert(intersection_1.size() == 1); - assert(assign(pair, intersection_1[0])); + assert(assign_variant(pair, intersection_1[0])); if(t2 == t3) assert(theEqual_3(pair.first,target)); if(t1 == t4) assert(theEqual_3(pair.first,source)); } else if((t1 < t3) && (t3 < t2 )) { Line_arc_3 line_a; assert(theDo_intersect_3(la, lb)); assert(intersection_1.size() == 1); - assert(assign(line_a, intersection_1[0])); + assert(assign_variant(line_a, intersection_1[0])); if(t2 < t4) { Line_arc_3 line_b; line_b = theConstruct_line_arc_3(l,sourcel,target); @@ -1490,7 +1515,7 @@ void _test_intersection_construct(SK sk) { Line_arc_3 line_a; assert(intersection_1.size() == 1); assert(theDo_intersect_3(la, lb)); - assert(assign(line_a, intersection_1[0])); + assert(assign_variant(line_a, intersection_1[0])); if(t4 < t2) { Line_arc_3 line_b; line_b = theConstruct_line_arc_3(l,source,targetl); @@ -1562,7 +1587,7 @@ void _test_intersection_construct(SK sk) { int n_of_intersection = 0; for(int j=0;j<6;j++) { if(i == j) continue; - std::vector< CGAL::Object > intersection_1; + std::vector< std::variant > > intersection_1; theIntersect_3(l[i], l[j], std::back_inserter(intersection_1)); assert((intersection_1.size() == 0) || (intersection_1.size() == 1)); @@ -1570,7 +1595,7 @@ void _test_intersection_construct(SK sk) { assert(theDo_intersect_3(l[i], l[j])); n_of_intersection++; std::pair pair; - assert(assign(pair, intersection_1[0])); + assert(assign_variant(pair, intersection_1[0])); assert(theHas_on_3(l[i],pair.first)); assert(theHas_on_3(l[j],pair.first)); int n_of_edges = 2; @@ -1611,13 +1636,13 @@ void _test_intersection_construct(SK sk) { for(int t4=t3+1;t4<3;t4++) { Point_3 targetl = Point_3(a*t4,b*t4,c*t4); Line_arc_3 lb = theConstruct_line_arc_3(l,sourcel,targetl); - std::vector< CGAL::Object > intersection_1; + std::vector< std::variant > > intersection_1; intersection(la, lb, std::back_inserter(intersection_1)); if(t1 == t3) { Line_arc_3 line_a; assert(CGAL::do_intersect(la, lb)); assert(intersection_1.size() == 1); - assert(assign(line_a, intersection_1[0])); + assert(assign_variant(line_a, intersection_1[0])); if(t2 <= t4) { assert(theEqual_3(line_a, la)); } else { @@ -1627,7 +1652,7 @@ void _test_intersection_construct(SK sk) { Line_arc_3 line_a; assert(CGAL::do_intersect(la, lb)); assert(intersection_1.size() == 1); - assert(assign(line_a, intersection_1[0])); + assert(assign_variant(line_a, intersection_1[0])); if(t1 > t3) { assert(theEqual_3(line_a, la)); } else { @@ -1638,14 +1663,14 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(la, lb)); std::pair pair; assert(intersection_1.size() == 1); - assert(assign(pair, intersection_1[0])); + assert(assign_variant(pair, intersection_1[0])); if(t2 == t3) assert(theEqual_3(pair.first,target)); if(t1 == t4) assert(theEqual_3(pair.first,source)); } else if((t1 < t3) && (t3 < t2 )) { Line_arc_3 line_a; assert(CGAL::do_intersect(la, lb)); assert(intersection_1.size() == 1); - assert(assign(line_a, intersection_1[0])); + assert(assign_variant(line_a, intersection_1[0])); if(t2 < t4) { Line_arc_3 line_b; line_b = theConstruct_line_arc_3(l,sourcel,target); @@ -1657,7 +1682,7 @@ void _test_intersection_construct(SK sk) { Line_arc_3 line_a; assert(intersection_1.size() == 1); assert(CGAL::do_intersect(la, lb)); - assert(assign(line_a, intersection_1[0])); + assert(assign_variant(line_a, intersection_1[0])); if(t4 < t2) { Line_arc_3 line_b; line_b = theConstruct_line_arc_3(l,source,targetl); @@ -1729,7 +1754,7 @@ void _test_intersection_construct(SK sk) { int n_of_intersection = 0; for(int j=0;j<6;j++) { if(i == j) continue; - std::vector< CGAL::Object > intersection_1; + std::vector< std::variant > > intersection_1; intersection(l[i], l[j], std::back_inserter(intersection_1)); assert((intersection_1.size() == 0) || (intersection_1.size() == 1)); @@ -1737,7 +1762,7 @@ void _test_intersection_construct(SK sk) { assert(CGAL::do_intersect(l[i], l[j])); n_of_intersection++; std::pair pair; - assert(assign(pair, intersection_1[0])); + assert(assign_variant(pair, intersection_1[0])); assert(theHas_on_3(l[i],pair.first)); assert(theHas_on_3(l[j],pair.first)); int n_of_edges = 2; @@ -1801,7 +1826,7 @@ void _test_intersection_construct(SK sk) { for(int t2=0;t2<8;t2++) { if(t1 == t2) continue; Circular_arc_3 cb = theConstruct_circular_arc_3(cc,cp[t1],cp[t2]); - std::vector< CGAL::Object > intersection_1; + std::vector< std::variant > > intersection_1; theIntersect_3(ca, cb, std::back_inserter(intersection_1)); Circular_arc_3 cres, cres2; std::pair< Circular_arc_point_3, unsigned > cp1, cp2; @@ -1809,37 +1834,37 @@ void _test_intersection_construct(SK sk) { if(t2 == j) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(ca,cres)); } else if(simulate_has_on(i,j,t2)) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(cb, cres)); } else { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(ca, cres)); } } else if(t2 == j) { if(simulate_has_on(i,j,t1)) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(cb, cres)); } else { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(ca, cres)); } } else if(t1 == j) { if(t2 == i) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 2); - assert(assign(cp1,intersection_1[0])); - assert(assign(cp2,intersection_1[1])); + assert(assign_variant(cp1,intersection_1[0])); + assert(assign_variant(cp2,intersection_1[1])); assert(theEqual_3(cp1.first, cp[i]) || theEqual_3(cp1.first, cp[j])); assert(theEqual_3(cp2.first, cp[i]) || @@ -1848,13 +1873,13 @@ void _test_intersection_construct(SK sk) { } else if(simulate_has_on(t1,i,t2)) { assert(intersection_1.size() == 1); assert(theDo_intersect_3(ca, cb)); - assert(assign(cp1,intersection_1[0])); + assert(assign_variant(cp1,intersection_1[0])); assert(theEqual_3(cp1.first, cp[t1])); } else { assert(intersection_1.size() == 2); assert(theDo_intersect_3(ca, cb)); - if(assign(cp1,intersection_1[0]) && assign(cres,intersection_1[1])); - else if(assign(cres,intersection_1[0]) && assign(cp1,intersection_1[1])); + if(assign_variant(cp1,intersection_1[0]) && assign_variant(cres,intersection_1[1])); + else if(assign_variant(cres,intersection_1[0]) && assign_variant(cp1,intersection_1[1])); else assert(false); Circular_arc_3 conf = theConstruct_circular_arc_3(cc,cp[i],cp[t2]); assert(theEqual_3(conf, cres)); @@ -1864,8 +1889,8 @@ void _test_intersection_construct(SK sk) { if(t1 == j) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 2); - assert(assign(cp1,intersection_1[0])); - assert(assign(cp2,intersection_1[1])); + assert(assign_variant(cp1,intersection_1[0])); + assert(assign_variant(cp2,intersection_1[1])); assert(theEqual_3(cp1.first, cp[i]) || theEqual_3(cp1.first, cp[j])); assert(theEqual_3(cp2.first, cp[i]) || @@ -1874,13 +1899,13 @@ void _test_intersection_construct(SK sk) { } else if(simulate_has_on(j,i,t1)) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cp1,intersection_1[0])); + assert(assign_variant(cp1,intersection_1[0])); assert(theEqual_3(cp1.first, cp[i])); } else { assert(intersection_1.size() == 2); assert(theDo_intersect_3(ca, cb)); - if(assign(cp1,intersection_1[0]) && assign(cres,intersection_1[1])); - else if(assign(cres,intersection_1[0]) && assign(cp1,intersection_1[1])); + if(assign_variant(cp1,intersection_1[0]) && assign_variant(cres,intersection_1[1])); + else if(assign_variant(cres,intersection_1[0]) && assign_variant(cp1,intersection_1[1])); else assert(false); Circular_arc_3 conf = theConstruct_circular_arc_3(cc,cp[t1],cp[j]); assert(theEqual_3(conf, cres)); @@ -1890,19 +1915,19 @@ void _test_intersection_construct(SK sk) { if(simulate_has_on(t1,j,t2)) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(cb, cres)); } else if(simulate_has_on(t2,j,i)) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); Circular_arc_3 conf = theConstruct_circular_arc_3(cc,cp[t1],cp[j]); assert(theEqual_3(cres, conf)); } else { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 2); - assert(assign(cres,intersection_1[0])); - assert(assign(cres2,intersection_1[1])); + assert(assign_variant(cres,intersection_1[0])); + assert(assign_variant(cres2,intersection_1[1])); Circular_arc_3 conf1 = theConstruct_circular_arc_3(cc,cp[t1],cp[j]); Circular_arc_3 conf2 = theConstruct_circular_arc_3(cc,cp[i],cp[t2]); assert((theEqual_3(cres, conf1) && theEqual_3(cres2, conf2)) || @@ -1912,20 +1937,20 @@ void _test_intersection_construct(SK sk) { if(simulate_has_on(i,t2,t1)) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(cb, cres)); } else if(simulate_has_on(j,i,t1)) { assert(theDo_intersect_3(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); Circular_arc_3 conf = theConstruct_circular_arc_3(cc,cp[i],cp[t2]); assert(theEqual_3(cres, conf)); } else { // This case should never happen, because it already happen before assert(intersection_1.size() == 2); assert(theDo_intersect_3(ca, cb)); - assert(assign(cres,intersection_1[0])); - assert(assign(cres2,intersection_1[1])); + assert(assign_variant(cres,intersection_1[0])); + assert(assign_variant(cres2,intersection_1[1])); Circular_arc_3 conf1 = theConstruct_circular_arc_3(cc,cp[t1],cp[j]); Circular_arc_3 conf2 = theConstruct_circular_arc_3(cc,cp[i],cp[t2]); assert((theEqual_3(cres, conf1) && theEqual_3(cres2, conf2)) || @@ -1935,7 +1960,7 @@ void _test_intersection_construct(SK sk) { // the case whether (i,j) contains (t1,t2) is handled before assert(intersection_1.size() == 1); assert(theDo_intersect_3(ca, cb)); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(ca, cres)); } else { assert(intersection_1.size() == 0); @@ -1956,7 +1981,7 @@ void _test_intersection_construct(SK sk) { for(int t2=0;t2<8;t2++) { if(t1 == t2) continue; Circular_arc_3 cb = theConstruct_circular_arc_3(cc,cp[t1],cp[t2]); - std::vector< CGAL::Object > intersection_1; + std::vector< std::variant > > intersection_1; intersection(ca, cb, std::back_inserter(intersection_1)); Circular_arc_3 cres, cres2; std::pair< Circular_arc_point_3, unsigned > cp1, cp2; @@ -1964,37 +1989,37 @@ void _test_intersection_construct(SK sk) { if(t2 == j) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(ca,cres)); } else if(simulate_has_on(i,j,t2)) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(cb, cres)); } else { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(ca, cres)); } } else if(t2 == j) { if(simulate_has_on(i,j,t1)) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(cb, cres)); } else { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(ca, cres)); } } else if(t1 == j) { if(t2 == i) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 2); - assert(assign(cp1,intersection_1[0])); - assert(assign(cp2,intersection_1[1])); + assert(assign_variant(cp1,intersection_1[0])); + assert(assign_variant(cp2,intersection_1[1])); assert(theEqual_3(cp1.first, cp[i]) || theEqual_3(cp1.first, cp[j])); assert(theEqual_3(cp2.first, cp[i]) || @@ -2003,13 +2028,13 @@ void _test_intersection_construct(SK sk) { } else if(simulate_has_on(t1,i,t2)) { assert(intersection_1.size() == 1); assert(CGAL::do_intersect(ca, cb)); - assert(assign(cp1,intersection_1[0])); + assert(assign_variant(cp1,intersection_1[0])); assert(theEqual_3(cp1.first, cp[t1])); } else { assert(intersection_1.size() == 2); assert(CGAL::do_intersect(ca, cb)); - if(assign(cp1,intersection_1[0]) && assign(cres,intersection_1[1])); - else if(assign(cres,intersection_1[0]) && assign(cp1,intersection_1[1])); + if(assign_variant(cp1,intersection_1[0]) && assign_variant(cres,intersection_1[1])); + else if(assign_variant(cres,intersection_1[0]) && assign_variant(cp1,intersection_1[1])); else assert(false); Circular_arc_3 conf = theConstruct_circular_arc_3(cc,cp[i],cp[t2]); assert(theEqual_3(conf, cres)); @@ -2019,8 +2044,8 @@ void _test_intersection_construct(SK sk) { if(t1 == j) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 2); - assert(assign(cp1,intersection_1[0])); - assert(assign(cp2,intersection_1[1])); + assert(assign_variant(cp1,intersection_1[0])); + assert(assign_variant(cp2,intersection_1[1])); assert(theEqual_3(cp1.first, cp[i]) || theEqual_3(cp1.first, cp[j])); assert(theEqual_3(cp2.first, cp[i]) || @@ -2029,13 +2054,13 @@ void _test_intersection_construct(SK sk) { } else if(simulate_has_on(j,i,t1)) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cp1,intersection_1[0])); + assert(assign_variant(cp1,intersection_1[0])); assert(theEqual_3(cp1.first, cp[i])); } else { assert(intersection_1.size() == 2); assert(CGAL::do_intersect(ca, cb)); - if(assign(cp1,intersection_1[0]) && assign(cres,intersection_1[1])); - else if(assign(cres,intersection_1[0]) && assign(cp1,intersection_1[1])); + if(assign_variant(cp1,intersection_1[0]) && assign_variant(cres,intersection_1[1])); + else if(assign_variant(cres,intersection_1[0]) && assign_variant(cp1,intersection_1[1])); else assert(false); Circular_arc_3 conf = theConstruct_circular_arc_3(cc,cp[t1],cp[j]); assert(theEqual_3(conf, cres)); @@ -2045,19 +2070,19 @@ void _test_intersection_construct(SK sk) { if(simulate_has_on(t1,j,t2)) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(cb, cres)); } else if(simulate_has_on(t2,j,i)) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); Circular_arc_3 conf = theConstruct_circular_arc_3(cc,cp[t1],cp[j]); assert(theEqual_3(cres, conf)); } else { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 2); - assert(assign(cres,intersection_1[0])); - assert(assign(cres2,intersection_1[1])); + assert(assign_variant(cres,intersection_1[0])); + assert(assign_variant(cres2,intersection_1[1])); Circular_arc_3 conf1 = theConstruct_circular_arc_3(cc,cp[t1],cp[j]); Circular_arc_3 conf2 = theConstruct_circular_arc_3(cc,cp[i],cp[t2]); assert((theEqual_3(cres, conf1) && theEqual_3(cres2, conf2)) || @@ -2067,20 +2092,20 @@ void _test_intersection_construct(SK sk) { if(simulate_has_on(i,t2,t1)) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(cb, cres)); } else if(simulate_has_on(j,i,t1)) { assert(CGAL::do_intersect(ca, cb)); assert(intersection_1.size() == 1); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); Circular_arc_3 conf = theConstruct_circular_arc_3(cc,cp[i],cp[t2]); assert(theEqual_3(cres, conf)); } else { // This case should never happen, because it already happen before assert(intersection_1.size() == 2); assert(CGAL::do_intersect(ca, cb)); - assert(assign(cres,intersection_1[0])); - assert(assign(cres2,intersection_1[1])); + assert(assign_variant(cres,intersection_1[0])); + assert(assign_variant(cres2,intersection_1[1])); Circular_arc_3 conf1 = theConstruct_circular_arc_3(cc,cp[t1],cp[j]); Circular_arc_3 conf2 = theConstruct_circular_arc_3(cc,cp[i],cp[t2]); assert((theEqual_3(cres, conf1) && theEqual_3(cres2, conf2)) || @@ -2090,7 +2115,7 @@ void _test_intersection_construct(SK sk) { // the case whether (i,j) contains (t1,t2) is handled before assert(intersection_1.size() == 1); assert(CGAL::do_intersect(ca, cb)); - assert(assign(cres,intersection_1[0])); + assert(assign_variant(cres,intersection_1[0])); assert(theEqual_3(ca, cres)); } else { assert(intersection_1.size() == 0); @@ -2280,11 +2305,11 @@ void _test_bounding_box_construct(SK sk) Circle_3 c1 = theConstruct_circle_3(std::make_pair(es1, pol)); Circle_3 c2 = theConstruct_circle_3(std::make_pair(es2, pol)); - std::vector< CGAL::Object > intersection_2; + std::vector< std::variant > > intersection_2; theIntersect_3(c1, c2, std::back_inserter(intersection_2)); std::pair cap1, cap2; - assign(cap1,intersection_2[0]); - assign(cap2,intersection_2[1]); + assign_variant(cap1,intersection_2[0]); + assign_variant(cap2,intersection_2[1]); _test_bbox(cap1.first); _test_bbox(cap2.first); @@ -2295,10 +2320,10 @@ void _test_bounding_box_construct(SK sk) const FT dl = 0; Polynomial_1_3 pol2 = Polynomial_1_3(al,bl,cl,dl); Circle_3 c4 = theConstruct_circle_3(std::make_pair(es1, pol2)); - std::vector< CGAL::Object > intersection_4; + std::vector< std::variant > > intersection_4; theIntersect_3(c1, c4, std::back_inserter(intersection_4)); - assign(cap1,intersection_4[0]); - assign(cap2,intersection_4[1]); + assign_variant(cap1,intersection_4[0]); + assign_variant(cap2,intersection_4[1]); _test_bbox(cap1.first); _test_bbox(cap2.first); } @@ -2309,10 +2334,10 @@ void _test_bounding_box_construct(SK sk) const FT d_c = -FT(va) / FT(10); Polynomial_1_3 pol2 = Polynomial_1_3(a_c,b_c,c_c,d_c); Circle_3 c5 = theConstruct_circle_3(std::make_pair(es2, pol2)); - std::vector< CGAL::Object > intersection_5; + std::vector< std::variant > > intersection_5; theIntersect_3(c1, c5, std::back_inserter(intersection_5)); - assign(cap1,intersection_5[0]); - assign(cap2,intersection_5[1]); + assign_variant(cap1,intersection_5[0]); + assign_variant(cap2,intersection_5[1]); _test_bbox(cap1.first); _test_bbox(cap2.first); } @@ -2334,15 +2359,15 @@ void _test_bounding_box_construct(SK sk) Sphere_3 sl_2 = theConstruct_sphere_3( Polynomial_for_spheres_2_3(x+10,y+10,z+10,r*r)); int d2 = (vx*vx + vy*vy + vz*vz); - CGAL::Object intersection_1 = theIntersect_3(s, sl_1); - CGAL::Object intersection_2 = theIntersect_3(s_t10, sl_2); + std::optional> intersection_1 = theIntersect_3(s, sl_1); + std::optional> intersection_2 = theIntersect_3(s_t10, sl_2); // No intersection if((d2 > (r+1)*(r+1)) || (d2 < (r-1)*(r-1))) continue; if(x == 0 && y == 0 && z == 0) continue; if((d2 == (r+1)*(r+1)) || (d2 == (r-1)*(r-1))) continue; Circle_3 circle1, circle2; - assign(circle1, intersection_1); - assign(circle2, intersection_2); + assign_variant(circle1, intersection_1); + assign_variant(circle2, intersection_2); _test_bbox(circle1); _test_bbox(circle2); } From d91d010ee7eeb40a84aa8650ff341413bd48cae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 18:07:48 +0200 Subject: [PATCH 096/156] add missing includes --- .../include/CGAL/Arr_point_location_result.h | 1 + .../internal/tetrahedral_remeshing_helpers.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h index 4651b64c4dd..50aa748ba72 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location_result.h @@ -15,6 +15,7 @@ #include #include +#include #include #include 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 07848cbe492..1c4237191d0 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 @@ -24,6 +24,7 @@ #include #include #include +#include #include From f31d41c1f280aae5030040a0d2c89d02bf4c4ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 18:08:31 +0200 Subject: [PATCH 097/156] missing include --- Envelope_3/include/CGAL/Env_sphere_traits_3.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Envelope_3/include/CGAL/Env_sphere_traits_3.h b/Envelope_3/include/CGAL/Env_sphere_traits_3.h index bec2a5b72a9..2a42d07f0a0 100644 --- a/Envelope_3/include/CGAL/Env_sphere_traits_3.h +++ b/Envelope_3/include/CGAL/Env_sphere_traits_3.h @@ -25,6 +25,8 @@ #include #include +#include + namespace CGAL { template From 9e22fdfcb8df6333d59df93a80b2114820f87c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 18:08:57 +0200 Subject: [PATCH 098/156] iformat for optional --- Stream_support/include/CGAL/IO/io.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 8634c38f88d..3460398bea9 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -267,6 +267,19 @@ public: std::istream& operator()( std::istream& is) const { return (is >> t); } }; +template +class Input_rep> +{ + std::optional& t; + +public: + //! initialize with a reference to \a t. + Input_rep( std::optional& tt) : t(tt) {} + + //! perform the input, calls \c operator\>\> by default. + std::istream& operator()( std::istream& is) const { return (is >> t.value()); } +}; + #if CGAL_FORCE_IFORMAT_DOUBLE || \ ( ( _MSC_VER > 1600 ) && ( _MSC_VER < 1910 ) && (! defined( CGAL_NO_IFORMAT_DOUBLE )) ) From a32483d885d1672c3d1e9fa5d68574e0e67acd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 18:09:18 +0200 Subject: [PATCH 099/156] use iformat --- .../include/CGAL/Curved_kernel_via_analysis_2/Point_2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index c134c8cc901..2d194eb5254 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -736,13 +736,13 @@ public: swallow(is, '('); // read values - is >> rep._m_xy; + is >> iformat(rep._m_xy); swallow(is, ','); - is >> rep._m_x; + is >> iformat(rep._m_x); swallow(is, ','); - is >> rep._m_curve; + is >> iformat(rep._m_curve); swallow(is, ','); - is >> rep._m_arcno; + is >> iformat(rep._m_arcno); swallow(is, ','); is >> rep._m_location; From b1465645adc0ac9b420d7fc5952b3b54b1f4dc08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 18:48:15 +0200 Subject: [PATCH 100/156] fix variant output --- Stream_support/include/CGAL/IO/io.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 3460398bea9..6a5fa185e6b 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -191,13 +191,15 @@ public: template class Output_rep, F> { - const std::optional& t; + const std::optional& t; public: Output_rep( const std::optional& tt) : t(tt) {} - std::ostream& operator()( std::ostream& os) const { + std::ostream& operator()( std::ostream& os) const + { if (t==std::nullopt) return (os << "--"); - return (os << t.value()); } + return (os << t.value()); + } }; template @@ -207,8 +209,10 @@ class Output_rep, F> public: Output_rep( const std::variant& tt) : t(tt) {} - std::ostream& operator()( std::ostream& os) const { - return (os << "--"); + std::ostream& operator()( std::ostream& os) const + { + std::visit([&os](auto&& v) { os << v; }, t); + return os; } }; From cc41b541160e3cc1e40da4f397e19caf1b1c3fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 12 Jul 2023 13:31:13 +0200 Subject: [PATCH 101/156] remove extra comment begin --- .../Arrangement_on_surface_2/CGAL/Arr_point_location_result.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h index ed8cc09f5d0..2a48e35b399 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h @@ -1,5 +1,3 @@ -/*! - namespace CGAL { /*! From 7ec586ca736d070fb904252a043b4b85bc761cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 19 Jul 2023 10:47:17 +0200 Subject: [PATCH 102/156] Temporary workaround the selection item emitting way too many signals --- .../Plugins/Display/Heat_method_plugin.cpp | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp index 7ba691b6cf1..fc6d564379b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp @@ -605,18 +605,25 @@ private: sm_item->setRenderingMode(GouraudPlusEdges); sm_item->redraw(); - scene->addItem(heat_item); - scene->setSelectedItem(scene->item_id(sm_item)); + auto heat_item_id = scene->addItem(heat_item); + scene->setSelectedItem(heat_item_id); // any change of sm_item destroys everything - connect(sm_item, &Scene_surface_mesh_item::itemChanged, - this, [this, sm_item, heat_item]() - { - sm_item->resetColors(); - removePluginProperties(sm_item); - scene->erase(scene->item_id(heat_item)); - onItemIndicesSelected(scene->selectionIndices()); - }); + + // @todo do not emit itemChanged when the colors are reset + // @todo with qt6, single connection can be performed with `static_cast(Qt::SingleShotConnection)` + // see https://www.kdab.com/single-shot-connections/ + auto connection = std::make_shared(); + *connection = connect(sm_item, &Scene_surface_mesh_item::itemChanged, + this, [this, sm_item, heat_item, connection]() + { + QObject::disconnect(*connection); + + sm_item->resetColors(); + removePluginProperties(sm_item); + scene->erase(scene->item_id(heat_item)); + onItemIndicesSelected(scene->selectionIndices()); + }); connect(sm_item, &Scene_surface_mesh_item::aboutToBeDestroyed, this, [this, heat_item]() @@ -765,7 +772,8 @@ private Q_SLOTS: Scene_polyhedron_selection_item* source_vertices = new Scene_polyhedron_selection_item(sm_item, mw); source_vertices->setName(tr("%1 (source vertices)").arg(sm_item->name())); - scene->addItem(source_vertices); + auto source_vertices_id = scene->addItem(source_vertices); + scene->setSelectedItem(source_vertices_id); link_mesh_and_selection(sm_item, source_vertices); From a76926c8f69c541e65f401d11a72cffaaedd3933 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 24 Jul 2023 16:36:35 +0200 Subject: [PATCH 103/156] replace "bad" / "wrong" / "authorized" to "compatible" / "incompatible" version after review --- Installation/include/CGAL/version_checker.h | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Installation/include/CGAL/version_checker.h b/Installation/include/CGAL/version_checker.h index 9061ee89c54..785f8be1712 100644 --- a/Installation/include/CGAL/version_checker.h +++ b/Installation/include/CGAL/version_checker.h @@ -19,31 +19,31 @@ // you want to use. //// Set the 3 following macros to the version of CGAL you want to use -//#define CGAL_AUTHORIZED_VERSION_MAJOR 6 -//#define CGAL_AUTHORIZED_VERSION_MINOR 0 -//#define CGAL_AUTHORIZED_VERSION_PATCH 0 +//#define CGAL_COMPATIBLE_VERSION_MAJOR 6 +//#define CGAL_COMPATIBLE_VERSION_MINOR 0 +//#define CGAL_COMPATIBLE_VERSION_PATCH 0 // Set the following macros to 1 to get a warning/an error -// when using a bad version of CGAL +// when using a possibly incompatible version of CGAL #define CGAL_VERSION_CHECKER_ERROR 0 #define CGAL_VERSION_CHECKER_WARNING 0 -#define CGAL_AUTHORIZED_VERSION_STR CGAL_STR(CGAL_AUTHORIZED_VERSION_MAJOR) "." \ - CGAL_STR(CGAL_AUTHORIZED_VERSION_MINOR) "." \ - CGAL_STR(CGAL_AUTHORIZED_VERSION_PATCH) +#define CGAL_COMPATIBLE_VERSION_STR CGAL_STR(CGAL_COMPATIBLE_VERSION_MAJOR) "." \ + CGAL_STR(CGAL_COMPATIBLE_VERSION_MINOR) "." \ + CGAL_STR(CGAL_COMPATIBLE_VERSION_PATCH) // Check that the version of CGAL used is the one expected -#if CGAL_AUTHORIZED_VERSION_MAJOR != CGAL_VERSION_MAJOR \ - || CGAL_AUTHORIZED_VERSION_MINOR != CGAL_VERSION_MINOR \ - || CGAL_AUTHORIZED_VERSION_PATCH != CGAL_VERSION_PATCH +#if CGAL_COMPATIBLE_VERSION_MAJOR != CGAL_VERSION_MAJOR \ + || CGAL_COMPATIBLE_VERSION_MINOR != CGAL_VERSION_MINOR \ + || CGAL_COMPATIBLE_VERSION_PATCH != CGAL_VERSION_PATCH #if CGAL_VERSION_CHECKER_WARNING || CGAL_VERSION_CHECKER_ERROR - #pragma message("These headers are meant to be used with CGAL " CGAL_AUTHORIZED_VERSION_STR " only."\ + #pragma message("These headers are meant to be used with CGAL " CGAL_COMPATIBLE_VERSION_STR " only."\ " You are using CGAL version: " CGAL_STR(CGAL_VERSION) ".") #ifdef CGAL_VERSION_CHECKER_ERROR - #error "Wrong version of CGAL" + #error "Incompatible version of CGAL" #endif #endif From fb3680f8f5ad6542c102525b8318a73f6b815e26 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:48:55 +0200 Subject: [PATCH 104/156] Update Mesh_3/doc/Mesh_3/Mesh_3.txt Co-authored-by: Jane Tournois --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 43660034018..fd1fe191063 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -296,7 +296,7 @@ also inserts a small set of auxiliary vertices that belong to the triangulation but are isolated from the complex at the end of the meshing process. These so-called \em isolated vertices belong to the triangulation but not to any cell -of the `C3T3`. They can be removed using the function `CGAL::Polygon_mesh_processing::remove_isolated_vertices()`. +of the `C3T3`. They can be removed using the function `remove_isolated_vertices()` of `CGAL::Mesh_complex_3_in_triangulation_3`. \section Mesh_3_section_interface Interface From 81bbc3e0db20285013ce5ed7b28c76e48c653f4f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:50:23 +0200 Subject: [PATCH 105/156] Update Mesh_3/doc/Mesh_3/Mesh_3.txt Co-authored-by: Jane Tournois --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index fd1fe191063..abe63982656 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -494,7 +494,7 @@ protecting ball centers that are consecutive on a 1-feature. This parameter has The four additional parameters are optimization parameters. They control which optimization processes are performed -and enables the user to tune the parameters of the activated optimization processes. +and enable the user to tune the parameters of the activated optimization processes. These parameters have internal types which are not described but the library provides global functions to generate appropriate values of these types: From 7f20c6b773cd6dff5d660dfdacf6082937f4dd74 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:51:13 +0200 Subject: [PATCH 106/156] Update Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 38c2b9570f1..a1a757ee560 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -164,7 +164,7 @@ public: Constructor from a polyhedral surface. No feature detection is done at this level. Note that a copy of `bounding_polyhedron` will be done. The polyhedron `bounding_polyhedron` has to be closed and free of intersections. - Its interior of `bounding_polyhedron` will be meshed. + The interior of `bounding_polyhedron` will be meshed. */ Polyhedral_mesh_domain_with_features_3(const Polyhedron& bounding_polyhedron #ifndef DOXYGEN_RUNNING From 54fbebf2b69c4bc16230ad1201628a36f2e744fa Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:51:38 +0200 Subject: [PATCH 107/156] Update Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index a1a757ee560..fdc5fd0a158 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -245,7 +245,7 @@ public: * queries. * * @tparam InputPolyhedraPtrIterator must be a model of - * `ForwardIterator` and value type `Polyhedron*` + * `ForwardIterator` with value type `Polyhedron*` * * @param begin iterator for a sequence of pointers to polyhedra * @param end iterator for a sequence of pointers to polyhedra From 7bc4b30501ebae90dc50491e3e73961165b564cf Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:52:13 +0200 Subject: [PATCH 108/156] Update Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index fdc5fd0a158..33145d18b2e 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -274,7 +274,7 @@ public: * polyhedral surface. * * @tparam InputPolyhedraPtrIterator must be a model of - * `ForwardIterator` and value type `Polyhedron*` + * `ForwardIterator` with value type `Polyhedron*` * * @param begin iterator for a sequence of pointers to polyhedra * @param end iterator for a sequence of pointers to polyhedra From 1963697d8473227b70a6bc6c8e51313458fb9621 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:56:32 +0200 Subject: [PATCH 109/156] Update Mesh_3/include/CGAL/Mesh_cell_criteria_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index b13a9955521..f493eddf618 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -93,7 +93,7 @@ public: * bound will be refined. * * See Section \ref introsecparam for further details. - * Note that if one parameter is set to 0, then its corresponding criteria is ignored. + * Note that if one parameter is set to 0, then its corresponding criterion is ignored. */ Mesh_cell_criteria_3(const FT& radius_edge_bound, const FT& radius_bound, From 21b9f6dfb5b1e87ad9a728156f034e0105a63913 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:57:09 +0200 Subject: [PATCH 110/156] Update Mesh_3/include/CGAL/Mesh_cell_criteria_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index f493eddf618..b8bfd6cfdcf 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -32,7 +32,7 @@ namespace CGAL { The class `Mesh_cell_criteria_3` is a model of `MeshCellCriteria_3`. It provides, for the mesh tetrahedra, -a uniform shape criteria +a uniform shape criterion and a sizing field which may be a uniform or variable field. \tparam Tr must be identical to the nested type From 5b0857034536b8d1d5358c5cf6c580b22c0d665d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:57:41 +0200 Subject: [PATCH 111/156] Update Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 8ffc5d6f93a..8407722a0f5 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -111,7 +111,7 @@ struct IGT_generator The class `Polyhedral_mesh_domain_3` implements a domain defined by a simplicial polyhedral surface. -The input polyhedral surface must be free of intersection. +The input polyhedral surface must be free of intersections. It must include (at least) one closed connected component that defines the boundary of the domain to be meshed. Inside this bounding component, From acdb2d40c5ba1f3f15cc5553ee40d001dbc43878 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:58:24 +0200 Subject: [PATCH 112/156] Update Mesh_3/include/CGAL/Mesh_facet_criteria_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_facet_criteria_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h index 30adfbd26f4..50c36e047c4 100644 --- a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h @@ -93,7 +93,7 @@ public: /*! returns an object to serve as criteria for facets. - \param angle_bound is the lower bound for the angle in degrees of the + \param angle_bound is the lower bound for the angles in degrees of the surface mesh facets. \param radius_bound is a uniform upper bound for the radius of the surface Delaunay balls. From ba0172a544f578bdc92f62a6cda180d3157731a7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:59:30 +0200 Subject: [PATCH 113/156] Update Mesh_3/doc/Mesh_3/PackageDescription.txt Co-authored-by: Jane Tournois --- Mesh_3/doc/Mesh_3/PackageDescription.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index c4221f3cfbf..e063c6eeee7 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -84,7 +84,7 @@ related to the template parameters of some models of the main concepts: \cgalCRPSection{Classes} -- `CGAL::Mesh_triangulation_3` +- `CGAL::Mesh_triangulation_3` - `CGAL::Mesh_vertex_base_3` - `CGAL::Compact_mesh_cell_base_3` - `CGAL::Mesh_cell_base_3` From 41ae66aedfd52d8c377c1bc62158fa08618a400a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:42:59 +0200 Subject: [PATCH 114/156] Update Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h index c57f4e4d3b3..3bb106e1242 100644 --- a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h @@ -147,7 +147,7 @@ private: \ingroup PkgMesh3Domains The class `Implicit_multi_domain_to_labeling_function_wrapper` is a helping class to get a function with integer values -labeling the components of a multi-domain. The multidomain is described through a set of functions {fi(p), i=1, ...n}. +labeling the components of a multidomain. The multidomain is described through a set of functions {fi(p), i=1, ...n}. Each component corresponds to a sign vector [s1, s2, ..., sn] where si is the sign of the function fi(p) at a point p of the component. This wrapper class can be passed to `Labeled_mesh_domain_3` as first template parameter. From da5b2ae86286e8e03ccfdebe625229a333637515 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:46:33 +0200 Subject: [PATCH 115/156] Update Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7e5a82c03bf..7ef8b49f578 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 @@ -84,7 +84,7 @@ public: return points_.back(); } - /// returns `true` if the polyline is not degenerated + /// returns `true` if the polyline is not degenerate bool is_valid() const { return points_.size() > 1; From c42aa489498ec6402f8f96d8ad7257c7c9f86cc3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:47:16 +0200 Subject: [PATCH 116/156] Update Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7ef8b49f578..7bc7df1a573 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 `p` and `q`. + /// returns the 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 From c70d8670b3f5553ae831bab9a4048ae46800c82f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:47:50 +0200 Subject: [PATCH 117/156] Update Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7bc7df1a573..17a44a65d98 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 @@ -694,7 +694,7 @@ public: /// @} /// \name Implementation of the concept MeshDomainWithFeatures_3 - /// The following methods implement the requirement of the concept + /// The following methods implement the requirements of the concept /// `MeshDomainWithFeatures_3`. /// @{ From 626f0578f74df810a8a5cdd97fce5ef2cb58550a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:48:33 +0200 Subject: [PATCH 118/156] Update Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 17a44a65d98..5e7945f1151 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 @@ -699,7 +699,7 @@ public: /// @{ /// implements `MeshDomainWithFeatures_3::get_corners()`. - /// OutputIterator is std::pair + /// OutputIterator is `std::pair` template OutputIterator get_corners(OutputIterator out) const; From 913e8848c6250a6bbbb6cde8e0f3a333c7770e38 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:50:18 +0200 Subject: [PATCH 119/156] Update Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 33145d18b2e..824d7ed1a22 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -63,7 +63,7 @@ namespace CGAL { The class `Polyhedral_mesh_domain_with_features_3` implements a domain whose boundary is a simplicial polyhedral surface. -This surface must be free of intersection. It can either be closed, +This surface must be free of intersections. It can either be closed, included inside another polyhedral surface which is closed and free of intersection, or open. In the latter case, the meshing process will only take care of the quality of the 1D (features and boundaries) and 2D (surfaces) components of the mesh. From 2ef1bb4e48ad992b685b278350f7d06b93e9fd3d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:50:57 +0200 Subject: [PATCH 120/156] Update Mesh_3/include/CGAL/Mesh_polyhedron_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_polyhedron_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h index 8e053945d60..6ae077e5bf8 100644 --- a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h +++ b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h @@ -213,7 +213,7 @@ public: \ingroup PkgMesh3Domains The class `Mesh_polyhedron_3` provides a customized `Polyhedron_3` type. This type uses -as `PolyhedronItems_3` a customized type which adds data to the Vertex, Face and +as `PolyhedronItems_3` a customized type which adds data to the `Vertex`, `Face` and Halfedge classes. Those data are required to use the detection of sharp features. \tparam IGT stands for the geometric traits associated From 50f47a3f572b71c63d3d4183dfb9f0dfba19f946 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:51:23 +0200 Subject: [PATCH 121/156] Update Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 824d7ed1a22..593c0624258 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -64,7 +64,7 @@ The class `Polyhedral_mesh_domain_with_features_3` implements a domain whose boundary is a simplicial polyhedral surface. This surface must be free of intersections. It can either be closed, -included inside another polyhedral surface which is closed and free of intersection, +included inside another polyhedral surface which is closed and free of intersections, or open. In the latter case, the meshing process will only take care of the quality of the 1D (features and boundaries) and 2D (surfaces) components of the mesh. From de85effe56542df09887972e0532ebc1dc731e4b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:54:26 +0200 Subject: [PATCH 122/156] Update Mesh_3/include/CGAL/Mesh_polyhedron_3.h Co-authored-by: Jane Tournois --- Mesh_3/include/CGAL/Mesh_polyhedron_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h index 6ae077e5bf8..454c0c94aff 100644 --- a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h +++ b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h @@ -214,7 +214,7 @@ public: The class `Mesh_polyhedron_3` provides a customized `Polyhedron_3` type. This type uses as `PolyhedronItems_3` a customized type which adds data to the `Vertex`, `Face` and -Halfedge classes. Those data are required to use the detection of sharp features. +`Halfedge` classes. Those data are required to use the detection of sharp features. \tparam IGT stands for the geometric traits associated to the meshing process. It must be a model of the two concepts From b843f0b2a82e6ae646910bf154e1c26506381947 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 Jul 2023 11:35:42 +0100 Subject: [PATCH 123/156] CamelCase --- Mesh_3/include/CGAL/Mesh_facet_criteria_3.h | 6 +++--- Mesh_3/include/CGAL/refine_mesh_3.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h index 50c36e047c4..916e1073ac8 100644 --- a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h @@ -125,9 +125,9 @@ public: as above, except that the radius and distance bound parameters are functionals instead of constants. */ - template < typename Sizing_field, typename DistanceField > + template < typename SizingField, typename DistanceField > Mesh_facet_criteria_3(const FT& angle_bound, - const Sizing_field & radius_bound, + const SizingField & radius_bound, const DistanceField& distance_bound, const Mesh_facet_topology topology = FACET_VERTICES_ON_SURFACE, const FT& min_radius_bound = 0.) @@ -139,7 +139,7 @@ public: init_aspect(angle_bound); init_radius(radius_bound, - Mesh_3::Is_mesh_domain_field_3()); + Mesh_3::Is_mesh_domain_field_3()); init_distance(distance_bound, Mesh_3::Is_mesh_domain_field_3()); diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 78778059d35..284d54791f5 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -174,7 +174,7 @@ private: * 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 enable to enable or disable the optimizer. + * that enable/disable the optimizer. * * \cgalNamedParamsBegin * \cgalParamSectionBegin{Topological options (manifoldness)} From 1cce66c3434d07f1ddfa320d46fe1b724b1fa1a0 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 30 Jul 2023 12:59:17 +0200 Subject: [PATCH 124/156] Spelling corrections Spelling corrections `a e...` -> `an e...` --- .../doc/Algebraic_foundations/Concepts/EuclideanRing.h | 2 +- .../CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h | 2 +- .../include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h | 2 +- .../include/CGAL/Arr_batched_point_location.h | 2 +- .../include/CGAL/Arr_circular_line_arc_traits_2.h | 2 +- Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h | 2 +- .../Arr_batched_point_location_traits_2.h | 2 +- .../include/CGAL/Arr_vertical_decomposition_2.h | 2 +- .../Arrangement_2/Arrangement_on_surface_2_global.h | 2 +- .../include/CGAL/IO/Arr_text_formatter.h | 2 +- .../Surface_sweep_2/Arr_basic_insertion_traits_2.h | 2 +- .../Arr_no_intersection_insertion_ss_visitor.h | 2 +- .../CGAL/Surface_sweep_2/Arr_overlay_traits_2.h | 2 +- BGL/test/BGL/test_Gwdwg.cpp | 2 +- .../Boolean_set_operations_2/Gps_traits_decorator.h | 2 +- Circulator/doc/Circulator/CGAL/circulator.h | 4 ++-- .../doc/Cone_spanners_2/Cone_spanners_2.txt | 2 +- Documentation/doc/biblio/geom.bib | 4 ++-- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 2 +- .../CGAL/Hyperbolic_Delaunay_triangulation_2.h | 2 +- .../Hyperbolic_triangulation_2.txt | 10 +++++----- .../cmake/modules/CGAL_SetupCGALDependencies.cmake | 2 +- Installation/cmake/modules/FindTBB.cmake | 2 +- Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h | 2 +- Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h | 2 +- .../include/CGAL/Sqrt_extension/Fraction_traits.h | 2 +- .../test_p4ht2_locate.cpp | 2 +- .../CGAL/Polynomial/Algebraic_structure_traits.h | 2 +- Polynomial/include/CGAL/Polynomial/prs_resultant.h | 2 +- Polynomial/include/CGAL/Polynomial_traits_d.h | 2 +- .../doc/Spatial_searching/Concepts/GeneralDistance.h | 2 +- .../CGAL/Straight_skeleton_vertex_base_2.h | 2 +- .../CGAL/constructions/Straight_skeleton_cons_ftC2.h | 4 ++-- Surface_mesh/include/CGAL/Surface_mesh/Properties.h | 2 +- .../internal/auxiliary/graph.h | 2 +- .../Surface_mesh_topology/Surface_mesh_topology.txt | 2 +- 36 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h index 69421885198..7ae8d52ecc5 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h @@ -21,7 +21,7 @@ Moreover, `CGAL::Algebraic_structure_traits< EuclideanRing >` is a model of \cgalHeading{Remarks} -The most prominent example of a Euclidean ring are the integers. +The most prominent example of an Euclidean ring are the integers. Whenever both \f$ x\f$ and \f$ y\f$ are positive, then it is conventional to choose the smallest positive remainder \f$ r\f$. diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index 05b97af9bcd..dad6b92fb90 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -613,7 +613,7 @@ public: /* * \brief returns the indices of the ith event value * - * Returns a Event_indices (fg,ffy,ggy) such that + * Returns an Event_indices (fg,ffy,ggy) such that * the ith event root is the fgth root of the * resultant of \c f and \c g, the ffyth root of the * discriminant of \c f, and the ggyth root of the 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 81a74c56c38..9d262c4d172 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 @@ -254,7 +254,7 @@ public: /*! * \brief y-coordinate of this point * - * Note: In general, this method results in a extremely large polynomial + * Note: In general, this method results in an extremely large polynomial * for the y-coordinate. It is recommended to use it carefully, * and using get_approximation_y() instead whenever approximations suffice. */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h index af58c261240..fc7b9445914 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h @@ -105,7 +105,7 @@ locate(const Arrangement_on_surface_2& arr, } } - // Obtain a extended traits-class object. + // Obtain an extended traits-class object. const Gt2* geom_traits = arr.geometry_traits(); /* We would like to avoid copy construction of the geometry traits class. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h index 4d5c07d46ea..79c50ad680f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -459,7 +459,7 @@ namespace CGAL { } - // a empty class used to have different types between Curve_2 and X_monotone_curve_2 + // an empty class used to have different types between Curve_2 and X_monotone_curve_2 // in Arr_circular_line_arc_traits_2. namespace internal_Argt_traits{ struct Not_X_Monotone{}; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h index 19a95a662f6..e318449631f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h @@ -231,7 +231,7 @@ overlay(const Arrangement_on_surface_2& arr1 xcvs_vec[i] = Ovl_x_monotone_curve_2(eit2->curve(), invalid_he1, he2); } - // Obtain a extended traits-class object and define the sweep-line visitor. + // Obtain an extended traits-class object and define the sweep-line visitor. const typename Arr_res::Traits_adaptor_2* traits_adaptor = arr.traits_adaptor(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h index ce95e1da07a..4b80bb84dd5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h @@ -411,7 +411,7 @@ public: } }; - /*! Obtain a Equal_2 function object. */ + /*! Obtain an Equal_2 function object. */ Equal_2 equal_2_object() const { return (Equal_2(m_base_traits->equal_2_object())); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_vertical_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_vertical_decomposition_2.h index 3739d35a83a..75c8f25e0c9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_vertical_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_vertical_decomposition_2.h @@ -109,7 +109,7 @@ decompose(const Arrangement_on_surface_2& arr, } } - // Obtain a extended traits-class object. + // Obtain an extended traits-class object. const Gt2* geom_traits = arr.geometry_traits(); /* We would like to avoid copy construction of the geometry traits class. diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h index d54f4c2cb0e..35498a4dbfd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h @@ -737,7 +737,7 @@ insert_non_intersecting_curve if (vh1 != nullptr) { if (vh2 != nullptr) { - // Both endpoints are associated with a existing vertices. + // Both endpoints are associated with an existing vertices. // In this case insert_at_vertices() already returns a halfedge // directed from left to right. new_he = arr.insert_at_vertices(c, diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h index 34cb310fd07..332f1518179 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h @@ -524,7 +524,7 @@ public: /*! \class * A class defining a textual (\ascii) input/output format for arrangements * that store auxiliary dat with all their DCEL records, as they are templated - * by a extended DCEL class. + * by an extended DCEL class. */ template class Arr_extended_dcel_text_formatter : diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h index 953652180e5..1b6ee63cd92 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h @@ -440,7 +440,7 @@ public: { return (m_base_eq(p1.base(), p2.base())); } }; - /*! Obtain a Equal_2 function object */ + /*! Obtain an Equal_2 function object */ Equal_2 equal_2_object() const { return (Equal_2(m_base_traits->equal_2_object())); } diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_no_intersection_insertion_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_no_intersection_insertion_ss_visitor.h index e6d4d543144..e82e28b3164 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_no_intersection_insertion_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_no_intersection_insertion_ss_visitor.h @@ -23,7 +23,7 @@ * This class can be further split into two, where one derives from the other, * such that the derived class handles the case of inserting non-intersecting * curves into a non-empty arrangement, and the base class handles the case of - * inserting non-intersecting curves into a empty arrangement. + * inserting non-intersecting curves into an empty arrangement. */ #include diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h index b38fc25d344..17231f6eb5c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h @@ -705,7 +705,7 @@ public: { return m_base_equal(xcv1.base(), xcv2.base()); } }; - /*! Obtain a Equal_2 functor object. */ + /*! Obtain an Equal_2 functor object. */ Equal_2 equal_2_object() const { return Equal_2(m_base_traits->equal_2_object()); } diff --git a/BGL/test/BGL/test_Gwdwg.cpp b/BGL/test/BGL/test_Gwdwg.cpp index e250c5a63a2..08a742f0be1 100644 --- a/BGL/test/BGL/test_Gwdwg.cpp +++ b/BGL/test/BGL/test_Gwdwg.cpp @@ -22,7 +22,7 @@ int main() Mesh mesh2(sm2); try { if( target( *(halfedges(mesh).first), mesh2) == *(vertices(mesh).first)){ - CGAL_error_msg("The previous lie should have throw a exception"); + CGAL_error_msg("The previous line should have throw an exception"); } } catch(...){ std::cerr << "we caught it" << std::endl; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h index d9d6f19c1c9..41d7508d12e 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h @@ -387,7 +387,7 @@ public: } }; - /*! Get a Equal_2 functor object. */ + /*! Get an Equal_2 functor object. */ Equal_2 equal_2_object() const { return Equal_2(m_base_traits->equal_2_object()); diff --git a/Circulator/doc/Circulator/CGAL/circulator.h b/Circulator/doc/Circulator/CGAL/circulator.h index 7bfeae56805..2973413afd0 100644 --- a/Circulator/doc/Circulator/CGAL/circulator.h +++ b/Circulator/doc/Circulator/CGAL/circulator.h @@ -246,7 +246,7 @@ Circulator_from_iterator(); /*! a circulator `c` initialized to refer to the element `*cur` in a range `[begin, end)`. -The circulator `c` refers to a empty sequence +The circulator `c` refers to an empty sequence if `begin==end`. */ @@ -255,7 +255,7 @@ const I& end, const I& cur = begin); /*! a copy of circulator `d` referring to the element `*cur`. -The circulator `c` refers to a empty sequence +The circulator `c` refers to an empty sequence if `d` does so. */ diff --git a/Cone_spanners_2/doc/Cone_spanners_2/Cone_spanners_2.txt b/Cone_spanners_2/doc/Cone_spanners_2/Cone_spanners_2.txt index d21ef3f1aca..088fd1c5168 100644 --- a/Cone_spanners_2/doc/Cone_spanners_2/Cone_spanners_2.txt +++ b/Cone_spanners_2/doc/Cone_spanners_2/Cone_spanners_2.txt @@ -304,7 +304,7 @@ and `Construct_yao_graph_2` construct full Theta and Yao graphs. They also provi to compute Half Theta and Yao graphs. As mentioned in Section \ref sec_CBS_mydefinitions, only the edges for the odd or even cones are added to the graph in an Half Theta and Yao graph. To do so, the constructor of the functors provides a parameter of type -`Cones_selected` which is a enumeration that contains the following possible values: +`Cones_selected` which is an enumeration that contains the following possible values: `ALL_CONES`, `EVEN_CONES` and `ODD_CONES`. Users should include the `CGAL/Cone_spanners_enum_2.h` header file to use these enum values. The following are the examples on the functor constructions for Half Theta and Yao Graphs. diff --git a/Documentation/doc/biblio/geom.bib b/Documentation/doc/biblio/geom.bib index 969a1a79b5b..6b7c6366af7 100644 --- a/Documentation/doc/biblio/geom.bib +++ b/Documentation/doc/biblio/geom.bib @@ -33579,7 +33579,7 @@ the problem of processing the all-pairs Euclidean {\em short} path queries is that of reporting an obstacle-avoiding path $P$ (or its length) between two arbitrary query points $p$ and $q$ in the plane, such that the length of $P$ is within a small factor of the -length of a Euclidean {\em shortest} obstacle-avoiding path between +length of an Euclidean {\em shortest} obstacle-avoiding path between $p$ and $q$. The goal is to answer each short path query quickly by constructing data structures that capture path information in the obstacle-scattered plane. For the related all-pairs Euclidean @@ -120365,7 +120365,7 @@ Contains C code." , keywords = "Polynomial time approximation schemes, optimal algorithms, derandomization, Traveling salesman tour, Steiner minimum tree, Minimum spanning tree, Minimum matchings, 2-matchings, Edge cover, Rectilinear Steiner minimum tree, quadtrees, spanners, banyans." , update = "00.11 smid, 00.07 smid, 98.03 mitchell" , abstract = " -We give deterministic and randomized algorithms to find a Euclidean +We give deterministic and randomized algorithms to find an Euclidean traveling salesman tour (TST) of length within $(1+1/s)$ times optimal. They run in $O(N \log N)$ time and $O(N)$ space for constant dimension and $s$. These time and space bounds are optimal in an diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 0950301c127..cd505d53540 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -194,7 +194,7 @@ This method is automatically called once, before the first call to paintGL(). Overload init() instead of this method to modify viewer specific OpenGL state. -If a 4.3 context could not be set, a ES 2.0 context will be used instead. +If a 4.3 context could not be set, an ES 2.0 context will be used instead. \see `isOpenGL_4_3()` */ CGAL_INLINE_FUNCTION 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 19e4c668351..4d2b45ca343 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 @@ -208,7 +208,7 @@ public: /// @{ /*! Inserts the point `p` in the triangulation. - If the point `p` coincides with a existing vertex, then the vertex is returned + If the point `p` coincides with an existing vertex, then the vertex is returned and the triangulation is not modified. The optional parameter `start` is used to initialize the location of `p`. */ diff --git a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Hyperbolic_triangulation_2.txt b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Hyperbolic_triangulation_2.txt index d5b32a20979..ed546716b1f 100644 --- a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Hyperbolic_triangulation_2.txt +++ b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Hyperbolic_triangulation_2.txt @@ -27,7 +27,7 @@ H_\infty\f$ of points at infinity. In this model, a hyperbolic line is either an arc of circle perpendicular to the unit circle or, if it passes through the origin, -a diameter of the unit disk. A hyperbolic circle is a Euclidean +a diameter of the unit disk. A hyperbolic circle is an Euclidean circle contained in the unit disk; however, its hyperbolic center and radius are not the same as its Euclidean center and radius. @@ -53,9 +53,9 @@ precisely, the hyperbolic Delaunay triangulation of \f$\mathcal P\f$ only contains the simplices of the Euclidean Delaunay triangulation that are hyperbolic:
      -
    • A Euclidean Delaunay face is hyperbolic if its +
    • An Euclidean Delaunay face is hyperbolic if its circumscribing circle is contained in \f$\mathbb H^2\f$. -
    • A Euclidean Delaunay edge is hyperbolic if one of the +
    • An Euclidean Delaunay edge is hyperbolic if one of the empty disks (i.e., not containing any point of \f$\mathcal P\f$) passing through its endpoints is contained in \f$\mathbb H^2\f$. @@ -138,13 +138,13 @@ The example below shows how user-defined info can be added to the hyperbolic fac We have measured the insertion execution time of our implementation with both traits classes `CGAL::Hyperbolic_Delaunay_triangulation_CK_traits_2` and `CGAL::Hyperbolic_Delaunay_triangulation_traits_2` with their default template -parameters against the insertion time in a Euclidean \cgal triangulation. +parameters against the insertion time in an Euclidean \cgal triangulation. We generate 1 million random points, uniformly distributed in the unit disk with respect to the Euclidean metric. We insert the same set of points in three triangulations:
      • a hyperbolic Delaunay triangulation with `CGAL::Hyperbolic_Delaunay_triangulation_traits_2` (%CORE traits) as traits class;
      • a hyperbolic Delaunay triangulation with `CGAL::Hyperbolic_Delaunay_triangulation_CK_traits_2` (CK traits) as traits class; -
      • a Euclidean Delaunay triangulation with `CGAL::Exact_predicates_inexact_constructions_kernel` (EPICK) as traits class. +
      • an Euclidean Delaunay triangulation with `CGAL::Exact_predicates_inexact_constructions_kernel` (EPICK) as traits class.
      We create two instances of each type of triangulation. In one instance we insert the points one by one, which causes non-hyperbolic faces to be filtered out at each insertion. In the other instance we insert the points via iterator diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index 355bde0dd6d..1d51bbbdac5 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -15,7 +15,7 @@ # .. variable:: CGAL_DISABLE_GMP # # If set, the `GMP` library will not be used. If -# :variable:`WITH_LEDA` is not used either, a efficient exact +# :variable:`WITH_LEDA` is not used either, an efficient exact # number types are used by CGAL kernels for exact computation. # # .. variable:: WITH_LEDA diff --git a/Installation/cmake/modules/FindTBB.cmake b/Installation/cmake/modules/FindTBB.cmake index 4e808b39eee..23ec7180e34 100644 --- a/Installation/cmake/modules/FindTBB.cmake +++ b/Installation/cmake/modules/FindTBB.cmake @@ -84,7 +84,7 @@ function(tbb_extract_real_library library real_library) set(_elf_magic "7f454c46") file(READ ${library} _hex_data OFFSET 0 LIMIT 4 HEX) if(_hex_data STREQUAL _elf_magic) - #we have opened a elf binary so this is what + #we have opened an elf binary so this is what #we should link to set(${real_library} "${library}" PARENT_SCOPE) return() diff --git a/Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h b/Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h index ae3aec7f350..d18631c63cf 100644 --- a/Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h +++ b/Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h @@ -6,7 +6,7 @@ namespace CGAL { The class `Extended_homogeneous` serves as a traits class for the class `Nef_polyhedron_2`. It uses a polynomial component -representation based on a Euclidean ring number type `RT`. +representation based on an Euclidean ring number type `RT`. \cgalModels `ExtendedKernelTraits_2` diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h b/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h index 7c09b4eaf0c..994c6a41b80 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h @@ -34,7 +34,7 @@ namespace CGAL { /*{\Manpage {SM_io_parser}{Decorator_}{IO of embedded maps}{IO}}*/ /*{\Mdefinition An instance |\Mvar| of the data type |\Mname| is a -decorator to provide input and output of a embedded map. |\Mtype| is +decorator to provide input and output of an embedded map. |\Mtype| is generic with respect to the |Decorator_| parameter. |Decorator_| has to be a decorator model of our |SM_decorator| concept.}*/ diff --git a/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h b/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h index 80e67f1ea86..ceb0515c0d1 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h @@ -41,7 +41,7 @@ namespace Intern{ * * Extensions provide suitable specializations of \c CGAL::Fraction_traits. * They are decomposable iff their coefficient type is. - * The denominator \e d of a Extension \e ext is a low common multiple + * The denominator \e d of an Extension \e ext is a low common multiple * (see \c CGAL::Fraction_traits::Common_factor for details) of the * denominators of its coefficients. The numerator is the Extenion * \e d*ext with a fraction-free coefficient type. diff --git a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/test_p4ht2_locate.cpp b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/test_p4ht2_locate.cpp index 87c787ddb2b..62cfc0c3580 100644 --- a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/test_p4ht2_locate.cpp +++ b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/test_p4ht2_locate.cpp @@ -57,7 +57,7 @@ int main(int, char**) std::cout << " dummy point " << j << ": OK " << std::endl; } - std::cout << "---- locating the midpoint of a Euclidean segment ----" << std::endl; + std::cout << "---- locating the midpoint of an Euclidean segment ----" << std::endl; Point p1 = tr.get_dummy_point(0), p2 = tr.get_dummy_point(1); Point query = midpoint(p1, p2); fh = tr.hyperbolic_locate(query, lt, li); diff --git a/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h b/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h index f989b8ff201..0ebb99ce5dd 100644 --- a/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h +++ b/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h @@ -241,7 +241,7 @@ class Polynomial_algebraic_structure_traits_base< POLY, Unique_factorization_dom }; }; -// Clone this for a EuclideanRing +// Clone this for an EuclideanRing template< class POLY > class Polynomial_algebraic_structure_traits_base< POLY, Euclidean_ring_tag > : public Polynomial_algebraic_structure_traits_base< POLY, diff --git a/Polynomial/include/CGAL/Polynomial/prs_resultant.h b/Polynomial/include/CGAL/Polynomial/prs_resultant.h index 87a150b1499..f4de96b3ec3 100644 --- a/Polynomial/include/CGAL/Polynomial/prs_resultant.h +++ b/Polynomial/include/CGAL/Polynomial/prs_resultant.h @@ -225,7 +225,7 @@ NT prs_resultant_decompose(Polynomial A, Polynomial B){ * subresultant version. This depends on the coefficient type: * If \c NT is a \c UFDomain , the subresultant PRS is formed. * If \c NT is a \c Field that is not decomposable (see - * \c CGAL::Fraction_traits ), then a Euclidean PRS is formed. + * \c CGAL::Fraction_traits ), then an Euclidean PRS is formed. * If \c NT is a \c Field that is decomposable, then the * \c Numerator must be a \c UFDomain, and the subresultant * PRS is formed for the decomposed polynomials. diff --git a/Polynomial/include/CGAL/Polynomial_traits_d.h b/Polynomial/include/CGAL/Polynomial_traits_d.h index f7a4d3993e3..366da066d2f 100644 --- a/Polynomial/include/CGAL/Polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Polynomial_traits_d.h @@ -462,7 +462,7 @@ private: // We use our own Strict Weak Ordering predicate in order to avoid - // problems when calling sort for a Exponents_coeff_pair where the + // problems when calling sort for an Exponents_coeff_pair where the // coeff type has no comparison operators available. private: struct Compare_exponents_coeff_pair diff --git a/Spatial_searching/doc/Spatial_searching/Concepts/GeneralDistance.h b/Spatial_searching/doc/Spatial_searching/Concepts/GeneralDistance.h index fd72ee75e07..1b19d9598ca 100644 --- a/Spatial_searching/doc/Spatial_searching/Concepts/GeneralDistance.h +++ b/Spatial_searching/doc/Spatial_searching/Concepts/GeneralDistance.h @@ -5,7 +5,7 @@ Requirements of a distance class defining a distance between a query item denoting a spatial object and a point. To optimize distance computations transformed distances are used, -e.g., for a Euclidean distance the transformed distance is the squared +e.g., for an Euclidean distance the transformed distance is the squared Euclidean distance. \cgalHasModel `CGAL::Manhattan_distance_iso_box_point` diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_vertex_base_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_vertex_base_2.h index fb30f495c46..389c4cb9053 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_vertex_base_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_vertex_base_2.h @@ -11,7 +11,7 @@ which is the vertex type required by the `StraightSkeleton_2` concept. \tparam Refs must be a model of `StraightSkeleton_2` \tparam Point a Point type \tparam FT must be a model of the `FieldWithSqrt`, which is the numeric type used to represent - the time of a vertex (a Euclidean distance). + the time of a vertex (an Euclidean distance). This class can be used as a base class allowing users of the straight skeleton data structure to decorate a vertex with additional data. The concrete vertex class must be given in the `HalfedgeDSItems` diff --git a/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h b/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h index b968c287195..ab4492aea32 100644 --- a/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h @@ -328,7 +328,7 @@ construct_trisegment ( Segment_2_with_ID const& e0, // If the lines do not intersect, for example, for collinear edges, or parallel edges but with the same orientation, // returns 0 (the actual distance is undefined in this case, but 0 is a useful return) // -// NOTE: The result is a explicit rational number returned as a tuple (num,den); the caller must check that den!=0 manually +// NOTE: The result is an explicit rational number returned as a tuple (num,den); the caller must check that den!=0 manually // (a predicate for instance should return indeterminate in this case) // // PRECONDITION: None of e0, e1 and e2 are collinear (but two of them can be parallel) @@ -596,7 +596,7 @@ compute_artifical_isec_timeC2 ( Trisegment_2_ptr< Trisegment_2 *nodeptr_block; void (*error_function)(const char - *); /* this function is called if a error occurs, + *); /* this function is called if an error occurs, with a corresponding error message (or exit(1) is called if it's nullptr) */ diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/Surface_mesh_topology.txt b/Surface_mesh_topology/doc/Surface_mesh_topology/Surface_mesh_topology.txt index 4ce425fb91f..d11557c2f2c 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/Surface_mesh_topology.txt +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/Surface_mesh_topology.txt @@ -31,7 +31,7 @@ The algorithm to find a shortest non-contractible curve through a specified vert \subsection SMTopology_homotopy Homotopy Test -Given a curve drawn on a surface one can ask if the curve can be continuously deformed to a point (i.e. a zero length curve). In other words, does there exist a continuous sequence of curves on the surface that starts with the input curve and ends to a point? Curves that deform to a point are said contractible. Any curve on a sphere is contractible but this is not true for all curves on a torus or on a surface with more complicated topology. The algorithms in this section are purely topological and do not assume any geometry on the input surface. In particular, the surface is not necessarily embedded in a Euclidean space. +Given a curve drawn on a surface one can ask if the curve can be continuously deformed to a point (i.e. a zero length curve). In other words, does there exist a continuous sequence of curves on the surface that starts with the input curve and ends to a point? Curves that deform to a point are said contractible. Any curve on a sphere is contractible but this is not true for all curves on a torus or on a surface with more complicated topology. The algorithms in this section are purely topological and do not assume any geometry on the input surface. In particular, the surface is not necessarily embedded in an Euclidean space. The algorithm implemented in this package builds a data structure to efficiently answer queries of the following forms: - Given a combinatorial surface \f$\cal{M}\f$ and a closed combinatorial curve specified as a sequence of edges of \f$\cal{M}\f$, decide if the curve is contractible on \f$\cal{M}\f$, From 40c7765ffb232ee6b421317401c1b2d226fc5bc9 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 30 Jul 2023 17:54:10 +0200 Subject: [PATCH 125/156] Spelling corrections Corrections based on review --- .../doc/Algebraic_foundations/Concepts/EuclideanRing.h | 4 ++-- .../CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h | 2 +- .../Arr_batched_point_location_traits_2.h | 2 +- .../Arrangement_2/Arrangement_on_surface_2_global.h | 2 +- .../Surface_sweep_2/Arr_basic_insertion_traits_2.h | 2 +- .../CGAL/Surface_sweep_2/Arr_overlay_traits_2.h | 2 +- .../Boolean_set_operations_2/Gps_traits_decorator.h | 2 +- Documentation/doc/biblio/geom.bib | 4 ++-- .../Hyperbolic_triangulation_2.txt | 10 +++++----- .../include/CGAL/Hyperbolic_Delaunay_triangulation_2.h | 4 ++-- Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h | 2 +- .../include/CGAL/Sqrt_extension/Fraction_traits.h | 4 ++-- .../test_p4ht2_locate.cpp | 2 +- .../CGAL/Polynomial/Algebraic_structure_traits.h | 2 +- Polynomial/include/CGAL/Polynomial/prs_resultant.h | 2 +- Polynomial/include/CGAL/Polynomial_traits_d.h | 2 +- .../doc/Spatial_searching/Concepts/GeneralDistance.h | 2 +- .../Spatial_searching/Concepts/OrthogonalDistance.h | 2 +- .../doc/Spatial_searching/Spatial_searching.txt | 2 +- .../CGAL/Straight_skeleton_vertex_base_2.h | 2 +- .../Concepts/PolygonOffsetBuilderTraits_2.h | 2 +- .../Concepts/StraightSkeletonBuilderTraits_2.h | 4 ++-- .../Concepts/StraightSkeletonVertex_2.h | 2 +- .../Surface_mesh_parameterization.txt | 2 +- .../CGAL/Curves_on_surface_topology.h | 2 +- .../Surface_mesh_topology/Surface_mesh_topology.txt | 2 +- 26 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h index 7ae8d52ecc5..a1ea3df6e96 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/Concepts/EuclideanRing.h @@ -3,7 +3,7 @@ \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \cgalConcept -A model of `EuclideanRing` represents an euclidean ring (or Euclidean domain). +A model of `EuclideanRing` represents a Euclidean ring (or Euclidean domain). It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to \f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$. @@ -21,7 +21,7 @@ Moreover, `CGAL::Algebraic_structure_traits< EuclideanRing >` is a model of \cgalHeading{Remarks} -The most prominent example of an Euclidean ring are the integers. +The most prominent example of a Euclidean ring are the integers. Whenever both \f$ x\f$ and \f$ y\f$ are positive, then it is conventional to choose the smallest positive remainder \f$ r\f$. diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index dad6b92fb90..1f289de4787 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -613,7 +613,7 @@ public: /* * \brief returns the indices of the ith event value * - * Returns an Event_indices (fg,ffy,ggy) such that + * Returns an `Event_indices` (fg,ffy,ggy) such that * the ith event root is the fgth root of the * resultant of \c f and \c g, the ffyth root of the * discriminant of \c f, and the ggyth root of the diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h index 4b80bb84dd5..b83ca0189e2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_batched_point_location_traits_2.h @@ -411,7 +411,7 @@ public: } }; - /*! Obtain an Equal_2 function object. */ + /*! Obtain an `Equal_2` function object. */ Equal_2 equal_2_object() const { return (Equal_2(m_base_traits->equal_2_object())); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h index 35498a4dbfd..80a29123168 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h @@ -737,7 +737,7 @@ insert_non_intersecting_curve if (vh1 != nullptr) { if (vh2 != nullptr) { - // Both endpoints are associated with an existing vertices. + // Both endpoints are associated with existing vertices. // In this case insert_at_vertices() already returns a halfedge // directed from left to right. new_he = arr.insert_at_vertices(c, diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h index 1b6ee63cd92..1418044d5f4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h @@ -440,7 +440,7 @@ public: { return (m_base_eq(p1.base(), p2.base())); } }; - /*! Obtain an Equal_2 function object */ + /*! Obtain an `Equal_2` function object */ Equal_2 equal_2_object() const { return (Equal_2(m_base_traits->equal_2_object())); } diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h index 17231f6eb5c..bde6981c768 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h @@ -705,7 +705,7 @@ public: { return m_base_equal(xcv1.base(), xcv2.base()); } }; - /*! Obtain an Equal_2 functor object. */ + /*! Obtain an `Equal_2` functor object. */ Equal_2 equal_2_object() const { return Equal_2(m_base_traits->equal_2_object()); } diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h index 41d7508d12e..cf1574c6ace 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h @@ -387,7 +387,7 @@ public: } }; - /*! Get an Equal_2 functor object. */ + /*! Get an `Equal_2` functor object. */ Equal_2 equal_2_object() const { return Equal_2(m_base_traits->equal_2_object()); diff --git a/Documentation/doc/biblio/geom.bib b/Documentation/doc/biblio/geom.bib index 6b7c6366af7..969a1a79b5b 100644 --- a/Documentation/doc/biblio/geom.bib +++ b/Documentation/doc/biblio/geom.bib @@ -33579,7 +33579,7 @@ the problem of processing the all-pairs Euclidean {\em short} path queries is that of reporting an obstacle-avoiding path $P$ (or its length) between two arbitrary query points $p$ and $q$ in the plane, such that the length of $P$ is within a small factor of the -length of an Euclidean {\em shortest} obstacle-avoiding path between +length of a Euclidean {\em shortest} obstacle-avoiding path between $p$ and $q$. The goal is to answer each short path query quickly by constructing data structures that capture path information in the obstacle-scattered plane. For the related all-pairs Euclidean @@ -120365,7 +120365,7 @@ Contains C code." , keywords = "Polynomial time approximation schemes, optimal algorithms, derandomization, Traveling salesman tour, Steiner minimum tree, Minimum spanning tree, Minimum matchings, 2-matchings, Edge cover, Rectilinear Steiner minimum tree, quadtrees, spanners, banyans." , update = "00.11 smid, 00.07 smid, 98.03 mitchell" , abstract = " -We give deterministic and randomized algorithms to find an Euclidean +We give deterministic and randomized algorithms to find a Euclidean traveling salesman tour (TST) of length within $(1+1/s)$ times optimal. They run in $O(N \log N)$ time and $O(N)$ space for constant dimension and $s$. These time and space bounds are optimal in an diff --git a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Hyperbolic_triangulation_2.txt b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Hyperbolic_triangulation_2.txt index ed546716b1f..d5b32a20979 100644 --- a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Hyperbolic_triangulation_2.txt +++ b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Hyperbolic_triangulation_2.txt @@ -27,7 +27,7 @@ H_\infty\f$ of points at infinity. In this model, a hyperbolic line is either an arc of circle perpendicular to the unit circle or, if it passes through the origin, -a diameter of the unit disk. A hyperbolic circle is an Euclidean +a diameter of the unit disk. A hyperbolic circle is a Euclidean circle contained in the unit disk; however, its hyperbolic center and radius are not the same as its Euclidean center and radius. @@ -53,9 +53,9 @@ precisely, the hyperbolic Delaunay triangulation of \f$\mathcal P\f$ only contains the simplices of the Euclidean Delaunay triangulation that are hyperbolic:
        -
      • An Euclidean Delaunay face is hyperbolic if its +
      • A Euclidean Delaunay face is hyperbolic if its circumscribing circle is contained in \f$\mathbb H^2\f$. -
      • An Euclidean Delaunay edge is hyperbolic if one of the +
      • A Euclidean Delaunay edge is hyperbolic if one of the empty disks (i.e., not containing any point of \f$\mathcal P\f$) passing through its endpoints is contained in \f$\mathbb H^2\f$. @@ -138,13 +138,13 @@ The example below shows how user-defined info can be added to the hyperbolic fac We have measured the insertion execution time of our implementation with both traits classes `CGAL::Hyperbolic_Delaunay_triangulation_CK_traits_2` and `CGAL::Hyperbolic_Delaunay_triangulation_traits_2` with their default template -parameters against the insertion time in an Euclidean \cgal triangulation. +parameters against the insertion time in a Euclidean \cgal triangulation. We generate 1 million random points, uniformly distributed in the unit disk with respect to the Euclidean metric. We insert the same set of points in three triangulations:
        • a hyperbolic Delaunay triangulation with `CGAL::Hyperbolic_Delaunay_triangulation_traits_2` (%CORE traits) as traits class;
        • a hyperbolic Delaunay triangulation with `CGAL::Hyperbolic_Delaunay_triangulation_CK_traits_2` (CK traits) as traits class; -
        • an Euclidean Delaunay triangulation with `CGAL::Exact_predicates_inexact_constructions_kernel` (EPICK) as traits class. +
        • a Euclidean Delaunay triangulation with `CGAL::Exact_predicates_inexact_constructions_kernel` (EPICK) as traits class.
        We create two instances of each type of triangulation. In one instance we insert the points one by one, which causes non-hyperbolic faces to be filtered out at each insertion. In the other instance we insert the points via iterator 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 538991692ba..d95bfe27fba 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h @@ -880,7 +880,7 @@ public: Face_handle locate(const Point& query, Locate_type& lt, int &li, Face_handle hint = Face_handle()) const { - // Perform an Euclidean location first and get close to the hyperbolic face containing the query point + // Perform a Euclidean location first and get close to the hyperbolic face containing the query point typename Base::Locate_type blt; Face_handle fh = Base::locate(query, blt, li, hint); @@ -901,7 +901,7 @@ public: CGAL_assertion(!is_infinite(fh)); - // This case corresponds to when the point is located on an Euclidean edge. + // This case corresponds to when the point is located on a Euclidean edge. if(lt == EDGE) { // Here because the call to `side_of_hyperbolic_triangle` might change `li` diff --git a/Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h b/Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h index d18631c63cf..ae3aec7f350 100644 --- a/Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h +++ b/Nef_2/doc/Nef_2/CGAL/Extended_homogeneous.h @@ -6,7 +6,7 @@ namespace CGAL { The class `Extended_homogeneous` serves as a traits class for the class `Nef_polyhedron_2`. It uses a polynomial component -representation based on an Euclidean ring number type `RT`. +representation based on a Euclidean ring number type `RT`. \cgalModels `ExtendedKernelTraits_2` diff --git a/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h b/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h index ceb0515c0d1..a4daeef3828 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h @@ -41,9 +41,9 @@ namespace Intern{ * * Extensions provide suitable specializations of \c CGAL::Fraction_traits. * They are decomposable iff their coefficient type is. - * The denominator \e d of an Extension \e ext is a low common multiple + * The denominator \e d of an extension \e ext is a low common multiple * (see \c CGAL::Fraction_traits::Common_factor for details) of the - * denominators of its coefficients. The numerator is the Extenion + * denominators of its coefficients. The numerator is the extenion * \e d*ext with a fraction-free coefficient type. * * This works for nested Sqrt_extensions, too. diff --git a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/test_p4ht2_locate.cpp b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/test_p4ht2_locate.cpp index 62cfc0c3580..87c787ddb2b 100644 --- a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/test_p4ht2_locate.cpp +++ b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/test_p4ht2_locate.cpp @@ -57,7 +57,7 @@ int main(int, char**) std::cout << " dummy point " << j << ": OK " << std::endl; } - std::cout << "---- locating the midpoint of an Euclidean segment ----" << std::endl; + std::cout << "---- locating the midpoint of a Euclidean segment ----" << std::endl; Point p1 = tr.get_dummy_point(0), p2 = tr.get_dummy_point(1); Point query = midpoint(p1, p2); fh = tr.hyperbolic_locate(query, lt, li); diff --git a/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h b/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h index 0ebb99ce5dd..f989b8ff201 100644 --- a/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h +++ b/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h @@ -241,7 +241,7 @@ class Polynomial_algebraic_structure_traits_base< POLY, Unique_factorization_dom }; }; -// Clone this for an EuclideanRing +// Clone this for a EuclideanRing template< class POLY > class Polynomial_algebraic_structure_traits_base< POLY, Euclidean_ring_tag > : public Polynomial_algebraic_structure_traits_base< POLY, diff --git a/Polynomial/include/CGAL/Polynomial/prs_resultant.h b/Polynomial/include/CGAL/Polynomial/prs_resultant.h index f4de96b3ec3..87a150b1499 100644 --- a/Polynomial/include/CGAL/Polynomial/prs_resultant.h +++ b/Polynomial/include/CGAL/Polynomial/prs_resultant.h @@ -225,7 +225,7 @@ NT prs_resultant_decompose(Polynomial A, Polynomial B){ * subresultant version. This depends on the coefficient type: * If \c NT is a \c UFDomain , the subresultant PRS is formed. * If \c NT is a \c Field that is not decomposable (see - * \c CGAL::Fraction_traits ), then an Euclidean PRS is formed. + * \c CGAL::Fraction_traits ), then a Euclidean PRS is formed. * If \c NT is a \c Field that is decomposable, then the * \c Numerator must be a \c UFDomain, and the subresultant * PRS is formed for the decomposed polynomials. diff --git a/Polynomial/include/CGAL/Polynomial_traits_d.h b/Polynomial/include/CGAL/Polynomial_traits_d.h index 366da066d2f..6eb4f0d6e3f 100644 --- a/Polynomial/include/CGAL/Polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Polynomial_traits_d.h @@ -462,7 +462,7 @@ private: // We use our own Strict Weak Ordering predicate in order to avoid - // problems when calling sort for an Exponents_coeff_pair where the + // problems when calling sort for an `Exponents_coeff_pair` where the // coeff type has no comparison operators available. private: struct Compare_exponents_coeff_pair diff --git a/Spatial_searching/doc/Spatial_searching/Concepts/GeneralDistance.h b/Spatial_searching/doc/Spatial_searching/Concepts/GeneralDistance.h index 1b19d9598ca..fd72ee75e07 100644 --- a/Spatial_searching/doc/Spatial_searching/Concepts/GeneralDistance.h +++ b/Spatial_searching/doc/Spatial_searching/Concepts/GeneralDistance.h @@ -5,7 +5,7 @@ Requirements of a distance class defining a distance between a query item denoting a spatial object and a point. To optimize distance computations transformed distances are used, -e.g., for an Euclidean distance the transformed distance is the squared +e.g., for a Euclidean distance the transformed distance is the squared Euclidean distance. \cgalHasModel `CGAL::Manhattan_distance_iso_box_point` diff --git a/Spatial_searching/doc/Spatial_searching/Concepts/OrthogonalDistance.h b/Spatial_searching/doc/Spatial_searching/Concepts/OrthogonalDistance.h index d2a398589d8..d5b2af664e8 100644 --- a/Spatial_searching/doc/Spatial_searching/Concepts/OrthogonalDistance.h +++ b/Spatial_searching/doc/Spatial_searching/Concepts/OrthogonalDistance.h @@ -4,7 +4,7 @@ Requirements of an orthogonal distance class supporting incremental distance updates. To optimize distance computations transformed distances are used. -E.g., for an Euclidean distance the transformed distance is the squared Euclidean distance. +E.g., for a Euclidean distance the transformed distance is the squared Euclidean distance. \cgalRefines{GeneralDistance} diff --git a/Spatial_searching/doc/Spatial_searching/Spatial_searching.txt b/Spatial_searching/doc/Spatial_searching/Spatial_searching.txt index afa3a3eb0ca..b6f06106069 100644 --- a/Spatial_searching/doc/Spatial_searching/Spatial_searching.txt +++ b/Spatial_searching/doc/Spatial_searching/Spatial_searching.txt @@ -282,7 +282,7 @@ scenarios for different splitter types. \subsection Spatial_searchingExampleforKNeighborSearching Example for K Neighbor Searching -The first example illustrates k neighbor searching with an Euclidean +The first example illustrates k neighbor searching with a Euclidean distance and 2-dimensional points. The generated random data points are inserted in a search tree. We then initialize the k neighbor search object with the origin as query. Finally, we diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_vertex_base_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_vertex_base_2.h index 389c4cb9053..fb30f495c46 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_vertex_base_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_vertex_base_2.h @@ -11,7 +11,7 @@ which is the vertex type required by the `StraightSkeleton_2` concept. \tparam Refs must be a model of `StraightSkeleton_2` \tparam Point a Point type \tparam FT must be a model of the `FieldWithSqrt`, which is the numeric type used to represent - the time of a vertex (an Euclidean distance). + the time of a vertex (a Euclidean distance). This class can be used as a base class allowing users of the straight skeleton data structure to decorate a vertex with additional data. The concrete vertex class must be given in the `HalfedgeDSItems` diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/PolygonOffsetBuilderTraits_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/PolygonOffsetBuilderTraits_2.h index d0c364262cb..0c9bd5a352e 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/PolygonOffsetBuilderTraits_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/PolygonOffsetBuilderTraits_2.h @@ -41,7 +41,7 @@ Must provide `boost::optional operator()(const FT& t, const Segment_2& e0, const Segment_2& e1, const Trisegment_2_ptr& et) const`, which constructs the point of intersection of the lines obtained by offsetting -the oriented lines given by `e0` and `e0` an Euclidean distance `t`. +the oriented lines given by `e0` and `e0` a Euclidean distance `t`. If `e0` and `e1` are collinear, if `et` is not specified (`nullptr`), then the midpoint should be returned, otherwise, the event point of `et` should be returned. diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonBuilderTraits_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonBuilderTraits_2.h index f971c1c880c..2b27a072c43 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonBuilderTraits_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonBuilderTraits_2.h @@ -67,8 +67,8 @@ Must provide `bool operator()( const Trisegment_2_ptr& tri_segment, boost::optional max_time ) const`, which determines if, given the three oriented lines defined by the three input edges, -there exists an Euclidean distance `t >= 0` and `t <= max_time` for which the corresponding three -offset lines at `t` (parallel lines at an Euclidean distance of `t`) intersect in a single point. +there exists a Euclidean distance `t >= 0` and `t <= max_time` for which the corresponding three +offset lines at `t` (parallel lines at a Euclidean distance of `t`) intersect in a single point. \pre Each edge in the triple must properly define an oriented line, that is, its points cannot be coincident. */ diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonVertex_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonVertex_2.h index 7a26285dccf..1b66e17ee69 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonVertex_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/Concepts/StraightSkeletonVertex_2.h @@ -26,7 +26,7 @@ The type of the 2D point being the geometric embedding of the vertex typedef unspecified_type Point_2; /*! -A model of the `FieldWithSqrt` concept representing the time of a vertex (an Euclidean distance) +A model of the `FieldWithSqrt` concept representing the time of a vertex (a Euclidean distance) */ typedef unspecified_type FT; diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt index 3a876b5977a..c4be5d3c0fb 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt @@ -441,7 +441,7 @@ Orbifold-Tutte Planar Embedding was introduced by Aigerman and Lipman \cgalCite{ and is a generalization of Tutte’s embedding to other topologies, and in particular spheres, which we consider here. The orbifold-Tutte embedding bijectively maps the original surface, that is required to be a topological ball, to a canonical, -topologically equivalent, two-dimensional flat surface called an Euclidean orbifold. +topologically equivalent, two-dimensional flat surface called a Euclidean orbifold. There are 17 Euclidean orbifolds, of which only the 4 sphere orbifolds are currently implemented in CGAL. diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Curves_on_surface_topology.h b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Curves_on_surface_topology.h index d8fafdc0304..21a7c20ee0e 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Curves_on_surface_topology.h +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Curves_on_surface_topology.h @@ -91,7 +91,7 @@ namespace Surface_mesh_topology { /// Number type of the weights. using Weight_t=double; - /// creates an Euclidean_length_weight_functor given a mesh. + /// creates a Euclidean_length_weight_functor given a mesh. Euclidean_length_weight_functor(const Mesh& m); }; diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/Surface_mesh_topology.txt b/Surface_mesh_topology/doc/Surface_mesh_topology/Surface_mesh_topology.txt index d11557c2f2c..4ce425fb91f 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/Surface_mesh_topology.txt +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/Surface_mesh_topology.txt @@ -31,7 +31,7 @@ The algorithm to find a shortest non-contractible curve through a specified vert \subsection SMTopology_homotopy Homotopy Test -Given a curve drawn on a surface one can ask if the curve can be continuously deformed to a point (i.e. a zero length curve). In other words, does there exist a continuous sequence of curves on the surface that starts with the input curve and ends to a point? Curves that deform to a point are said contractible. Any curve on a sphere is contractible but this is not true for all curves on a torus or on a surface with more complicated topology. The algorithms in this section are purely topological and do not assume any geometry on the input surface. In particular, the surface is not necessarily embedded in an Euclidean space. +Given a curve drawn on a surface one can ask if the curve can be continuously deformed to a point (i.e. a zero length curve). In other words, does there exist a continuous sequence of curves on the surface that starts with the input curve and ends to a point? Curves that deform to a point are said contractible. Any curve on a sphere is contractible but this is not true for all curves on a torus or on a surface with more complicated topology. The algorithms in this section are purely topological and do not assume any geometry on the input surface. In particular, the surface is not necessarily embedded in a Euclidean space. The algorithm implemented in this package builds a data structure to efficiently answer queries of the following forms: - Given a combinatorial surface \f$\cal{M}\f$ and a closed combinatorial curve specified as a sequence of edges of \f$\cal{M}\f$, decide if the curve is contractible on \f$\cal{M}\f$, From 7487010c0998739b3e5210b601f11d397aeb615a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 1 Aug 2023 09:43:59 +0100 Subject: [PATCH 126/156] Remove blabla as the emums are documented in Mesh_2/doc --- Mesher_level/include/CGAL/Mesh_optimization_return_code.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Mesher_level/include/CGAL/Mesh_optimization_return_code.h b/Mesher_level/include/CGAL/Mesh_optimization_return_code.h index 3643395667c..4717055c530 100644 --- a/Mesher_level/include/CGAL/Mesh_optimization_return_code.h +++ b/Mesher_level/include/CGAL/Mesh_optimization_return_code.h @@ -18,10 +18,7 @@ #define CGAL_MESH_OPTIMIZATION_RETURN_CODE_H namespace CGAL { - /*! - * \brief bla bla - @todo document correctly - */ + enum Mesh_optimization_return_code { MESH_OPTIMIZATION_UNKNOWN_ERROR=-1, From 06db9ccad8ebfabcac9d435975c2c1f7ee2301e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 2 Aug 2023 17:25:58 +0200 Subject: [PATCH 127/156] reproject barycenter to avoid boundary shrinking --- .../tangential_relaxation.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/tangential_relaxation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/tangential_relaxation.h index 2c67b83005f..85431955cf7 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/tangential_relaxation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/tangential_relaxation.h @@ -218,6 +218,7 @@ void tangential_relaxation(const VertexRange& vertices, typedef std::tuple VNP; std::vector< VNP > barycenters; auto gt_barycenter = gt.construct_barycenter_3_object(); + auto gt_project = gt.construct_projected_point_3_object(); // at each vertex, compute vertex normal std::unordered_map vnormals; @@ -269,8 +270,19 @@ void tangential_relaxation(const VertexRange& vertices, //check squared cosine is < 0.25 (~120 degrees) if (0.25 < dot*dot / ( squared_distance(get(vpm,ph0), get(vpm, v)) * squared_distance(get(vpm,ph1), get(vpm, v))) ) - barycenters.emplace_back(v, vn, - gt_barycenter(get(vpm, ph0), 0.25, get(vpm, ph1), 0.25, get(vpm, v), 0.5)); + { + typename GT::Point_3 bary = gt_barycenter(get(vpm, ph0), 0.25, get(vpm, ph1), 0.25, get(vpm, v), 0.5); + // to avoid shrinking of borders, we project back onto the incident segments + typename GT::Segment_3 s1(get(vpm, ph0), get(vpm,v)), + s2(get(vpm, ph1), get(vpm,v)); + + typename GT::Point_3 p1 = gt_project(s1, bary), p2 = gt_project(s2, bary); + + bary = squared_distance(p1, bary) Date: Wed, 2 Aug 2023 17:52:31 +0200 Subject: [PATCH 128/156] Update Installation/CHANGES.md Co-authored-by: Mael --- Installation/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 0d0bc97777e..b812b99fe81 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -17,7 +17,7 @@ Release date: October 2023 - **Breaking change**: Removed the concept `TriangleAccessor`, the template parameter `TriangleAccessor`, as well as the class `Triangle_accessor`. They were no longer used for several releases. -- Removed the class templates `Gray_image_mesh_domain_3` and `Labeled_image_mesh_domain_3` +- Removed the class templates `Gray_image_mesh_domain_3`, `Implicit_mesh_domain_3`, and `Labeled_image_mesh_domain_3` which are deprecated since CGAL-4.13. From 1791adb713b648adde7a059f9b951240816d5862 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 3 Aug 2023 12:26:56 +0200 Subject: [PATCH 129/156] patch to support Windows 32 bits --- Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index 7329be33116..718d37f25b0 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -119,6 +119,11 @@ function(CGAL_setup_CGAL_dependencies target) target_link_options(${target} INTERFACE -fsanitize=address) endif() # Now setup compilation flags + if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + message(STATUS "Boost MP is turned off for all Windows 32 bits architectures!") + target_compile_options(${target} INTERFACE "-DCGAL_DO_NOT_USE_BOOST_MP") + endif() + if(MSVC) target_compile_options(${target} INTERFACE "-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS") From cf0c6c07822050346cf0fd760ac0035b179de6cf Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 3 Aug 2023 14:05:37 +0200 Subject: [PATCH 130/156] tweak in CGAL/boost_mp.h instead --- .../cmake/modules/CGAL_SetupCGALDependencies.cmake | 5 ----- Number_types/include/CGAL/boost_mp.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index 718d37f25b0..7329be33116 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -119,11 +119,6 @@ function(CGAL_setup_CGAL_dependencies target) target_link_options(${target} INTERFACE -fsanitize=address) endif() # Now setup compilation flags - if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) - message(STATUS "Boost MP is turned off for all Windows 32 bits architectures!") - target_compile_options(${target} INTERFACE "-DCGAL_DO_NOT_USE_BOOST_MP") - endif() - if(MSVC) target_compile_options(${target} INTERFACE "-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS") diff --git a/Number_types/include/CGAL/boost_mp.h b/Number_types/include/CGAL/boost_mp.h index 3dcaadcad21..b98980acbc5 100644 --- a/Number_types/include/CGAL/boost_mp.h +++ b/Number_types/include/CGAL/boost_mp.h @@ -20,8 +20,18 @@ // easy solution. // MSVC had trouble with versions <= 1.69: // https://github.com/boostorg/multiprecision/issues/98 +// +// Disable also on Windows 32 bits +// because CGAL/cpp_float.h assumes _BitScanForward64 is available +// See https://learn.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64 +// +// Disable also with PowerPC processors, with Boost<1.80 because of that bug: +// https://github.com/boostorg/multiprecision/pull/421 +// #if !defined CGAL_DO_NOT_USE_BOOST_MP && \ - (!defined _MSC_VER || BOOST_VERSION >= 107000) + (!defined _MSC_VER || BOOST_VERSION >= 107000) && \ + (!defined _WIN32 || defined _WIN64) && \ + (BOOST_VERSION >= 108000 || (!defined _ARCH_PPC && !defined _ARCH_PPC64)) #define CGAL_USE_BOOST_MP 1 #include From 5db2fd0195051aa2190eac6a5d1fff9780d5d4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Aug 2023 10:39:37 +0200 Subject: [PATCH 131/156] fix CK3 demo --- .../demo/Circular_kernel_3/Viewer.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp b/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp index 1502fb44db2..b7192481138 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp +++ b/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp @@ -893,20 +893,19 @@ void Viewer::naive_compute_intersection_points(const std::vector& for (std::vector::const_iterator it_f=circles.begin();it_f!=--circles.end();++it_f){ std::vector::const_iterator it_s=it_f; ++it_s; + typedef std::pair Point_and_multiplicity; for (;it_s!=circles.end();++it_s){ - std::vector intersections; + std::vector intersections; //ensure_circles are different CGAL_precondition(*it_s!=*it_f); - CGAL::intersection(*it_f,*it_s,std::back_inserter(intersections)); + CGAL::intersection(*it_f,*it_s,CGAL::dispatch_or_drop_output(std::back_inserter(intersections))); if (!intersections.empty()){ - for (std::vector ::const_iterator it_pt=intersections.begin();it_pt!=intersections.end();++it_pt){ - const std::pair* pt= - CGAL::object_cast< std::pair > (&(*it_pt)); - assert(pt!=nullptr); - *out++=EPIC::Point_3( CGAL::to_double(pt->first.x()), - CGAL::to_double(pt->first.y()), - CGAL::to_double(pt->first.z()) - ); + for (const Point_and_multiplicity& pt : intersections) + { + *out++=EPIC::Point_3( CGAL::to_double(pt.first.x()), + CGAL::to_double(pt.first.y()), + CGAL::to_double(pt.first.z()) + ); } } } From 7f639164c170370b7e5810422458a7f0f9e6765e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Aug 2023 11:22:05 +0200 Subject: [PATCH 132/156] update CK2 demo --- .../demo/Circular_kernel_2/ArcsGraphicsItem.h | 52 +++++------ .../Circular_kernel_2/Circular_kernel_2.cpp | 92 +++++++++---------- 2 files changed, 71 insertions(+), 73 deletions(-) diff --git a/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h b/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h index b4de860626c..148293b705c 100644 --- a/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h +++ b/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h @@ -16,14 +16,18 @@ namespace Qt { template class ArcsGraphicsItem : public GraphicsItem { - std::vector& arcs, &intersections; typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Line_arc_2 Line_arc_2; + typedef std::variant, Circular_arc_2, Line_arc_2 > Inter_variant; + typedef std::variant Arc_variant; + + std::vector& arcs; + std::vector& intersections; public: - ArcsGraphicsItem(std::vector& arcs_, std::vector& intersections_); + ArcsGraphicsItem(std::vector& arcs_, std::vector& intersections_); void modelChanged(); @@ -68,7 +72,7 @@ protected: template -ArcsGraphicsItem::ArcsGraphicsItem(std::vector& arcs_, std::vector& intersections_) +ArcsGraphicsItem::ArcsGraphicsItem(std::vector& arcs_, std::vector& intersections_) : arcs(arcs_), intersections(intersections_), painterostream(nullptr) { setIntersectionsPen(QPen(::Qt::red, 3.)); @@ -97,33 +101,29 @@ ArcsGraphicsItem::paint(QPainter *painter, painter->setPen(this->inputPen()); painterostream = PainterOstream(painter); - for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ + for(typename std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ Circular_arc_2 ca; Line_arc_2 la; - if(assign(ca, *it)){ - painterostream << ca; - } else if(assign(la, *it)){ - painterostream << la; + if(auto ca = std::get_if(&(*it))){ + painterostream << *ca; + } else if(auto la = std::get_if(&(*it))){ + painterostream << *la; } } painter->setPen(this->intersectionsPen()); painterostream = PainterOstream(painter); - for(std::vector::iterator it = intersections.begin(); it != intersections.end(); ++it){ - std::pair cap_ui; - Circular_arc_2 ca; - Line_arc_2 la; - - if(assign(cap_ui, *it)){ + for(typename std::vector::iterator it = intersections.begin(); it != intersections.end(); ++it){ + if(auto cap_ui = std::get_if>(&*it)){ QTransform matrix = painter->worldTransform(); painter->resetTransform(); - painter->drawPoint(matrix.map(convert(cap_ui.first))); + painter->drawPoint(matrix.map(convert(cap_ui->first))); painter->setWorldTransform(matrix); - }if(assign(ca, *it)){ - painterostream << ca; - } else if(assign(la, *it)){ - painterostream << la; + }if(auto ca = std::get_if(&(*it))){ + painterostream << *ca; + } else if(auto la = std::get_if(&(*it))){ + painterostream << *la; } } } @@ -135,22 +135,22 @@ ArcsGraphicsItem::updateBoundingBox() bounding_rect = QRectF(0,0,100, 100); Bbox_2 bb; bool initialized = false; - for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ + for(typename std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ Circular_arc_2 ca; Line_arc_2 la; - if(assign(ca, *it)){ + if(auto ca = std::get_if(&(*it))){ if(initialized){ - bb = bb + ca.supporting_circle().bbox(); + bb = bb + ca->supporting_circle().bbox(); } else { initialized = true; - bb = ca.supporting_circle().bbox(); + bb = ca->supporting_circle().bbox(); } - } else if(assign(la, *it)){ + } else if(auto la = std::get_if(&(*it))){ if(initialized){ - bb = bb + la.bbox(); + bb = bb + la->bbox(); } else { initialized = true; - bb = la.bbox(); + bb = la->bbox(); } } } diff --git a/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp b/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp index 4fa766fb87c..e593af52c14 100644 --- a/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp +++ b/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include // Qt headers @@ -38,12 +37,15 @@ typedef CircularKernel::Segment_2 Segment_2; typedef CircularKernel::Line_arc_2 Line_arc_2; typedef CircularKernel::Circular_arc_2 Circular_arc_2; typedef CircularKernel::Circular_arc_point_2 Circular_arc_point_2; - +typedef std::variant Arc_variant; +typedef std::variant, + Circular_arc_2, Line_arc_2 > Inter_variant; typedef CGAL::Qt::ArcsGraphicsItem ArcsGraphicsItem; -typedef std::vector ArcContainer; +typedef std::vector ArcContainer; +typedef std::vector ArcIntersection; class MainWindow : public CGAL::Qt::DemosMainWindow, @@ -53,7 +55,7 @@ class MainWindow : private: ArcContainer arcs; - ArcContainer intersections; + ArcIntersection intersections; QGraphicsScene scene; ArcsGraphicsItem * agi; @@ -68,7 +70,7 @@ public Q_SLOTS: virtual void open(QString); - void processInput(CGAL::Object o); + void processInput(Arc_variant o); void on_actionInsertCircularArc_toggled(bool checked); @@ -107,8 +109,8 @@ MainWindow::MainWindow() // the signal/slot mechanism cai = new CGAL::Qt::GraphicsViewCircularArcInput(this, &scene); - QObject::connect(cai, SIGNAL(generate(CGAL::Object)), - this, SLOT(processInput(CGAL::Object))); + QObject::connect(cai, SIGNAL(generate(Arc_variant)), + this, SLOT(processInput(Arc_variant))); // Manual handling of actions // @@ -146,33 +148,33 @@ MainWindow::MainWindow() void -MainWindow::processInput(CGAL::Object o) +MainWindow::processInput(Arc_variant o) { - Circular_arc_2 ca; - Line_arc_2 la; + const Circular_arc_2* ca = nullptr; + const Line_arc_2* la = nullptr; bool is_circular = false; - if(assign(ca, o)){ + if( (ca = std::get_if(&o)) ){ is_circular = true; - } else if(! assign(la, o)){ + } else if(! (la = std::get_if(&o))){ std::cerr << "unknown object" << std::endl; return; } - for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ + for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ Circular_arc_2 vca; Line_arc_2 vla; - if(assign(vca, *it)){ + if(auto vca = std::get_if(&(*it))){ if(is_circular){ - CGAL::intersection(ca, vca, std::back_inserter(intersections)); + CGAL::intersection(*ca, *vca, std::back_inserter(intersections)); } else { - CGAL::intersection(la, vca, std::back_inserter(intersections)); + CGAL::intersection(*la, *vca, std::back_inserter(intersections)); } - } else if(assign(vla, *it)){ + } else if(auto vla = std::get_if(&(*it))){ if(is_circular){ - CGAL::intersection(ca, vla, std::back_inserter(intersections)); + CGAL::intersection(*ca, *vla, std::back_inserter(intersections)); } else { - CGAL::intersection(la, vla, std::back_inserter(intersections)); + CGAL::intersection(*la, *vla, std::back_inserter(intersections)); } } } @@ -241,32 +243,30 @@ MainWindow::open(QString fileName) { Line_arc_2 la(Segment_2(multi_points[0], multi_points[1])); - for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ - Circular_arc_2 vca; - Line_arc_2 vla; - if(assign(vca, *it)){ - CGAL::intersection(la, vca, std::back_inserter(intersections)); - } else if(assign(vla, *it)){ - CGAL::intersection(la, vla, std::back_inserter(intersections)); + for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ + if(auto vca = std::get_if(&(*it))){ + CGAL::intersection(la, *vca, std::back_inserter(intersections)); + } else if(auto vla = std::get_if(&(*it))){ + CGAL::intersection(la, *vla, std::back_inserter(intersections)); } } - arcs.push_back(make_object(la)); + arcs.push_back(la); } else if(multi_points.size() == 3) { Circular_arc_2 ca(multi_points[0], multi_points[1], multi_points[2]); - for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ + for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ Circular_arc_2 vca; Line_arc_2 vla; - if(assign(vca, *it)){ - CGAL::intersection(ca, vca, std::back_inserter(intersections)); - } else if(assign(vla, *it)){ - CGAL::intersection(ca, vla, std::back_inserter(intersections)); + if(auto vca = std::get_if(&(*it))){ + CGAL::intersection(ca, *vca, std::back_inserter(intersections)); + } else if(auto vla = std::get_if(&(*it))){ + CGAL::intersection(ca, *vla, std::back_inserter(intersections)); } } - arcs.push_back(make_object(ca)); + arcs.push_back(ca); } else if(multi_points.size()>0) { @@ -285,16 +285,14 @@ MainWindow::open(QString fileName) Point_2 q(x,y); Line_arc_2 la(Segment_2(p,q)); - for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ - Circular_arc_2 vca; - Line_arc_2 vla; - if(assign(vca, *it)){ - CGAL::intersection(la, vca, std::back_inserter(intersections)); - } else if(assign(vla, *it)){ - CGAL::intersection(la, vla, std::back_inserter(intersections)); + for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ + if(auto vca = std::get_if(&(*it))){ + CGAL::intersection(la, *vca, std::back_inserter(intersections)); + } else if(auto vla = std::get_if(&(*it))){ + CGAL::intersection(la, *vla, std::back_inserter(intersections)); } } - arcs.push_back(make_object(la)); + arcs.push_back(la); } else if(c == 'c'){ ifs >> x >> y; Point_2 p(x,y); @@ -303,16 +301,16 @@ MainWindow::open(QString fileName) ifs >> x >> y; Point_2 r(x,y); Circular_arc_2 ca(p,q,r); - for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ + for(std::vector::iterator it = arcs.begin(); it != arcs.end(); ++it){ Circular_arc_2 vca; Line_arc_2 vla; - if(assign(vca, *it)){ - CGAL::intersection(ca, vca, std::back_inserter(intersections)); - } else if(assign(vla, *it)){ - CGAL::intersection(ca, vla, std::back_inserter(intersections)); + if(auto vca = std::get_if(&(*it))){ + CGAL::intersection(ca, *vca, std::back_inserter(intersections)); + } else if(auto vla = std::get_if(&(*it))){ + CGAL::intersection(ca, *vla, std::back_inserter(intersections)); } } - arcs.push_back(make_object(ca)); + arcs.push_back(ca); } } } From 361f6e2f63c57410fcabbcb05f8bf3baddbd66d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 4 Aug 2023 13:30:26 +0200 Subject: [PATCH 133/156] Clean code to use Face_location / Barycentric_coordinates everywhere --- .../CGAL/Polygon_mesh_processing/locate.h | 144 ++++++------------ 1 file changed, 50 insertions(+), 94 deletions(-) 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 26d0266e03a..a8359779125 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -52,6 +52,36 @@ namespace CGAL { namespace Polygon_mesh_processing { + +/// \ingroup PMP_locate_grp +/// +/// A variant used in the function `get_descriptor_from_location()`. +template +using descriptor_variant = boost::variant::vertex_descriptor, + typename boost::graph_traits::halfedge_descriptor, + typename boost::graph_traits::face_descriptor>; + +/// \ingroup PMP_locate_grp +/// +/// A triplet of coordinates describing the barycentric coordinates of a point +/// with respect to the vertices of a triangular face. +/// +/// \sa `Face_location` +template +using Barycentric_coordinates = std::array; + +/// \ingroup PMP_locate_grp +/// +/// If `tm` is the input triangulated surface mesh and given the pair (`f`, `bc`) +/// such that `bc` is the triplet of barycentric coordinates `(w0, w1, w2)`, the correspondence +/// between the coordinates in `bc` and the vertices of the face `f` is the following: +/// - `w0` corresponds to `source(halfedge(f, tm), tm)` +/// - `w1` corresponds to `target(halfedge(f, tm), tm)` +/// - `w2` corresponds to `target(next(halfedge(f, tm), tm), tm)` +template +using Face_location = std::pair::face_descriptor, + Barycentric_coordinates >; + namespace internal { // The Ray must have the same ambient dimension as the property map's value type (aka, the point type) @@ -85,51 +115,20 @@ struct Location_traits typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef std::array Barycentric_coordinates; - typedef std::pair Face_location; + typedef CGAL::Polygon_mesh_processing::Barycentric_coordinates Barycentric_coordinates; + typedef CGAL::Polygon_mesh_processing::Face_location Face_location; }; } // end namespace internal -/// \ingroup PMP_locate_grp -/// -/// A variant used in the function `get_descriptor_from_location()`. -template -using descriptor_variant = boost::variant::vertex_descriptor, - typename boost::graph_traits::halfedge_descriptor, - typename boost::graph_traits::face_descriptor>; - -/// \ingroup PMP_locate_grp -/// -/// A triplet of coordinates describing the barycentric coordinates of a point -/// with respect to the vertices of a triangular face. -/// -/// \sa `Face_location` -template -using Barycentric_coordinates = std::array; - -/// \ingroup PMP_locate_grp -/// -/// If `tm` is the input triangulated surface mesh and given the pair (`f`, `bc`) -/// such that `bc` is the triplet of barycentric coordinates `(w0, w1, w2)`, the correspondence -/// between the coordinates in `bc` and the vertices of the face `f` is the following: -/// - `w0` corresponds to `source(halfedge(f, tm), tm)` -/// - `w1` corresponds to `target(halfedge(f, tm), tm)` -/// - `w2` corresponds to `target(next(halfedge(f, tm), tm), tm)` -template -using Face_location = std::pair::face_descriptor, - Barycentric_coordinates >; - // forward declarations template -bool is_in_face(const std::pair::face_descriptor, - std::array >& loc, +bool is_in_face(const Face_location& loc, const TriangleMesh& tm); template descriptor_variant -get_descriptor_from_location(const std::pair::face_descriptor, - std::array >& loc, +get_descriptor_from_location(const Face_location& loc, const TriangleMesh& tm); // end of forward declarations @@ -138,8 +137,7 @@ namespace internal { template OutputIterator -incident_faces(const std::pair::face_descriptor, - std::array >& location, +incident_faces(const Face_location& loc, const TriangleMesh& tm, OutputIterator out) { @@ -147,7 +145,7 @@ incident_faces(const std::pair::face_ typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; - const descriptor_variant dv = get_descriptor_from_location(location, tm); + const descriptor_variant dv = get_descriptor_from_location(loc, tm); if(const vertex_descriptor* vd_ptr = boost::get(&dv)) { @@ -173,7 +171,7 @@ incident_faces(const std::pair::face_ // Snapping coordinates for robustness template bool -snap_coordinates_to_border(std::array& coords, +snap_coordinates_to_border(Barycentric_coordinates& coords, const FT tolerance = std::numeric_limits::epsilon()) { #ifdef CGAL_PMP_LOCATE_DEBUG @@ -224,8 +222,7 @@ snap_coordinates_to_border(std::array& coords, template bool -snap_location_to_border(std::pair::face_descriptor, - std::array >& loc, +snap_location_to_border(Face_location& loc, const TriangleMesh /*tm*/, const FT tolerance = std::numeric_limits::epsilon()) { @@ -235,7 +232,7 @@ snap_location_to_border(std::pair::fa template struct Barycentric_coordinate_calculator // 2D version { - std::array + Barycentric_coordinates operator()(const P& ip, const P& iq, const P& ir, const P& iquery, const K& k) const { typedef typename K::FT FT; @@ -273,7 +270,7 @@ struct Barycentric_coordinate_calculator // 2D version template struct Barycentric_coordinate_calculator { - std::array + Barycentric_coordinates operator()(const P& ip, const P& iq, const P& ir, const P& iquery, const K& k) const { typedef typename K::FT FT; @@ -364,7 +361,7 @@ struct Barycentric_point_constructor // 3D version /// \pre `query` lies on the plane defined by `p`, `q`, and `r`. /// template -std::array +Barycentric_coordinates barycentric_coordinates(const Point& p, const Point& q, const Point& r, const Point& query, const GeomTraits& gt) { @@ -373,7 +370,7 @@ barycentric_coordinates(const Point& p, const Point& q, const Point& r, const Po } template -std::array::type::FT, 3> +Barycentric_coordinates::type::FT> barycentric_coordinates(const Point& p, const Point& q, const Point& r, const Point& query) { typedef typename CGAL::Kernel_traits::type Kernel; @@ -411,7 +408,7 @@ random_location_on_halfedge(typename boost::graph_traits::halfedge const int h_id = halfedge_index_in_face(hd, tm); const FT t(rnd.uniform_real(0., 1.)); - std::array coordinates; + Barycentric_coordinates coordinates; coordinates[h_id] = t; coordinates[(h_id+1)%3] = FT(1)-t; coordinates[(h_id+2)%3] = FT(0); @@ -510,8 +507,7 @@ descriptor_variant #ifdef DOXYGEN_RUNNING // just for convenience because template alias do not allow template deduction get_descriptor_from_location(const Face_location& loc, #else -get_descriptor_from_location(const std::pair::face_descriptor, - std::array >& loc, +get_descriptor_from_location(const Face_location& loc, #endif const TriangleMesh& tm) { @@ -589,12 +585,10 @@ get_descriptor_from_location(const std::pair #ifdef DOXYGEN_RUNNING Point -construct_point(const Face_location& loc, #else typename internal::Location_traits::Point -construct_point(const std::pair::face_descriptor, - std::array >& loc, #endif +construct_point(const Face_location& loc, const TriangleMesh& tm, const NamedParameters& np = parameters::default_values()) { @@ -648,12 +642,7 @@ construct_point(const std::pair::face /// template bool -#ifdef DOXYGEN_RUNNING is_on_vertex(const Face_location& loc, -#else -is_on_vertex(const std::pair::face_descriptor, - std::array >& loc, -#endif const typename boost::graph_traits::vertex_descriptor vd, const TriangleMesh& tm) { @@ -692,12 +681,7 @@ is_on_vertex(const std::pair::face_de /// template bool -#ifdef DOXYGEN_RUNNING is_on_halfedge(const Face_location& loc, -#else -is_on_halfedge(const std::pair::face_descriptor, - std::array >& loc, -#endif const typename boost::graph_traits::halfedge_descriptor hd, const TriangleMesh& tm) { @@ -738,11 +722,7 @@ is_on_halfedge(const std::pair::face_ /// template bool -#ifdef DOXYGEN_RUNNING is_in_face(const Barycentric_coordinates& bar, -#else -is_in_face(const std::array& bar, -#endif const TriangleMesh& tm) { CGAL_USE(tm); @@ -780,12 +760,7 @@ is_in_face(const std::array& bar, /// template bool -#ifdef DOXYGEN_RUNNING is_in_face(const Face_location& loc, -#else -is_in_face(const std::pair::face_descriptor, - std::array >& loc, -#endif const TriangleMesh& tm) { return is_in_face(loc.second, tm); @@ -812,12 +787,7 @@ is_in_face(const std::pair::face_desc /// template bool -#ifdef DOXYGEN_RUNNING is_on_face_border(const Face_location& loc, -#else -is_on_face_border(const std::pair::face_descriptor, - std::array >& loc, -#endif const TriangleMesh& tm) { if(!is_in_face(loc, tm)) @@ -853,12 +823,7 @@ is_on_face_border(const std::pair::fa /// template bool -#ifdef DOXYGEN_RUNNING is_on_mesh_border(const Face_location& loc, -#else -is_on_mesh_border(const std::pair::face_descriptor, - std::array >& loc, -#endif const TriangleMesh& tm) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -1136,7 +1101,7 @@ locate_in_face(const typename internal::Location_traits coords = barycentric_coordinates(p0, p1, p2, query, gt); + Barycentric_coordinates coords = barycentric_coordinates(p0, p1, p2, query, gt); if(snap_tolerance != FT(0) && !is_in_face(coords, tm)) { @@ -1174,12 +1139,7 @@ locate_in_face(const typename internal::Location_traits Face_location -#ifdef DOXYGEN_RUNNING locate_in_adjacent_face(const Face_location& loc, -#else -locate_in_adjacent_face(const std::pair::face_descriptor, - std::array >& loc, -#endif const typename boost::graph_traits::face_descriptor fd, const TriangleMesh& tm) { @@ -1247,11 +1207,9 @@ locate_in_adjacent_face(const std::pair bool -locate_in_common_face(std::pair::face_descriptor, - std::array >& known_location, +locate_in_common_face(Face_location& known_location, const typename internal::Location_traits::Point& query, - std::pair::face_descriptor, - std::array >& query_location, + Face_location& query_location, const TriangleMesh& tm, const NamedParameters& np, const FT tolerance = std::numeric_limits::epsilon()) @@ -1323,10 +1281,8 @@ locate_in_common_face(std::pair::face // - both locations must be known but can change template bool -locate_in_common_face(std::pair::face_descriptor, - std::array >& first_location, - std::pair::face_descriptor, - std::array >& second_location, +locate_in_common_face(Face_location& first_location, + Face_location& second_location, const TriangleMesh& tm) { typedef typename boost::graph_traits::face_descriptor face_descriptor; From a909cafcce6fa5563387f0b60b6e7620cf53803b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 26 Jul 2023 14:32:54 +0100 Subject: [PATCH 134/156] Fix return type in the documentation --- .../doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h index fb82e23c709..cde835d30f6 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h @@ -608,24 +608,22 @@ Vertex_handle nearest_neighbor(const Point_2& p, Vertex_handle vnear) const; /*! Returns the dual corresponding to the face handle `f`. The returned object can -be assignable to one of the following: `Site_2`, `Gt::Line_2`. +be assigned to one of the following: `Site_2`, `Gt::Line_2`. */ Gt::Object_2 dual(Face_handle f) const; /*! Returns the dual of the face to which `it` points to. The returned object can -be assignable to one of the following: `Site_2`, `Gt::Line_2`. +be assigned to one of the following: `Site_2`, `Gt::Line_2`. */ Gt::Object_2 dual(All_faces_iterator it) const; /*! Returns -the dual of the face to which `it` points to. The returned -object can be assignable to one of the following: `Site_2`, -`Gt::Line_2`. +the dual of the face to which `it` points to. */ -Gt::Object_2 dual(Finite_faces_iterator it) const; +Site dual(Finite_faces_iterator it) const; /// @} From 6f0907d07c921edb2efea9ba7ea214ef8d198bd1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 10:24:35 +0100 Subject: [PATCH 135/156] Document the third template parameter --- .../CGAL/Apollonius_graph_vertex_base_2.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h index ae9eca3dc6e..7d65994f734 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h @@ -7,9 +7,12 @@ namespace CGAL { The class `Apollonius_graph_vertex_base_2` provides a model for the `ApolloniusGraphVertexBase_2` concept which is the vertex base required by the `ApolloniusGraphDataStructure_2` concept. The -class `Apollonius_graph_vertex_base_2` has two template arguments, the first being the -geometric traits of the Apollonius graph and should be a model of the -concept `ApolloniusGraphTraits_2`. The second is a Boolean which +class `Apollonius_graph_vertex_base_2` has two template arguments. + +\tparam Gt is the geometric traits of the Apollonius graph and must be a model of the +concept `ApolloniusGraphTraits_2`. + +\tparam StoreHidden is a Boolean which controls whether hidden sites are actually stored. Such a control is important if the user is not interested in hidden sites and/or if only insertions are made, in which case no hidden @@ -17,13 +20,17 @@ site can become visible. If `StoreHidden` is set to `true`, hidden sites are stored, otherwise they are discarded. By default `StoreHidden` is set to `true`. +\tparam Vb must be a model of the concept `TriangulationDSVertexBase_2` +By default this parameter is +instantiated by `Triangulation_ds_vertex_base_2<>`. + \cgalModels `ApolloniusGraphVertexBase_2` \sa `CGAL::Triangulation_data_structure_2` \sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2` */ -template< typename Gt, typename StoreHidden > -class Apollonius_graph_vertex_base_2 { + template< typename Gt, typename StoreHidden, typename Vb > + class Apollonius_graph_vertex_base_2 : public Vb { public: /// \name Creation From 43433b4a462fb8f1bc97963f29a8aaa87832ec8f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:46:25 +0200 Subject: [PATCH 136/156] Update Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h Co-authored-by: Mael --- .../Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h index 7d65994f734..3f01b435181 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h @@ -7,7 +7,7 @@ namespace CGAL { The class `Apollonius_graph_vertex_base_2` provides a model for the `ApolloniusGraphVertexBase_2` concept which is the vertex base required by the `ApolloniusGraphDataStructure_2` concept. The -class `Apollonius_graph_vertex_base_2` has two template arguments. +class `Apollonius_graph_vertex_base_2` has three template arguments. \tparam Gt is the geometric traits of the Apollonius graph and must be a model of the concept `ApolloniusGraphTraits_2`. From 2e7a815589b6612e0a19f8fd05e587a30a39f2a4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:46:37 +0200 Subject: [PATCH 137/156] Update Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h Co-authored-by: Mael --- .../Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h index 3f01b435181..c633618c7de 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h @@ -30,7 +30,7 @@ instantiated by `Triangulation_ds_vertex_base_2<>`. \sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2` */ template< typename Gt, typename StoreHidden, typename Vb > - class Apollonius_graph_vertex_base_2 : public Vb { +class Apollonius_graph_vertex_base_2 : public Vb { public: /// \name Creation From 7854fddd02e0848db20863d062cfd988812546b4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Jul 2023 11:46:44 +0200 Subject: [PATCH 138/156] Update Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h Co-authored-by: Mael --- .../Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h index c633618c7de..3bf702d3afd 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h @@ -29,7 +29,7 @@ instantiated by `Triangulation_ds_vertex_base_2<>`. \sa `CGAL::Triangulation_data_structure_2` \sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2` */ - template< typename Gt, typename StoreHidden, typename Vb > +template< typename Gt, typename StoreHidden, typename Vb > class Apollonius_graph_vertex_base_2 : public Vb { public: From 0ecba6b9b9c32735dcf98cf0981efd17b30de89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Aug 2023 14:24:58 +0200 Subject: [PATCH 139/156] const& should not be in the get --- .../include/internal/Qt/HyperbolicPainterOstream.h | 2 +- .../include/internal/Qt/HyperbolicPainterOstreamCK.h | 2 +- .../include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 81522776a5b..e561bd30b69 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 @@ -85,7 +85,7 @@ public: return *this; } - const Circular_arc_2& arc = std::get(s); + const Circular_arc_2& arc = std::get(s); if(arc.squared_radius() > 100) { Euclidean_segment_2 seg(arc.source(), arc.target()); 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 61d6630eeb3..f634789193c 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 @@ -49,7 +49,7 @@ namespace Qt { return *this; } - const Circular_arc& arc = std::get(s); + const Circular_arc& arc = std::get(s); if(arc.squared_radius() > 10) { 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 e54c4cb75a8..0c0829309b7 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 @@ -468,7 +468,7 @@ public: typedef Hyperbolic_point_2 Hyperbolic_Voronoi_point_2; typedef typename Kernel::Circle_2 Circle_2; typedef typename Kernel::Line_2 Euclidean_line_2; - typedef std::variant Euclidean_circle_or_line_2; + typedef std::variant Euclidean_circle_or_line_2; typedef internal::HDT_2_Circular_arc_2 Circular_arc_2; typedef typename Kernel::Segment_2 Euclidean_segment_2; // only used internally here typedef std::variant Hyperbolic_segment_2; From 33d70dd95fe700d87d13b24085c9f179e26df355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 4 Aug 2023 14:32:48 +0200 Subject: [PATCH 140/156] Minor improvements to orient_PS's doc --- .../orient_polygon_soup.h | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h index 2ffc899b549..de2bcab9c1c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h @@ -39,10 +39,10 @@ namespace CGAL { namespace Polygon_mesh_processing { /** \ingroup PMP_orientation_grp + * * Default visitor model of `PMPPolygonSoupOrientationVisitor`. * All of its functions have an empty body. This class can be used as a - * base class if only some of the functions of the concept require to be - * overridden. + * base class if only some of the functions of the concept will be overridden. */ struct Default_orientation_visitor{ void non_manifold_edge(std::size_t, std::size_t, std::size_t){} @@ -483,12 +483,22 @@ struct Polygon_soup_orienter * * \brief tries to consistently orient a soup of polygons in 3D space. * - * When it is not possible to produce a combinatorial manifold surface, + * The algorithm re-orients polygons such that the orientation + * of adjacent polygons is consistent. Note that the adjacency is + * defined in a combinatorial sense, i.e. two polygons are sharing + * an edge if and only if the endpoints of this edge are represented + * by the same point indices in both faces (possibly in a different order); + * it is not sufficient for the points to be geometrically identical. + * One may use `CGAL::Polygon_mesh_processing::merge_duplicate_points_in_polygon_soup()` + * to convert geometrical point equality into combinatorial point equality. + * + * When it is not possible to produce a combinatorial manifold surface + * (for example, if the polygon soup makes up a Möbius strip), * some points are duplicated. * Because a polygon soup does not have any connectivity (each point * has as many occurrences as the number of polygons it belongs to), * duplicating one point (or a pair of points) - * amounts to duplicate the polygon to which it belongs. + * amounts to duplicating the polygon to which it belongs. * * These points are either an endpoint of an edge incident to more * than two polygons, an endpoint of an edge between @@ -521,7 +531,7 @@ struct Polygon_soup_orienter * \cgalNamedParamsEnd * * @return `true` if the orientation operation succeeded. - * @return `false` if some points were duplicated, thus producing a self-intersecting polyhedron. + * @return `false` if some points were duplicated, thus producing a combinatorially manifold but self-intersecting polyhedron. * * @sa `orient_triangle_soup_with_reference_triangle_mesh()` */ From 69202afc5452e95aed811e31e63fc95c6d2c0966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Aug 2023 14:40:13 +0200 Subject: [PATCH 141/156] fix L1_VD demo --- .../include/CGAL/L1_voronoi_traits_2.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/L1_voronoi_traits_2.h b/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/L1_voronoi_traits_2.h index 49be2350b4d..e7d9b163a4c 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/L1_voronoi_traits_2.h +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/L1_voronoi_traits_2.h @@ -270,7 +270,7 @@ public: // The sites have the same x/y coordinate. if (s_x == CGAL::ZERO || s_y == CGAL::ZERO) { - *o++ = CGAL::make_object(Intersection_curve(CGAL::bisector(s1, s2), 1)); + *o++ = Intersection_curve(CGAL::bisector(s1, s2), 1); return o; } @@ -300,7 +300,7 @@ public: } // We construct the diagonal line either way. - *o++ = CGAL::make_object(Intersection_curve(Segment_2(p1, p2), 1)); + *o++ = Intersection_curve(Segment_2(p1, p2), 1); // Now construct vertical rays. Two or four rays. If it is only two rays, // then the multiplicity of all the curves is 1. @@ -309,14 +309,14 @@ public: if (s_d != CGAL::POSITIVE) { // horizontal rectangle or square = vertical rays. - *o++ = CGAL::make_object(Intersection_curve(Ray_2(*top, Direction_2(0, 1)), mult)); - *o++ = CGAL::make_object(Intersection_curve(Ray_2(*bottom, Direction_2(0, -1)), mult)); + *o++ = Intersection_curve(Ray_2(*top, Direction_2(0, 1)), mult); + *o++ = Intersection_curve(Ray_2(*bottom, Direction_2(0, -1)), mult); } if (s_d != CGAL::NEGATIVE) { // vertical rectangle or square = horizontal rays. - *o++ = CGAL::make_object(Intersection_curve(Ray_2(*right, Direction_2(1, 0)), mult)); - *o++ = CGAL::make_object(Intersection_curve(Ray_2(*left, Direction_2(-1, 0)), mult)); + *o++ = Intersection_curve(Ray_2(*right, Direction_2(1, 0)), mult); + *o++ = Intersection_curve(Ray_2(*left, Direction_2(-1, 0)), mult); } return o; From 5d87958a7c7f0950c5728d498c42110c66039784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Aug 2023 14:40:24 +0200 Subject: [PATCH 142/156] fix format only changing the top string, not the data --- .../SMDS_3/data/c3t3_io-hetero.binary.cgal | Bin 1618 -> 1616 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/SMDS_3/test/SMDS_3/data/c3t3_io-hetero.binary.cgal b/SMDS_3/test/SMDS_3/data/c3t3_io-hetero.binary.cgal index f4c958d923934984575fbf1a79ec79e6f498f161..ab735a65e00a81188a79d3f901e4c5c6b7a2f5a2 100644 GIT binary patch delta 14 Vcmcb_bAe}q3v+Qv%0^F4HUKIP1m*w$ delta 16 Xcmcb>bBSky3u{t-esRf0cTP3{HdF<| From f06d9fb606de8688ba2eff4721358b614b277f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Aug 2023 15:04:26 +0200 Subject: [PATCH 143/156] fix shortcut mistake --- Triangulation/include/CGAL/Triangulation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index 9a3e4aecb47..1c1bff78370 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -101,8 +101,8 @@ protected: template CGAL::Orientation operator()(Iter a, Iter b) const { - return ifo(fop->value(),a,b); if (*fop) + return ifo(fop->value(),a,b); *fop = cfo(a,b); CGAL_assertion(ifo(fop->value(),a,b) == CGAL::POSITIVE); return CGAL::POSITIVE; From 89fd91e35440048343c4df33c2e283ecb2f6e50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Aug 2023 16:56:55 +0200 Subject: [PATCH 144/156] fix argt demo changes in Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h should be undo --- .../ArrangementGraphicsItem.cpp | 11 ++--- .../Utils/IntersectCurves.cpp | 18 +++++++- .../Arrangement_on_surface_2/Utils/Utils.cpp | 45 +++++++++---------- .../include/CGAL/Arr_polycurve_traits_2.h | 6 +-- 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementGraphicsItem.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementGraphicsItem.cpp index 86ad76fe086..d8573dfa0cb 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementGraphicsItem.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementGraphicsItem.cpp @@ -961,15 +961,16 @@ findOtherInterestingPoints const CGAL::Bbox_2& allowable_range) { using Traits = demo_types::DemoTypes::Alg_seg_traits; CGAL::Bbox_2 bb = {}; - std::vector intersections; + typedef std::pair Pt_m; + std::vector intersections; for (auto it = arr->edges_begin(); it != arr->edges_end(); ++it) { for (auto& arc : getXyCurves(arr->traits())) + { if (arc.is_vertical() != it->curve().is_vertical()) - it->curve().intersections(arc, std::back_inserter(intersections)); + it->curve().intersections(arc, CGAL::dispatch_or_drop_output(std::back_inserter(intersections))); + } } - for (auto it = intersections.begin(); it != intersections.end(); it++) { - std::pair point_multiplicity; - CGAL::assign(point_multiplicity, *it); + for (auto point_multiplicity :intersections) { auto& point = point_multiplicity.first; if (point.location() == CGAL::ARR_INTERIOR) { auto xy = point.to_double(); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/IntersectCurves.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/IntersectCurves.cpp index f2d154c4eac..ef0d027ab85 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/IntersectCurves.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/IntersectCurves.cpp @@ -11,6 +11,8 @@ #include "IntersectCurves.h" #include "ArrangementTypes.h" +#include + template Intersect_curves::Intersect_curves(const Traits* traits) : @@ -18,12 +20,26 @@ Intersect_curves::Intersect_curves(const Traits* traits) : { } +struct Object_putter +{ + std::vector& v; + Object_putter(std::vector& v) + : v(v) + {} + + template + void operator()(const T& t) + { + v.push_back(make_object(t)); + } +}; + template void Intersect_curves::operator()( const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2, std::vector& output) { - this->intersect(cv1, cv2, std::back_inserter(output)); + this->intersect(cv1, cv2, boost::make_function_output_iterator(Object_putter(output))); } ARRANGEMENT_DEMO_SPECIALIZE_TRAITS(Intersect_curves) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp index 438b8214908..df21f6699ab 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp @@ -625,14 +625,14 @@ operator()(const X_monotone_curve_2& curve, const CoordinateType& x, Point_2 p2c1(x, CoordinateType(clipRect.ymax() + 1)); const X_monotone_curve_2 verticalLine = ctr_xcv(p1c1, p2c1); - CGAL::Object o; - CGAL::Oneset_iterator oi(o); + std::vector pairs; - this->intersectCurves(curve, verticalLine, oi); + this->intersectCurves(curve, verticalLine, + CGAL::dispatch_or_drop_output(std::back_inserter(pairs))); IntersectionResult pair; - if (CGAL::assign(pair, o)) { - Point_2 pt = pair.first; + if (!pairs.empty()) { + Point_2 pt = pairs[0].first; res = pt.y(); } return res; @@ -654,14 +654,13 @@ operator()(const X_monotone_curve_2& curve, const CoordinateType& x, Point_2 p2c1(x, CoordinateType(10000000)); // upper bounding box const X_monotone_curve_2 verticalLine = ctr_xcv(p1c1, p2c1); - CGAL::Object o; - CGAL::Oneset_iterator oi(o); + std::vector pairs; - this->intersectCurves(curve, verticalLine, oi); + this->intersectCurves(curve, verticalLine, + CGAL::dispatch_or_drop_output(std::back_inserter(pairs))); - IntersectionResult pair; - if (CGAL::assign(pair, o)) { - Point_2 pt = pair.first; + if (!pairs.empty()) { + Point_2 pt = pairs[0].first; res = pt.y(); } return res; @@ -681,15 +680,15 @@ operator()(const X_monotone_curve_2& curve, const Coordinate_type& x) Point_2 p2c1(x, Coordinate_type(clip_rect.ymax() + 1)); const X_monotone_curve_2 vertical_line = ctr_xcv(p1c1, p2c1); - CGAL::Object o; - CGAL::Oneset_iterator oi(o); - this->intersect_curves(curve, vertical_line, oi); + std::vector pairs; + + this->intersect_curves(curve, vertical_line, + CGAL::dispatch_or_drop_output(std::back_inserter(pairs))); Coordinate_type res(0); - IntersectionResult pair; - if (CGAL::assign(pair, o)) { - Point_2 pt = pair.first; + if (!pairs.empty()) { + Point_2 pt = pairs[0].first; res = pt.y(); } return res; @@ -708,15 +707,15 @@ auto Arr_compute_y_at_x_2>:: operator()(const X_monotone_curve_2& curve, const CoordinateType& x) -> CoordinateType { - CGAL::Object o; - CGAL::Oneset_iterator oi(o); Intersect_2 intersect = traits->intersect_2_object(); X_monotone_curve_2 c2 = this->makeVerticalLine(x); - intersect(curve, c2, oi); - std::pair res; - if (CGAL::assign(res, o)) { + typedef std::pair PtM; + + std::vector res; + intersect(curve, c2, CGAL::dispatch_or_drop_output(std::back_inserter(res))); + if (!res.empty()) { // TODO: handle failure case - const Point_2& p = res.first; + const Point_2& p = res[0].first; CoordinateType coord = p.y(); return coord; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h index 488ed21dea7..50433fe8724 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h @@ -826,7 +826,7 @@ public: std::get_if(&xection); if (subcv_p != nullptr) { ocv.push_back(*subcv_p); - oi = output_ocv (ocv, invert_ocv, oi); + output_ocv (ocv, invert_ocv, oi); continue; } @@ -883,7 +883,7 @@ public: // An overlap occurred at the previous iteration: // Output the overlapping polycurve. CGAL_assertion(ocv.size() > 0); - oi = output_ocv (ocv, invert_ocv, oi); + output_ocv (ocv, invert_ocv, oi); } else { // The left point of the current subcurve of one @@ -929,7 +929,7 @@ public: // Output the remaining overlapping polycurve, if necessary. if (ocv.size() > 0) { - oi = output_ocv (ocv, invert_ocv, oi); + output_ocv (ocv, invert_ocv, oi); } else if (right_coincides) { typedef std::pair return_point; From 3cef94d401ffe247010bf1a814cacacb1ab80186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Aug 2023 22:12:58 +0200 Subject: [PATCH 145/156] make the output iterator movable restore changes in Arr_polycurve_traits_2 --- .../Arrangement_on_surface_2/Utils/IntersectCurves.cpp | 8 ++++---- .../include/CGAL/Arr_polycurve_traits_2.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/IntersectCurves.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/IntersectCurves.cpp index ef0d027ab85..5e98113dabc 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/IntersectCurves.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/IntersectCurves.cpp @@ -22,15 +22,15 @@ Intersect_curves::Intersect_curves(const Traits* traits) : struct Object_putter { - std::vector& v; - Object_putter(std::vector& v) - : v(v) + std::reference_wrapper> v; + Object_putter(std::vector& v_) + : v(std::ref(v_)) {} template void operator()(const T& t) { - v.push_back(make_object(t)); + v.get().push_back(make_object(t)); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h index 50433fe8724..488ed21dea7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h @@ -826,7 +826,7 @@ public: std::get_if(&xection); if (subcv_p != nullptr) { ocv.push_back(*subcv_p); - output_ocv (ocv, invert_ocv, oi); + oi = output_ocv (ocv, invert_ocv, oi); continue; } @@ -883,7 +883,7 @@ public: // An overlap occurred at the previous iteration: // Output the overlapping polycurve. CGAL_assertion(ocv.size() > 0); - output_ocv (ocv, invert_ocv, oi); + oi = output_ocv (ocv, invert_ocv, oi); } else { // The left point of the current subcurve of one @@ -929,7 +929,7 @@ public: // Output the remaining overlapping polycurve, if necessary. if (ocv.size() > 0) { - output_ocv (ocv, invert_ocv, oi); + oi = output_ocv (ocv, invert_ocv, oi); } else if (right_coincides) { typedef std::pair return_point; From 61874d15e1ce69dbae099ff584c8639a35a0c18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 9 Aug 2023 08:36:44 +0200 Subject: [PATCH 146/156] do not use deprecated code --- .../Arrangement_on_surface_2/Traits_test.h | 44 +++++++++---------- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 4 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h index fe340b4a88c..3331200a607 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h @@ -733,7 +733,7 @@ min_vertex_wrapper(std::istringstream& str_stream) unsigned int id1, id2; str_stream >> id1 >> id2; Point_2& exp_answer = this->m_points[id2]; - std::cout << "Test: min_vertex( " << CGAL::oformat(this->m_xcurves[id1]) << " ) ? " + std::cout << "Test: min_vertex( " << CGAL::IO::oformat(this->m_xcurves[id1]) << " ) ? " << exp_answer << " "; Point_2 real_answer = @@ -751,7 +751,7 @@ max_vertex_wrapper(std::istringstream& str_stream) unsigned int id1, id2; str_stream >> id1 >> id2; Point_2& exp_answer = this->m_points[id2]; - std::cout << "Test: max_vertex( " << CGAL::oformat(this->m_xcurves[id1]) << " ) ? " + std::cout << "Test: max_vertex( " << CGAL::IO::oformat(this->m_xcurves[id1]) << " ) ? " << exp_answer << " "; Point_2 real_answer = @@ -767,7 +767,7 @@ is_vertical_wrapper(std::istringstream& str_stream) unsigned int id; str_stream >> id; bool exp_answer = this->get_expected_boolean(str_stream); - std::cout << "Test: is_vertical( " << CGAL::oformat(this->m_xcurves[id]) << " ) ? " + std::cout << "Test: is_vertical( " << CGAL::IO::oformat(this->m_xcurves[id]) << " ) ? " << exp_answer << " "; bool real_answer = @@ -789,7 +789,7 @@ compare_y_at_x_wrapper(std::istringstream& str_stream) str_stream >> id1 >> id2; unsigned int exp_answer = this->get_expected_enum(str_stream); std::cout << "Test: compare_y_at_x( " << this->m_points[id1] << "," - << CGAL::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; + << CGAL::IO::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; unsigned int real_answer = this->m_geom_traits.compare_y_at_x_2_object()(this->m_points[id1], @@ -853,8 +853,8 @@ compare_y_at_x_right_wrapper(std::istringstream& str_stream) unsigned int id1, id2, id3; str_stream >> id1 >> id2 >> id3; unsigned int exp_answer = this->get_expected_enum(str_stream); - std::cout << "Test: compare_y_at_x_right( " << CGAL::oformat(this->m_xcurves[id1]) << "," - << CGAL::oformat(this->m_xcurves[id2]) << ", " << this->m_points[id3] << " ) ? " + std::cout << "Test: compare_y_at_x_right( " << CGAL::IO::oformat(this->m_xcurves[id1]) << "," + << CGAL::IO::oformat(this->m_xcurves[id2]) << ", " << this->m_points[id3] << " ) ? " << exp_answer << " "; unsigned int real_answer = @@ -891,8 +891,8 @@ equal_curves_wrapper(std::istringstream& str_stream) unsigned int id1, id2; str_stream >> id1 >> id2; bool exp_answer = this->get_expected_boolean(str_stream); - std::cout << "Test: equal( " << CGAL::oformat(this->m_xcurves[id1]) << ", " - << CGAL::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; + std::cout << "Test: equal( " << CGAL::IO::oformat(this->m_xcurves[id1]) << ", " + << CGAL::IO::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; bool real_answer = this->m_geom_traits.equal_2_object()(this->m_xcurves[id1], this->m_xcurves[id2]); @@ -918,7 +918,7 @@ make_x_monotone_wrapper(std::istringstream& str_stream) unsigned int id; str_stream >> id; - std::cout << "Test: make_x_monotone( " << CGAL::oformat(this->m_curves[id]) << " ) ? "; + std::cout << "Test: make_x_monotone( " << CGAL::IO::oformat(this->m_curves[id]) << " ) ? "; std::vector objs; this->m_geom_traits.make_x_monotone_2_object()(this->m_curves[id], std::back_inserter(objs)); @@ -979,8 +979,8 @@ intersect_wrapper(std::istringstream& str_stream) this->m_xcurves[id2], std::back_inserter(xections)); - std::cout << "Test: intersect( " << CGAL::oformat(this->m_xcurves[id1]) << "," - << CGAL::oformat(this->m_xcurves[id2]) << " ) ? "; + std::cout << "Test: intersect( " << CGAL::IO::oformat(this->m_xcurves[id1]) << "," + << CGAL::IO::oformat(this->m_xcurves[id2]) << " ) ? "; size_t num; str_stream >> num; if (! this->compare(num, xections.size(), "size")) return false; @@ -1031,7 +1031,7 @@ bool Traits_test::split_wrapper(std::istringstream& str_stream) unsigned int id1, id2, id3, id4; str_stream >> id1 >> id2 >> id3 >> id4; X_monotone_curve_2 cv1, cv2; - std::cout << "Test: split( " << CGAL::oformat(this->m_xcurves[id1]) << "," + std::cout << "Test: split( " << CGAL::IO::oformat(this->m_xcurves[id1]) << "," << this->m_points[id2] << " ) ? "; this->m_geom_traits.split_2_object()(this->m_xcurves[id1], @@ -1069,8 +1069,8 @@ are_mergeable_wrapper_imp(std::istringstream& str_stream, CGAL::Tag_true) unsigned int id1, id2; str_stream >> id1 >> id2; bool exp_answer = this->get_expected_boolean(str_stream); - std::cout << "Test: are_mergeable( " << CGAL::oformat(this->m_xcurves[id1]) << ", " - << CGAL::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; + std::cout << "Test: are_mergeable( " << CGAL::IO::oformat(this->m_xcurves[id1]) << ", " + << CGAL::IO::oformat(this->m_xcurves[id2]) << " ) ? " << exp_answer << " "; bool real_answer = this->m_geom_traits.are_mergeable_2_object()(this->m_xcurves[id1], @@ -1107,8 +1107,8 @@ Traits_test::merge_wrapper_imp(std::istringstream& str_stream, unsigned int id1, id2, id; str_stream >> id1 >> id2 >> id; X_monotone_curve_2 cv; - std::cout << "Test: merge( " << CGAL::oformat(this->m_xcurves[id1]) << ", " - << CGAL::oformat(this->m_xcurves[id2]) << " ) ? " << CGAL::oformat(this->m_xcurves[id]) << " "; + std::cout << "Test: merge( " << CGAL::IO::oformat(this->m_xcurves[id1]) << ", " + << CGAL::IO::oformat(this->m_xcurves[id2]) << " ) ? " << CGAL::IO::oformat(this->m_xcurves[id]) << " "; this->m_geom_traits.merge_2_object()(this->m_xcurves[id1], this->m_xcurves[id2], cv); @@ -1181,7 +1181,7 @@ parameter_space_in_x_wrapper_imp(std::istringstream& str_stream, CGAL::Arr_curve_end cv_end = CGAL::ARR_MIN_END; if (curves_op) { cv_end = static_cast(next_input.second); - std::cout << "Test: parameter_space_x( " << CGAL::oformat(this->m_xcurves[id]) << " , " + std::cout << "Test: parameter_space_x( " << CGAL::IO::oformat(this->m_xcurves[id]) << " , " << (cv_end == CGAL::ARR_MIN_END ? "MIN_END" : "MAX_END") << " ) ? "; next_input = this->get_next_input(str_stream); @@ -1248,8 +1248,8 @@ compare_y_near_boundary_wrapper_imp(std::istringstream& str_stream, assert(next_input.first == Base::CURVE_END); CGAL::Arr_curve_end cv_end = static_cast(next_input.second); - std::cout << "Test: compare_y_near_boundary( " << CGAL::oformat(this->m_xcurves[id1]) - << " , " << CGAL::oformat(this->m_xcurves[id2]) << " , " + std::cout << "Test: compare_y_near_boundary( " << CGAL::IO::oformat(this->m_xcurves[id1]) + << " , " << CGAL::IO::oformat(this->m_xcurves[id2]) << " , " << (cv_end == CGAL::ARR_MIN_END ? "MIN_END" : "MAX_END") << " ) ? "; next_input = this->get_next_input(str_stream); @@ -1309,7 +1309,7 @@ parameter_space_in_y_wrapper_imp(std::istringstream& str_stream, CGAL::Arr_curve_end cv_end = CGAL::ARR_MIN_END; if (curves_op) { cv_end = static_cast(next_input.second); - std::cout << "Test: parameter_space_y( " << CGAL::oformat(this->m_xcurves[id]) << " , " + std::cout << "Test: parameter_space_y( " << CGAL::IO::oformat(this->m_xcurves[id]) << " , " << (cv_end == CGAL::ARR_MIN_END ? "MIN_END" : "MAX_END") << " ) ? "; next_input = this->get_next_input(str_stream); @@ -1381,8 +1381,8 @@ compare_x_near_boundary_wrapper_imp(std::istringstream& str_stream, CGAL::Arr_curve_end cv_end = static_cast(next_input.second); - std::cout << CGAL::oformat(this->m_xcurves[id1]) << ", " - << CGAL::oformat(this->m_xcurves[id2]) << " , " + std::cout << CGAL::IO::oformat(this->m_xcurves[id1]) << ", " + << CGAL::IO::oformat(this->m_xcurves[id2]) << " , " << this->curve_end_str(cv_end) << " ) ? "; next_input = this->get_next_input(str_stream); diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index a0ceda5d3b9..2e7571eb41d 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -333,13 +333,13 @@ struct Tester else { std::cerr << "\nc1 circumcenter: " << tr.dual(c1); std::cerr << "\nc1 is in domain: " - << CGAL::oformat(domain.is_in_domain_object()(tr.dual(c1))); + << CGAL::IO::oformat(domain.is_in_domain_object()(tr.dual(c1))); } if(tr.is_infinite(c2)) std::cerr << "\nc2 is infinite"; else { std::cerr << "\nc2 circumcenter: "<< tr.dual(c2); std::cerr << "\nc2 is in domain: " - << CGAL::oformat(domain.is_in_domain_object()(tr.dual(c2))); + << CGAL::IO::oformat(domain.is_in_domain_object()(tr.dual(c2))); } std::cerr << std::endl; assert(false); From 6b24eed462b9632496d3889f2aa38460f6d72b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 9 Aug 2023 08:46:34 +0200 Subject: [PATCH 147/156] try resolving ambiguity --- .../include/CGAL/Arr_point_location/Td_active_edge.h | 4 ++-- .../CGAL/Arr_point_location/Td_active_trapezoid.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h index c1a177e5ab6..f08890e4623 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h @@ -147,7 +147,7 @@ public: /*! Initialize the trapezoid's neighbors. */ inline void init_neighbors(std::optional> next) { - set_next((next) ? *next : Td_map_item(0)); + set_next((next) ? next->get() : Td_map_item(0)); } /*! \copydoc init_neighbors * \deprecated please use #init_neighbors */ @@ -202,7 +202,7 @@ public: std::optional> next = std::nullopt) { - PTR = new Data(he, (next) ? *next : Td_map_item(0), node); + PTR = new Data(he, (next) ? next->get() : Td_map_item(0), node); //m_dag_node = node; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h index f226db992d9..6b9486e4e60 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h @@ -166,10 +166,10 @@ private: inline void init_neighbors(std::optional> lb, std::optional> lt, std::optional> rb, std::optional> rt) { - set_lb((lb) ? *lb : Td_map_item(0)); - set_lt((lt) ? *lt : Td_map_item(0)); - set_rb((rb) ? *rb : Td_map_item(0)); - set_rt((rt) ? *rt : Td_map_item(0)); + set_lb((lb) ? lb->get() : Td_map_item(0)); + set_lt((lt) ? lt->get() : Td_map_item(0)); + set_rb((rb) ? rb->get() : Td_map_item(0)); + set_rt((rt) ? rt->get() : Td_map_item(0)); } /*! \copydoc init_neighbors * \deprecated please use #init_neighbors */ @@ -273,8 +273,8 @@ private: std::optional> rt = std::nullopt, Dag_node* node = 0) { - PTR = new Data (l, r, b, t, (lb) ? *lb : Td_map_item(0), (lt) ? *lt : Td_map_item(0), - (rb) ? *rb : Td_map_item(0), (rt) ? *rt : Td_map_item(0), node); + PTR = new Data (l, r, b, t, (lb) ? lb->get() : Td_map_item(0), (lt) ? lt->get() : Td_map_item(0), + (rb) ? rb->get() : Td_map_item(0), (rt) ? rt->get() : Td_map_item(0), node); //m_dag_node = node; } From 10c1796c2a0c88ca400fa596dc9254e3e8a9f42b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 9 Aug 2023 08:49:42 +0200 Subject: [PATCH 148/156] fix unused variable warnings --- .../test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp | 4 ++-- .../test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp | 4 ++-- .../test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp index b34ca8c2909..5a0da9d0165 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp @@ -50,8 +50,8 @@ int main() for (Scalar y = step; y < limit; y += step) { const Point point(x, y); - const Output_type tri_result = triangle_coordinates(point, tri_coordinates); - const Output_type dh_result = discrete_harmonic_coordinates(point, old_coordinates); + /* const Output_type tri_result = */triangle_coordinates(point, tri_coordinates); + /* const Output_type dh_result = */discrete_harmonic_coordinates(point, old_coordinates); CGAL::Barycentric_coordinates::discrete_harmonic_coordinates_2( vertices, point, std::back_inserter(new_coordinates)); diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp index c4bac5497a4..50cbb51b97b 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp @@ -53,8 +53,8 @@ int main() for (Scalar y = step; y < limit; y += step) { const Point point(x, y); - const Output_type tri_result = triangle_coordinates(point, tri_coordinates); - const Output_type mv_result = mean_value_coordinates(point, old_coordinates); + /* const Output_type tri_result = */triangle_coordinates(point, tri_coordinates); + /* const Output_type mv_result = */mean_value_coordinates(point, old_coordinates); CGAL::Barycentric_coordinates::mean_value_coordinates_2( vertices, point, std::back_inserter(new_coordinates)); diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp index ae349dffb76..eb4c47ec2b5 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp @@ -51,8 +51,8 @@ int main() for (Scalar y = step; y < limit; y += step) { const Point point(x, y); - const Output_type tri_result = triangle_coordinates(point, tri_coordinates); - const Output_type wp_result = wachspress_coordinates(point, old_coordinates); + /* const Output_type tri_result = */triangle_coordinates(point, tri_coordinates); + /* const Output_type wp_result = */wachspress_coordinates(point, old_coordinates); CGAL::Barycentric_coordinates::wachspress_coordinates_2( vertices, point, std::back_inserter(new_coordinates)); From b7cebad9d31c94c7a9e58c2fdc5f0a402724f8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 9 Aug 2023 08:56:50 +0200 Subject: [PATCH 149/156] do not use deprecated API --- CGAL_ipelets/demo/CGAL_ipelets/hyperbolic.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CGAL_ipelets/demo/CGAL_ipelets/hyperbolic.cpp b/CGAL_ipelets/demo/CGAL_ipelets/hyperbolic.cpp index e0725a743e9..795375437fa 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/hyperbolic.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/hyperbolic.cpp @@ -209,16 +209,14 @@ void hyperbolicIpelet::protected_run(int fn) } // clip circ by poincare - std::vector< CGAL::Object > result; Kernel::Circular_arc_point_2 L,R; - std::pair the_pair; + typedef std::pair The_pair; + std::vector result; - CGAL::intersection(circ, poincare, std::back_inserter(result)); + CGAL::intersection(circ, poincare, CGAL::dispatch_or_drop_output(std::back_inserter(result))); assert (result.size()==2); - assign(the_pair, result[0]); - L = the_pair.first; - assign(the_pair, result[1]); - R = the_pair.first; + L = result[0].first; + R = result[1].first; Point_2 LL(CGAL::to_double(L.x()),CGAL::to_double(L.y())); Point_2 RR(CGAL::to_double(R.x()),CGAL::to_double(R.y())); assert( LL.x() <= RR.x()); From 99066b43638c1b92cd13d56149878abfa7f65cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 9 Aug 2023 08:59:26 +0200 Subject: [PATCH 150/156] hide unused type --- Kernel_23/examples/Kernel_23/MyKernel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/examples/Kernel_23/MyKernel.cpp b/Kernel_23/examples/Kernel_23/MyKernel.cpp index 13eec454b3d..834a22629b8 100644 --- a/Kernel_23/examples/Kernel_23/MyKernel.cpp +++ b/Kernel_23/examples/Kernel_23/MyKernel.cpp @@ -56,7 +56,7 @@ int main() K::Intersect_2 intersection; - const auto intersect = intersection(s1, s2); + /* const auto intersect = */intersection(s1, s2); K::Construct_cartesian_const_iterator_2 construct_it; K::Cartesian_const_iterator_2 cit = construct_it(a); From 71347f28a8bba6002dfb02c7b063f1a90df372b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 9 Aug 2023 09:00:38 +0200 Subject: [PATCH 151/156] remove unused variable --- .../test_corefinement_and_constraints.cpp | 1 - 1 file changed, 1 deletion(-) 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 7642f81f493..6508c453337 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 @@ -165,7 +165,6 @@ void test_bool_op_no_copy( assert( count_constrained_edges(tm2, ecm2)==307 ); typedef std::optional OTM; - Triangle_mesh *ptr = nullptr; const std::array output = reverse ? CGAL::make_array(OTM(&tm2), OTM(&tm1), std::optional(), std::optional()) : CGAL::make_array(OTM(&tm1), OTM(&tm2), std::optional(), std::optional()); From 2549f47191a4104e45b20052973a72aa95fb4f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 10 Aug 2023 17:27:29 +0200 Subject: [PATCH 152/156] fix other warnings --- .../test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp | 2 +- .../test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp index 9b39a907f43..90ec3474739 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp @@ -44,7 +44,7 @@ int main() int count = 0; for (int i = 0; i < 6; ++i) { - const Output_type result = segment_coordinates(query_points[i], std::back_inserter(old_coordinates)); + segment_coordinates(query_points[i], std::back_inserter(old_coordinates)); CGAL::Barycentric_coordinates::segment_coordinates_2( first_vertex, second_vertex, query_points[i], std::back_inserter(new_coordinates)); diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp index bd83f52a5bd..58506a5cec0 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp @@ -43,7 +43,7 @@ int main() int count = 0; for (int i = 0; i < 5; ++i) { - const Output_type result = triangle_coordinates(query_points[i], std::back_inserter(old_coordinates)); + triangle_coordinates(query_points[i], std::back_inserter(old_coordinates)); CGAL::Barycentric_coordinates::triangle_coordinates_2( first_vertex, second_vertex, third_vertex, query_points[i], std::back_inserter(new_coordinates)); From 5db243629a35d535b6bec49990680fd813957a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 14 Aug 2023 14:02:39 +0200 Subject: [PATCH 153/156] try working around an error with MSVC2017 `error C2338: Sorry: std::any doesn't support over-aligned types at this time.` --- STL_Extension/include/CGAL/Object.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index 8a3ed24dad5..765b5e70e3f 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -29,20 +29,20 @@ #include #include -#include +#include #include namespace CGAL { class Object { - std::shared_ptr obj; + std::shared_ptr obj; // returns an any pointer from a variant struct Any_from_variant { template - std::any* operator()(const T& t) const { - return new std::any(t); + boost::any* operator()(const T& t) const { + return new boost::any(t); } }; @@ -59,7 +59,7 @@ class Object Object() : obj() { } template - Object(T && t, private_tag) : obj(new std::any(std::forward(t))) { } + Object(T && t, private_tag) : obj(new boost::any(std::forward(t))) { } // implicit constructor from optionals containing variants template @@ -74,7 +74,7 @@ class Object template bool assign(T &t) const { - const T* res = std::any_cast(obj.get()); + const T* res = boost::any_cast(obj.get()); if (!res) return false; t = *res; return true; @@ -103,7 +103,7 @@ class Object template bool is() const { - return obj && std::any_cast(obj.get()); + return obj && boost::any_cast(obj.get()); } const std::type_info & type() const @@ -157,14 +157,14 @@ template inline const T * object_cast(const Object * o) { - return std::any_cast((o->obj).get()); + return boost::any_cast((o->obj).get()); } template inline T object_cast(const Object & o) { - const T * result = std::any_cast((o.obj).get()); + const T * result = boost::any_cast((o.obj).get()); if (!result) throw Bad_object_cast(); return *result; From d8a6478b57dc0c9965b322375b17fb4a6a8af744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 16 Aug 2023 09:02:28 +0200 Subject: [PATCH 154/156] remove another use of deprecated API --- .../include/CGAL/CGAL_Ipelet_base_v7.h | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h index 276e5d5c651..5373b0a3445 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h @@ -822,41 +822,34 @@ public: CGAL::Cartesian_converter conv; Exact_circle_2 exact_circle=conv(approx_circle); + typedef std::pair Cp2_mult; SK::Intersect_2 inter=SK().intersect_2_object(); - std::vector< std::pair > points; + std::vector< Cp2_mult > points; points.reserve(8); - std::vector ints; + std::vector< Cp2_mult > ints; ints.reserve(2); - std::pair tmp_pt; int indices[8]={-1,-1,-1,-1,-1,-1,-1,-1}; for (unsigned i=0;i!=4;++i){ ints.clear(); SK::Segment_2 S(conv(bbox[i]),conv(bbox[(i+1)%4])); - inter(exact_circle,SK::Line_arc_2(S),std::back_inserter(ints)); + inter(exact_circle,SK::Line_arc_2(S),dispatch_or_drop_output(std::back_inserter(ints))); unsigned index=0; - bool ok=true; switch (ints.size()){ case 1: - ok=CGAL::assign(tmp_pt,ints[0]); - CGAL_assertion(ok); CGAL_USE(ok); - points.push_back(tmp_pt); + points.push_back(ints[0]); index=points.size()-1; indices[i]=index; indices[(i+1)%4+4]=index; break; case 2: int right_ind=i<2?0:1; - ok=CGAL::assign(tmp_pt,ints[right_ind]); - CGAL_assertion(ok); CGAL_USE(ok); - points.push_back(tmp_pt); + points.push_back(ints[right_ind]); index=points.size()-1; indices[i]=index; - ok=CGAL::assign(tmp_pt,ints[(right_ind+1)%2]); - CGAL_assertion(ok); CGAL_USE(ok); - points.push_back(tmp_pt); + points.push_back(ints[(right_ind+1)%2]); index=points.size()-1; indices[(i+1)%4+4]=index; break; From f1f6126f1c725ee33d3eb96e68a3c59ee1ec2ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 16 Aug 2023 09:11:30 +0200 Subject: [PATCH 155/156] add missing IO namespace --- .../include/CGAL/Curved_kernel_via_analysis_2/Point_2.h | 8 ++++---- .../test/Arrangement_on_surface_2/Traits_base_test.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index 2d194eb5254..789f24b841e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -700,13 +700,13 @@ public: default: // ASCII os << "Point_2("; - os << oformat(this->ptr()->_m_xy); + os << ::CGAL::IO::oformat(this->ptr()->_m_xy); os << ","; - os << oformat(this->ptr()->_m_x); + os << ::CGAL::IO::oformat(this->ptr()->_m_x); os << ","; - os << oformat(this->ptr()->_m_curve); + os << ::CGAL::IO::oformat(this->ptr()->_m_curve); os << ","; - os << oformat(this->ptr()->_m_arcno); + os << ::CGAL::IO::oformat(this->ptr()->_m_arcno); os << ","; os << this->ptr()->_m_location; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h index 696c03ebb69..f03b66bb81d 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h @@ -136,8 +136,8 @@ protected: typename Traits::Equal_2 equal = this->m_geom_traits.equal_2_object(); if (equal(exp_answer, real_answer)) return true; - std::string exp_answer_str = boost::lexical_cast( oformat(exp_answer) ); - std::string real_answer_str = boost::lexical_cast( oformat(real_answer) ); + std::string exp_answer_str = boost::lexical_cast( CGAL::IO::oformat(exp_answer) ); + std::string real_answer_str = boost::lexical_cast( CGAL::IO::oformat(real_answer) ); this->print_answer(exp_answer_str, real_answer_str, "x-monotone curve"); return false; } From d6c04e3b8a4222e552b0bfeeb8c5d953dfd49183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 16 Aug 2023 09:17:58 +0200 Subject: [PATCH 156/156] do not use ref wrapper --- .../CGAL/Arr_point_location/Trapezoidal_decomposition_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index e461b86a443..1a3549c0008 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -272,7 +272,7 @@ public: Base_map_item_iterator() : traits(0), m_cur_item(Td_map_item(0)){ } Base_map_item_iterator(const Traits* traits_, - std::optional> curr = std::nullopt) + std::optional curr = std::nullopt) :traits(traits_), m_cur_item((curr) ? *curr : Td_map_item(0) ) { } Base_map_item_iterator(const Base_map_item_iterator &it)