Merge pull request #3093 from efifogel/Aos_2-ric_remove_edges-efif

Aos 2 ric remove edges efif

# Conflicts:
#	Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt
This commit is contained in:
Laurent Rineau 2018-05-28 13:58:28 +02:00
commit 089e0c10ce
12 changed files with 1684 additions and 1626 deletions

View File

@ -16,15 +16,15 @@
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
// Michal Balas <balasmic@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
#define CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*! \file
* Defintion of the Td_active_fictitious_vertex<Td_traits> class.
*/
@ -33,7 +33,6 @@
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
@ -46,63 +45,61 @@ namespace CGAL {
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_active_fictitious_vertex : public Handle
{
template <typename Td_traits_>
class Td_active_fictitious_vertex : public Handle {
public:
//type of traits class
typedef Td_traits_ Traits;
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
Halfedge_around_vertex_const_circulator;
//type of Td_active_fictitious_vertex (Self)
typedef typename Traits::Td_active_fictitious_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
typedef typename Traits::Td_active_fictitious_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
@ -113,199 +110,146 @@ public:
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
* Inner class Data derived from Rep class
*/
class Data : public Rep {
friend class Td_active_fictitious_vertex<Td_traits_>;
public:
//c'tors
Data (Vertex_const_handle _v,
Halfedge_const_handle _cw_he,
Dag_node* _p_node)
: v(_v),cw_he(_cw_he),p_node(_p_node)
{ }
~Data() { }
Data(Vertex_const_handle _v, Halfedge_const_handle _cw_he,
Dag_node* _p_node) :
v(_v), cw_he(_cw_he), p_node(_p_node)
{}
~Data() {}
protected:
Vertex_const_handle v;
Vertex_const_handle v;
Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
private:
Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const
{
//the circulator is of incoming halfedges
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
//if the vertex is associated with a point on the bounded coords,
// we can take any incident halfedge. o/w if the vertex lies at infinity,
// it has 2 fictitious incident halfedges
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
return Curve_end(he->curve(),
(he->direction() == ARR_RIGHT_TO_LEFT)?
ARR_MIN_END : ARR_MAX_END);
return Curve_end(he->curve(), ((he->direction() == ARR_RIGHT_TO_LEFT) ?
ARR_MIN_END : ARR_MAX_END));
}
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
protected:
#else
public: // workaround
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; }
/*! Set the vertex handle (Vertex_const_handle). */
inline void set_vertex(Vertex_const_handle v)
inline void set_vertex(Vertex_const_handle v) { ptr()->v = v; }
/*! Set the first he going clockwise starting at 12 o'clock.
*/
inline void set_cw_he(Halfedge_const_handle he)
{
ptr()->v = v;
}
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
inline void set_cw_he(Halfedge_const_handle he)
{
if (cw_he() != Traits::empty_he_handle() &&
cw_he()->direction() != he->direction())
{
ptr()->cw_he = he->twin();
}
else
{
ptr()->cw_he = he;
}
ptr()->cw_he = ((cw_he() != Traits::empty_he_handle()) &&
(cw_he()->direction() != he->direction())) ?
he->twin() : he;
}
public:
/*! Reset the first he going clockwise starting at 12 o'clock.
*/
inline void reset_cw_he() { ptr()->cw_he = Traits::empty_he_handle(); }
public:
/// \name Constructors.
//@{
Td_active_fictitious_vertex ()
Td_active_fictitious_vertex()
{
PTR = new Data
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
}
/*! Constructor given Vertex & Halfedge handles. */
Td_active_fictitious_vertex (Vertex_const_handle v,
Halfedge_const_handle cw_he,
Dag_node* node = 0)
{
PTR = new Data(v, cw_he, node);
}
Td_active_fictitious_vertex(Vertex_const_handle v,
Halfedge_const_handle cw_he,
Dag_node* node = 0)
{ PTR = new Data(v, cw_he, node); }
/*! Copy constructor. */
Td_active_fictitious_vertex (const Self& tr) : Handle(tr)
{
}
Td_active_fictitious_vertex (const Self& tr) : Handle(tr) {}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
inline Self& operator=(const Self& t2)
{
Handle::operator=(t2);
return *this;
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
inline bool operator==(const Self& t2) const { return (ptr() == t2.ptr()); }
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
inline bool operator!=(const Self& t2) const { return !(operator==(t2)); }
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
inline Self& self() { return *this; }
inline const Self& self() const { return *this; }
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
inline unsigned long id() const { return (unsigned long) PTR; }
/*! Access trapezoid left.
* filters out the infinite case which returns predefined dummy values
*/
inline Vertex_const_handle vertex() const
{
return ptr()->v;
}
/*! Access trapezoid left.
* filters out the infinite case which returns predefined dummy values
*/
inline Vertex_const_handle vertex() const { return ptr()->v; }
Curve_end curve_end() const
{
return vtx_to_ce(vertex());
}
Curve_end curve_end() const { return vtx_to_ce(vertex()); }
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he() const { return ptr()->cw_he; }
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he () const
{
return ptr()->cw_he;
}
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; } //m_dag_node;}
Dag_node* dag_node() const { return ptr()->p_node; } //m_dag_node;}
//@}
};
} //namespace CGAL

View File

@ -16,15 +16,15 @@
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
// Michal Balas <balasmic@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_TD_ACTIVE_VERTEX_H
#define CGAL_TD_ACTIVE_VERTEX_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*! \file
* Defintion of the Td_active_vertex<Td_traits> class.
*/
@ -46,63 +46,62 @@ namespace CGAL {
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_active_vertex : public Handle
{
public:
template <typename Td_traits_>
class Td_active_vertex : public Handle {
public:
//type of traits class
typedef Td_traits_ Traits;
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
Halfedge_around_vertex_const_circulator;
//type of Td_active_vertex (Self)
typedef typename Traits::Td_active_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
typedef typename Traits::Td_active_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
@ -113,201 +112,145 @@ class Td_active_vertex : public Handle
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
* Inner class Data derived from Rep class
*/
class Data : public Rep {
friend class Td_active_vertex<Td_traits_>;
public:
//c'tors
Data (Vertex_const_handle _v,
Halfedge_const_handle _cw_he,
Dag_node* _p_node)
: v(_v),cw_he(_cw_he),p_node(_p_node)
{ }
~Data() { }
Data(Vertex_const_handle _v, Halfedge_const_handle _cw_he,
Dag_node* _p_node) :
v(_v), cw_he(_cw_he), p_node(_p_node)
{}
~Data() {}
protected:
Vertex_const_handle v;
Vertex_const_handle v;
Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock
Dag_node* p_node;
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
private:
Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const
{
//the circulator is of incoming halfedges
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
//if the vertex is associated with a point on the bounded coords,
// we can take any incident halfedge. o/w if the vertex lies at infinity,
// it has 2 fictitious incident halfedges
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
return Curve_end(he->curve(),
(he->direction() == ARR_RIGHT_TO_LEFT)?
ARR_MIN_END : ARR_MAX_END);
return Curve_end(he->curve(), ((he->direction() == ARR_RIGHT_TO_LEFT) ?
ARR_MIN_END : ARR_MAX_END));
}
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
protected:
#else
public: // workaround
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; }
/*! Set the vertex handle (Vertex_const_handle). */
inline void set_vertex(Vertex_const_handle v)
inline void set_vertex(Vertex_const_handle v) { ptr()->v = v; }
/*! Set the first he going clockwise starting at 12 o'clock.
*/
inline void set_cw_he(Halfedge_const_handle he)
{
ptr()->v = v;
ptr()->cw_he = ((cw_he() != Traits::empty_he_handle()) &&
(cw_he()->direction() != he->direction())) ?
he->twin() : he;
}
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
inline void set_cw_he(Halfedge_const_handle he)
{
if (cw_he() != Traits::empty_he_handle() &&
cw_he()->direction() != he->direction())
{
ptr()->cw_he = he->twin();
}
else
{
ptr()->cw_he = he;
}
}
public:
/*! Reset the first he going clockwise starting at 12 o'clock.
*/
inline void reset_cw_he() { ptr()->cw_he = Traits::empty_he_handle(); }
public:
/// \name Constructors.
//@{
Td_active_vertex ()
Td_active_vertex()
{
PTR = new Data
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
}
/*! Constructor given Vertex & Halfedge handles. */
Td_active_vertex (Vertex_const_handle v,
Halfedge_const_handle cw_he,
Td_active_vertex(Vertex_const_handle v, Halfedge_const_handle cw_he,
Dag_node* node = 0)
{
PTR = new Data (v, cw_he, node);
}
{ PTR = new Data(v, cw_he, node); }
/*! Copy constructor. */
Td_active_vertex(const Self& tr) : Handle(tr)
{
}
Td_active_vertex(const Self& tr) : Handle(tr) {}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
inline Self& operator=(const Self& t2)
{
Handle::operator=(t2);
return *this;
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
inline bool operator==(const Self& t2) const { return (ptr() == t2.ptr()); }
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
inline bool operator!=(const Self& t2) const { return !(operator==(t2)); }
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
inline Self& self() { return *this; }
inline const Self& self() const { return *this; }
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
inline unsigned long id() const { return (unsigned long) PTR; }
inline Vertex_const_handle vertex() const
{
return ptr()->v;
}
inline Vertex_const_handle vertex() const { return ptr()->v; }
Curve_end curve_end() const { return vtx_to_ce(vertex()); }
inline const Point& point() const { return vertex()->point(); }
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he() const { return ptr()->cw_he; }
Curve_end curve_end() const
{
return vtx_to_ce(vertex());
}
inline const Point& point() const
{
return vertex()->point();
}
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he () const
{
return ptr()->cw_he;
}
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; }
//@}
Dag_node* dag_node() const { return ptr()->p_node; }
//@}
};
} //namespace CGAL

View File

@ -16,8 +16,9 @@
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// Iddo Hanniel <hanniel@math.tau.ac.il>
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
// Iddo Hanniel <hanniel@math.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H
@ -617,29 +618,36 @@ public:
}
};
class set_cw_he_visitor : public boost::static_visitor<void>
{
/*! A visitor to set the cw halfedge of a vertex node.
*/
class set_cw_he_visitor : public boost::static_visitor<void> {
public:
set_cw_he_visitor (Halfedge_const_handle he) : m_cw_he(he) {}
set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {}
void operator()(Td_active_vertex& t) const { t.set_cw_he(m_cw_he); }
void operator()(Td_active_vertex& t) const
{
t.set_cw_he(m_cw_he);
}
void operator()(Td_active_fictitious_vertex& t) const
{
t.set_cw_he(m_cw_he);
}
{ t.set_cw_he(m_cw_he); }
template <typename T>
void operator()(T& /*t*/) const { CGAL_assertion(false); }
template < typename T >
void operator()(T& /*t*/) const
{
CGAL_assertion(false);
}
private:
Halfedge_const_handle m_cw_he;
};
/*! A visitor to reset the cw halfedge of a vertex node.
*/
class reset_cw_he_visitor : public boost::static_visitor<void> {
public:
void operator()(Td_active_vertex& t) const { t.reset_cw_he(); }
void operator()(Td_active_fictitious_vertex& t) const { t.reset_cw_he(); }
template <typename T>
void operator()(T& /*t*/) const { CGAL_assertion(false); }
};
class dag_node_visitor : public boost::static_visitor<Dag_node*>
{
public:
@ -1151,6 +1159,11 @@ protected:
Halfedge_const_handle new_he,
Td_map_item& vtx_item);
/*! Update the cw halfedge of an active vertex after a halfedge is removed.
*/
void update_vtx_cw_he_after_remove(Halfedge_const_handle old_he,
Td_map_item& vtx_item);
////MICHAL: currently not in use since split is implemented as: remove and insert two
//void set_trp_params_after_split_halfedge_update(Halfedge_const_handle new_he,
// Td_map_item& vtx_item,
@ -1758,22 +1771,20 @@ public:
#endif
Halfedge_container container;
#ifdef CGAL_TD_DEBUG
unsigned long rep = Halfedge_filter(container, &dag_root());
#else
Halfedge_filter(container, &dag_root());
#endif
clear();
//// initialize container to point to curves in Td_map_item Tree
//if (rep>0)
//{
//if (rep>0) {
// bool o = set_with_guarantees(false);
// typename std::vector<Halfedge_const_handle>::iterator
// it = container.begin(),
// it_end = container.end();
// while(it!=it_end)
// {
// while (it != it_end) {
// insert(*it);
// ++it;
// }
@ -1787,8 +1798,7 @@ public:
#ifdef CGAL_TD_DEBUG
CGAL_assertion(is_valid());
unsigned long sz = number_of_curves();
if (sz != rep)
{
if (sz != rep) {
std::cerr << "\nnumber_of_curves()=" << sz;
std::cerr << "\nrepresentatives.size()=" << rep;
CGAL_assertion(number_of_curves() == rep);
@ -1832,46 +1842,37 @@ public:
// return container.size();
//}
/* Return a container for all active curves.
*/
template <typename Halfedge_container>
unsigned long Halfedge_filter(Halfedge_container& container,
const Dag_node* ds) const
/* Return a container for all active curves */
{
unsigned long sz = number_of_curves();
std::list<Td_map_item> representatives;
//X_trapezoid_list representatives;
ds->filter(representatives, Td_active_edge_item(*traits));
#ifndef CGAL_TD_DEBUG
CGAL_warning(sz==representatives.size());
CGAL_warning(sz == representatives.size());
#else
unsigned long rep=representatives.size();
if (sz != rep)
{
unsigned long rep = representatives.size();
if (sz != rep) {
std::cerr << "\nnumber_of_curves()=" << sz;
std::cerr << "\nrepresentatives.size()=" << rep;
CGAL_assertion(number_of_curves()==representatives.size());
}
#endif
if (sz > 0)
{
typename std::list<Td_map_item>::iterator it = representatives.begin(),
it_end = representatives.end();
//typename X_trapezoid_list::iterator it = representatives.begin(),
// it_end = representatives.end();
while(!(it==it_end))
if (sz > 0) {
for (typename std::list<Td_map_item>::iterator it =
representatives.begin(); it != representatives.end(); ++it)
{
Td_active_edge e (boost::get<Td_active_edge>(*it));
Td_active_edge e(boost::get<Td_active_edge>(*it));
container.push_back(e.halfedge()); //it represents an active trapezoid
++it;
}
}
if(! container.empty()) {
if (! container.empty()) {
CGAL::cpp98::random_shuffle(container.begin(),container.end());
}
return sz;
@ -2010,7 +2011,6 @@ public:
true, *m_dag_root, *m_dag_root);
}
protected:
//Trapezoidal Decomposition data members
@ -2138,7 +2138,6 @@ private:
#endif
void print_cv_data(const X_monotone_curve_2& cv,
std::ostream& out = std::cout) const
{
@ -2206,7 +2205,6 @@ private:
}
}
void print_dag_addresses(const Dag_node& curr) const
{

View File

@ -6,7 +6,7 @@ project( Arrangement_on_surface_2_Tests )
enable_testing()
cmake_minimum_required(VERSION 2.8.10)
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core)
@ -33,8 +33,7 @@ if ( CGAL_FOUND )
endif()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -132,7 +132,7 @@ read_perform_opts(std::istream& is)
rc = false;
continue;
}
if (cmd == 'i') insert(*(this->m_arr), this->m_xcurves[id]);
if (cmd == 'i') CGAL::insert(*(this->m_arr), this->m_xcurves[id]);
if (cmd == 'd') {
if (!remove(this->m_xcurves[id])) rc = false;

View File

@ -0,0 +1,15 @@
i 0
i 1
i 2
i 3
i 4
i 5
i 6
i 7
d 7
d 6
d 5
d 4
d 3
d 2
d 1

View File

@ -0,0 +1,8 @@
0 0 1 1
1 1 2 2
2 2 3 3
3 3 4 4
4 4 5 5
5 5 6 6
6 6 7 7
7 7 8 8

View File

@ -1 +1,3 @@
./data/empty.zero ./data/point_location/segments/xcurves/test10.txt ./data/empty.zero ./data/point_location/segments/ops/test10.txt ./data/point_location/segments/queries/test10.txt
./data/empty.zero ./data/point_location/segments/xcurves/test11.txt ./data/empty.zero ./data/point_location/segments/ops/test11.txt ./data/point_location/segments/queries/test03.txt
./data/empty.zero ./data/point_location/segments/xcurves/test11.txt ./data/empty.zero ./data/point_location/segments/ops/test12.txt ./data/point_location/segments/queries/test03.txt

View File

@ -6,15 +6,16 @@ project( Minkowski_sum_2_Tests )
cmake_minimum_required(VERSION 2.8.10)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11)
if (has_cpp11 LESS 0)
message(STATUS "NOTICE: These examples requires a C++11 compiler and will not be compiled.")
return()
endif()
# Commented out C++11 for now
# list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11)
# if (has_cpp11 LESS 0)
# message(STATUS "NOTICE: These examples requires a C++11 compiler and will not be compiled.")
# return()
# endif()
# Use C++11 for this directory and its sub-directories.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
# # Use C++11 for this directory and its sub-directories.
# set(CMAKE_CXX_STANDARD 11)
# set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
find_package(CGAL QUIET COMPONENTS Core )