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
This commit is contained in:
Menelaos Karavelas 2004-02-16 19:09:28 +00:00
parent 76fb7c7181
commit 0e6c52f950
5 changed files with 158 additions and 122 deletions

View File

@ -27,11 +27,9 @@
#include <algorithm>
#include <CGAL/Triangulation_2.h>
// the following include should be removed
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Segment_Voronoi_diagram_site_2.h>
#include <CGAL/Segment_Voronoi_diagram_data_structure_2.h>
#include <CGAL/Segment_Voronoi_diagram_face_base_2.h>
#include <CGAL/Triangulation_face_base_2.h>
#include <CGAL/Segment_Voronoi_diagram_vertex_base_2.h>
#include <CGAL/Segment_Voronoi_diagram_constructions_C2.h>
@ -99,7 +97,7 @@ template<class Gt,
class DS = Segment_Voronoi_diagram_data_structure_2 <
Segment_Voronoi_diagram_vertex_base_2<Gt,PC,
typename Gt::Intersections_tag>,
Segment_Voronoi_diagram_face_base_2<Gt> >,
Triangulation_face_base_2<Gt> >,
class LTag = Tag_false >
class Segment_Voronoi_diagram_2
: private Triangulation_2<

View File

@ -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 <mkaravel@cse.nd.edu>
#ifndef CGAL_SEGMENT_VORONOI_DIAGRAM_FACE_BASE_2_H
#define CGAL_SEGMENT_VORONOI_DIAGRAM_FACE_BASE_2_H
#include <CGAL/Triangulation_ds_face_base_2.h>
#include <CGAL/Triangulation_face_base_2.h>
//#include <CGAL/Triangulation_face_base_with_edges_2.h>
#include <CGAL/Apollonius_graph_face_base_2.h>
CGAL_BEGIN_NAMESPACE
namespace CGALi {
template<class Gt, class Fb, class ADD_EDGES_Tag>
struct SVDFB2_Which_base;
template<class Gt, class Fb>
struct SVDFB2_Which_base<Gt,Fb,Tag_true>
{
// 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<Gt,Fb> Base;
typedef Apollonius_graph_face_base_2<Gt,Fb> Base;
};
template<class Gt, class Fb>
struct SVDFB2_Which_base<Gt,Fb,Tag_false>
{
typedef Triangulation_face_base_2<Gt,Fb> Base;
};
} // namespace CGALi
template<class Gt,
class Fb = Triangulation_ds_face_base_2<>,
class ADD_EDGES_Tag = Tag_false>
class Segment_Voronoi_diagram_face_base_2
: public CGALi::SVDFB2_Which_base<Gt,Fb,ADD_EDGES_Tag>::Base
{
protected:
// local types
typedef typename Fb::Triangulation_data_structure DS;
public:
// TYPES
//------
typedef Gt Geom_traits;
typedef typename
CGALi::SVDFB2_Which_base<Gt,Fb,ADD_EDGES_Tag>::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 <typename DS2>
struct Rebind_TDS {
typedef typename Fb::template Rebind_TDS<DS2>::Other Vb2;
typedef Segment_Voronoi_diagram_face_base_2<Gt,Vb2> 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

View File

@ -31,7 +31,7 @@
#include <CGAL/Segment_Voronoi_diagram_data_structure_2.h>
#include <CGAL/Segment_Voronoi_diagram_vertex_base_2.h>
#include <CGAL/Segment_Voronoi_diagram_hierarchy_vertex_base_2.h>
#include <CGAL/Segment_Voronoi_diagram_face_base_2.h>
#include <CGAL/Triangulation_face_base_2.h>
CGAL_BEGIN_NAMESPACE
@ -54,7 +54,7 @@ template < class Gt,
Segment_Voronoi_diagram_hierarchy_vertex_base_2<
Segment_Voronoi_diagram_vertex_base_2<Gt,PC,
typename Gt::Intersections_tag> >,
Segment_Voronoi_diagram_face_base_2<Gt> >,
Triangulation_face_base_2<Gt> >,
class LTag = Tag_false>
class Segment_Voronoi_diagram_hierarchy_2
: public Segment_Voronoi_diagram_2<Gt,PC,DS,LTag>

View File

@ -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 <mkaravel@cse.nd.edu>
#ifndef CGAL_TRIANGULATION_FACE_BASE_WITH_EDGES_2_H
#define CGAL_TRIANGULATION_FACE_BASE_WITH_EDGES_2_H
#include <CGAL/Apollonius_graph_short_names_2.h>
#include <CGAL/Triangulation_ds_face_base_2.h>
#include <CGAL/triangulation_assertions.h>
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 <typename TDS2>
struct Rebind_TDS {
typedef typename Fb::template Rebind_TDS<TDS2>::Other Vb2;
typedef Triangulation_face_base_with_edges_2<Gt,Vb2> 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

View File

@ -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;
}