1 #ifndef __CPPLUGINS__EXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__H__
2 #define __CPPLUGINS__EXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__H__
6 // -------------------------------------------------------------------------
7 #define cpPluginsQEIteratorsMacro( op, it, cit ) \
8 inline it Begin##op( ) \
9 { return( it( this, it::Op##op, true ) ); } \
10 inline it End##op( ) \
11 { return( it( this, it::Op##op, false ) ); } \
12 inline cit Begin##op( ) const \
13 { return( cit( this, cit::Op##op, true ) ); } \
14 inline cit End##op( ) const \
15 { return( cit( this, cit::Op##op, false ) ); }
17 // -------------------------------------------------------------------------
18 #define cpPluginsExtensionsQEPointIteratorsMacro( op, it, cit ) \
19 inline Point##it BeginPoint##op( ) \
20 { return( Point##it( this, it::Op##op, true ) ); } \
21 inline Point##it EndPoint##op( ) \
22 { return( Point##it( this, it::Op##op, false ) ); } \
23 inline Point##cit BeginPoint##op( ) const \
24 { return( Point##cit( this, cit::Op##op, true ) ); } \
25 inline Point##cit EndPoint ##op( ) const \
26 { return( Point##cit( this, cit::Op##op, false ) ); }
28 // -------------------------------------------------------------------------
29 #define cpPluginsExtensionsQEAllIteratorsMacro( op ) \
30 cpPluginsQEIteratorsMacro( op, Iterator, ConstIterator ); \
31 cpPluginsExtensionsQEPointIteratorsMacro( op, Iterator, ConstIterator );
37 namespace DataStructures
42 class QuadEdgeBaseIterator
45 typedef QuadEdgeBaseIterator Self;
48 // Different types of logical iterators
62 QuadEdgeBaseIterator( E* e, int op = OpOnext, bool start = true );
63 virtual ~QuadEdgeBaseIterator( );
64 Self& operator=( const Self& r );
66 E* GetStartEdge( ) const;
67 E* GetIterator( ) const;
68 int GetOpType( ) const;
69 bool GetStart( ) const;
71 bool operator==( Self& r );
72 bool operator==( const Self& r ) const;
73 bool operator!=( Self& r );
74 bool operator!=( const Self& r ) const;
76 Self& operator++( int );
79 /// Method that should do all the iteration work
80 virtual void _GoToNext( );
83 E* m_StartEdge; /**< Start edge */
84 E* m_Iterator; /**< Current iteration position */
85 int m_OpType; /**< Operation type */
86 bool m_Start; /**< Indicates iteration has just started */
92 class QuadEdgeIterator
93 : public QuadEdgeBaseIterator< E >
96 typedef QuadEdgeIterator Self;
97 typedef QuadEdgeBaseIterator< E > Superclass;
102 E* e = NULL, int op = Superclass::OpOnext, bool start = true
104 virtual ~QuadEdgeIterator( );
111 class QuadEdgeConstIterator
112 : public QuadEdgeBaseIterator< const E >
115 typedef QuadEdgeConstIterator Self;
116 typedef QuadEdgeBaseIterator< const E > Superclass;
120 QuadEdgeConstIterator(
121 const E* e = NULL, int op = Superclass::OpOnext, bool start = true
123 virtual ~QuadEdgeConstIterator( );
124 const E* operator*( ) const;
130 class QuadEdgePointIterator
131 : public QuadEdgeBaseIterator< const E >
134 typedef QuadEdgePointIterator Self;
135 typedef QuadEdgeBaseIterator< const E > Superclass;
139 QuadEdgePointIterator(
140 const E* e = NULL, int op = Superclass::OpOnext, bool start = true
142 virtual ~QuadEdgePointIterator( );
143 typename E::TPrimalGeometry& operator*( );
149 class QuadEdgePointConstIterator
150 : public QuadEdgeBaseIterator< const E >
153 typedef QuadEdgePointConstIterator Self;
154 typedef QuadEdgeBaseIterator< const E > Superclass;
158 QuadEdgePointConstIterator(
159 const E* e = NULL, int op = Superclass::OpOnext, bool start = true
161 virtual ~QuadEdgePointConstIterator( );
162 const typename E::TPrimalGeometry& operator*( ) const;
171 #include <cpPlugins/Extensions/DataStructures/QuadEdgeIterators.hxx>
173 #endif // __CPPLUGINS__EXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__H__