From 669ba26a266c4e935a546587d92362fa7ca93814 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 25 Nov 2022 13:00:42 +0100 Subject: [PATCH 01/28] 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 542b5ab176a3..340b0551c988 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 02/28] 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 8c1c39162128..31bcaf161d65 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 03/28] 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 37d555793b6b..c3ddb24005be 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 @@ class Compact_container_with_index 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 04/28] add insert_cell_1_between_two_cells_2 method in CMap and GMap --- .../include/CGAL/Combinatorial_map.h | 90 +++++++++- .../include/CGAL/Generalized_map.h | 165 +++++++++++++----- 2 files changed, 203 insertions(+), 52 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index fa13fbe6d6c4..f16a3779cd99 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 6aa6b56045ea..273d8b32bf27 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)); + 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 ) { - CGAL_assertion(is_insertable_cell_1_in_cell_2(adart1, adart2)); + 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 05/28] 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 55e93de1f2b6..3b96f69ca76c 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 06/28] 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 885940755110..bda62d360f86 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 950a723bf21a..7514a5a0089c 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 07/28] 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 2ba09b326500..8d29ad53b6ca 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 8366f3495dfe..abffe8d16513 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 08/28] 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 1abea6aef50e..aecd73c271a3 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 09/28] 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 b239bad84c16..1a3f67aabc30 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 10/28] 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 3b96f69ca76c..b76bbf1d7e62 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 1606dbdaffac..edc8b0f6d40d 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 11/28] 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 f16a3779cd99..b65e30614dd9 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 bda62d360f86..08dd26c00c75 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 340b0551c988..884c4f80b981 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 8d29ad53b6ca..9a2a3a947448 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 abffe8d16513..7ae5b70117fc 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 12/28] 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 9adb636537f1..0b7a094a29d1 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 7235848f2e84..d5811fbfff11 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 13/28] 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 b65e30614dd9..77af5bbc736c 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 08dd26c00c75..6fd93934b2c1 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 273d8b32bf27..d65292ed5a0b 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 d5811fbfff11..8b8d55ea375e 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 14/28] 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 423f49aae1c0..2e36037ea231 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 007d8b424c56..03f492d1b081 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 31bcaf161d65..790d378bd074 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 091fb5730a1d..0c931f0e30d9 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 768e0b82aeb5..7366d1189284 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 77af5bbc736c..ee80b2978c2c 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 d3d11cbdfc7a..5cbf7b7861a6 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 6fd93934b2c1..d86c152c503a 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 5fe14f3217b2..3e0b147942c5 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 884c4f80b981..4488da87fe19 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 eeb2c40b1460..0b2c39bc7204 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 31e8cff3946a..e691fce122c6 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 aad7d6437877..584442412c54 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 c3ddb24005be..d3d67c57a88d 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 @@ class Compact_container_with_index 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 761e9023249a..3308def61039 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 f45b23d76f8a..ba13c664c213 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 94b110c4ac7c..6357af2198d4 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 000000000000..49e8795eef77 --- /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 172e2481899f..91c430a9d914 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 0b08884f40ac..491a8c9ed3d3 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 48651e5ef92c..4c8717af339d 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 d65292ed5a0b..4f4b29152fbd 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 7514a5a0089c..69179ad118c9 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 80044bdc7d3f..828004b84164 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 d712bb061dc5..e773e5c32187 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 000000000000..6dd17ee0a84f --- /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 7dc0446bf45b..a4b0902e60d4 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 889ee37db5d1..f092321e4a9e 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 @@ class Surface_mesh { 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 8f9487c28cc7..21aa768dbfb4 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 @@ class Vector } - /// 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 6326da0e6650..e461312f2dd2 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 0b7a094a29d1..9adb636537f1 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 8b8d55ea375e..1f696a418113 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 1237c7a39873bc2d7a6c4efae7e7f3decaee6fed Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 9 Jun 2023 12:45:19 +0200 Subject: [PATCH 15/28] 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 28195f353548..89f981f53d1b 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 16/28] 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 c1d6eb4cdfef..6e04cbb07a3a 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 737e6b965ba2..b4d882132755 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 b994bc35745b424a7480057f96f314c626a3bc1f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 20 Jun 2023 11:47:31 +0200 Subject: [PATCH 17/28] 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 790d378bd074..adccc875cd0f 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 18/28] 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 adccc875cd0f..c080e2166d4c 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 e4d98ef92a1dcc81e0fae1cfe7ad5f0cd6652040 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 21 Jun 2023 15:32:58 +0200 Subject: [PATCH 19/28] 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 000000000000..4963fcb23a70 --- /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 20/28] 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 2e36037ea231..0ff995a3cddb 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 21/28] 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 ce72b6a64a2b..c77e4e6c5221 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 22/28] Update changes.md --- Installation/CHANGES.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index c4ce7a51d6d1..229d1145c8a3 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 23/28] 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 0ff995a3cddb..6b95790b57be 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 24/28] 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 6b95790b57be..08afd5085870 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 c080e2166d4c..2439a614f03c 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 25/28] 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 08afd5085870..6e7960fe4b02 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 3ed60dc64908e65c1ae2d003585b576bd979b67a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 23 Jun 2023 08:22:00 +0200 Subject: [PATCH 26/28] 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 000000000000..56c4a5cbd2f8 --- /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 27/28] 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 6e7960fe4b02..d1216129f48f 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 491a8c9ed3d3..39aa3e1b2e0d 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 c38131ac9fbc..1ea597a39759 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 6eae9275a757..0cb7753c302a 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 4f178f666d19..def1f1a28fee 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}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$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 28/28] 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 02f9b3654ec5..72aa6cf6103b 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.