Start LCC with index.

This commit is contained in:
Guillaume Damiand 2022-04-11 14:59:02 +02:00
parent aa654901b5
commit abd93465a4
7 changed files with 804 additions and 633 deletions

View File

@ -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<unsigned int i>
bool is_free(Dart_const_handle dh) const

View File

@ -85,7 +85,6 @@ namespace CGAL {
typename Alloc_::template rebind<T>::other,
Multiply_by_two_policy_for_cc_with_size<64>, size_type >
{};
/// Typedef for attributes
typedef typename internal::template Get_attributes_tuple<Dart_wrapper>::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<unsigned int i>
bool is_free(Dart_const_handle dh) const
@ -319,7 +318,6 @@ namespace CGAL {
return std::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah];
}
template<unsigned int i>
const typename Attribute_type<i>::type&
get_attribute(typename Attribute_const_handle<i>::type ah) const

View File

@ -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<d_, ambient_dim, Traits_,
Items_, Alloc_, Concurrent_tag> 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<Self> Helper;
typedef typename Items_::template Dart_wrapper<Self> 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<d_, ambient_dim, Traits_,
Items_, Alloc_, Concurrent_tag>::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<unsigned int d_, unsigned int ambient_dim,
class Traits_, class Items_, class Alloc_, class Size_type >
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<d_, ambient_dim, Traits_,
Items_, Alloc_, Size_type> Self;
typedef internal::Combinatorial_map_helper<Self> Helper;
typedef typename Items_::template Dart_wrapper<Self> Dart_wrapper;
typedef typename Dart_wrapper::Dart Dart;
typedef typename Alloc_::template rebind<Dart>::other Dart_allocator;
typedef Size_type size_type; // Type used as index.
typedef Compact_container_with_index_2<Dart,Dart_allocator,
Constant_size_policy_for_cc_with_size<1024>, size_type >
Dart_container;
typedef CGAL::Tag_true Use_index;
typedef Items_ Items;
typedef Alloc_ Alloc;
template <typename T>
struct Container_for_attributes : public
Compact_container_with_index_2<T,
typename Alloc_::template rebind<T>::other,
Constant_size_policy_for_cc_with_size<1024>, size_type >
{};
/// Typedef for attributes
typedef typename Dart_wrapper::Attributes Attributes;
template<int i>
struct Attribute_type: public Helper::template Attribute_type<i>
{};
template<int i>
struct Attribute_handle: public Helper::template Attribute_handle<i>
{};
template<int i>
struct Attribute_const_handle:
public Helper::template Attribute_const_handle<i>
{};
template<int i>
struct Attribute_range: public Helper::template Attribute_range<i>
{};
template<int i>
struct Attribute_const_range:
public Helper::template Attribute_const_range<i>
{};
/// 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<unsigned int i>
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<NB_MARKS>& amarks) const
{
mdarts[ADart].set_marks(amarks);
}
/// Return all the marks of a dart.
std::bitset<NB_MARKS> 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<int B1>
Dart_handle get_beta(Dart_handle ADart)
{
CGAL_assertion(B1>=0 && B1<=dimension);
return mdarts[ADart].mbeta[B1];
}
template<int B1>
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<unsigned int i>
typename Attribute_handle<i>::type attribute(Dart_handle ADart)
{
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
"attribute<i> called but i-attributes are disabled.");
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
(mdarts[ADart].mattribute_handles);
}
template<unsigned int i>
typename Attribute_const_handle<i>::type
attribute(Dart_const_handle ADart) const
{
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
"attribute<i> called but i-attributes are disabled.");
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
(mdarts[ADart].mattribute_handles);
}
template<unsigned int i>
typename Attribute_type<i>::type& get_attribute
(typename Attribute_handle<i>::type ah)
{
CGAL_assertion( ah!=null_handle );
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah];
}
template<unsigned int i>
const typename Attribute_type<i>::type&
get_attribute(typename Attribute_const_handle<i>::type ah) const
{
CGAL_assertion( ah!=null_handle );
return CGAL::cpp11::get<Helper::template Dimension_index<i>::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<unsigned int i>
typename Attribute_type<i>::type& get_attribute_of_dart(Dart_handle adart)
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( attribute<i>(adart)!=null_handle );
return get_attribute<i>(attribute<i>(adart));
}
template<unsigned int i>
const typename Attribute_type<i>::type&
get_attribute_of_dart(Dart_const_handle adart) const
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( attribute<i>(adart)!=null_handle );
return get_attribute<i>(attribute<i>(adart));
}
// Get the dart of the given attribute
template<unsigned int i>
Dart_handle dart_of_attribute(typename Attribute_handle<i>::type ah)
{
CGAL_assertion( ah!=null_handle );
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah].dart();
}
template<unsigned int i>
Dart_const_handle dart_of_attribute
(typename Attribute_const_handle<i>::type ah) const
{
CGAL_assertion( ah!=null_handle );
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah].dart();
}
// Set the dart of the given attribute
template<unsigned int i>
void set_dart_of_attribute(typename Attribute_handle<i>::type ah,
Dart_handle adart)
{
CGAL_assertion( ah!=null_handle );
CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah].set_dart(adart);
}
// Get the info of the given attribute
template<unsigned int i>
typename Attribute_type<i>::type::Info &
info_of_attribute(typename Attribute_handle<i>::type ah)
{
CGAL_assertion( ah!=null_handle );
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah].info();
}
template<unsigned int i>
const typename Attribute_type<i>::type::Info &
info_of_attribute(typename Attribute_const_handle<i>::type ah) const
{
CGAL_assertion( ah!=null_handle );
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah].info();
}
// Get the info of the i-cell attribute associated with the given dart
template<unsigned int i>
typename Attribute_type<i>::type::Info & info(Dart_handle adart)
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( this->template attribute<i>(adart)!=null_handle );
return info_of_attribute<i>(attribute<i>(adart));
}
template<unsigned int i>
const typename Attribute_type<i>::type::Info &
info(Dart_const_handle adart) const
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( attribute<i>(adart)!=null_handle );
return info_of_attribute<i>(attribute<i>(adart));
}
// Get the dart of the i-cell attribute associated with the given dart
template<unsigned int i>
Dart_handle & dart(Dart_handle adart)
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( attribute<i>(adart)!=null_handle );
return dart_of_attribute<i>(attribute<i>(adart));
}
template<unsigned int i>
Dart_const_handle dart(Dart_const_handle adart) const
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( attribute<i>(adart)!=null_handle );
return dart_of_attribute<i>(attribute<i>(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<<ADart; }
template<unsigned int i>
void display_attribute(typename Attribute_const_handle<i>::type ah) const
{ std::cout<<ah; }
protected:
// Set the handle on the i th attribute
template<unsigned int i>
void basic_set_dart_attribute(Dart_handle ADart,
typename Attribute_handle<i>::type ah)
{
CGAL::cpp11::get<Helper::template Dimension_index<i>::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<unsigned int i>
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<unsigned int i>
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<unsigned int d_, unsigned int ambient_dim,
class Traits_, class Items_, class Alloc_, class Size_type>
const Size_type Linear_cell_complex_storage_2<d_, ambient_dim, Traits_,
Items_, Alloc_, Size_type>::null_handle((std::numeric_limits<Size_type>::max)()/2);
} // namespace CGAL
#if defined(BOOST_GCC)

View File

@ -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 <guillaume.damiand@liris.cnrs.fr>
//
#ifndef CGAL_CMAP_LINEAR_CELL_COMPLEX_STORAGES_WITH_INDEX_H
#define CGAL_CMAP_LINEAR_CELL_COMPLEX_STORAGES_WITH_INDEX_H 1
#include <CGAL/Compact_container_with_index_2.h>
#include <CGAL/Dart.h>
#include <CGAL/Handle_hash_function.h>
#include <bitset>
#include <boost/config.hpp>
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Warray-bounds\"")
#endif
namespace CGAL {
namespace internal {
template <typename M>
struct Combinatorial_map_helper;
template<typename Concurrent_tag, class T, class Alloc_>
struct Container_type;
struct Index_hash_function {
typedef std::size_t result_type;
template <class H>
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<unsigned int d_, unsigned int ambient_dim,
class Traits_, class Items_, class Alloc_, class Size_type >
class CMap_linear_cell_complex_storage_2
{
public:
using Self=CMap_linear_cell_complex_storage_2<d_, ambient_dim, Traits_,
Items_, Alloc_, Size_type>;
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<Self> Helper;
typedef typename Items_::template Dart_wrapper<Self> Dart_wrapper;
typedef typename internal::template Get_dart_info<Dart_wrapper>::type
Dart_info;
typedef CGAL::Index::Dart<d_, Self, Dart_info> Dart;
typedef std::allocator_traits<Alloc_> Allocator_traits;
typedef typename Allocator_traits::template rebind_alloc<Dart> Dart_allocator;
typedef Compact_container_with_index_2<Dart,Dart_allocator,
Multiply_by_two_policy_for_cc_with_size<64>, Index_type>
Dart_container;
// typedef unsigned int Dart_index;
// typedef MyIndex<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;
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 <typename T>
struct Container_for_attributes : public
Compact_container_with_index_2<T,
typename Alloc_::template rebind<T>::other,
Multiply_by_two_policy_for_cc_with_size<64>, size_type >
{};
/// Typedef for attributes
typedef typename internal::template Get_attributes_tuple<Dart_wrapper>::type
Attributes;
template<int i>
struct Attribute_type: public Helper::template Attribute_type<i>
{};
template<int i>
struct Attribute_handle: public Helper::template Attribute_handle<i>
{};
template<int i>
struct Attribute_const_handle:
public Helper::template Attribute_const_handle<i>
{};
template<int i>
struct Attribute_range: public Helper::template Attribute_range<i>
{};
template<int i>
struct Attribute_const_range:
public Helper::template Attribute_const_range<i>
{};
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"
<<std::endl;
CGAL_assertion(false);
}
}
void clear_storage()
{ mdarts.clear(); }
/** 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_dart_handle for \em adimension.
*/
template<unsigned int i>
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<NB_MARKS>& amarks) const
{
mdarts[ADart].set_marks(amarks);
}
/// Return all the marks of a dart.
std::bitset<NB_MARKS> 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<int B1>
Dart_handle get_beta(Dart_handle ADart)
{
CGAL_assertion(B1>=0 && B1<=dimension);
return mdarts[ADart].mf[B1];
}
template<int B1>
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<unsigned int i>
typename Attribute_handle<i>::type attribute(Dart_handle ADart)
{
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
"attribute<i> called but i-attributes are disabled.");
return std::get<Helper::template Dimension_index<i>::value>
(mdarts[ADart].mattribute_handles);
}
template<unsigned int i>
typename Attribute_const_handle<i>::type
attribute(Dart_const_handle ADart) const
{
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
"attribute<i> called but i-attributes are disabled.");
return std::get<Helper::template Dimension_index<i>::value>
(mdarts[ADart].mattribute_handles);
}
// Copy a given attribute
template<unsigned int i>
typename Attribute_handle<i>::type copy_attribute
(typename Attribute_const_handle<i>::type ah)
{
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
"copy_attribute<i> called but i-attributes are disabled.");
typename Attribute_handle<i>::type res=
std::get<Helper::template Dimension_index<i>::value>
(mattribute_containers).emplace(get_attribute<i>(ah));
this->template init_attribute_ref_counting<i>(res);
return res;
}
// Test if a given attribute is valid
template<unsigned int i>
bool is_valid_attribute(typename Attribute_const_handle<i>::type ah) const
{
return get_attribute<i>(ah).is_valid();
}
// accessors and modifiers to the attribute ref counting given its handle
template<unsigned int i>
std::size_t get_attribute_ref_counting
(typename Attribute_const_handle<i>::type ah) const
{
return get_attribute<i>(ah).get_nb_refs();
}
template<unsigned int i>
void init_attribute_ref_counting(typename Attribute_handle<i>::type ah)
{
get_attribute<i>(ah).mrefcounting=0;
}
template<unsigned int i>
void inc_attribute_ref_counting(typename Attribute_handle<i>::type ah)
{
get_attribute<i>(ah).inc_nb_refs();
}
template<unsigned int i>
void dec_attribute_ref_counting(typename Attribute_handle<i>::type ah)
{
get_attribute<i>(ah).dec_nb_refs();
}
// get the attribute given its index
template<unsigned int i>
typename Attribute_type<i>::type&
get_attribute(typename Attribute_handle<i>::type ah)
{
CGAL_assertion( ah!=null_handle );
return std::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah];
}
template<unsigned int i>
const typename Attribute_type<i>::type&
get_attribute(typename Attribute_const_handle<i>::type ah) const
{
CGAL_assertion( ah!=null_handle );
return std::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah];
}
// Get the dart of the given attribute
template<unsigned int i>
Dart_handle dart_of_attribute(typename Attribute_handle<i>::type ah)
{
CGAL_assertion( ah!=null_handle );
return get_attribute<i>(ah).dart();
}
template<unsigned int i>
Dart_const_handle
dart_of_attribute(typename Attribute_const_handle<i>::type ah) const
{
CGAL_assertion( ah!=null_handle );
return get_attribute<i>(ah).dart();
}
// Set the dart of the given attribute
template<unsigned int i>
void set_dart_of_attribute(typename Attribute_handle<i>::type ah,
Dart_handle adart)
{
CGAL_assertion( ah!=null_handle );
get_attribute<i>(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<unsigned int i>
typename Attribute_type<i>::type::Info &
info_of_attribute(typename Attribute_handle<i>::type ah)
{
CGAL_assertion( ah!=null_handle );
return get_attribute<i>(ah).info();
}
template<unsigned int i>
const typename Attribute_type<i>::type::Info &
info_of_attribute(typename Attribute_const_handle<i>::type ah) const
{
CGAL_assertion( ah!=null_handle );
return get_attribute<i>(ah).info();
}
// Get the info of the i-cell attribute associated with the given dart
template<unsigned int i>
typename Attribute_type<i>::type::Info & info(Dart_handle adart)
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( this->template attribute<i>(adart)!=null_handle );
return info_of_attribute<i>(attribute<i>(adart));
}
template<unsigned int i>
const typename Attribute_type<i>::type::Info &
info(Dart_const_handle adart) const
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( attribute<i>(adart)!=null_handle );
return info_of_attribute<i>(attribute<i>(adart));
}
// Get the dart of the i-cell attribute associated with the given dart
template<unsigned int i>
Dart_handle dart(Dart_handle adart)
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( attribute<i>(adart)!=null_handle );
return dart_of_attribute<i>(attribute<i>(adart));
}
template<unsigned int i>
Dart_const_handle dart(Dart_const_handle adart) const
{
CGAL_assertion( adart!=null_handle );
CGAL_assertion( attribute<i>(adart)!=null_handle );
return dart_of_attribute<i>(attribute<i>(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<<ADart; }
template<unsigned int i>
void display_attribute(typename Attribute_const_handle<i>::type ah) const
{ std::cout<<ah; }
protected:
// Set the handle on the i th attribute
template<unsigned int i>
void basic_set_dart_attribute(Dart_handle ADart,
typename Attribute_handle<i>::type ah)
{
std::get<Helper::template Dimension_index<i>::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<unsigned int i>
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<unsigned int i>
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<unsigned int d_, unsigned int ambient_dim,
class Items_, class Alloc_, class Size_type>
typename CMap_linear_cell_complex_storage_2<d_, ambient_dim, Items_, Alloc_, Size_type>::
Dart_index CMap_linear_cell_complex_storage_2<d_, ambient_dim, Items_, Alloc_, Size_type>::
null_dart_handle(0);
/// null_handle
template<unsigned int d_, unsigned int ambient_dim,
class Traits_, class Items_, class Alloc_, class Size_type>
typename CMap_linear_cell_complex_storage_2<d_, ambient_dim, Items_, Alloc_, Size_type>::
Null_handle_type CMap_linear_cell_complex_storage_2<d_, ambient_dim, Traits_,
Items_, Alloc_, Size_type>::
null_handle((std::numeric_limits<Size_type>::max)()/2);
} // namespace CGAL
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic pop")
#endif
#endif // CGAL_CMAP_LINEAR_CELL_COMPLEX_STORAGES_WITH_INDEX_H //
// EOF //

View File

@ -18,6 +18,7 @@
#include <CGAL/Linear_cell_complex_min_items.h>
#include <CGAL/Combinatorial_map.h>
#include <CGAL/CMap_linear_cell_complex_storages.h>
#include <CGAL/CMap_linear_cell_complex_storages_with_index.h>
#include <CGAL/boost/graph/properties.h>
#include <unordered_map>
@ -35,7 +36,7 @@ namespace CGAL {
class Traits_, class Items_, class Alloc_,
template<unsigned int,class,class,class,class> class CMap,
class Storage_ >
class Linear_cell_complex_for_combinatorial_map:
class Linear_cell_complex_for_combinatorial_map_base:
public Linear_cell_complex_base<d_, ambient_dim, Traits_,
Items_, Alloc_, CMap,
Linear_cell_complex_for_combinatorial_map
@ -45,7 +46,7 @@ namespace CGAL {
Storage_>
{
public:
typedef Linear_cell_complex_for_combinatorial_map<d_, ambient_dim,
typedef Linear_cell_complex_for_combinatorial_map_base<d_, ambient_dim,
Traits_, Items_, Alloc_, CMap, Storage_> Self;
typedef Linear_cell_complex_base<d_, ambient_dim,
@ -94,18 +95,18 @@ namespace CGAL {
* @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_base(const Self& alcc) : Base(alcc)
{}
Linear_cell_complex_for_combinatorial_map(Self&& alcc) : Base(alcc)
Linear_cell_complex_for_combinatorial_map_base(Self&& alcc) : Base(alcc)
{}
template <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Linear_cell_complex_for_combinatorial_map_base
(const Linear_cell_complex_for_combinatorial_map_base<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc) : Base(alcc)
{}
@ -113,8 +114,8 @@ namespace CGAL {
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Linear_cell_complex_for_combinatorial_map_base
(const Linear_cell_complex_for_combinatorial_map_base<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc,
const Converters& converters) : Base(alcc, converters)
{}
@ -123,8 +124,8 @@ namespace CGAL {
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters, typename DartInfoConverter>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Linear_cell_complex_for_combinatorial_map_base
(const Linear_cell_complex_for_combinatorial_map_base<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc,
const Converters& converters,
const DartInfoConverter& dartinfoconverter) :
@ -136,8 +137,8 @@ namespace CGAL {
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters,
typename DartInfoConverter, typename PointConverter>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Linear_cell_complex_for_combinatorial_map_base
(const Linear_cell_complex_for_combinatorial_map_base<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& 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<unsigned int,class,class,class,class> class CMap,
class Storage_ >
class Linear_cell_complex_for_combinatorial_map:
public Linear_cell_complex_for_combinatorial_map_base
<d_, ambient_dim, Traits_, Items_, Alloc_, CMap, Storage_>
{
typedef Linear_cell_complex_for_combinatorial_map<d_, ambient_dim,
Traits_, Items_, Alloc_, CMap, Storage_> Self;
typedef Linear_cell_complex_for_combinatorial_map_base<d_, ambient_dim,
Traits_, Items_, Alloc_, CMap, Storage_> 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 <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc) : Base(alcc)
{}
template <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc,
const Converters& converters) : Base(alcc, converters)
{}
template <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters, typename DartInfoConverter>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc,
const Converters& converters,
const DartInfoConverter& dartinfoconverter) :
Base(alcc, converters, dartinfoconverter)
{}
template <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters,
typename DartInfoConverter, typename PointConverter>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& 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<ambient_dim>,
class Items_ = Linear_cell_complex_min_items<d_>,
class Alloc_ = CGAL_ALLOCATOR(int),
template<unsigned int,class,class,class,class>
class CMap = Combinatorial_map_base,
class Storage_ = Linear_cell_complex_storage_2<d_, ambient_dim,
Traits_, Items_,
Alloc_, unsigned int> >
class Linear_cell_complex : public Linear_cell_complex_base<d_,
ambient_dim, Traits_, Items_, Alloc_, CMap,
Linear_cell_complex<d_, ambient_dim,
Traits_, Items_, Alloc_, CMap, Storage_>,
Storage_>
{ // TODO
};
}
template< unsigned int d_, unsigned int ambient_dim,
class Traits_, class Items_, class Alloc_,
template<unsigned int,class,class,class,class>
class CMap, class Storage_>
class Linear_cell_complex_for_combinatorial_map:
public Linear_cell_complex_for_combinatorial_map_base
<d_, ambient_dim, Traits_, Items_, Alloc_, CMap, Storage_>
{
typedef Linear_cell_complex_for_combinatorial_map<d_, ambient_dim,
Traits_, Items_, Alloc_, CMap, Storage_> Self;
typedef Linear_cell_complex_for_combinatorial_map_base<d_, ambient_dim,
Traits_, Items_, Alloc_, CMap, Storage_> 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 <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc) : Base(alcc)
{}
template <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc,
const Converters& converters) : Base(alcc, converters)
{}
template <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters, typename DartInfoConverter>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& alcc,
const Converters& converters,
const DartInfoConverter& dartinfoconverter) :
Base(alcc, converters, dartinfoconverter)
{}
template <unsigned int d2, unsigned int ambient_dim2, class Traits2,
class Items2, class Alloc2,
template<unsigned int,class,class,class,class> class CMap2,
class Storage2, typename Converters,
typename DartInfoConverter, typename PointConverter>
Linear_cell_complex_for_combinatorial_map
(const Linear_cell_complex_for_combinatorial_map<d2, ambient_dim2,
Traits2, Items2, Alloc2, CMap2, Storage2>& 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 //

View File

@ -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<ambient_dim>,
class Items_ = Linear_cell_complex_min_items,
class Alloc_ = CGAL_ALLOCATOR(int),
template<unsigned int,class,class,class,class>
class CMap = Combinatorial_map_base,
class Storage_ = CMap_linear_cell_complex_storage_2<d_, ambient_dim,
Traits_, Items_,
Alloc_, unsigned int>>
// 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<ambient_dim>,
class Items_ = Linear_cell_complex_min_items,
class Alloc_ = CGAL_ALLOCATOR(int),
template<unsigned int,class,class,class,class>
class CMap = Combinatorial_map_base,
class Storage_ = CMap_linear_cell_complex_storage_2<d_, ambient_dim,
Traits_, Items_,
Alloc_, unsigned int>>
// 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<ambient_dim>,
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

View File

@ -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<class Refs, class Info>
using My_cell_attribute=CGAL::Index::Cell_attribute<Refs, Info>;
template<class Refs, class Info>
using My_cell_attribute_with_point=
CGAL::Index::Cell_attribute_with_point<Refs, Info>;
template<unsigned int d, unsigned int ambient_dim,
class Traits, class Items>
using My_lcc_cmap=CGAL::Index::Linear_cell_complex_for_combinatorial_map
<d, ambient_dim, Traits, Items>;
// TODO use CGAL::Index::Linear_cell_complex_for_generalized_map
template<unsigned int d, unsigned int ambient_dim,
class Traits, class Items>
using My_lcc_gmap=CGAL::Linear_cell_complex_for_generalized_map
<d, ambient_dim, Traits, Items>;
#else
template<class Refs, class Info>
using My_cell_attribute=CGAL::Cell_attribute<Refs, Info>;
template<class Refs, class Info>
using My_cell_attribute_with_point=CGAL::Cell_attribute_with_point<Refs, Info>;
template<unsigned int d, unsigned int ambient_dim,
class Traits, class Items>
using My_lcc_cmap=CGAL::Linear_cell_complex_for_combinatorial_map
<d, ambient_dim, Traits, Items>;
template<unsigned int d, unsigned int ambient_dim,
class Traits, class Items>
using My_lcc_gmap=CGAL::Linear_cell_complex_for_generalized_map
<d, ambient_dim, Traits, Items>;
#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<Double_attrib_wp, void, Double_attrib> 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<Int_attrib_wp, Int_attrib,
Double_attrib> Attributes;
typedef std::tuple<Int_attrib_wp, Int_attrib,Double_attrib> 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<Double_attrib_wp, void,
Int_attrib, Double_attrib> Attributes;
typedef std::tuple<Double_attrib_wp, void,Int_attrib, Double_attrib>
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<Int_attrib_wp, Int_attrib,
Int_attrib, Double_attrib> Attributes;
typedef std::tuple<Int_attrib_wp, Int_attrib,Int_attrib, Double_attrib>
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<Int_attrib_wp, void, Int_attrib> 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<Int_attrib_wp, void,
Int_attrib, void, Int_attrib>
typedef std::tuple<Int_attrib_wp, void, Int_attrib, void, Int_attrib>
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<Int_attrib_wp, Int_attrib,
Int_attrib, Int_attrib, Double_attrib>
typedef std::tuple<Int_attrib_wp, Int_attrib,Int_attrib, Int_attrib, Double_attrib>
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
{