diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h index 9bbea312c66..1162260398f 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h @@ -525,14 +525,6 @@ public: //------------------- typename Gt::Object_2 dual(const Face_handle& f) const; -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE - //af: all_faces_iterator == Face_handle -#else - typename Gt::Object_2 dual(const All_faces_iterator& it) const - { - return dual(*it); - } -#endif Site_2 dual(const Finite_faces_iterator& it) const { typename Gt::Object_2 o = dual(Face_handle(it)); @@ -967,11 +959,7 @@ protected: Vertex_handle insert_degree_2(Edge e, const Site_2& p); void remove_degree_2(Vertex_handle v); void remove_degree_3(Vertex_handle v); -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE void remove_degree_3(Vertex_handle v, Face_handle f); -#else - void remove_degree_3(Vertex_handle v, Face* f); -#endif // this was defined because the hierarchy needs it Vertex_handle create_vertex() { diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h index 21725c93cc4..baa4b0838c7 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h @@ -396,22 +396,14 @@ void Apollonius_graph_2:: remove_degree_3(Vertex_handle v) { -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE remove_degree_3(v, Face_handle()); -#else - remove_degree_3(v, NULL); -#endif } template void Apollonius_graph_2:: -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE -remove_degree_3(Vertex_handle v, Face_handle f) // af:was Face* -#else -remove_degree_3(Vertex_handle v, Face* f) -#endif +remove_degree_3(Vertex_handle v, Face_handle f) { CGAL_triangulation_precondition( degree(v) == 3 ); this->_tds.remove_degree_3(v, f); @@ -1834,11 +1826,7 @@ remove_degree_d_vertex(Vertex_handle v) } CGAL_triangulation_precondition( degree(v) == 3 ); -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE this->_tds.remove_degree_3( v, Face_handle() ); -#else - this->_tds.remove_degree_3( v, NULL ); -#endif for (unsigned int i = 0; i < num_fe; i++) { delete[] flipped_edges[i]; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h index 164c991c4b3..5da045dee34 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h @@ -147,11 +147,7 @@ is_valid(bool verbose, int level) const for(unsigned int i = 1; i < ag_hierarchy_2__maxlevel; ++i) { for( Finite_vertices_iterator it = hierarchy[i]->finite_vertices_begin(); it != hierarchy[i]->finite_vertices_end(); ++it) { -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE result = result && ( &*it == &*(it->down()->up()) ); -#else - result = result && ( it->down()->up() == it ); -#endif } } return result; diff --git a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h index b983befafaf..9669c70fa7c 100644 --- a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h @@ -30,10 +30,6 @@ #include #include -//#if (!defined _MSC_VER || defined __INTEL_COMPILER) -# define CGAL_T2_USE_ITERATOR_AS_HANDLE -//#endif - #include #include #include @@ -86,80 +82,9 @@ public: typedef Triangulation_ds_vertex_circulator_2 Vertex_circulator; typedef Triangulation_ds_edge_circulator_2 Edge_circulator; -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE - typedef Vertex_iterator Vertex_handle; - typedef Face_iterator Face_handle; -#else - // Defining nested classes for the handles instead of typedefs - // considerably shortens the symbol names (and compile times). - // It makes error messages more readable as well. - class Vertex_handle { - Vertex_iterator _v; - public: - typedef Vertex value_type; - typedef value_type * pointer; - typedef value_type & reference; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef void iterator_category; + typedef Vertex_iterator Vertex_handle; + typedef Face_iterator Face_handle; - Vertex_handle() : _v() {} - Vertex_handle(const Vertex_iterator& v) : _v(v) {} - Vertex_handle(const Vertex_circulator& v) : _v(v.base()._v) {} - Vertex_handle(void * CGAL_triangulation_precondition_code(n)) : _v() - { CGAL_triangulation_precondition(n == NULL); } - - Vertex* operator->() const { return &*_v; } - Vertex& operator*() const { return *_v; } - - bool operator==(Vertex_handle v) const { return _v == v._v; } - bool operator!=(Vertex_handle v) const { return _v != v._v; } - - // For std::set and co. - bool operator<(Vertex_handle v) const { return &*_v < &*v._v; } - - // Should be private to the TDS : - const Vertex_iterator & base() const { return _v; } - Vertex_iterator & base() { return _v; } - - void * for_compact_container() const { return _v.for_compact_container(); } - void * & for_compact_container() { return _v.for_compact_container(); } - }; - - class Face_handle { - Face_iterator _f; - public: - typedef Face value_type; - typedef value_type * pointer; - typedef value_type & reference; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef void iterator_category; - - Face_handle() : _f() {} - Face_handle(const Face_iterator& f) : _f(f) {} - Face_handle(const Face_circulator& f) : _f(f.base()._f) {} - //Face_handle(Face_circulator f) : _f(f.base()._f) {} - Face_handle(void * CGAL_triangulation_precondition_code(n)) : _f() - { CGAL_triangulation_precondition(n == NULL); } - - Face* operator->() const { return &*_f; } - Face& operator*() const { return *_f; } - - bool operator==(Face_handle f) const { return _f == f._f; } - bool operator!=(Face_handle f) const { return _f != f._f; } - - // For std::set and co. - bool operator<(Face_handle f) const { return &*_f < &*f._f; } - - // These should be private to the TDS : - const Face_iterator & base() const { return _f; } - Face_iterator & base() { return _f; } - - void * for_compact_container() const { return _f.for_compact_container(); } - void * & for_compact_container() { return _f.for_compact_container(); } - }; -#endif typedef std::pair Edge; typedef std::list List_edges; @@ -1397,26 +1322,16 @@ delete_face(Face_handle f) CGAL_triangulation_expensive_precondition( dimension() != 1 || is_edge(f,2)); CGAL_triangulation_expensive_precondition( dimension() != 0 || is_vertex(f->vertex(0)) ); -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE face_container().erase(f); -#else - face_container().erase(f.base()); -#endif } - - template inline void Triangulation_data_structure_2:: delete_vertex(Vertex_handle v) { CGAL_triangulation_expensive_precondition( is_vertex(v) ); -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE vertex_container().erase(v); -#else - vertex_container().erase(v.base()); -#endif } // split and join operations diff --git a/Triangulation_2/include/CGAL/Triangulation_ds_circulators_2.h b/Triangulation_2/include/CGAL/Triangulation_ds_circulators_2.h index 525ed6ef606..2b2660fafed 100644 --- a/Triangulation_2/include/CGAL/Triangulation_ds_circulators_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_ds_circulators_2.h @@ -74,10 +74,9 @@ public: bool operator==(const Face_circulator &fc) const; bool operator!=(const Face_circulator &fc) const; -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE + bool operator==(const Face_handle &fh) const { return pos == fh; } bool operator!=(const Face_handle &fh) const { return pos != fh; } -#endif bool is_empty() const; bool operator==(CGAL_NULL_TYPE CGAL_triangulation_assertion_code(n)) const; @@ -100,12 +99,9 @@ public: } Face_handle base() const {return pos;} -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE operator Face_handle() const {return pos;} -#endif }; -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE template < class Tds_ > bool operator==(typename Tds_::Face_handle fh, @@ -121,7 +117,7 @@ operator!=(typename Tds_::Face_handle fh, { return (fc!=fh); } -#endif + template < class Tds > class Triangulation_ds_vertex_circulator_2 : @@ -157,12 +153,12 @@ public: bool operator==(const Vertex_circulator &vc) const; bool operator!=(const Vertex_circulator &vc) const; -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE + bool operator==(const Vertex_handle &vh) const { return pos->vertex(_ri) == vh; } bool operator!=(const Vertex_handle &vh) const { return pos->vertex(_ri) != vh; } -#endif + bool is_empty() const; bool operator==(CGAL_NULL_TYPE CGAL_triangulation_assertion_code(n)) const; bool operator!=(CGAL_NULL_TYPE CGAL_triangulation_assertion_code(n)) const; @@ -184,12 +180,9 @@ public: } Vertex_handle base() const {return pos->vertex(_ri);} -#if defined CGAL_T2_USE_ITERATOR_AS_HANDLE operator Vertex_handle() const {return pos->vertex(_ri);} -#endif }; -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE template < class Tds_ > inline bool @@ -207,7 +200,7 @@ operator!=(typename Tds_::Vertex_handle vh, { return !(vc==vh); } -#endif + template < class Tds > class Triangulation_ds_edge_circulator_2 : diff --git a/Triangulation_2/include/CGAL/Triangulation_line_face_circulator_2.h b/Triangulation_2/include/CGAL/Triangulation_line_face_circulator_2.h index 349f899066e..20972f77df5 100644 --- a/Triangulation_2/include/CGAL/Triangulation_line_face_circulator_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_line_face_circulator_2.h @@ -95,10 +95,10 @@ public: operator const Face_handle() const {return pos;} bool operator==(const Line_face_circulator& lfc) const; bool operator!=(const Line_face_circulator& lfc) const; -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE + bool operator==(const Face_handle& fh) const { return fh == pos; } bool operator!=(const Face_handle& fh) const { return fh != pos; } -#endif + bool operator==(CGAL_NULL_TYPE CGAL_triangulation_assertion_code(n)) const; bool operator!=(CGAL_NULL_TYPE n) const; bool is_empty() const; @@ -117,7 +117,6 @@ private: void decrement(); }; -#ifdef CGAL_T2_USE_ITERATOR_AS_HANDLE template < class Gt, class Tds > inline bool @@ -135,7 +134,6 @@ operator!=(typename Tds::Face_handle fh, { return (fc!=fh); } -#endif template < class Gt, class Tds > Triangulation_line_face_circulator_2:: diff --git a/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h b/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h index 1632efcdcc7..50463cacf2d 100644 --- a/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h @@ -36,10 +36,6 @@ #include -//#if (!defined _MSC_VER || defined __INTEL_COMPILER) -# define CGAL_T3_USE_ITERATOR_AS_HANDLE -//#endif - #include #include #include @@ -96,87 +92,10 @@ public: //private: // In 2D only : typedef Triangulation_ds_face_circulator_3 Face_circulator; -#ifdef CGAL_T3_USE_ITERATOR_AS_HANDLE - typedef Vertex_iterator Vertex_handle; - typedef Cell_iterator Cell_handle; -#else - // Defining nested classes for the handles instead of typedefs - // considerably shortens the symbol names (and compile times). - // It makes error messages more readable as well. - class Vertex_handle { - Vertex_iterator _v; - public: - typedef Vertex value_type; - typedef value_type * pointer; - typedef value_type & reference; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef void iterator_category; - Vertex_handle() : _v() {} - Vertex_handle(Vertex_iterator v) : _v(v) {} -#ifndef CGAL_NO_DEPRECATED_CODE // must be kept - Vertex_handle(void * CGAL_triangulation_precondition_code(n)) : _v() - { CGAL_triangulation_precondition(n == NULL); } -#endif + typedef Vertex_iterator Vertex_handle; + typedef Cell_iterator Cell_handle; - Vertex* operator->() const { return &*_v; } - Vertex& operator*() const { return *_v; } - - bool operator==(Vertex_handle v) const { return _v == v._v; } - bool operator!=(Vertex_handle v) const { return _v != v._v; } - -#ifndef CGAL_NO_DEPRECATED_CODE // must be kept - // For std::set and co. - bool operator<(Vertex_handle v) const { return &*_v < &*v._v; } -#endif - - // Should be private to the TDS : - const Vertex_iterator & base() const { return _v; } - Vertex_iterator & base() { return _v; } - - void * for_compact_container() const { return _v.for_compact_container(); } - void * & for_compact_container() { return _v.for_compact_container(); } - }; - - class Cell_handle { - Cell_iterator _c; - public: - typedef Cell value_type; - typedef value_type * pointer; - typedef value_type & reference; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef void iterator_category; - - Cell_handle() : _c() {} - Cell_handle(Cell_iterator c) : _c(c) {} - Cell_handle(const Cell_circulator &c) : _c(c.base()._c) {} - Cell_handle(const Face_circulator &c) : _c(c.base()._c) {} -#ifndef CGAL_NO_DEPRECATED_CODE // must be kept - Cell_handle(void * CGAL_triangulation_precondition_code(n)) : _c() - { CGAL_triangulation_precondition(n == NULL); } -#endif - - Cell* operator->() const { return &*_c; } - Cell& operator*() const { return *_c; } - - bool operator==(Cell_handle c) const { return _c == c._c; } - bool operator!=(Cell_handle c) const { return _c != c._c; } - -#ifndef CGAL_NO_DEPRECATED_CODE // must be kept - // For std::set and co. - bool operator<(Cell_handle c) const { return &*_c < &*c._c; } -#endif - - // These should be private to the TDS : - const Cell_iterator & base() const { return _c; } - Cell_iterator & base() { return _c; } - - void * for_compact_container() const { return _c.for_compact_container(); } - void * & for_compact_container() { return _c.for_compact_container(); } - }; -#endif typedef std::pair Facet; typedef Triple Edge; @@ -335,11 +254,7 @@ public: void delete_vertex( const Vertex_handle& v ) { CGAL_triangulation_expensive_precondition( is_vertex(v) ); -#ifdef CGAL_T3_USE_ITERATOR_AS_HANDLE vertex_container().erase(v); -#else - vertex_container().erase(v.base()); -#endif } void delete_cell( const Cell_handle& c ) @@ -352,11 +267,7 @@ public: is_edge(c,0,1) ); CGAL_triangulation_expensive_precondition( dimension() != 0 || is_vertex(c->vertex(0)) ); -#ifdef CGAL_T3_USE_ITERATOR_AS_HANDLE cell_container().erase(c); -#else - cell_container().erase(c.base()); -#endif } template diff --git a/Triangulation_3/include/CGAL/Triangulation_ds_circulators_3.h b/Triangulation_3/include/CGAL/Triangulation_ds_circulators_3.h index 8f4d3cf0d41..3602976c42b 100644 --- a/Triangulation_3/include/CGAL/Triangulation_ds_circulators_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_ds_circulators_3.h @@ -136,7 +136,6 @@ public: return ! (*this == ccir); } -#ifdef CGAL_T3_USE_ITERATOR_AS_HANDLE bool operator==(Cell_handle ch) const { return ch == pos; @@ -146,7 +145,6 @@ public: { return ch != pos; } -#endif bool operator==(CGAL_NULL_TYPE CGAL_triangulation_assertion_code(n)) const { @@ -161,9 +159,8 @@ public: // For TDS's private use only. Cell_handle base() const { return pos; } -#ifdef CGAL_T3_USE_ITERATOR_AS_HANDLE operator Cell_handle() const { return pos; } -#endif + private: Vertex_handle _s; // source vertex of the edge Vertex_handle _t; // target vertex of the edge @@ -175,7 +172,6 @@ private: } }; -#ifdef CGAL_T3_USE_ITERATOR_AS_HANDLE template < class Tds_ > inline bool @@ -191,7 +187,6 @@ operator!=(typename Tds_::Cell_handle ch, Triangulation_ds_cell_circulator_3 class Triangulation_ds_facet_circulator_3 @@ -483,9 +478,7 @@ public: // For TDS's private use only. Cell_handle base() const { return pos; } -#ifdef CGAL_T3_USE_ITERATOR_AS_HANDLE operator Cell_handle() const { return pos; } -#endif private: Vertex_handle _s; // source vertex diff --git a/Triangulation_3/include/CGAL/Triangulation_ds_iterators_3.h b/Triangulation_3/include/CGAL/Triangulation_ds_iterators_3.h index 6e862a3e0bb..8dcdb4528d5 100644 --- a/Triangulation_3/include/CGAL/Triangulation_ds_iterators_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_ds_iterators_3.h @@ -236,11 +236,7 @@ public: Cell_circulator ccir = _tds->incident_cells(edge); do { ++ccir; -#ifdef CGAL_T3_USE_ITERATOR_AS_HANDLE } while ( pos < ccir ); -#else - } while ( Cell_handle(pos) < Cell_handle(ccir) ); -#endif // loop terminates since it stops at least when ccir = pos if ( Cell_handle(ccir) == Cell_handle(pos) ) // pos is the cell with minimal pointer