From 0e6c52f95057bcf143bdc65c0cb226d738976c49 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Mon, 16 Feb 2004 19:09:28 +0000 Subject: [PATCH] removed the Segment_Voronoi_diagram_face_base_2 class; this class is now obsolete; the Triangulation_face_base_2 class is used in its place --- .../include/CGAL/Segment_Voronoi_diagram_2.h | 6 +- .../Segment_Voronoi_diagram_face_base_2.h | 115 ------------- .../Segment_Voronoi_diagram_hierarchy_2.h | 4 +- .../Triangulation_face_base_with_edges_2.h | 153 ++++++++++++++++++ .../include/CGAL/edge_list.h | 2 +- 5 files changed, 158 insertions(+), 122 deletions(-) delete mode 100644 Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_face_base_2.h create mode 100644 Packages/Segment_Voronoi_diagram_2/include/CGAL/Triangulation_face_base_with_edges_2.h diff --git a/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_2.h b/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_2.h index 3419852683d..e7aa0507a80 100644 --- a/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_2.h +++ b/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_2.h @@ -27,11 +27,9 @@ #include #include -// the following include should be removed -#include #include #include -#include +#include #include #include @@ -99,7 +97,7 @@ template, - Segment_Voronoi_diagram_face_base_2 >, + Triangulation_face_base_2 >, class LTag = Tag_false > class Segment_Voronoi_diagram_2 : private Triangulation_2< diff --git a/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_face_base_2.h b/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_face_base_2.h deleted file mode 100644 index 1e29ff99778..00000000000 --- a/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_face_base_2.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) 2003,2004 INRIA Sophia-Antipolis (France) and -// Notre Dame University (U.S.A.). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $Source$ -// $Revision$ $Date$ -// $Name$ -// -// Author(s) : Menelaos Karavelas - - - - -#ifndef CGAL_SEGMENT_VORONOI_DIAGRAM_FACE_BASE_2_H -#define CGAL_SEGMENT_VORONOI_DIAGRAM_FACE_BASE_2_H - -#include -#include -//#include -#include - - -CGAL_BEGIN_NAMESPACE - - -namespace CGALi { - - template - struct SVDFB2_Which_base; - - - template - struct SVDFB2_Which_base - { - // MK::ERROR: replace the Apollonius_graph_face_base_2 class by the - // more generic one: Triangulation_face_base_with_edges_2 - // typedef Triangulation_face_base_with_edges_2 Base; - - typedef Apollonius_graph_face_base_2 Base; - }; - - template - struct SVDFB2_Which_base - { - typedef Triangulation_face_base_2 Base; - }; - -} // namespace CGALi - - - -template, - class ADD_EDGES_Tag = Tag_false> -class Segment_Voronoi_diagram_face_base_2 - : public CGALi::SVDFB2_Which_base::Base -{ -protected: - // local types - typedef typename Fb::Triangulation_data_structure DS; - -public: - // TYPES - //------ - typedef Gt Geom_traits; - typedef typename - CGALi::SVDFB2_Which_base::Base Base; - // typedef Fb Base; - - typedef DS Segment_Voronoi_diagram_data_structure_2; - - typedef typename DS::Vertex_handle Vertex_handle; - typedef typename DS::Face_handle Face_handle; - typedef typename DS::Edge Edge; - - - template - struct Rebind_TDS { - typedef typename Fb::template Rebind_TDS::Other Vb2; - typedef Segment_Voronoi_diagram_face_base_2 Other; - }; - - -public: - // CREATION - //--------- - Segment_Voronoi_diagram_face_base_2() : Base() {} - - Segment_Voronoi_diagram_face_base_2(Vertex_handle v0, - Vertex_handle v1, - Vertex_handle v2) - : Base(v0,v1,v2) {} - - Segment_Voronoi_diagram_face_base_2(Vertex_handle v0, - Vertex_handle v1, - Vertex_handle v2, - Face_handle n0, - Face_handle n1, - Face_handle n2) - : Base(v0,v1,v2,n0,n1,n2) {} -}; - - -CGAL_END_NAMESPACE - -#endif // CGAL_SEGMENT_VORONOI_DIAGRAM_FACE_BASE_2_H diff --git a/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_hierarchy_2.h b/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_hierarchy_2.h index cc0346a59f0..c571216d2d8 100644 --- a/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_hierarchy_2.h +++ b/Packages/Segment_Voronoi_diagram_2/include/CGAL/Segment_Voronoi_diagram_hierarchy_2.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include CGAL_BEGIN_NAMESPACE @@ -54,7 +54,7 @@ template < class Gt, Segment_Voronoi_diagram_hierarchy_vertex_base_2< Segment_Voronoi_diagram_vertex_base_2 >, - Segment_Voronoi_diagram_face_base_2 >, + Triangulation_face_base_2 >, class LTag = Tag_false> class Segment_Voronoi_diagram_hierarchy_2 : public Segment_Voronoi_diagram_2 diff --git a/Packages/Segment_Voronoi_diagram_2/include/CGAL/Triangulation_face_base_with_edges_2.h b/Packages/Segment_Voronoi_diagram_2/include/CGAL/Triangulation_face_base_with_edges_2.h new file mode 100644 index 00000000000..1dcdc5527cd --- /dev/null +++ b/Packages/Segment_Voronoi_diagram_2/include/CGAL/Triangulation_face_base_with_edges_2.h @@ -0,0 +1,153 @@ +// Copyright (c) 2004 INRIA Sophia-Antipolis (France) and +// Notre Dame University (U.S.A.). All rights reserved. +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $Source$ +// $Revision$ $Date$ +// $Name$ +// +// Author(s) : Menelaos Karavelas + + + +#ifndef CGAL_TRIANGULATION_FACE_BASE_WITH_EDGES_2_H +#define CGAL_TRIANGULATION_FACE_BASE_WITH_EDGES_2_H + + +#include + + +#include +#include + + + +CGAL_BEGIN_NAMESPACE + + +template < class Gt, + class Fb = Triangulation_ds_face_base_2<> > +class Triangulation_face_base_with_edges_2 + : public Fb +{ +protected: + // local types + typedef typename Fb::Triangulation_data_structure TDS; + +public: + // TYPES + //------ + typedef Gt Geom_traits; + typedef Fb Base; + typedef TDS Triangulation_data_structure_2; + typedef typename TDS::Vertex_handle Vertex_handle; + typedef typename TDS::Face_handle Face_handle; + typedef typename TDS::Edge Edge; + + + template + struct Rebind_TDS { + typedef typename Fb::template Rebind_TDS::Other Vb2; + typedef Triangulation_face_base_with_edges_2 Other; + }; + + +public: + // CREATION + //--------- + Triangulation_face_base_with_edges_2() : Base() + { init(); } + + Triangulation_face_base_with_edges_2(Vertex_handle v0, + Vertex_handle v1, + Vertex_handle v2) + : Base(v0,v1,v2) + { init(); } + + Triangulation_face_base_with_edges_2(Vertex_handle v0, + Vertex_handle v1, + Vertex_handle v2, + Face_handle n0, + Face_handle n1, + Face_handle n2) + : Base(v0,v1,v2,n0,n1,n2) + { init(); } + +public: + // OPERATIONS + //----------- + bool is_in_list(int i) const + { + CGAL_precondition( i >= 0 && i <= 2 ); + return ( next_edge_in_list[i].first != Face_handle() || + prev_edge_in_list[i].first != Face_handle() ); + } + + void set_next(int i, const Edge& next) + { + CGAL_precondition( i >= 0 && i <= 2 ); + CGAL_precondition( next.first == Face_handle() || + (next.second >= 0 && next.second <= 2) ); + next_edge_in_list[i] = next; + } + + void set_previous(int i, const Edge& prev) + { + CGAL_precondition( i >= 0 && i <= 2 ); + CGAL_precondition( prev.first == Face_handle() || + (prev.second >= 0 && prev.second <= 2) ); + prev_edge_in_list[i] = prev; + } + + Edge next(int i) const + { + CGAL_precondition( i >= 0 && i <= 2 ); + return next_edge_in_list[i]; + } + + Edge previous(int i) const + { + CGAL_precondition( i >= 0 && i <= 2 ); + return prev_edge_in_list[i]; + } + + +protected: + // class variables + Edge next_edge_in_list[3]; + Edge prev_edge_in_list[3]; + +protected: + static int sentinel_index() { return -1; } + + static const Edge& sentinel_edge() { + static Edge SENTINEL_EDGE = Edge(Face_handle(), sentinel_index()); + return SENTINEL_EDGE; + } + + // initialization of in-place list pointers + void init() { + for (int i = 0; i < 3; i++) { + next_edge_in_list[i] = sentinel_edge(); + prev_edge_in_list[i] = sentinel_edge(); + } + } + +}; + + + + +CGAL_END_NAMESPACE + +#endif // CGAL_TRIANGULATION_FACE_BASE_WITH_EDGES_2_H diff --git a/Packages/Segment_Voronoi_diagram_2/include/CGAL/edge_list.h b/Packages/Segment_Voronoi_diagram_2/include/CGAL/edge_list.h index de4a3cf1652..c5c9567419d 100644 --- a/Packages/Segment_Voronoi_diagram_2/include/CGAL/edge_list.h +++ b/Packages/Segment_Voronoi_diagram_2/include/CGAL/edge_list.h @@ -64,7 +64,7 @@ namespace CGALi { public: // remove the following method and make SENTINEL_EDGE a static const // member of the class. - static Edge sentinel_edge() { + static const Edge& sentinel_edge() { static Edge SENTINEL_EDGE = Edge(Face_handle(), sentinel_index()); return SENTINEL_EDGE; }