mirror of https://github.com/CGAL/cgal
- removed Point_container.h and Simple_container_wrapper.h; these
files are either unused or no longer needed - modified storage traits to define const_Point_handle as well; modified Segment_Delaunay_graph_2 class to take all point handles from storage traits
This commit is contained in:
parent
c8b9eb5893
commit
5732954651
|
|
@ -1,5 +1,10 @@
|
|||
1 August 2006: Menelaos Karavelas
|
||||
- changed some file names to match the names of the classes they contain
|
||||
- removed Point_container.h and Simple_container_wrapper.h; these
|
||||
files are either unused or no longer needed
|
||||
- modified storage traits to define const_Point_handle as well;
|
||||
modified Segment_Delaunay_graph_2 class to take all point handles
|
||||
from storage traits
|
||||
|
||||
31 July 2006: Menelaos Karavelas
|
||||
- renamed storage traits related file names and classes; modified test
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
#include <CGAL/Segment_Delaunay_graph_2/Constructions_C2.h>
|
||||
|
||||
#include <CGAL/Iterator_project.h>
|
||||
#include <CGAL/Segment_Delaunay_graph_2/Simple_container_wrapper.h>
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -185,6 +184,8 @@ public:
|
|||
typedef typename DS::Vertex Vertex;
|
||||
typedef typename DS::Face Face;
|
||||
|
||||
typedef typename DS::size_type size_type;
|
||||
|
||||
typedef typename DS::Vertex_circulator Vertex_circulator;
|
||||
typedef typename DS::Edge_circulator Edge_circulator;
|
||||
typedef typename DS::Face_circulator Face_circulator;
|
||||
|
|
@ -197,30 +198,29 @@ public:
|
|||
typedef typename DG::Finite_vertices_iterator Finite_vertices_iterator;
|
||||
typedef typename DG::Finite_edges_iterator Finite_edges_iterator;
|
||||
|
||||
typedef typename Storage_traits::Point_container Point_container;
|
||||
typedef typename Storage_traits::Point_handle Point_handle;
|
||||
typedef typename Storage_traits::const_Point_handle const_Point_handle;
|
||||
|
||||
protected:
|
||||
typedef typename Geom_traits::Arrangement_type_2 AT2;
|
||||
typedef typename AT2::Arrangement_type Arrangement_type;
|
||||
|
||||
typedef typename Storage_traits::Point_container PC;
|
||||
typedef typename Storage_traits::Point_handle PH;
|
||||
|
||||
|
||||
// these containers should have point handles and should replace the
|
||||
// point container...
|
||||
typedef boost::tuples::tuple<PH,PH,bool> Site_rep_2;
|
||||
// typedef Triple<PH,PH,bool> Site_rep_2;
|
||||
typedef boost::tuples::tuple<Point_handle,Point_handle,bool> Site_rep_2;
|
||||
|
||||
struct Site_rep_less_than {
|
||||
// less than for site reps
|
||||
bool operator()(const Site_rep_2& x, const Site_rep_2& y) const {
|
||||
PH x1 = boost::tuples::get<0>(x);
|
||||
PH y1 = boost::tuples::get<0>(y);
|
||||
Point_handle x1 = boost::tuples::get<0>(x);
|
||||
Point_handle y1 = boost::tuples::get<0>(y);
|
||||
|
||||
if ( &(*x1) < &(*y1) ) { return true; }
|
||||
if ( &(*y1) < &(*x1) ) { return false; }
|
||||
|
||||
PH x2 = boost::tuples::get<1>(x);
|
||||
PH y2 = boost::tuples::get<1>(y);
|
||||
Point_handle x2 = boost::tuples::get<1>(x);
|
||||
Point_handle y2 = boost::tuples::get<1>(y);
|
||||
|
||||
return &(*x2) < &(*y2);
|
||||
}
|
||||
|
|
@ -235,18 +235,9 @@ protected:
|
|||
Project_input_to_site_2<Site_rep_2, Site_2>
|
||||
Proj_input_to_site;
|
||||
|
||||
public:
|
||||
typedef Simple_container_wrapper<PC> Point_container;
|
||||
typedef typename Point_container::iterator Point_handle;
|
||||
|
||||
typedef typename DS::size_type size_type;
|
||||
|
||||
protected:
|
||||
typedef CGAL_SEGMENT_DELAUNAY_GRAPH_2_NS::Internal::Project_site_2<Vertex>
|
||||
Proj_site;
|
||||
|
||||
typedef typename Point_container::const_iterator const_Point_handle;
|
||||
|
||||
struct Point_handle_less_than {
|
||||
// less than
|
||||
bool operator()(const const_Point_handle& x,
|
||||
|
|
@ -810,7 +801,7 @@ protected:
|
|||
typename Input_sites_container::iterator it = isc_.find(rep);
|
||||
CGAL_assertion( it != isc_.end() );
|
||||
|
||||
pc_.remove(h);
|
||||
pc_.erase(h);
|
||||
isc_.erase(it);
|
||||
}
|
||||
|
||||
|
|
@ -837,7 +828,7 @@ protected:
|
|||
|
||||
inline Point_handle register_input_site(const Point_2& p)
|
||||
{
|
||||
std::pair<PH,bool> it = pc_.insert(p);
|
||||
std::pair<Point_handle,bool> it = pc_.insert(p);
|
||||
Site_rep_2 rep(it.first, it.first, true);
|
||||
isc_.insert( rep );
|
||||
return it.first;
|
||||
|
|
@ -846,8 +837,8 @@ protected:
|
|||
inline
|
||||
Point_handle_pair register_input_site(const Point_2& p0, const Point_2& p1)
|
||||
{
|
||||
std::pair<PH,bool> it1 = pc_.insert(p0);
|
||||
std::pair<PH,bool> it2 = pc_.insert(p1);
|
||||
std::pair<Point_handle,bool> it1 = pc_.insert(p0);
|
||||
std::pair<Point_handle,bool> it2 = pc_.insert(p1);
|
||||
Site_rep_2 rep(it1.first, it2.first, false);
|
||||
isc_.insert( rep );
|
||||
return Point_handle_pair(it1.first, it2.first);
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
// Copyright (c) 2003,2004,2005,2006 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.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// Author(s) : Menelaos Karavelas <mkaravel@cse.nd.edu>
|
||||
|
||||
|
||||
#ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_2_POINT_CONTAINER_H
|
||||
#define CGAL_SEGMENT_DELAUNAY_GRAPH_2_POINT_CONTAINER_H
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
CGAL_BEGIN_NAMESPACE
|
||||
|
||||
template<class P, class C = std::list<P> >
|
||||
class Point_container
|
||||
{
|
||||
public:
|
||||
typedef C Container;
|
||||
typedef P Point_2;
|
||||
typedef typename Container::iterator Point_handle;
|
||||
typedef typename Container::size_type size_type;
|
||||
|
||||
private:
|
||||
typedef Point_container<Point_2,Container> Self;
|
||||
|
||||
public:
|
||||
Point_container() {}
|
||||
|
||||
Point_handle insert(const Point_2& p)
|
||||
{
|
||||
c.push_back(p);
|
||||
return --c.end();
|
||||
}
|
||||
|
||||
void remove(Point_handle handle)
|
||||
{
|
||||
c.erase(handle);
|
||||
}
|
||||
|
||||
void swap(const Self& other)
|
||||
{
|
||||
c.swap(other.c);
|
||||
}
|
||||
|
||||
void clear() {
|
||||
c.clear();
|
||||
}
|
||||
|
||||
size_type size() const { return c.size(); }
|
||||
|
||||
private:
|
||||
Container c;
|
||||
};
|
||||
|
||||
#if 1
|
||||
template<class P, unsigned long S>
|
||||
class Array_point_container
|
||||
{
|
||||
public:
|
||||
// typedef C Container;
|
||||
typedef P Point_2;
|
||||
enum { Size = S };
|
||||
typedef Point_2* Point_handle;
|
||||
typedef unsigned long size_type;
|
||||
|
||||
Array_point_container() {
|
||||
last = 0;
|
||||
c = new Point_2[Size];
|
||||
}
|
||||
|
||||
Point_handle insert(const Point_2& p)
|
||||
{
|
||||
CGAL_precondition( last < Size );
|
||||
|
||||
c[last] = p;
|
||||
Point_handle h = &c[last];
|
||||
last++;
|
||||
return h;
|
||||
}
|
||||
|
||||
std::size_t size() const { return c.size(); }
|
||||
|
||||
void clear() {
|
||||
last = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned long last;
|
||||
Point_2* c;
|
||||
};
|
||||
#endif
|
||||
|
||||
CGAL_END_NAMESPACE
|
||||
|
||||
#endif // CGAL_SEGMENT_DELAUNAY_GRAPH_2_POINT_CONTAINER_H
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
// Copyright (c) 2003,2004,2005,2006 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.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// Author(s) : Menelaos Karavelas <mkaravel@cse.nd.edu>
|
||||
|
||||
|
||||
#ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_2_SIMPLE_CONTAINER_WRAPPER_H
|
||||
#define CGAL_SEGMENT_DELAUNAY_GRAPH_2_SIMPLE_CONTAINER_WRAPPER_H
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <list>
|
||||
|
||||
|
||||
CGAL_BEGIN_NAMESPACE
|
||||
|
||||
template<class C>
|
||||
class Simple_container_wrapper
|
||||
{
|
||||
public:
|
||||
typedef C Container;
|
||||
typedef typename Container::value_type value_type;
|
||||
typedef typename Container::iterator iterator;
|
||||
typedef typename Container::const_iterator const_iterator;
|
||||
typedef typename Container::size_type size_type;
|
||||
|
||||
private:
|
||||
typedef Simple_container_wrapper<Container> Self;
|
||||
|
||||
public:
|
||||
Simple_container_wrapper(const Container& c = Container())
|
||||
: c(c) {}
|
||||
|
||||
iterator begin() { return c.begin(); }
|
||||
iterator end() { return c.end(); }
|
||||
|
||||
const_iterator begin() const { return c.begin(); }
|
||||
const_iterator end() const { return c.end(); }
|
||||
|
||||
std::pair<iterator,bool> insert(const value_type& t)
|
||||
{
|
||||
// std::pair<iterator,bool> it_b = c.insert(t);
|
||||
// return it_b.first;
|
||||
#if 1
|
||||
return c.insert(t);
|
||||
#else
|
||||
c.push_back(t);
|
||||
return std::pair<iterator,bool>(--c.end(), true);
|
||||
#endif
|
||||
}
|
||||
|
||||
const_iterator find(const value_type& t) const {
|
||||
return c.find(t);
|
||||
}
|
||||
|
||||
bool remove(const value_type& t)
|
||||
{
|
||||
iterator it = c.find(t);
|
||||
if ( it == c.end() ) { return false; }
|
||||
c.erase(it);
|
||||
return true;
|
||||
}
|
||||
|
||||
void remove(iterator it)
|
||||
{
|
||||
c.erase(it);
|
||||
}
|
||||
|
||||
void swap(Self& other)
|
||||
{
|
||||
c.swap(other.c);
|
||||
}
|
||||
|
||||
void clear() {
|
||||
c.clear();
|
||||
}
|
||||
|
||||
size_type size() const { return c.size(); }
|
||||
|
||||
private:
|
||||
Container c;
|
||||
};
|
||||
|
||||
|
||||
CGAL_END_NAMESPACE
|
||||
|
||||
#endif // CGAL_SEGMENT_DELAUNAY_GRAPH_2_SIMPLE_CONTAINER_WRAPPER_H
|
||||
|
|
@ -77,6 +77,7 @@ public:
|
|||
typedef typename Geom_traits::Site_2 Site_2;
|
||||
typedef std::set<Point_2> Point_container;
|
||||
typedef typename Point_container::iterator Point_handle;
|
||||
typedef typename Point_container::const_iterator const_Point_handle;
|
||||
|
||||
private:
|
||||
typedef Segment_Delaunay_graph_storage_traits_2<Geom_traits> Self;
|
||||
|
|
|
|||
Loading…
Reference in New Issue