mirror of https://github.com/CGAL/cgal
First try with index class.
This commit is contained in:
parent
0053fa20bc
commit
6d71a45447
|
|
@ -492,10 +492,10 @@ namespace CGAL {
|
||||||
template <unsigned int, typename>
|
template <unsigned int, typename>
|
||||||
friend struct Index::Dart;
|
friend struct Index::Dart;
|
||||||
|
|
||||||
template < unsigned int, class, class, class >
|
template < unsigned int, class, class, class, class >
|
||||||
friend class Generalized_map_base;
|
friend class Generalized_map_base;
|
||||||
|
|
||||||
template <int, typename>
|
template <unsigned int, typename>
|
||||||
friend struct GMap_dart;
|
friend struct GMap_dart;
|
||||||
|
|
||||||
template <class, class, class>
|
template <class, class, class>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef CGAL_COMBINATORIAL_MAP_ITERATORS_BASE_HH
|
#ifndef CGAL_COMBINATORIAL_MAP_ITERATORS_BASE_HH
|
||||||
#define CGAL_COMBINATORIAL_MAP_ITERATORS_BASE_HH 1
|
#define CGAL_COMBINATORIAL_MAP_ITERATORS_BASE_HH 1
|
||||||
|
|
||||||
#include <CGAL/Compact_container.h>
|
#include <CGAL/Compact_container_with_index_2.h>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <CGAL/Handle_hash_function.h>
|
#include <CGAL/Handle_hash_function.h>
|
||||||
|
|
||||||
#include <CGAL/Compact_container.h>
|
#include <CGAL/Compact_container_with_index_2.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -403,6 +403,26 @@ namespace CGAL {
|
||||||
// Thus we initialize null_dart_handle in the Combinatorial_map constructor
|
// Thus we initialize null_dart_handle in the Combinatorial_map constructor
|
||||||
#endif // CGAL_CMAP_DEPRECATED
|
#endif // CGAL_CMAP_DEPRECATED
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
class MyIndex
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyIndex(size_t s=-1) : idx(s)
|
||||||
|
{}
|
||||||
|
operator size_t() const
|
||||||
|
{ return idx; }
|
||||||
|
MyIndex<T>& operator++()
|
||||||
|
{ ++idx; return *this; }
|
||||||
|
MyIndex<T> operator++(int)
|
||||||
|
{ MyIndex<T> res(*this); ++idx; return res; }
|
||||||
|
MyIndex<T>& operator--()
|
||||||
|
{ --idx; return *this; }
|
||||||
|
MyIndex<T> operator--(int)
|
||||||
|
{MyIndex<T> res(*this); --idx; return res;}
|
||||||
|
private:
|
||||||
|
T idx;
|
||||||
|
};
|
||||||
|
|
||||||
// Storage with combinatorial maps using index
|
// Storage with combinatorial maps using index
|
||||||
template<unsigned int d_, class Items_, class Alloc_>
|
template<unsigned int d_, class Items_, class Alloc_>
|
||||||
class Combinatorial_map_storage_2
|
class Combinatorial_map_storage_2
|
||||||
|
|
@ -460,7 +480,8 @@ namespace CGAL {
|
||||||
/// The dimension of the combinatorial map.
|
/// The dimension of the combinatorial map.
|
||||||
static const unsigned int dimension = d_;
|
static const unsigned int dimension = d_;
|
||||||
|
|
||||||
typedef unsigned int Dart_index;
|
// typedef unsigned int Dart_index;
|
||||||
|
typedef MyIndex<unsigned int> Dart_index;
|
||||||
|
|
||||||
// Definition of old types, for backward compatibility.
|
// Definition of old types, for backward compatibility.
|
||||||
typedef Dart_index Dart_handle;
|
typedef Dart_index Dart_handle;
|
||||||
|
|
@ -468,7 +489,7 @@ namespace CGAL {
|
||||||
|
|
||||||
/// Value of null handle (!= null_dart_handle !!)
|
/// Value of null handle (!= null_dart_handle !!)
|
||||||
typedef Dart_index Null_handle_type;
|
typedef Dart_index Null_handle_type;
|
||||||
static const Dart_index null_handle = 0;
|
static const Dart_index null_handle; //=0;
|
||||||
|
|
||||||
typedef Index_hash_function Hash_function;
|
typedef Index_hash_function Hash_function;
|
||||||
|
|
||||||
|
|
@ -742,7 +763,7 @@ namespace CGAL {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Void dart. A dart d is i-free if beta_i(d)=null_dart_handle.
|
/// Void dart. A dart d is i-free if beta_i(d)=null_dart_handle.
|
||||||
static const Dart_index null_dart_handle=0;
|
static const Dart_index null_dart_handle; //=0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Dart container.
|
/// Dart container.
|
||||||
|
|
@ -752,6 +773,12 @@ namespace CGAL {
|
||||||
typename Helper::Attribute_containers mattribute_containers;
|
typename Helper::Attribute_containers mattribute_containers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// null_dart_handle
|
||||||
|
template<unsigned int d_, class Items_, class Alloc_>
|
||||||
|
const typename Combinatorial_map_storage_2<d_, Items_, Alloc_>::Dart_index
|
||||||
|
Combinatorial_map_storage_2<d_, Items_, Alloc_>::null_dart_handle(0);
|
||||||
|
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_COMBINATORIAL_MAP_H //
|
#endif // CGAL_COMBINATORIAL_MAP_H //
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,7 @@ namespace CGAL {
|
||||||
template<unsigned int, unsigned int, class, class, class>
|
template<unsigned int, unsigned int, class, class, class>
|
||||||
friend class Linear_cell_complex_storage_2;
|
friend class Linear_cell_complex_storage_2;
|
||||||
|
|
||||||
template <class, class, class>
|
template <class, class, class, class>
|
||||||
friend class Compact_container;
|
friend class Compact_container;
|
||||||
|
|
||||||
template <class, class, class>
|
template <class, class, class>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue