diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h index 3bb1f7fef5d..c13684894fb 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h @@ -137,7 +137,7 @@ namespace CGAL { /** Return if this dart is free for adimension. * @param dh a dart handle * @param i the dimension. - * @return true iff dh is linked with nullptr for \em adimension. + * @return true iff dh is linked with null_dart_handle for \em adimension. */ template bool is_free(Dart_const_handle dh) const 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 b2aca6dc8f4..a70dccb5f21 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h @@ -85,7 +85,6 @@ namespace CGAL { typename Alloc_::template rebind::other, Multiply_by_two_policy_for_cc_with_size<64>, size_type > {}; - /// Typedef for attributes typedef typename internal::template Get_attributes_tuple::type Attributes; @@ -180,7 +179,7 @@ namespace CGAL { /** Return if this dart is free for adimension. * @param dh a dart handle * @param i the dimension. - * @return true iff dh is linked with NULL for \em adimension. + * @return true iff dh is linked with null_dart_handle for \em adimension. */ template bool is_free(Dart_const_handle dh) const @@ -319,7 +318,6 @@ namespace CGAL { return std::get::value> (mattribute_containers)[ah]; } - template const typename Attribute_type::type& get_attribute(typename Attribute_const_handle::type ah) const diff --git a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h index 646bda0ee0b..08dc411ec19 100644 --- a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h +++ b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h @@ -37,7 +37,6 @@ namespace CGAL { /** @file CMap_linear_cell_complex_storages.h * Definition of storages for dD Linear cell complex for combinatorial maps. */ - // Storage of darts with compact container, beta with handles // Copy of Combinatorial_map_storage_1 and add new types related // to geometry (not possible to inherith because we use Self type @@ -48,14 +47,14 @@ namespace CGAL { class CMap_linear_cell_complex_storage_1 { public: - typedef typename Traits_::Point Point; - typedef typename Traits_::Vector Vector; - typedef typename Traits_::FT FT; - typedef CMap_linear_cell_complex_storage_1 Self; typedef CGAL::Tag_false Use_index; + typedef typename Traits_::Point Point; + typedef typename Traits_::Vector Vector; + typedef typename Traits_::FT FT; + typedef internal::Combinatorial_map_helper Helper; typedef typename Items_::template Dart_wrapper Dart_wrapper; @@ -138,7 +137,6 @@ namespace CGAL { // emplace null_dart; initialized in Combinatorial_map class null_dart_handle = mnull_dart_container.emplace(); } - } void clear_storage() { @@ -490,435 +488,6 @@ namespace CGAL { CMap_linear_cell_complex_storage_1::null_handle = nullptr; - // Storage with combinatorial maps using index - // Copy of Combinatorial_map_storage_2 and add new types related - // to geometry (not possible to inherith because we use Self type - // as template parameter of Dart_wrapper. If we inherit, Self is not - // the correct type.) - template - class Linear_cell_complex_storage_2 - { - public: - typedef typename Traits_::Point Point; - typedef typename Traits_::Vector Vector; - typedef typename Traits_::FT FT; - - typedef Linear_cell_complex_storage_2 Self; - - typedef internal::Combinatorial_map_helper Helper; - - typedef typename Items_::template Dart_wrapper Dart_wrapper; - typedef typename Dart_wrapper::Dart Dart; - typedef typename Alloc_::template rebind::other Dart_allocator; - - typedef Size_type size_type; // Type used as index. - - typedef Compact_container_with_index_2, size_type > - Dart_container; - - typedef CGAL::Tag_true Use_index; - - typedef Items_ Items; - typedef Alloc_ Alloc; - - template - struct Container_for_attributes : public - Compact_container_with_index_2::other, - Constant_size_policy_for_cc_with_size<1024>, size_type > - {}; - - /// Typedef for attributes - typedef typename Dart_wrapper::Attributes Attributes; - - template - struct Attribute_type: public Helper::template Attribute_type - {}; - template - struct Attribute_handle: public Helper::template Attribute_handle - {}; - template - struct Attribute_const_handle: - public Helper::template Attribute_const_handle - {}; - template - struct Attribute_range: public Helper::template Attribute_range - {}; - template - struct Attribute_const_range: - public Helper::template Attribute_const_range - {}; - - /// Number of marks - static const unsigned int NB_MARKS = 32; - - /// The dimension of the combinatorial map. - static const unsigned int dimension = d_; - - // typedef unsigned int Dart_index; - typedef typename Dart_container::Index Dart_index; - - // Definition of old types, for backward compatibility. - typedef Dart_index Dart_handle; - typedef Dart_index Dart_const_handle; - - /// Value of null handle (!= null_dart_handle !!) - typedef size_type Null_handle_type; - static const size_type null_handle; - - typedef Index_hash_function Hash_function; - - //************************************************************************** - // Dart_range - struct Dart_range - { - typedef typename Dart_container::iterator iterator; - typedef typename Dart_container::const_iterator const_iterator; - Dart_range(Self &amap) : mmap(amap) - {} - iterator begin() - { iterator res=mmap.mdarts.begin(); ++res; return res; } - iterator end() { return mmap.mdarts.end(); } - const_iterator begin() const - { const_iterator res=mmap.mdarts.begin(); ++res; return res; } - const_iterator end() const { return mmap.mdarts.end(); } - size_type size() - { return mmap.mdarts.size()-1; } - bool empty() const - { return mmap.is_empty(); } - private: - Self & mmap; - }; - typedef const Dart_range Dart_const_range; - - /// @return a Dart_range (range through all the darts of the map). - Dart_range& darts() { return mdarts_range;} - Dart_const_range& darts() const { return mdarts_range; } - //************************************************************************** - - Linear_cell_complex_storage_2() : mdarts_range(*this) - {} - - void init_storage() - { - // Allocate a dart for null_dart_handle - null_dart_handle = mdarts.emplace(); - } - - void clear_storage() - {} - - /** Test if the map is empty. - * @return true iff the map is empty. - */ - bool is_empty() const - { return this->mdarts.size()==1; } - - /// @return the number of darts. - size_type number_of_darts() const - { return mdarts.size()-1; } - - /** Return if this dart is free for adimension. - * @param dh a dart handle - * @param i the dimension. - * @return true iff dh is linked with NULL for \em adimension. - */ - template - bool is_free(Dart_const_handle dh) const - { - CGAL_assertion(i <= dimension); - return mdarts[dh].mbeta[i]==null_dart_handle; - } - bool is_free(Dart_const_handle dh, unsigned int i) const - { - CGAL_assertion(i <= dimension); - return mdarts[dh].mbeta[i]==null_dart_handle; - } - - /// Set simultaneously all the marks of this dart to a given value. - void set_dart_marks(Dart_const_handle ADart, - const std::bitset& amarks) const - { - mdarts[ADart].set_marks(amarks); - } - /// Return all the marks of a dart. - std::bitset get_dart_marks(Dart_const_handle ADart) const - { - return mdarts[ADart].get_marks(); - } - /// Return the mark value of dart a given mark number. - bool get_dart_mark(Dart_const_handle ADart, int amark) const - { - return mdarts[ADart].get_mark(amark); - } - - /// Set the mark of a given mark number to a given value. - void set_dart_mark(Dart_const_handle ADart, int amark, bool avalue) const - { - mdarts[ADart].set_mark(amark, avalue); - } - - /// Flip the mark of a given mark number to a given value. - void flip_dart_mark(Dart_const_handle ADart, int amark) const - { - mdarts[ADart].flip_mark(amark); - } - - // Access to beta maps - Dart_handle get_beta(Dart_handle ADart, int B1) - { - CGAL_assertion(B1>=0 && B1<=dimension); - return mdarts[ADart].mbeta[B1]; - } - Dart_const_handle get_beta(Dart_const_handle ADart, int B1) const - { - CGAL_assertion(B1>=0 && B1<=dimension); - return mdarts[ADart].mbeta[B1]; - } - template - Dart_handle get_beta(Dart_handle ADart) - { - CGAL_assertion(B1>=0 && B1<=dimension); - return mdarts[ADart].mbeta[B1]; - } - template - Dart_const_handle get_beta(Dart_const_handle ADart) const - { - CGAL_assertion(B1>=0 && B1<=dimension); - return mdarts[ADart].mbeta[B1]; - } - - // return a handle on the i-attribute - template - typename Attribute_handle::type attribute(Dart_handle ADart) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "attribute called but i-attributes are disabled."); - return CGAL::cpp11::get::value> - (mdarts[ADart].mattribute_handles); - } - template - typename Attribute_const_handle::type - attribute(Dart_const_handle ADart) const - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "attribute called but i-attributes are disabled."); - return CGAL::cpp11::get::value> - (mdarts[ADart].mattribute_handles); - } - - template - typename Attribute_type::type& get_attribute - (typename Attribute_handle::type ah) - { - CGAL_assertion( ah!=null_handle ); - return CGAL::cpp11::get::value> - (mattribute_containers)[ah]; - } - - template - const typename Attribute_type::type& - get_attribute(typename Attribute_const_handle::type ah) const - { - CGAL_assertion( ah!=null_handle ); - return CGAL::cpp11::get::value> - (mattribute_containers)[ah]; - } - - Dart & get_dart(Dart_handle ah) - { - CGAL_assertion( ah!=null_handle ); - return mdarts[ah]; - } - const Dart & get_dart(Dart_const_handle ah) const - { - CGAL_assertion( ah!=null_handle ); - return mdarts[ah]; - } - - // Get the attribute of a dart - template - typename Attribute_type::type& get_attribute_of_dart(Dart_handle adart) - { - CGAL_assertion( adart!=null_handle ); - CGAL_assertion( attribute(adart)!=null_handle ); - return get_attribute(attribute(adart)); - } - template - const typename Attribute_type::type& - get_attribute_of_dart(Dart_const_handle adart) const - { - CGAL_assertion( adart!=null_handle ); - CGAL_assertion( attribute(adart)!=null_handle ); - return get_attribute(attribute(adart)); - } - - // Get the dart of the given attribute - template - Dart_handle dart_of_attribute(typename Attribute_handle::type ah) - { - CGAL_assertion( ah!=null_handle ); - return CGAL::cpp11::get::value> - (mattribute_containers)[ah].dart(); - } - template - Dart_const_handle dart_of_attribute - (typename Attribute_const_handle::type ah) const - { - CGAL_assertion( ah!=null_handle ); - return CGAL::cpp11::get::value> - (mattribute_containers)[ah].dart(); - } - - // Set the dart of the given attribute - template - void set_dart_of_attribute(typename Attribute_handle::type ah, - Dart_handle adart) - { - CGAL_assertion( ah!=null_handle ); - CGAL::cpp11::get::value> - (mattribute_containers)[ah].set_dart(adart); - } - - // Get the info of the given attribute - template - typename Attribute_type::type::Info & - info_of_attribute(typename Attribute_handle::type ah) - { - CGAL_assertion( ah!=null_handle ); - return CGAL::cpp11::get::value> - (mattribute_containers)[ah].info(); - } - template - const typename Attribute_type::type::Info & - info_of_attribute(typename Attribute_const_handle::type ah) const - { - CGAL_assertion( ah!=null_handle ); - return CGAL::cpp11::get::value> - (mattribute_containers)[ah].info(); - } - - // Get the info of the i-cell attribute associated with the given dart - template - typename Attribute_type::type::Info & info(Dart_handle adart) - { - CGAL_assertion( adart!=null_handle ); - CGAL_assertion( this->template attribute(adart)!=null_handle ); - return info_of_attribute(attribute(adart)); - } - template - const typename Attribute_type::type::Info & - info(Dart_const_handle adart) const - { - CGAL_assertion( adart!=null_handle ); - CGAL_assertion( attribute(adart)!=null_handle ); - return info_of_attribute(attribute(adart)); - } - - // Get the dart of the i-cell attribute associated with the given dart - template - Dart_handle & dart(Dart_handle adart) - { - CGAL_assertion( adart!=null_handle ); - CGAL_assertion( attribute(adart)!=null_handle ); - return dart_of_attribute(attribute(adart)); - } - template - Dart_const_handle dart(Dart_const_handle adart) const - { - CGAL_assertion( adart!=null_handle ); - CGAL_assertion( attribute(adart)!=null_handle ); - return dart_of_attribute(attribute(adart)); - } - - // Get the dart of the given 0-attribute - Point & point_of_vertex_attribute(typename Attribute_handle<0>::type vh) - { - CGAL_assertion( vh!=null_handle ); - return get_attribute<0>(vh).point(); - } - - const Point & point_of_vertex_attribute - (typename Attribute_const_handle<0>::type vh) const - { - CGAL_assertion( vh!=null_handle ); - return get_attribute<0>(vh).point(); - } - - void display_dart(Dart_const_handle ADart) const - { std::cout< - void display_attribute(typename Attribute_const_handle::type ah) const - { std::cout< - void basic_set_dart_attribute(Dart_handle ADart, - typename Attribute_handle::type ah) - { - CGAL::cpp11::get::value> - (mdarts[ADart].mattribute_handles) = ah; - } - - /** Link a dart with a given dart for a given dimension. - * @param adart the dart to link. - * @param adart2 the dart to link with. - * @param i the dimension. - */ - template - void dart_link_beta(Dart_handle adart, Dart_handle adart2) - { - CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=null_dart_handle); - mdarts[adart].mbeta[i] = adart2; - } - void dart_link_beta(Dart_handle adart, Dart_handle adart2, unsigned int i) - { - CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=null_dart_handle); - mdarts[adart].mbeta[i] = adart2; - } - - /** Unlink a dart for a given dimension. - * @param adart a dart. - * @param i the dimension. - */ - template - void dart_unlink_beta(Dart_handle adart) - { - CGAL_assertion(i <= dimension); - mdarts[adart].mbeta[i] = null_dart_handle; - } - void dart_unlink_beta(Dart_handle adart, unsigned int i) - { - CGAL_assertion(i <= dimension); - mdarts[adart].mbeta[i] = null_dart_handle; - } - - public: - /// Void dart. A dart d is i-free if beta_i(d)=null_dart_handle. - Dart_index null_dart_handle; - - protected: - /// Dart container. - Dart_container mdarts; - Dart_range mdarts_range; - - /// Tuple of attributes containers - typename Helper::Attribute_containers mattribute_containers; - }; - - /// null_handle - template - const Size_type Linear_cell_complex_storage_2::null_handle((std::numeric_limits::max)()/2); - } // namespace CGAL #if defined(BOOST_GCC) diff --git a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages_with_index.h b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages_with_index.h new file mode 100644 index 00000000000..4b215ff1cd5 --- /dev/null +++ b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages_with_index.h @@ -0,0 +1,533 @@ +// Copyright (c) 2013 CNRS and LIRIS' Establishments (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Guillaume Damiand +// +#ifndef CGAL_CMAP_LINEAR_CELL_COMPLEX_STORAGES_WITH_INDEX_H +#define CGAL_CMAP_LINEAR_CELL_COMPLEX_STORAGES_WITH_INDEX_H 1 + +#include +#include +#include +#include + +#include +#if defined(BOOST_GCC) +_Pragma("GCC diagnostic push") +_Pragma("GCC diagnostic ignored \"-Warray-bounds\"") +#endif + +namespace CGAL { + + namespace internal { + template + struct Combinatorial_map_helper; + + template + struct Container_type; + + struct Index_hash_function { + typedef std::size_t result_type; + template + std::size_t operator() (const H& h) const { + return h; + } + }; + } + + /** @file CMap_linear_cell_complex_storages_with_index.h + * Definition of storages for dD Linear cell complex for combinatorial maps index version. + */ + // Storage with combinatorial maps using index + // Copy of Combinatorial_map_storage_2 and add new types related + // to geometry (not possible to inherith because we use Self type + // as template parameter of Dart_wrapper. If we inherit, Self is not + // the correct type.) + template + class CMap_linear_cell_complex_storage_2 + { + public: + using Self=CMap_linear_cell_complex_storage_2; + using Use_index=CGAL::Tag_true; + using Index_type=Index_type_; + + typedef typename Traits_::Point Point; + typedef typename Traits_::Vector Vector; + typedef typename Traits_::FT FT; + + typedef internal::Combinatorial_map_helper Helper; + + typedef typename Items_::template Dart_wrapper Dart_wrapper; + + typedef typename internal::template Get_dart_info::type + Dart_info; + typedef CGAL::Index::Dart Dart; + + typedef std::allocator_traits Allocator_traits; + typedef typename Allocator_traits::template rebind_alloc Dart_allocator; + + typedef Compact_container_with_index_2, Index_type> + Dart_container; + + // typedef unsigned int Dart_index; + // typedef MyIndex Dart_index; + typedef typename Dart_container::Index Dart_index; + + // Definition of old types, for backward compatibility. + typedef Dart_index Dart_handle; + typedef Dart_index Dart_const_handle; + typedef typename Dart_container::size_type size_type; + + typedef Dart_index Null_handle_type; + static Null_handle_type null_handle; + + typedef Items_ Items; + typedef Alloc_ Alloc; + template + struct Container_for_attributes : public + Compact_container_with_index_2::other, + Multiply_by_two_policy_for_cc_with_size<64>, size_type > + {}; + /// Typedef for attributes + typedef typename internal::template Get_attributes_tuple::type + Attributes; + + template + struct Attribute_type: public Helper::template Attribute_type + {}; + template + struct Attribute_handle: public Helper::template Attribute_handle + {}; + template + struct Attribute_const_handle: + public Helper::template Attribute_const_handle + {}; + template + struct Attribute_range: public Helper::template Attribute_range + {}; + template + struct Attribute_const_range: + public Helper::template Attribute_const_range + {}; + + typedef typename Attribute_type<0>::type Vertex_attribute; + typedef typename Attribute_handle<0>::type Vertex_attribute_handle; + typedef typename Attribute_const_handle<0>::type + Vertex_attribute_const_handle; + + typedef typename Attribute_range<0>::type Vertex_attribute_range; + typedef typename Attribute_const_range<0>::type + Vertex_attribute_const_range; + + /// Number of marks + static const size_type NB_MARKS = 32; + + /// The dimension of the combinatorial map. + static const unsigned int dimension = d_; + + typedef internal::Index_hash_function Hash_function; + + //************************************************************************** + // Dart_range + struct Dart_range + { + typedef typename Dart_container::iterator iterator; + typedef typename Dart_container::const_iterator const_iterator; + Dart_range(Self &amap) : mmap(amap) + {} + iterator begin() + { iterator res=mmap.mdarts.begin(); ++res; return res; } + iterator end() { return mmap.mdarts.end(); } + const_iterator begin() const + { const_iterator res=mmap.mdarts.begin(); ++res; return res; } + const_iterator end() const { return mmap.mdarts.end(); } + size_type size() + { return mmap.mdarts.size()-1; } + bool empty() const + { return mmap.is_empty(); } + size_type index(Dart_index idx) const + { return idx; } + size_type index(const_iterator cit) const + { return cit; } + private: + Self & mmap; + }; + typedef const Dart_range Dart_const_range; + + /// @return a Dart_range (range through all the darts of the map). + Dart_range& darts() { return mdarts_range;} + Dart_const_range& darts() const { return mdarts_range; } + //************************************************************************** + + CMap_linear_cell_complex_storage_2() : mdarts_range(*this) + {} + + void init_storage() + { + // Allocate a dart for null_dart_handle + assert(mdarts.empty()); + Dart_index local_null_dart_handle = mdarts.emplace(); + if(local_null_dart_handle!=0) + { + std::cerr<<"[ERROR] fatal in CMap_linear_cell_complex_storage_2::init_storage" + <mdarts.size()==1; } + + /// @return the number of darts. + size_type number_of_darts() const + { return mdarts.size()-1; } + + /** Return if this dart is free for adimension. + * @param dh a dart handle + * @param i the dimension. + * @return true iff dh is linked with null_dart_handle for \em adimension. + */ + template + bool is_free(Dart_const_handle dh) const + { + CGAL_assertion(i <= dimension); + return mdarts[dh].mf[i]==null_dart_handle; + } + bool is_free(Dart_const_handle dh, unsigned int i) const + { + CGAL_assertion(i <= dimension); + return mdarts[dh].mf[i]==null_dart_handle; + } + + /// Set simultaneously all the marks of this dart to a given value. + void set_dart_marks(Dart_const_handle ADart, + const std::bitset& amarks) const + { + mdarts[ADart].set_marks(amarks); + } + /// Return all the marks of a dart. + std::bitset get_dart_marks(Dart_const_handle ADart) const + { + return mdarts[ADart].get_marks(); + } + /// Return the mark value of dart a given mark number. + bool get_dart_mark(Dart_const_handle ADart, size_type amark) const + { + return mdarts[ADart].get_mark(amark); + } + + /// Set the mark of a given mark number to a given value. + void set_dart_mark(Dart_const_handle ADart, size_type amark, bool avalue) const + { + mdarts[ADart].set_mark(amark, avalue); + } + + /// Flip the mark of a given mark number to a given value. + void flip_dart_mark(Dart_const_handle ADart, size_type amark) const + { + mdarts[ADart].flip_mark(amark); + } + + // Access to beta maps + Dart_handle get_beta(Dart_handle ADart, int B1) + { + CGAL_assertion(B1>=0 && B1<=dimension); + return mdarts[ADart].mf[B1]; + } + Dart_const_handle get_beta(Dart_const_handle ADart, int B1) const + { + CGAL_assertion(B1>=0 && B1<=dimension); + return mdarts[ADart].mf[B1]; + } + template + Dart_handle get_beta(Dart_handle ADart) + { + CGAL_assertion(B1>=0 && B1<=dimension); + return mdarts[ADart].mf[B1]; + } + template + Dart_const_handle get_beta(Dart_const_handle ADart) const + { + CGAL_assertion(B1>=0 && B1<=dimension); + return mdarts[ADart].mf[B1]; + } + + // return a handle on the i-attribute + template + typename Attribute_handle::type attribute(Dart_handle ADart) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "attribute called but i-attributes are disabled."); + return std::get::value> + (mdarts[ADart].mattribute_handles); + } + template + typename Attribute_const_handle::type + attribute(Dart_const_handle ADart) const + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "attribute called but i-attributes are disabled."); + return std::get::value> + (mdarts[ADart].mattribute_handles); + } + + // Copy a given attribute + template + typename Attribute_handle::type copy_attribute + (typename Attribute_const_handle::type ah) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "copy_attribute called but i-attributes are disabled."); + typename Attribute_handle::type res= + std::get::value> + (mattribute_containers).emplace(get_attribute(ah)); + this->template init_attribute_ref_counting(res); + return res; + } + + // Test if a given attribute is valid + template + bool is_valid_attribute(typename Attribute_const_handle::type ah) const + { + return get_attribute(ah).is_valid(); + } + + // accessors and modifiers to the attribute ref counting given its handle + template + std::size_t get_attribute_ref_counting + (typename Attribute_const_handle::type ah) const + { + return get_attribute(ah).get_nb_refs(); + } + template + void init_attribute_ref_counting(typename Attribute_handle::type ah) + { + get_attribute(ah).mrefcounting=0; + } + template + void inc_attribute_ref_counting(typename Attribute_handle::type ah) + { + get_attribute(ah).inc_nb_refs(); + } + template + void dec_attribute_ref_counting(typename Attribute_handle::type ah) + { + get_attribute(ah).dec_nb_refs(); + } + + // get the attribute given its index + template + typename Attribute_type::type& + get_attribute(typename Attribute_handle::type ah) + { + CGAL_assertion( ah!=null_handle ); + return std::get::value> + (mattribute_containers)[ah]; + } + template + const typename Attribute_type::type& + get_attribute(typename Attribute_const_handle::type ah) const + { + CGAL_assertion( ah!=null_handle ); + return std::get::value> + (mattribute_containers)[ah]; + } + + // Get the dart of the given attribute + template + Dart_handle dart_of_attribute(typename Attribute_handle::type ah) + { + CGAL_assertion( ah!=null_handle ); + return get_attribute(ah).dart(); + } + template + Dart_const_handle + dart_of_attribute(typename Attribute_const_handle::type ah) const + { + CGAL_assertion( ah!=null_handle ); + return get_attribute(ah).dart(); + } + + // Set the dart of the given attribute + template + void set_dart_of_attribute(typename Attribute_handle::type ah, + Dart_handle adart) + { + CGAL_assertion( ah!=null_handle ); + get_attribute(ah).set_dart(adart); + } + + // Get the information associated with a given dart + Dart_info& info(Dart_handle adart) + { return mdarts[adart].info(); } + const Dart_info& info(Dart_const_handle adart) const + { return mdarts[adart].info(); } + + // Get the info of the given attribute + template + typename Attribute_type::type::Info & + info_of_attribute(typename Attribute_handle::type ah) + { + CGAL_assertion( ah!=null_handle ); + return get_attribute(ah).info(); + } + template + const typename Attribute_type::type::Info & + info_of_attribute(typename Attribute_const_handle::type ah) const + { + CGAL_assertion( ah!=null_handle ); + return get_attribute(ah).info(); + } + + // Get the info of the i-cell attribute associated with the given dart + template + typename Attribute_type::type::Info & info(Dart_handle adart) + { + CGAL_assertion( adart!=null_handle ); + CGAL_assertion( this->template attribute(adart)!=null_handle ); + return info_of_attribute(attribute(adart)); + } + template + const typename Attribute_type::type::Info & + info(Dart_const_handle adart) const + { + CGAL_assertion( adart!=null_handle ); + CGAL_assertion( attribute(adart)!=null_handle ); + return info_of_attribute(attribute(adart)); + } + + // Get the dart of the i-cell attribute associated with the given dart + template + Dart_handle dart(Dart_handle adart) + { + CGAL_assertion( adart!=null_handle ); + CGAL_assertion( attribute(adart)!=null_handle ); + return dart_of_attribute(attribute(adart)); + } + template + Dart_const_handle dart(Dart_const_handle adart) const + { + CGAL_assertion( adart!=null_handle ); + CGAL_assertion( attribute(adart)!=null_handle ); + return dart_of_attribute(attribute(adart)); + } + + // Get the dart of the given 0-attribute + Point & point_of_vertex_attribute(typename Attribute_handle<0>::type vh) + { + CGAL_assertion( vh!=null_handle ); + return get_attribute<0>(vh).point(); + } + + const Point & point_of_vertex_attribute + (typename Attribute_const_handle<0>::type vh) const + { + CGAL_assertion( vh!=null_handle ); + return get_attribute<0>(vh).point(); + } + + // Debug function + void display_dart(Dart_const_handle ADart) const + { std::cout< + void display_attribute(typename Attribute_const_handle::type ah) const + { std::cout< + void basic_set_dart_attribute(Dart_handle ADart, + typename Attribute_handle::type ah) + { + std::get::value> + (mdarts[ADart].mattribute_handles) = ah; + } + + /** Link a dart with a given dart for a given dimension. + * @param adart the dart to link. + * @param adart2 the dart to link with. + * @param i the dimension. + */ + template + void dart_link_beta(Dart_handle adart, Dart_handle adart2) + { + CGAL_assertion(i <= dimension); + CGAL_assertion(adart!=null_dart_handle); + mdarts[adart].mf[i] = adart2; + } + void dart_link_beta(Dart_handle adart, Dart_handle adart2, unsigned int i) + { + CGAL_assertion(i <= dimension); + CGAL_assertion(adart!=null_dart_handle); + mdarts[adart].mf[i] = adart2; + } + + /** Unlink a dart for a given dimension. + * @param adart a dart. + * @param i the dimension. + */ + template + void dart_unlink_beta(Dart_handle adart) + { + CGAL_assertion(i <= dimension); + mdarts[adart].mf[i] = null_dart_handle; + } + void dart_unlink_beta(Dart_handle adart, unsigned int i) + { + CGAL_assertion(i <= dimension); + mdarts[adart].mf[i] = null_dart_handle; + } + + public: + /// Void dart. A dart d is i-free if beta_i(d)=null_dart_handle. + static Dart_index null_dart_handle; //=0; + + protected: + /// Dart container. + Dart_container mdarts; + Dart_range mdarts_range; + + /// Tuple of attributes containers + typename Helper::Attribute_containers mattribute_containers; + }; + + /// null_dart_handle + template + typename CMap_linear_cell_complex_storage_2:: + Dart_index CMap_linear_cell_complex_storage_2:: + null_dart_handle(0); + + /// null_handle + template + typename CMap_linear_cell_complex_storage_2:: + Null_handle_type CMap_linear_cell_complex_storage_2:: + null_handle((std::numeric_limits::max)()/2); + +} // namespace CGAL + +#if defined(BOOST_GCC) + _Pragma("GCC diagnostic pop") +#endif + +#endif // CGAL_CMAP_LINEAR_CELL_COMPLEX_STORAGES_WITH_INDEX_H // +// EOF // diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_for_combinatorial_map.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_for_combinatorial_map.h index 8f377e2a224..70cf339dd49 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_for_combinatorial_map.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_for_combinatorial_map.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,7 @@ namespace CGAL { class Traits_, class Items_, class Alloc_, template class CMap, class Storage_ > - class Linear_cell_complex_for_combinatorial_map: + class Linear_cell_complex_for_combinatorial_map_base: public Linear_cell_complex_base { public: - typedef Linear_cell_complex_for_combinatorial_map Self; typedef Linear_cell_complex_base class CMap2, class Storage2> - Linear_cell_complex_for_combinatorial_map - (const Linear_cell_complex_for_combinatorial_map& alcc) : Base(alcc) {} @@ -113,8 +114,8 @@ namespace CGAL { class Items2, class Alloc2, template class CMap2, class Storage2, typename Converters> - Linear_cell_complex_for_combinatorial_map - (const Linear_cell_complex_for_combinatorial_map& alcc, const Converters& converters) : Base(alcc, converters) {} @@ -123,8 +124,8 @@ namespace CGAL { class Items2, class Alloc2, template class CMap2, class Storage2, typename Converters, typename DartInfoConverter> - Linear_cell_complex_for_combinatorial_map - (const Linear_cell_complex_for_combinatorial_map& alcc, const Converters& converters, const DartInfoConverter& dartinfoconverter) : @@ -136,8 +137,8 @@ namespace CGAL { template class CMap2, class Storage2, typename Converters, typename DartInfoConverter, typename PointConverter> - Linear_cell_complex_for_combinatorial_map - (const Linear_cell_complex_for_combinatorial_map& alcc, const Converters& converters, const DartInfoConverter& dartinfoconverter, const PointConverter& pointconverter) : @@ -225,6 +226,83 @@ namespace CGAL { void clear() { Base::clear(); } //need explicit definition for Has_member_clear in bgl helpers }; + template < unsigned int d_, unsigned int ambient_dim, + class Traits_, class Items_, class Alloc_, + template class CMap, + class Storage_ > + class Linear_cell_complex_for_combinatorial_map: + public Linear_cell_complex_for_combinatorial_map_base + + { + typedef Linear_cell_complex_for_combinatorial_map Self; + + typedef Linear_cell_complex_for_combinatorial_map_base Base; + + typedef Traits_ Traits; + typedef Items_ Items; + typedef Alloc_ Alloc; + + Linear_cell_complex_for_combinatorial_map() : Base() + {} + + /** Copy the given linear cell complex into *this. + * Note that both LCC can have different dimensions and/or non void attributes. + * @param alcc the linear cell complex to copy. + * @post *this is valid. + */ + Linear_cell_complex_for_combinatorial_map(const Self& alcc) : Base(alcc) + {} + + Linear_cell_complex_for_combinatorial_map(Self&& alcc) : Base(alcc) + {} + + template class CMap2, + class Storage2> + Linear_cell_complex_for_combinatorial_map + (const Linear_cell_complex_for_combinatorial_map& alcc) : Base(alcc) + {} + + template class CMap2, + class Storage2, typename Converters> + Linear_cell_complex_for_combinatorial_map + (const Linear_cell_complex_for_combinatorial_map& alcc, + const Converters& converters) : Base(alcc, converters) + {} + + template class CMap2, + class Storage2, typename Converters, typename DartInfoConverter> + Linear_cell_complex_for_combinatorial_map + (const Linear_cell_complex_for_combinatorial_map& alcc, + const Converters& converters, + const DartInfoConverter& dartinfoconverter) : + Base(alcc, converters, dartinfoconverter) + {} + + template class CMap2, + class Storage2, typename Converters, + typename DartInfoConverter, typename PointConverter> + Linear_cell_complex_for_combinatorial_map + (const Linear_cell_complex_for_combinatorial_map& alcc, + const Converters& converters, const DartInfoConverter& dartinfoconverter, + const PointConverter& pointconverter) : + Base(alcc, converters, dartinfoconverter, pointconverter) + {} +}; + namespace Index { // New class Linear_cell_complex using compact container with index. @@ -232,23 +310,83 @@ namespace Index // template parameters and the default parameter for Refs class. // NOTE: If we want to inherit from this class, we need to add the Refs class // template parameter. -template < unsigned int d_, unsigned int ambient_dim = d_, - class Traits_ = Linear_cell_complex_traits, - class Items_ = Linear_cell_complex_min_items, - class Alloc_ = CGAL_ALLOCATOR(int), - template - class CMap = Combinatorial_map_base, - class Storage_ = Linear_cell_complex_storage_2 > - class Linear_cell_complex : public Linear_cell_complex_base, - Storage_> - { // TODO - }; - } +template< unsigned int d_, unsigned int ambient_dim, + class Traits_, class Items_, class Alloc_, + template + class CMap, class Storage_> +class Linear_cell_complex_for_combinatorial_map: + public Linear_cell_complex_for_combinatorial_map_base + +{ + typedef Linear_cell_complex_for_combinatorial_map Self; + + typedef Linear_cell_complex_for_combinatorial_map_base Base; + + typedef Traits_ Traits; + typedef Items_ Items; + typedef Alloc_ Alloc; + + Linear_cell_complex_for_combinatorial_map() : Base() + {} + + /** Copy the given linear cell complex into *this. + * Note that both LCC can have different dimensions and/or non void attributes. + * @param alcc the linear cell complex to copy. + * @post *this is valid. + */ + Linear_cell_complex_for_combinatorial_map(const Self& alcc) : Base(alcc) + {} + + Linear_cell_complex_for_combinatorial_map(Self&& alcc) : Base(alcc) + {} + + template class CMap2, + class Storage2> + Linear_cell_complex_for_combinatorial_map + (const Linear_cell_complex_for_combinatorial_map& alcc) : Base(alcc) + {} + + template class CMap2, + class Storage2, typename Converters> + Linear_cell_complex_for_combinatorial_map + (const Linear_cell_complex_for_combinatorial_map& alcc, + const Converters& converters) : Base(alcc, converters) + {} + + template class CMap2, + class Storage2, typename Converters, typename DartInfoConverter> + Linear_cell_complex_for_combinatorial_map + (const Linear_cell_complex_for_combinatorial_map& alcc, + const Converters& converters, + const DartInfoConverter& dartinfoconverter) : + Base(alcc, converters, dartinfoconverter) + {} + + template class CMap2, + class Storage2, typename Converters, + typename DartInfoConverter, typename PointConverter> + Linear_cell_complex_for_combinatorial_map + (const Linear_cell_complex_for_combinatorial_map& alcc, + const Converters& converters, const DartInfoConverter& dartinfoconverter, + const PointConverter& pointconverter) : + Base(alcc, converters, dartinfoconverter, pointconverter) + {} +}; +} // namespace Index } // namespace CGAL #endif // CGAL_LINEAR_CELL_COMPLEX_FOR_COMBINATORIAL_MAP_H // diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_fwd.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_fwd.h index b130f582a65..c207e24ff49 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_fwd.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_fwd.h @@ -75,21 +75,21 @@ template < unsigned int d_, unsigned int ambient_dim = d_, Alloc_, CGAL::Tag_false> > class Linear_cell_complex_for_generalized_map; - namespace Index - { - template < unsigned int d_, unsigned int ambient_dim = d_, - class Traits_ = Linear_cell_complex_traits, - class Items_ = Linear_cell_complex_min_items, - class Alloc_ = CGAL_ALLOCATOR(int), - template - class CMap = Combinatorial_map_base, - class Storage_ = CMap_linear_cell_complex_storage_2> - // TODO READD CGAL::Tag_false> > - class Linear_cell_complex_for_combinatorial_map; +namespace Index +{ +template < unsigned int d_, unsigned int ambient_dim = d_, + class Traits_ = Linear_cell_complex_traits, + class Items_ = Linear_cell_complex_min_items, + class Alloc_ = CGAL_ALLOCATOR(int), + template + class CMap = Combinatorial_map_base, + class Storage_ = CMap_linear_cell_complex_storage_2> +// TODO READD CGAL::Tag_false> > +class Linear_cell_complex_for_combinatorial_map; - /* TODO GMap_linear_cell_complex_storage_2 +/* TODO GMap_linear_cell_complex_storage_2 template < unsigned int d_, unsigned int ambient_dim = d_, class Traits_ = Linear_cell_complex_traits, class Items_ = Linear_cell_complex_min_items, @@ -100,7 +100,7 @@ class Linear_cell_complex_for_generalized_map; Traits_, Items_, unsigned int>> // TODO READD CGAL::Tag_false> > class Linear_cell_complex_for_generalized_map; */ - } // namespace Index +} // namespace Index } // CGAL diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_copy_test.cpp b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_copy_test.cpp index 8ffc3f80b59..04cbf4ce6eb 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_copy_test.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_copy_test.cpp @@ -10,7 +10,42 @@ // If defined, use compact container with index; otherwise use compact // container with handle. -// #define USE_COMPACT_CONTAINER_WITH_INDEX 1 +#ifdef USE_COMPACT_CONTAINER_WITH_INDEX +template +using My_cell_attribute=CGAL::Index::Cell_attribute; + +template +using My_cell_attribute_with_point= +CGAL::Index::Cell_attribute_with_point; + +template +using My_lcc_cmap=CGAL::Index::Linear_cell_complex_for_combinatorial_map +; + +// TODO use CGAL::Index::Linear_cell_complex_for_generalized_map +template +using My_lcc_gmap=CGAL::Linear_cell_complex_for_generalized_map +; +#else +template +using My_cell_attribute=CGAL::Cell_attribute; + +template +using My_cell_attribute_with_point=CGAL::Cell_attribute_with_point; + +template +using My_lcc_cmap=CGAL::Linear_cell_complex_for_combinatorial_map +; + +template +using My_lcc_gmap=CGAL::Linear_cell_complex_for_generalized_map +; +#endif // USE_COMPACT_CONTAINER_WITH_INDEX + using namespace std; struct Map_2_dart_items @@ -19,16 +54,9 @@ struct Map_2_dart_items template < class Refs > struct Dart_wrapper { -#ifdef USE_COMPACT_CONTAINER_WITH_INDEX - typedef CGAL::Index::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Index::Cell_attribute< Refs, double > Double_attrib; - typedef CGAL::Index::Cell_attribute_with_point< Refs, double > Double_attrib_wp; -#else - typedef CGAL::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Cell_attribute< Refs, double > Double_attrib; - typedef CGAL::Cell_attribute_with_point< Refs, double > Double_attrib_wp; -#endif - + typedef My_cell_attribute< Refs, int > Int_attrib; + typedef My_cell_attribute< Refs, double > Double_attrib; + typedef My_cell_attribute< Refs, double > Double_attrib_wp; typedef std::tuple Attributes; }; }; @@ -39,19 +67,11 @@ struct Map_2_dart_max_items_3 template < class Refs > struct Dart_wrapper { -#ifdef USE_COMPACT_CONTAINER_WITH_INDEX - typedef CGAL::Index::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Index::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Index::Cell_attribute< Refs, double > Double_attrib; -#else - typedef CGAL::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Cell_attribute< Refs, double > Double_attrib; -#endif - + typedef My_cell_attribute_with_point< Refs, int > Int_attrib_wp; + typedef My_cell_attribute< Refs, int > Int_attrib; + typedef My_cell_attribute< Refs, double > Double_attrib; typedef double Dart_info; - typedef std::tuple Attributes; + typedef std::tuple Attributes; }; }; @@ -61,19 +81,12 @@ struct Map_3_dart_items_3 template < class Refs > struct Dart_wrapper { -#ifdef USE_COMPACT_CONTAINER_WITH_INDEX - typedef CGAL::Index::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Index::Cell_attribute< Refs, double > Double_attrib; - typedef CGAL::Index::Cell_attribute_with_point< Refs, double > Double_attrib_wp; -#else - typedef CGAL::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Cell_attribute< Refs, double > Double_attrib; - typedef CGAL::Cell_attribute_with_point< Refs, double > Double_attrib_wp; -#endif - + typedef My_cell_attribute< Refs, int > Int_attrib; + typedef My_cell_attribute< Refs, double > Double_attrib; + typedef My_cell_attribute_with_point< Refs, double > Double_attrib_wp; typedef char Dart_info; - typedef std::tuple Attributes; + typedef std::tuple + Attributes; }; }; @@ -83,19 +96,12 @@ struct Map_3_dart_max_items_3 template < class Refs > struct Dart_wrapper { -#ifdef USE_COMPACT_CONTAINER_WITH_INDEX - typedef CGAL::Index::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Index::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Index::Cell_attribute< Refs, double > Double_attrib; -#else - typedef CGAL::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Cell_attribute< Refs, double > Double_attrib; -#endif - + typedef My_cell_attribute_with_point< Refs, int > Int_attrib_wp; + typedef My_cell_attribute< Refs, int > Int_attrib; + typedef My_cell_attribute< Refs, double > Double_attrib; typedef char* Dart_info; - typedef std::tuple Attributes; + typedef std::tuple + Attributes; }; }; @@ -106,14 +112,8 @@ public: template < class Refs > struct Dart_wrapper { -#ifdef USE_COMPACT_CONTAINER_WITH_INDEX - typedef CGAL::Index::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Index::Cell_attribute< Refs, int > Int_attrib; -#else - typedef CGAL::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Cell_attribute< Refs, int > Int_attrib; -#endif - + typedef My_cell_attribute_with_point< Refs, int > Int_attrib_wp; + typedef My_cell_attribute< Refs, int > Int_attrib; typedef int* Dart_info; typedef std::tuple Attributes; }; @@ -137,19 +137,11 @@ struct Map_dart_items_4 template < class Refs > struct Dart_wrapper { -#ifdef USE_COMPACT_CONTAINER_WITH_INDEX - typedef CGAL::Index::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Index::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Index::Cell_attribute< Refs, double > Double_attrib; -#else - typedef CGAL::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Cell_attribute< Refs, double > Double_attrib; -#endif - + typedef My_cell_attribute_with_point< Refs, int > Int_attrib_wp; + typedef My_cell_attribute< Refs, int > Int_attrib; + typedef My_cell_attribute< Refs, double > Double_attrib; typedef MonInfo Dart_info; - typedef std::tuple + typedef std::tuple Attributes; }; }; @@ -159,19 +151,11 @@ struct Map_dart_max_items_4 template < class Refs > struct Dart_wrapper { -#ifdef USE_COMPACT_CONTAINER_WITH_INDEX - typedef CGAL::Index::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Index::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Index::Cell_attribute< Refs, double > Double_attrib; -#else - typedef CGAL::Cell_attribute_with_point< Refs, int > Int_attrib_wp; - typedef CGAL::Cell_attribute< Refs, int > Int_attrib; - typedef CGAL::Cell_attribute< Refs, double > Double_attrib; -#endif - + typedef My_cell_attribute_with_point< Refs, int > Int_attrib_wp; + typedef My_cell_attribute< Refs, int > Int_attrib; + typedef My_cell_attribute< Refs, double > Double_attrib; typedef double Dart_info; - typedef std::tuple + typedef std::tuple Attributes; }; }; @@ -184,83 +168,41 @@ typedef CGAL::Linear_cell_complex_traits typedef CGAL::Linear_cell_complex_traits<4> Traits4_a; -#ifdef USE_COMPACT_CONTAINER_WITH_INDEX -// Point_3, void, void -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<2,3, Traits3_a, -CGAL::Linear_cell_complex_min_items<2> > CMap1; - -// Point_3+double, void, double -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<2,3, Traits3_a, Map_2_dart_items > CMap2; - -// Point_3+int, int, double -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<2,3, Traits3_b, Map_2_dart_max_items_3> CMap3; - -// Point_3, void, void, void -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<3,3, Traits3_a, -CGAL::Linear_cell_complex_min_items<3> > CMap4; - -// Point_3+double, void, int, double -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<3,3, Traits3_a, Map_3_dart_items_3> CMap5; - -// Point_3+int, int, int, double -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<3,3, Traits3_b, Map_3_dart_max_items_3> CMap6; - -// Point_3+int, void, int, void -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<3,3, Traits3_b, -Another_map_3_dart_items_3> CMap7; - -// Point_4+int, void, int, void, int -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<4,4, Traits4_a, Map_dart_items_4> CMap8; - -// Point_4+int, int, int, int, double -typedef CGAL::Index::Linear_cell_complex_for_combinatorial_map<4,4, Traits4_a, Map_dart_max_items_4> CMap9; - -#else - // ======================= LCC based on combinatorial maps // Point_3, void, void -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3, Traits3_a, - CGAL::Linear_cell_complex_min_items > CMap1; +typedef My_lcc_cmap<2,3, Traits3_a, CGAL::Linear_cell_complex_min_items> CMap1; // Point_3+double, void, double -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3, - Traits3_a, Map_2_dart_items > CMap2; +typedef My_lcc_cmap<2,3,Traits3_a, Map_2_dart_items> CMap2; // Point_3+int, int, double -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3, Traits3_b, - Map_2_dart_max_items_3> CMap3; +typedef My_lcc_cmap<2,3, Traits3_b, Map_2_dart_max_items_3> CMap3; // Point_3, void, void, void -typedef CGAL::Linear_cell_complex_for_combinatorial_map<3,3, Traits3_a, - CGAL::Linear_cell_complex_min_items > CMap4; +typedef My_lcc_cmap<3,3, Traits3_a, CGAL::Linear_cell_complex_min_items> CMap4; // Point_3+double, void, int, double -typedef CGAL::Linear_cell_complex_for_combinatorial_map<3,3, - Traits3_a, Map_3_dart_items_3> CMap5; +typedef My_lcc_cmap<3,3, Traits3_a, Map_3_dart_items_3> CMap5; // Point_3+int, int, int, double -typedef CGAL::Linear_cell_complex_for_combinatorial_map<3,3, - Traits3_b, Map_3_dart_max_items_3> CMap6; +typedef My_lcc_cmap<3,3, Traits3_b, Map_3_dart_max_items_3> CMap6; // Point_3+int, void, int, void -typedef CGAL::Linear_cell_complex_for_combinatorial_map<3,3, - Traits3_b, Another_map_3_dart_items_3> CMap7; +typedef My_lcc_cmap<3,3, Traits3_b, Another_map_3_dart_items_3> CMap7; // Point_4+int, void, int, void, int -typedef CGAL::Linear_cell_complex_for_combinatorial_map<4,4, - Traits4_a, Map_dart_items_4> CMap8; +typedef My_lcc_cmap<4,4, Traits4_a, Map_dart_items_4> CMap8; // Point_4+int, int, int, int, double -typedef CGAL::Linear_cell_complex_for_combinatorial_map<4,4, - Traits4_a, Map_dart_max_items_4> CMap9; +typedef My_lcc_cmap<4,4, Traits4_a, Map_dart_max_items_4> CMap9; struct Converter_map9_points_into_map5_points { - CMap5::Attribute_handle<0>::type operator() + CMap5::template Attribute_handle<0>::type operator() (const CMap9& map1, CMap5& map2, CMap9::Dart_const_handle dh1, CMap5::Dart_handle dh2) const { - assert( map1.attribute<0>(dh1)!=map1.null_handle ); + assert( ap1.attribute<0>(dh1)!=map1.null_handle); CMap5::Attribute_handle<0>::type res = map2.attribute<0>(dh2); if ( res==map2.null_handle ) @@ -276,40 +218,31 @@ struct Converter_map9_points_into_map5_points // ======================= LCC based on generalized maps // Point_3, void, void -typedef CGAL::Linear_cell_complex_for_generalized_map<2,3, Traits3_a, - CGAL::Linear_cell_complex_min_items > GMap1; +typedef My_lcc_gmap<2,3, Traits3_a, CGAL::Linear_cell_complex_min_items> GMap1; // Point_3+double, void, double -typedef CGAL::Linear_cell_complex_for_generalized_map<2,3, - Traits3_a, Map_2_dart_items > GMap2; +typedef My_lcc_gmap<2,3, Traits3_a, Map_2_dart_items> GMap2; // Point_3+int, int, double -typedef CGAL::Linear_cell_complex_for_generalized_map<2,3, Traits3_b, - Map_2_dart_max_items_3> GMap3; +typedef My_lcc_gmap<2,3, Traits3_b, Map_2_dart_max_items_3> GMap3; // Point_3, void, void, void -typedef CGAL::Linear_cell_complex_for_generalized_map<3,3, Traits3_a, - CGAL::Linear_cell_complex_min_items > GMap4; +typedef My_lcc_gmap<3,3, Traits3_a, CGAL::Linear_cell_complex_min_items> GMap4; // Point_3+double, void, int, double -typedef CGAL::Linear_cell_complex_for_generalized_map<3,3, - Traits3_a, Map_3_dart_items_3> GMap5; +typedef My_lcc_gmap<3,3, Traits3_a, Map_3_dart_items_3> GMap5; // Point_3+int, int, int, double -typedef CGAL::Linear_cell_complex_for_generalized_map<3,3, - Traits3_b, Map_3_dart_max_items_3> GMap6; +typedef My_lcc_gmap<3,3, Traits3_b, Map_3_dart_max_items_3> GMap6; // Point_3+int, void, int, void -typedef CGAL::Linear_cell_complex_for_generalized_map<3,3, - Traits3_b, Another_map_3_dart_items_3> GMap7; +typedef My_lcc_gmap<3,3, Traits3_b, Another_map_3_dart_items_3> GMap7; // Point_4+int, void, int, void, int -typedef CGAL::Linear_cell_complex_for_generalized_map<4,4, - Traits4_a, Map_dart_items_4> GMap8; +typedef My_lcc_gmap<4,4, Traits4_a, Map_dart_items_4> GMap8; // Point_4+int, int, int, int, double -typedef CGAL::Linear_cell_complex_for_generalized_map<4,4, - Traits4_a, Map_dart_max_items_4> GMap9; +typedef My_lcc_gmap<4,4, Traits4_a, Map_dart_max_items_4> GMap9; struct Converter_gmap9_points_into_gmap5_points {