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