mirror of https://github.com/CGAL/cgal
VC8 STL iterator fixes
This commit is contained in:
parent
36302e190f
commit
8faa59772e
|
|
@ -33,6 +33,8 @@
|
||||||
#include <CGAL/In_place_list.h>
|
#include <CGAL/In_place_list.h>
|
||||||
#include <CGAL/HalfedgeDS_iterator.h>
|
#include <CGAL/HalfedgeDS_iterator.h>
|
||||||
#include <CGAL/Arrangement_2/Arrangement_2_iterators.h>
|
#include <CGAL/Arrangement_2/Arrangement_2_iterators.h>
|
||||||
|
#include <CGAL/function_objects.h>
|
||||||
|
#include <CGAL/Iterator_project.h>
|
||||||
|
|
||||||
CGAL_BEGIN_NAMESPACE
|
CGAL_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
@ -60,6 +62,7 @@ inline bool _is_lsb_set (const void* p)
|
||||||
return ((val & mask) != 0);
|
return ((val & mask) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! \class
|
/*! \class
|
||||||
* Base vertex class.
|
* Base vertex class.
|
||||||
*/
|
*/
|
||||||
|
|
@ -297,6 +300,7 @@ public:
|
||||||
Isolated_vertex_const_iterator;
|
Isolated_vertex_const_iterator;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
public:
|
||||||
|
|
||||||
void *p_he; // An incident halfedge along the face boundary.
|
void *p_he; // An incident halfedge along the face boundary.
|
||||||
// The LSB of the pointer indicates whether
|
// The LSB of the pointer indicates whether
|
||||||
|
|
@ -637,19 +641,11 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define the hole iterators:
|
typedef Cast_function_object<void*,Halfedge*> HolePtr2HalfedgePtrCast ;
|
||||||
typedef I_HalfedgeDS_iterator<
|
|
||||||
typename F::Hole_iterator,
|
typedef Iterator_project<typename F::Hole_iterator , HolePtr2HalfedgePtrCast> Hole_iterator ;
|
||||||
Halfedge*,
|
typedef Iterator_project<typename F::Hole_const_iterator, HolePtr2HalfedgePtrCast> Hole_const_iterator ;
|
||||||
typename F::Hole_iterator::difference_type,
|
|
||||||
typename F::Hole_iterator::iterator_category> Hole_iterator;
|
|
||||||
|
|
||||||
typedef I_HalfedgeDS_const_iterator<
|
|
||||||
typename F::Hole_const_iterator,
|
|
||||||
typename F::Hole_iterator,
|
|
||||||
const Halfedge*,
|
|
||||||
typename F::Hole_const_iterator::difference_type,
|
|
||||||
typename F::Hole_const_iterator::iterator_category> Hole_const_iterator;
|
|
||||||
|
|
||||||
/*! Get the number of holes inside the face. */
|
/*! Get the number of holes inside the face. */
|
||||||
size_t number_of_holes() const
|
size_t number_of_holes() const
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,10 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <CGAL/function_objects.h>
|
||||||
|
#include <CGAL/Iterator_project.h>
|
||||||
|
#include <CGAL/Iterator_transform.h>
|
||||||
|
|
||||||
CGAL_BEGIN_NAMESPACE
|
CGAL_BEGIN_NAMESPACE
|
||||||
|
|
||||||
/*! \class
|
/*! \class
|
||||||
|
|
@ -353,28 +357,50 @@ public:
|
||||||
Halfedge_const_iterator,
|
Halfedge_const_iterator,
|
||||||
Bidirectional_circulator_tag> Ccb_halfedge_const_circulator;
|
Bidirectional_circulator_tag> Ccb_halfedge_const_circulator;
|
||||||
|
|
||||||
typedef I_HalfedgeDS_iterator
|
private:
|
||||||
<DHoles_iter, Ccb_halfedge_circulator,
|
|
||||||
DDifference,
|
struct HalfedgePtrToCirculator
|
||||||
DIterator_category> Hole_iterator;
|
{
|
||||||
|
typedef DHalfedge* argument_type ;
|
||||||
|
typedef Ccb_halfedge_circulator result_type ;
|
||||||
|
|
||||||
|
result_type operator() ( argument_type const& s ) const
|
||||||
|
{
|
||||||
|
return Ccb_halfedge_circulator( Halfedge_iterator(s) ) ;
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
struct HalfedgeConstPtrToConstCirculator
|
||||||
|
{
|
||||||
|
typedef DHalfedge const* argument_type ;
|
||||||
|
typedef Ccb_halfedge_const_circulator result_type ;
|
||||||
|
|
||||||
|
result_type operator() ( argument_type const& s ) const
|
||||||
|
{
|
||||||
|
return Ccb_halfedge_const_circulator( Halfedge_const_iterator(s) ) ;
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
typedef Cast_function_object<DVertex,Vertex> DVertexToVertexCast ;
|
||||||
|
|
||||||
|
typedef Iterator_project<DIsolated_vertices_iter ,DVertexToVertexCast> Isolated_vertex_iterator_base ;
|
||||||
|
typedef Iterator_project<DIsolated_vertices_const_iter,DVertexToVertexCast> Isolated_vertex_const_iterator_base ;
|
||||||
|
|
||||||
|
public :
|
||||||
|
|
||||||
|
typedef Iterator_transform<DHoles_iter ,HalfedgePtrToCirculator > Hole_iterator ;
|
||||||
|
typedef Iterator_transform<DHoles_const_iter,HalfedgeConstPtrToConstCirculator> Hole_const_iterator ;
|
||||||
|
|
||||||
|
|
||||||
typedef I_HalfedgeDS_const_iterator
|
|
||||||
<DHoles_const_iter, DHoles_iter,
|
|
||||||
Ccb_halfedge_const_circulator,
|
|
||||||
DDifference,
|
|
||||||
DIterator_category> Hole_const_iterator;
|
|
||||||
|
|
||||||
/*! \class
|
/*! \class
|
||||||
* Isolated vertices iterator - defined as a class to make it assignable
|
* Isolated vertices iterator - defined as a class to make it assignable
|
||||||
* to the vertex iterator type.
|
* to the vertex iterator type.
|
||||||
*/
|
*/
|
||||||
class Isolated_vertex_iterator :
|
|
||||||
public I_HalfedgeDS_iterator<DIsolated_vertices_iter, Vertex, DDifference,
|
class Isolated_vertex_iterator : public Isolated_vertex_iterator_base
|
||||||
DIterator_category>
|
|
||||||
{
|
{
|
||||||
typedef I_HalfedgeDS_iterator<DIsolated_vertices_iter,
|
typedef Isolated_vertex_iterator_base Base ;
|
||||||
Vertex, DDifference,
|
|
||||||
DIterator_category> Base;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -397,16 +423,9 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Isolated_vertex_const_iterator :
|
class Isolated_vertex_const_iterator : public Isolated_vertex_const_iterator_base
|
||||||
public I_HalfedgeDS_const_iterator <DIsolated_vertices_const_iter,
|
|
||||||
DIsolated_vertices_iter,
|
|
||||||
Vertex, DDifference,
|
|
||||||
DIterator_category>
|
|
||||||
{
|
{
|
||||||
typedef I_HalfedgeDS_const_iterator <DIsolated_vertices_const_iter,
|
typedef Isolated_vertex_const_iterator_base Base ;
|
||||||
DIsolated_vertices_iter,
|
|
||||||
Vertex, DDifference,
|
|
||||||
DIterator_category> Base;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -532,16 +551,21 @@ protected:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \class
|
|
||||||
* An iterator for traversing all arrangement edges (including the
|
|
||||||
* fictitious ones).
|
typedef Cast_function_object<DHalfedge,Halfedge> DHalfedgeToHalfedgeCast ;
|
||||||
*/
|
|
||||||
class _All_edge_iterator :
|
typedef Iterator_project<DEdge_iter ,DHalfedgeToHalfedgeCast> _All_edge_iterator_base;
|
||||||
public I_HalfedgeDS_iterator<DEdge_iter, Halfedge,
|
typedef Iterator_project<DEdge_const_iter,DHalfedgeToHalfedgeCast> _All_edge_const_iterator_base;
|
||||||
DDifference, DIterator_category>
|
|
||||||
|
|
||||||
|
//! \class
|
||||||
|
//! An iterator for traversing all arrangement edges (including the fictitious ones).
|
||||||
|
//!
|
||||||
|
|
||||||
|
class _All_edge_iterator : public _All_edge_iterator_base
|
||||||
{
|
{
|
||||||
typedef I_HalfedgeDS_iterator<DEdge_iter, Halfedge,
|
typedef _All_edge_iterator_base Base;
|
||||||
DDifference, DIterator_category> Base;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -565,14 +589,9 @@ protected:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class _All_edge_const_iterator :
|
class _All_edge_const_iterator : public _All_edge_const_iterator_base
|
||||||
public I_HalfedgeDS_const_iterator<DEdge_iter, DEdge_const_iter,
|
|
||||||
Halfedge, DDifference,
|
|
||||||
DIterator_category>
|
|
||||||
{
|
{
|
||||||
typedef I_HalfedgeDS_const_iterator<DEdge_iter, DEdge_const_iter,
|
typedef _All_edge_const_iterator_base Base;
|
||||||
Halfedge, DDifference,
|
|
||||||
DIterator_category> Base;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -587,6 +606,11 @@ protected:
|
||||||
Base (iter)
|
Base (iter)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
_All_edge_const_iterator ( _All_edge_iterator const& iter) :
|
||||||
|
Base (iter)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Casting to a halfedge iterator.
|
// Casting to a halfedge iterator.
|
||||||
operator Halfedge_const_iterator () const
|
operator Halfedge_const_iterator () const
|
||||||
{
|
{
|
||||||
|
|
@ -595,6 +619,7 @@ protected:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Definition of handles (equivalent to iterators):
|
// Definition of handles (equivalent to iterators):
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ public:
|
||||||
|
|
||||||
pointer ptr () const
|
pointer ptr () const
|
||||||
{
|
{
|
||||||
return (reinterpret_cast<value_type *> (*iter));
|
return (static_cast<value_type *> (*iter));
|
||||||
}
|
}
|
||||||
|
|
||||||
reference operator* () const
|
reference operator* () const
|
||||||
|
|
@ -199,7 +199,7 @@ public:
|
||||||
|
|
||||||
pointer ptr () const
|
pointer ptr () const
|
||||||
{
|
{
|
||||||
return (reinterpret_cast<const value_type *> (*iter));
|
return (static_cast<const value_type *> (*iter));
|
||||||
}
|
}
|
||||||
|
|
||||||
reference operator* () const
|
reference operator* () const
|
||||||
|
|
@ -283,11 +283,13 @@ public:
|
||||||
|
|
||||||
/*! Constructors. */
|
/*! Constructors. */
|
||||||
I_Filtered_iterator()
|
I_Filtered_iterator()
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
I_Filtered_iterator (Iterator it) :
|
I_Filtered_iterator (Iterator it) :
|
||||||
nt (it)
|
nt (it), iend(it)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
I_Filtered_iterator (Iterator it, Iterator end) :
|
I_Filtered_iterator (Iterator it, Iterator end) :
|
||||||
nt (it),
|
nt (it),
|
||||||
|
|
@ -325,7 +327,7 @@ public:
|
||||||
|
|
||||||
pointer ptr() const
|
pointer ptr() const
|
||||||
{
|
{
|
||||||
return (pointer)(&(*nt));
|
return static_cast<pointer>(&(*nt));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Equality operators. */
|
/*! Equality operators. */
|
||||||
|
|
@ -385,6 +387,7 @@ public:
|
||||||
--(*this);
|
--(*this);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -429,11 +432,13 @@ public:
|
||||||
|
|
||||||
/*! Constructors. */
|
/*! Constructors. */
|
||||||
I_Filtered_const_iterator()
|
I_Filtered_const_iterator()
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
I_Filtered_const_iterator (Iterator it) :
|
I_Filtered_const_iterator (Iterator it) :
|
||||||
nt (it)
|
nt (it), iend(it)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
I_Filtered_const_iterator (Iterator it, Iterator end) :
|
I_Filtered_const_iterator (Iterator it, Iterator end) :
|
||||||
nt (it),
|
nt (it),
|
||||||
|
|
@ -457,7 +462,8 @@ public:
|
||||||
nt (it.current_iterator()),
|
nt (it.current_iterator()),
|
||||||
iend (it.past_the_end()),
|
iend (it.past_the_end()),
|
||||||
filt (it.filter())
|
filt (it.filter())
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/*! Access operations. */
|
/*! Access operations. */
|
||||||
Iterator current_iterator() const
|
Iterator current_iterator() const
|
||||||
|
|
@ -477,7 +483,7 @@ public:
|
||||||
|
|
||||||
pointer ptr() const
|
pointer ptr() const
|
||||||
{
|
{
|
||||||
return (pointer)(&(*nt));
|
return static_cast<pointer>(&(*nt));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Equality operators. */
|
/*! Equality operators. */
|
||||||
|
|
@ -537,6 +543,7 @@ public:
|
||||||
--(*this);
|
--(*this);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CGAL_END_NAMESPACE
|
CGAL_END_NAMESPACE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue