mirror of https://github.com/CGAL/cgal
Changed Surface_sweep_2 and No_intersection_surface_sweep_2 to be templates parameterized only by visitors.
This commit is contained in:
parent
2c09a3f378
commit
ae01194712
|
|
@ -47,8 +47,8 @@ namespace Ss2 = Surface_sweep_2;
|
|||
* Face_const_handle> >.
|
||||
* It represents the arrangement feature containing the point.
|
||||
*/
|
||||
template<typename GeometryTraits_2, typename TopologyTraits,
|
||||
typename PointsIterator, typename OutputIterator>
|
||||
template <typename GeometryTraits_2, typename TopologyTraits,
|
||||
typename PointsIterator, typename OutputIterator>
|
||||
OutputIterator
|
||||
locate(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
||||
PointsIterator points_begin, PointsIterator points_end,
|
||||
|
|
@ -123,9 +123,7 @@ locate(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
|
||||
// Define the sweep-line visitor and perform the sweep.
|
||||
Bpl_visitor visitor(&arr, oi);
|
||||
Ss2::No_intersection_surface_sweep_2<Bpl_traits_2, Bpl_visitor,
|
||||
typename Bpl_visitor::Event,
|
||||
typename Bpl_visitor::Subcurve>
|
||||
Ss2::No_intersection_surface_sweep_2<Bpl_visitor>
|
||||
surface_sweep(&ex_traits, &visitor);
|
||||
surface_sweep.sweep(xcurves_vec.begin(), xcurves_vec.end(), // Curves.
|
||||
iso_pts_vec.begin(), iso_pts_vec.end(), // Action points.
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Eric Berberich <ericb@post.tau.ac.il>
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Eric Berberich <ericb@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_H
|
||||
#define CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_H
|
||||
|
|
@ -301,17 +301,24 @@ public:
|
|||
typedef Arr_no_intersection_insertion_sl_visitor<NxIHelper>
|
||||
Surface_sweep_no_intersection_insertion_visitor;
|
||||
|
||||
template <typename OutputIterator_>
|
||||
/*! \class Surface_sweep_batched_point_location_visitor
|
||||
*/
|
||||
template <typename OutputIterator>
|
||||
struct Surface_sweep_batched_point_location_visitor :
|
||||
public Arr_batched_pl_sl_visitor<BplHelper, OutputIterator_>
|
||||
public Arr_batched_pl_sl_visitor<
|
||||
BplHelper, OutputIterator,
|
||||
Surface_sweep_batched_point_location_visitor<OutputIterator> >
|
||||
{
|
||||
typedef OutputIterator_ Output_iterator;
|
||||
typedef OutputIterator Output_iterator;
|
||||
|
||||
typedef Arr_batched_pl_sl_visitor<BplHelper, Output_iterator>
|
||||
typedef Surface_sweep_batched_point_location_visitor<Output_iterator>
|
||||
Self;
|
||||
typedef Arr_batched_pl_sl_visitor<BplHelper, Output_iterator, Self>
|
||||
Base;
|
||||
typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
|
||||
typedef typename BplHelper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename BplHelper::Event Event;
|
||||
typedef typename BplHelper::Subcurve Subcurve;
|
||||
|
||||
Surface_sweep_batched_point_location_visitor(const Arr* arr,
|
||||
Output_iterator& oi) :
|
||||
|
|
@ -319,13 +326,20 @@ public:
|
|||
{}
|
||||
};
|
||||
|
||||
template <typename OutputIterator_>
|
||||
/*! \class Surface_sweep_vertical_decomposition_visitor
|
||||
*/
|
||||
template <typename OutputIterator>
|
||||
struct Surface_sweep_vertical_decomposition_visitor :
|
||||
public Arr_vert_decomp_sl_visitor<VdHelper, OutputIterator_>
|
||||
public Arr_vert_decomp_sl_visitor<
|
||||
VdHelper, OutputIterator,
|
||||
Surface_sweep_vertical_decomposition_visitor<OutputIterator> >
|
||||
{
|
||||
typedef OutputIterator_ Output_iterator;
|
||||
typedef OutputIterator Output_iterator;
|
||||
typedef Surface_sweep_vertical_decomposition_visitor<Output_iterator>
|
||||
Self;
|
||||
typedef Arr_vert_decomp_sl_visitor<VdHelper, Output_iterator, Self>
|
||||
Base;
|
||||
|
||||
typedef Arr_vert_decomp_sl_visitor<VdHelper, Output_iterator> Base;
|
||||
typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
|
|
@ -336,6 +350,8 @@ public:
|
|||
{}
|
||||
};
|
||||
|
||||
/*! \class Surface_sweep_overlay_visitor
|
||||
*/
|
||||
template <typename ArrangementA, typename ArrangementB,
|
||||
typename OverlayTraits>
|
||||
struct Surface_sweep_overlay_visitor :
|
||||
|
|
@ -344,7 +360,10 @@ public:
|
|||
Geometry_traits_2>,
|
||||
ArrangementA, ArrangementB>,
|
||||
ArrangementA, ArrangementB>,
|
||||
OverlayTraits>
|
||||
OverlayTraits,
|
||||
Surface_sweep_overlay_visitor<ArrangementA,
|
||||
ArrangementB,
|
||||
OverlayTraits> >
|
||||
{
|
||||
typedef ArrangementA Arrangement_a;
|
||||
typedef ArrangementB Arrangement_b;
|
||||
|
|
@ -358,7 +377,10 @@ public:
|
|||
typedef _Overlay_helper<Geom_ovl_traits_2, Arrangement_a, Arrangement_b>
|
||||
Ovl_helper;
|
||||
|
||||
typedef Arr_overlay_sl_visitor<Ovl_helper, Overlay_traits>
|
||||
typedef Surface_sweep_overlay_visitor<ArrangementA, ArrangementB,
|
||||
OverlayTraits>
|
||||
Self;
|
||||
typedef Arr_overlay_sl_visitor<Ovl_helper, Overlay_traits, Self>
|
||||
Base;
|
||||
|
||||
// typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||
|
||||
/*! \file
|
||||
*
|
||||
* Definition of the global Arr_overlay_2() function.
|
||||
*/
|
||||
|
||||
|
|
@ -150,10 +151,7 @@ void overlay(const Arrangement_on_surface_2<GeomTraitsA, TopTraitsA>& arr1,
|
|||
ex_traits(*traits_adaptor);
|
||||
|
||||
Ovl_visitor visitor(&arr1, &arr2, &arr_res, &ovl_tr);
|
||||
Ss2::Surface_sweep_2<Ovl_traits_2, Ovl_visitor,
|
||||
typename Ovl_visitor::Event,
|
||||
typename Ovl_visitor::Subcurve>
|
||||
sweep_line(&ex_traits, &visitor);
|
||||
Ss2::Surface_sweep_2<Ovl_visitor> sweep_line(&ex_traits, &visitor);
|
||||
|
||||
// In case both arrangement do not contain isolated vertices, go on and
|
||||
// overlay them.
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Efi Fogel <efif@post.tau.ac.il>
|
||||
// Eric Berberich <ericb@post.tau.ac.il>
|
||||
// Author(s) : Efi Fogel <efif@post.tau.ac.il>
|
||||
// Eric Berberich <ericb@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_SPHERICAL_TOPOLOGY_TRAITS_2_H
|
||||
#define CGAL_ARR_SPHERICAL_TOPOLOGY_TRAITS_2_H
|
||||
|
|
@ -344,8 +344,8 @@ private:
|
|||
|
||||
// Type definition for the basic insertion sweep-line visitor.
|
||||
typedef Arr_basic_insertion_traits_2<Gt2, Arr> NxITraits;
|
||||
typedef Arr_construction_event<NxITraits, Arr, Ss2::No_overlap_event_base>
|
||||
NxIEvent;
|
||||
typedef Arr_construction_event<NxITraits, Arr, Ss2::No_overlap_event_base,
|
||||
Ss2::No_overlap_subcurve> NxIEvent;
|
||||
typedef Arr_construction_subcurve<NxITraits, NxIEvent,
|
||||
Ss2::No_overlap_subcurve> NxISubcurve;
|
||||
typedef Arr_spherical_insertion_helper<NxITraits, Arr, NxIEvent, NxISubcurve>
|
||||
|
|
@ -360,11 +360,10 @@ private:
|
|||
|
||||
// Type definition for the vertical decomposition sweep-line visitor.
|
||||
typedef Arr_batched_point_location_traits_2<Arr> VdTraits;
|
||||
// typedef Ss2::No_overlap_event<VdTraits> VdEvent;
|
||||
// typedef Ss2::No_overlap_subcurve<VdTraits, VdEvent> VdSubcurve;
|
||||
// typedef Arr_spherical_vert_decomp_helper<VdTraits, Arr, VdEvent, VdSubcurve>
|
||||
// VdHelper;
|
||||
typedef Arr_spherical_vert_decomp_helper<VdTraits, Arr> VdHelper;
|
||||
typedef Ss2::No_overlap_event<VdTraits> VdEvent;
|
||||
typedef Ss2::No_overlap_subcurve<VdTraits, VdEvent> VdSubcurve;
|
||||
typedef Arr_spherical_vert_decomp_helper<VdTraits, Arr, VdEvent, VdSubcurve>
|
||||
VdHelper;
|
||||
|
||||
// Type definition for the overlay sweep-line visitor.
|
||||
template <typename ExtendedGeometryTraits_2, typename ArrangementA,
|
||||
|
|
@ -417,17 +416,23 @@ public:
|
|||
typedef Arr_no_intersection_insertion_sl_visitor<NxIHelper>
|
||||
Surface_sweep_no_intersection_insertion_visitor;
|
||||
|
||||
/*! \class Surface_sweep_batched_point_location_visitor
|
||||
*/
|
||||
template <typename OutputIterator>
|
||||
struct Surface_sweep_batched_point_location_visitor :
|
||||
public Arr_batched_pl_sl_visitor<BplHelper, OutputIterator>
|
||||
public Arr_batched_pl_sl_visitor<
|
||||
BplHelper, OutputIterator,
|
||||
Surface_sweep_batched_point_location_visitor<OutputIterator> >
|
||||
{
|
||||
typedef OutputIterator Output_iterator;
|
||||
|
||||
typedef Arr_batched_pl_sl_visitor<BplHelper, Output_iterator>
|
||||
typedef Surface_sweep_batched_point_location_visitor<Output_iterator>
|
||||
Self;
|
||||
typedef Arr_batched_pl_sl_visitor<BplHelper, Output_iterator, Self>
|
||||
Base;
|
||||
typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
typedef typename BplHelper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename BplHelper::Event Event;
|
||||
typedef typename BplHelper::Subcurve Subcurve;
|
||||
|
||||
Surface_sweep_batched_point_location_visitor(const Arr* arr,
|
||||
Output_iterator& oi) :
|
||||
|
|
@ -435,12 +440,19 @@ public:
|
|||
{}
|
||||
};
|
||||
|
||||
/*! \class Surface_sweep_vertical_decomposition_visitor
|
||||
*/
|
||||
template <typename OutputIterator>
|
||||
struct Surface_sweep_vertical_decomposition_visitor :
|
||||
public Arr_vert_decomp_sl_visitor<VdHelper, OutputIterator>
|
||||
public Arr_vert_decomp_sl_visitor<
|
||||
VdHelper, OutputIterator,
|
||||
Surface_sweep_vertical_decomposition_visitor<OutputIterator> >
|
||||
{
|
||||
typedef OutputIterator Output_iterator;
|
||||
typedef Arr_vert_decomp_sl_visitor<VdHelper,Output_iterator> Base;
|
||||
typedef Surface_sweep_vertical_decomposition_visitor<Output_iterator>
|
||||
Self;
|
||||
typedef Arr_vert_decomp_sl_visitor<VdHelper, Output_iterator, Self>
|
||||
Base;
|
||||
|
||||
typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Event Event;
|
||||
|
|
@ -460,7 +472,10 @@ public:
|
|||
ArrangementA,
|
||||
ArrangementB>,
|
||||
ArrangementA, ArrangementB>,
|
||||
OverlayTraits>
|
||||
OverlayTraits,
|
||||
Surface_sweep_overlay_visitor<ArrangementA,
|
||||
ArrangementB,
|
||||
OverlayTraits> >
|
||||
{
|
||||
typedef ArrangementA Arrangement_a;
|
||||
typedef ArrangementB Arrangement_b;
|
||||
|
|
@ -473,7 +488,10 @@ public:
|
|||
typedef _Overlay_helper<Geom_ovl_traits_2, Arrangement_a, Arrangement_b>
|
||||
Ovl_helper;
|
||||
|
||||
typedef Arr_overlay_sl_visitor<Ovl_helper, Overlay_traits>
|
||||
typedef Surface_sweep_overlay_visitor<ArrangementA, ArrangementB,
|
||||
OverlayTraits>
|
||||
Self;
|
||||
typedef Arr_overlay_sl_visitor<Ovl_helper, Overlay_traits, Self>
|
||||
Base;
|
||||
|
||||
// typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_BOUNDED_PLANAR_BATCHED_PL_HELPER_H
|
||||
#define CGAL_ARR_BOUNDED_PLANAR_BATCHED_PL_HELPER_H
|
||||
|
|
@ -29,7 +30,7 @@ namespace CGAL {
|
|||
|
||||
namespace Ss2 = Surface_sweep_2;
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
|
||||
/*! \class Arr_bounded_planar_batched_pl_helper
|
||||
*
|
||||
|
|
@ -45,15 +46,13 @@ public:
|
|||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||
|
||||
public:
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
|
||||
typedef typename Arrangement_2::Topology_traits Topology_traits;
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_BOUNDED_PLANAR_CONSTRUCTION_HELPER_H
|
||||
#define CGAL_ARR_BOUNDED_PLANAR_CONSTRUCTION_HELPER_H
|
||||
|
|
@ -25,7 +26,7 @@
|
|||
* Definition of the Arr_bounded_planar_construction_helper class-template.
|
||||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -46,6 +47,7 @@ public:
|
|||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
|
@ -54,9 +56,6 @@ public:
|
|||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
|
||||
typedef typename Arrangement_2::Face_handle Face_handle;
|
||||
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_BOUNDED_PLANAR_INSERTION_HELPER_H
|
||||
#define CGAL_ARR_BOUNDED_PLANAR_INSERTION_HELPER_H
|
||||
|
|
@ -25,7 +26,6 @@
|
|||
* Definition of the Arr_bounded_planar_insertion_helper class-template.
|
||||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_2/Arr_construction_sl_visitor.h>
|
||||
#include <CGAL/Arr_topology_traits/Arr_bounded_planar_construction_helper.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -62,18 +62,12 @@ public:
|
|||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
|
||||
typedef Arr_construction_sl_visitor<Self> Parent_visitor;
|
||||
|
||||
typedef typename Arrangement_2::Face_handle Face_handle;
|
||||
|
||||
typedef typename Base::Indices_list Indices_list;
|
||||
typedef typename Base::Halfedge_indices_map Halfedge_indices_map;
|
||||
|
||||
public:
|
||||
|
||||
/*! Constructor. */
|
||||
Arr_bounded_planar_insertion_helper(Arrangement_2* arr) :
|
||||
Base(arr)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_BOUNDED_PLANAR_OVERLAY_HELPER_H
|
||||
#define CGAL_ARR_BOUNDED_PLANAR_OVERLAY_HELPER_H
|
||||
|
|
@ -79,7 +80,7 @@ protected:
|
|||
|
||||
public:
|
||||
/*! Constructor, given the input red and blue arrangements. */
|
||||
Arr_bounded_planar_overlay_helper(const Ar2 *red_arr, const Ab2 *blue_arr) :
|
||||
Arr_bounded_planar_overlay_helper(const Ar2* red_arr, const Ab2* blue_arr) :
|
||||
m_red_top_traits (red_arr->topology_traits()),
|
||||
m_blue_top_traits (blue_arr->topology_traits())
|
||||
{}
|
||||
|
|
@ -88,25 +89,24 @@ public:
|
|||
//@{
|
||||
|
||||
/* A notification issued before the sweep process starts. */
|
||||
void before_sweep ()
|
||||
void before_sweep()
|
||||
{
|
||||
// Get the unbounded faces in both arrangements.
|
||||
m_red_ubf = Face_handle_red (m_red_top_traits->unbounded_face());
|
||||
m_blue_ubf = Face_handle_blue (m_blue_top_traits->unbounded_face());
|
||||
return;
|
||||
}
|
||||
|
||||
/*! A notification invoked before the sweep-line starts handling the given
|
||||
* event.
|
||||
*/
|
||||
void before_handle_event (Event* /* e */) {}
|
||||
void before_handle_event(Event* /* e */) {}
|
||||
//@}
|
||||
|
||||
/*! Obtain the current red top face. */
|
||||
Face_handle_red red_top_face () const { return m_red_ubf; }
|
||||
Face_handle_red red_top_face() const { return m_red_ubf; }
|
||||
|
||||
/*! Obtain the current blue top face. */
|
||||
Face_handle_blue blue_top_face () const { return m_blue_ubf; }
|
||||
Face_handle_blue blue_top_face() const { return m_blue_ubf; }
|
||||
};
|
||||
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_BOUNDED_PLANAR_VERT_DEOCMP_HELPER_H
|
||||
#define CGAL_ARR_BOUNDED_PLANAR_VERT_DEOCMP_HELPER_H
|
||||
|
|
@ -28,7 +29,7 @@ namespace CGAL {
|
|||
|
||||
namespace Ss2 = Surface_sweep_2;
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
|
||||
/*! \class Arr_bounded_planar_vert_decomp_helper
|
||||
*
|
||||
|
|
@ -44,17 +45,13 @@ public:
|
|||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
||||
public:
|
||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||
|
||||
public:
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
|
||||
typedef typename Arrangement_2::Topology_traits Topology_traits;
|
||||
|
||||
protected:
|
||||
|
|
@ -73,7 +70,7 @@ public:
|
|||
/// \name Notification functions.
|
||||
//@{
|
||||
|
||||
/* A notification issued before the sweep process starts. */
|
||||
/*! A notification issued before the sweep process starts. */
|
||||
void before_sweep()
|
||||
{
|
||||
// Get the unbounded face.
|
||||
|
|
@ -93,6 +90,6 @@ public:
|
|||
CGAL::Object bottom_object() const { return CGAL::make_object(m_unb_face); }
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
} // namespace CGAL
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
//
|
||||
|
||||
#ifndef CGAL_ARR_SPHERICAL_BATCHED_PL_HELPER_H
|
||||
#define CGAL_ARR_SPHERICAL_BATCHED_PL_HELPER_H
|
||||
|
|
@ -31,8 +30,6 @@ namespace CGAL {
|
|||
|
||||
namespace Ss2 = Surface_sweep_2;
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
|
||||
/*! \class Arr_spherical_batched_pl_helper
|
||||
*
|
||||
* A helper class for the batched point-location sweep-line visitor, suitable
|
||||
|
|
@ -47,13 +44,12 @@ public:
|
|||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
||||
public:
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||
typedef typename Event::Subcurve_iterator Subcurve_iterator;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* Definition of the Arr_spherical_construction_helper class-template.
|
||||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -38,14 +37,15 @@ namespace Ss2 = Surface_sweep_2;
|
|||
* for an Arrangement_on_surface_2 instantiated with a topology-traits class
|
||||
* for bounded curves in the plane.
|
||||
*/
|
||||
template <typename Traits_, typename Arrangement_, typename Event_,
|
||||
template <typename GeometryTraits_2, typename Arrangement_, typename Event_,
|
||||
typename Subcurve_>
|
||||
class Arr_spherical_construction_helper {
|
||||
public:
|
||||
typedef Traits_ Geometry_traits_2;
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
|
@ -54,9 +54,6 @@ public:
|
|||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
|
||||
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
|
||||
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
|
||||
typedef typename Arrangement_2::Face_handle Face_handle;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* Definition of the Arr_spherical_insertion_helper class-template.
|
||||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_2/Arr_construction_sl_visitor.h>
|
||||
#include <CGAL/Arr_topology_traits/Arr_spherical_construction_helper.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -61,11 +60,6 @@ public:
|
|||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
|
||||
typedef Arr_construction_sl_visitor<Self> Parent_visitor;
|
||||
|
||||
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
|
||||
typedef typename Arrangement_2::Face_handle Face_handle;
|
||||
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
|
||||
|
|
@ -231,6 +225,6 @@ Arr_spherical_insertion_helper<Tr, Arr, Evnt, Sbcv>::top_face() const
|
|||
return this->m_spherical_face;
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
} // namespace CGAL
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
//
|
||||
|
||||
#ifndef CGAL_ARR_SPHERICAL_VERT_DECOMP_HELPER_H
|
||||
#define CGAL_ARR_SPHERICAL_VERT_DECOMP_HELPER_H
|
||||
|
|
@ -30,33 +29,31 @@ namespace CGAL {
|
|||
|
||||
namespace Ss2 = Surface_sweep_2;
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
|
||||
/*! \class Arr_spherical_vert_decomp_helper
|
||||
*
|
||||
* A helper class for the vertical decomposition sweep-line visitor, suitable
|
||||
* for an Arrangement_on_surface_2 instantiated with a topology-traits class
|
||||
* for bounded curves in the plane.
|
||||
*/
|
||||
template <typename GeometryTraits_2, typename Arrangement_>
|
||||
template <typename GeometryTraits_2, typename Arrangement_, typename Event_,
|
||||
typename Subcurve_>
|
||||
class Arr_spherical_vert_decomp_helper {
|
||||
public:
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
||||
public:
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2> Base_visitor;
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
|
||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle;
|
||||
|
||||
typedef typename Base_visitor::Event Event;
|
||||
typedef typename Base_visitor::Subcurve Subcurve;
|
||||
|
||||
protected:
|
||||
typedef typename Arrangement_2::Topology_traits Topology_traits;
|
||||
|
||||
|
|
@ -111,8 +108,8 @@ public:
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification issued before the sweep process starts.
|
||||
//
|
||||
template <typename Tr, typename Arr>
|
||||
void Arr_spherical_vert_decomp_helper<Tr, Arr>::before_sweep()
|
||||
template <typename Tr, typename Arr, typename Evnt, typename Sbcv>
|
||||
void Arr_spherical_vert_decomp_helper<Tr, Arr, Evnt, Sbcv>::before_sweep()
|
||||
{
|
||||
// Get the north pole and the face that intially contains it.
|
||||
m_valid_north_pole = (m_top_traits->north_pole() != NULL);
|
||||
|
|
@ -133,9 +130,9 @@ void Arr_spherical_vert_decomp_helper<Tr, Arr>::before_sweep()
|
|||
// A notification invoked after the sweep-line finishes handling the given
|
||||
// event.
|
||||
///
|
||||
template <typename Tr, typename Arr>
|
||||
void
|
||||
Arr_spherical_vert_decomp_helper<Tr, Arr>::after_handle_event (Event *event)
|
||||
template <typename Tr, typename Arr, typename Evnt, typename Sbcv>
|
||||
void Arr_spherical_vert_decomp_helper<Tr, Arr, Evnt, Sbcv>::
|
||||
after_handle_event(Event *event)
|
||||
{
|
||||
// Ignore events that are not incident to the poles.
|
||||
if (event->parameter_space_in_y() == ARR_INTERIOR) return;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_UNB_PLANAR_BATCHED_PL_HELPER_H
|
||||
#define CGAL_ARR_UNB_PLANAR_BATCHED_PL_HELPER_H
|
||||
|
|
@ -30,7 +30,7 @@ namespace CGAL {
|
|||
|
||||
namespace Ss2 = Surface_sweep_2;
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
|
||||
/*! \class Arr_unb_planar_batched_pl_helper
|
||||
*
|
||||
|
|
@ -46,13 +46,12 @@ public:
|
|||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
||||
public:
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_UNB_PLANAR_CONSTRUCTION_HELPER_H
|
||||
#define CGAL_ARR_UNB_PLANAR_CONSTRUCTION_HELPER_H
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
* Definition of the Arr_unb_planar_construction_helper class-template.
|
||||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -47,13 +47,12 @@ public:
|
|||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
||||
public:
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_UNB_PLANAR_INSERTION_HELPER_H
|
||||
#define CGAL_ARR_UNB_PLANAR_INSERTION_HELPER_H
|
||||
|
|
@ -26,7 +26,6 @@
|
|||
* Definition of the Arr_unb_planar_insertion_helper class-template.
|
||||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_2/Arr_construction_sl_visitor.h>
|
||||
#include <CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -62,11 +61,6 @@ public:
|
|||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
|
||||
typedef Arr_construction_sl_visitor<Self> Parent_visitor;
|
||||
|
||||
typedef typename Arrangement_2::Face_handle Face_handle;
|
||||
|
||||
typedef typename Base::Indices_list Indices_list;
|
||||
|
|
|
|||
|
|
@ -119,7 +119,8 @@ public:
|
|||
//
|
||||
template <typename Tr, typename ArrR, typename ArrB, typename Arr,
|
||||
typename Evnt, typename Sbcv>
|
||||
void Arr_unb_planar_overlay_helper<Tr,ArrR,ArrB,Arr,Evnt,Sbcv>::before_sweep()
|
||||
void Arr_unb_planar_overlay_helper<Tr, ArrR, ArrB, Arr, Evnt, Sbcv>::
|
||||
before_sweep()
|
||||
{
|
||||
// Get the top-left fictitious vertices in both arrangements.
|
||||
v_red_tl = Vertex_handle_red(m_red_top_traits->top_left_vertex());
|
||||
|
|
@ -155,7 +156,7 @@ void Arr_unb_planar_overlay_helper<Tr,ArrR,ArrB,Arr,Evnt,Sbcv>::before_sweep()
|
|||
//
|
||||
template <typename Tr, typename ArrR, typename ArrB, typename Arr,
|
||||
typename Evnt, typename Sbcv>
|
||||
void Arr_unb_planar_overlay_helper<Tr,ArrR,ArrB,Arr,Evnt,Sbcv>::
|
||||
void Arr_unb_planar_overlay_helper<Tr, ArrR, ArrB, Arr, Evnt, Sbcv>::
|
||||
before_handle_event(Event* e)
|
||||
{
|
||||
// Nothing to do in case the event represents a valid point.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace CGAL {
|
|||
|
||||
namespace Ss2 = Surface_sweep_2;
|
||||
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
|
||||
/*! \class Arr_unb_planar_vert_decomp_helper
|
||||
*
|
||||
|
|
@ -45,13 +45,12 @@ public:
|
|||
typedef Arrangement_ Arrangement_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef typename Subcurve::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
||||
public:
|
||||
typedef Ss2::Surface_sweep_empty_visitor<Gt2, Event, Subcurve>
|
||||
Base_visitor;
|
||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||
|
||||
protected:
|
||||
|
|
@ -146,8 +145,8 @@ before_sweep()
|
|||
// A notification invoked after the sweep-line finishes handling the given
|
||||
// event.
|
||||
//
|
||||
template <typename Tr, typename Arr, typename Event_, typename Subcurve_>
|
||||
void Arr_unb_planar_vert_decomp_helper<Tr, Arr, Event_, Subcurve_>::
|
||||
template <typename Tr, typename Arr, typename Evnt, typename Sbcv>
|
||||
void Arr_unb_planar_vert_decomp_helper<Tr, Arr, Evnt, Sbcv>::
|
||||
after_handle_event(Event* event)
|
||||
{
|
||||
// If the event is at infinity and occurs on the top edge of the fictitious
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_UNB_PLANAR_TOPOLOGY_TRAITS_2_H
|
||||
#define CGAL_ARR_UNB_PLANAR_TOPOLOGY_TRAITS_2_H
|
||||
|
|
@ -240,8 +240,8 @@ private:
|
|||
|
||||
// Type definition for the basic insertion surface-sweep visitor.
|
||||
typedef Arr_basic_insertion_traits_2<Gt2, Arr> NxITraits;
|
||||
typedef Arr_construction_event<NxITraits, Arr, Ss2::No_overlap_event_base>
|
||||
NxIEvent;
|
||||
typedef Arr_construction_event<NxITraits, Arr, Ss2::No_overlap_event_base,
|
||||
Ss2::No_overlap_subcurve> NxIEvent;
|
||||
typedef Arr_construction_subcurve<NxITraits, NxIEvent,
|
||||
Ss2::No_overlap_subcurve> NxISubcurve;
|
||||
typedef Arr_unb_planar_insertion_helper<NxITraits, Arr, NxIEvent, NxISubcurve>
|
||||
|
|
@ -311,15 +311,24 @@ public:
|
|||
typedef Arr_no_intersection_insertion_sl_visitor<NxIHelper>
|
||||
Surface_sweep_no_intersection_insertion_visitor;
|
||||
|
||||
/*! \class Surface_sweep_batched_point_location_visitor
|
||||
*/
|
||||
template <typename OutputIterator>
|
||||
struct Surface_sweep_batched_point_location_visitor :
|
||||
public Arr_batched_pl_sl_visitor<BplHelper, OutputIterator>
|
||||
public Arr_batched_pl_sl_visitor<
|
||||
BplHelper, OutputIterator,
|
||||
Surface_sweep_batched_point_location_visitor<OutputIterator> >
|
||||
{
|
||||
typedef OutputIterator Output_iterator;
|
||||
typedef Arr_batched_pl_sl_visitor<BplHelper, Output_iterator> Base;
|
||||
typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
|
||||
typedef Surface_sweep_batched_point_location_visitor<Output_iterator>
|
||||
Self;
|
||||
typedef Arr_batched_pl_sl_visitor<BplHelper, Output_iterator, Self>
|
||||
Base;
|
||||
|
||||
typedef typename BplHelper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename BplHelper::Event Event;
|
||||
typedef typename BplHelper::Subcurve Subcurve;
|
||||
|
||||
Surface_sweep_batched_point_location_visitor(const Arr* arr,
|
||||
Output_iterator& oi) :
|
||||
|
|
@ -327,12 +336,19 @@ public:
|
|||
{}
|
||||
};
|
||||
|
||||
/*! \class Surface_sweep_vertical_decomposition_visitor
|
||||
*/
|
||||
template <typename OutputIterator>
|
||||
struct Surface_sweep_vertical_decomposition_visitor :
|
||||
public Arr_vert_decomp_sl_visitor<VdHelper, OutputIterator>
|
||||
public Arr_vert_decomp_sl_visitor<
|
||||
VdHelper, OutputIterator,
|
||||
Surface_sweep_vertical_decomposition_visitor<OutputIterator> >
|
||||
{
|
||||
typedef OutputIterator Output_iterator;
|
||||
typedef Arr_vert_decomp_sl_visitor<VdHelper, Output_iterator> Base;
|
||||
typedef Surface_sweep_vertical_decomposition_visitor<Output_iterator>
|
||||
Self;
|
||||
typedef Arr_vert_decomp_sl_visitor<VdHelper, Output_iterator, Self>
|
||||
Base;
|
||||
typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
|
|
@ -342,6 +358,8 @@ public:
|
|||
Base(arr, oi) {}
|
||||
};
|
||||
|
||||
/*! \class Surface_sweep_overlay_visitor
|
||||
*/
|
||||
template <typename ArrangementA, typename ArrangementB,
|
||||
typename OverlayTraits>
|
||||
struct Surface_sweep_overlay_visitor :
|
||||
|
|
@ -349,7 +367,10 @@ public:
|
|||
Gt2,
|
||||
ArrangementA, ArrangementB>,
|
||||
ArrangementA, ArrangementB>,
|
||||
OverlayTraits>
|
||||
OverlayTraits,
|
||||
Surface_sweep_overlay_visitor<ArrangementA,
|
||||
ArrangementB,
|
||||
OverlayTraits> >
|
||||
{
|
||||
typedef ArrangementA Arrangement_a;
|
||||
typedef ArrangementB Arrangement_b;
|
||||
|
|
@ -362,9 +383,14 @@ public:
|
|||
typedef _Overlay_helper<Geom_ovl_traits_2, Arrangement_a, Arrangement_b>
|
||||
Ovl_helper;
|
||||
|
||||
typedef Arr_overlay_sl_visitor<Ovl_helper, Overlay_traits> Base;
|
||||
typedef Surface_sweep_overlay_visitor<ArrangementA, ArrangementB,
|
||||
OverlayTraits>
|
||||
Self;
|
||||
typedef Arr_overlay_sl_visitor<Ovl_helper, Overlay_traits, Self>
|
||||
Base;
|
||||
|
||||
// typedef typename Base::Traits_2 Traits_2;
|
||||
|
||||
// typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
|
||||
|
|
|
|||
|
|
@ -123,10 +123,7 @@ decompose(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
|
||||
// Define the sweep-line visitor and perform the sweep.
|
||||
Vd_visitor visitor(&arr, &oi);
|
||||
Ss2::No_intersection_surface_sweep_2<typename Vd_visitor::Geometry_traits_2,
|
||||
Vd_visitor,
|
||||
typename Vd_visitor::Event,
|
||||
typename Vd_visitor::Subcurve>
|
||||
Ss2::No_intersection_surface_sweep_2<Vd_visitor>
|
||||
surface_sweep(&ex_traits, &visitor);
|
||||
surface_sweep.sweep(xcurves_vec.begin(), xcurves_vec.end(), // Curves.
|
||||
iso_pts_vec.begin(), iso_pts_vec.end()); // Action points.
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
//
|
||||
|
||||
#ifndef CGAL_ARRANGEMENT_ON_SURFACE_2_GLOBAL_H
|
||||
|
|
@ -277,11 +277,7 @@ void insert_empty(Arrangement_on_surface_2<GeometryTraits_2, TopTraits>& arr,
|
|||
traits(*geom_traits);
|
||||
|
||||
// Define a surface-sweep instance and perform the sweep:
|
||||
Ss2::Surface_sweep_2<Cgt2,
|
||||
Construct_visitor,
|
||||
typename Construct_visitor::Event,
|
||||
typename Construct_visitor::Subcurve>
|
||||
surface_sweep(&traits, &visitor);
|
||||
Ss2::Surface_sweep_2<Construct_visitor> surface_sweep(&traits, &visitor);
|
||||
surface_sweep.sweep(begin_xcurves, end_xcurves);
|
||||
}
|
||||
|
||||
|
|
@ -324,11 +320,7 @@ void insert_empty(Arrangement_on_surface_2<GeometryTraits_2, TopTraits>& arr,
|
|||
traits(*geom_traits);
|
||||
|
||||
// Define a surface-sweep instance and perform the sweep.
|
||||
Ss2::Surface_sweep_2<Cgt2,
|
||||
Construct_visitor,
|
||||
typename Construct_visitor::Event,
|
||||
typename Construct_visitor::Subcurve>
|
||||
surface_sweep(&traits, &visitor);
|
||||
Ss2::Surface_sweep_2<Construct_visitor> surface_sweep(&traits, &visitor);
|
||||
surface_sweep.sweep(begin_xcurves, end_xcurves, begin_points, end_points);
|
||||
}
|
||||
|
||||
|
|
@ -383,11 +375,7 @@ void insert_non_empty(Arrangement_on_surface_2<GeometryTraits_2,
|
|||
&traits);
|
||||
|
||||
// Define a basic surface-sweep instance and perform the sweep.
|
||||
Ss2::Surface_sweep_2<Igt2,
|
||||
Insert_visitor,
|
||||
typename Insert_visitor::Event,
|
||||
typename Insert_visitor::Subcurve>
|
||||
surface_sweep(&traits, &visitor);
|
||||
Ss2::Surface_sweep_2<Insert_visitor> surface_sweep(&traits, &visitor);
|
||||
surface_sweep.sweep(ex_cvs.begin(), ex_cvs.end(),ex_pts.begin(), ex_pts.end());
|
||||
}
|
||||
|
||||
|
|
@ -824,10 +812,7 @@ void non_intersecting_insert_empty(Arrangement_on_surface_2<GeometryTraits_2,
|
|||
|
||||
// Define a basic surface-sweep instance (which is not supposed to handle
|
||||
// insersections) and perform the sweep.
|
||||
Ss2::No_intersection_surface_sweep_2<Cgt2,
|
||||
Construct_visitor,
|
||||
typename Construct_visitor::Event,
|
||||
typename Construct_visitor::Subcurve>
|
||||
Ss2::No_intersection_surface_sweep_2<Construct_visitor>
|
||||
surface_sweep(&traits, &visitor);
|
||||
surface_sweep.sweep(begin_xcurves, end_xcurves);
|
||||
}
|
||||
|
|
@ -871,10 +856,7 @@ void non_intersecting_insert_empty(Arrangement_on_surface_2<GeometryTraits_2,
|
|||
|
||||
// Define a basic surface-sweep instance (which is not supposed to handle
|
||||
// insersections) and perform the sweep.
|
||||
Ss2::No_intersection_surface_sweep_2<Cgt2,
|
||||
Construct_visitor,
|
||||
typename Construct_visitor::Event,
|
||||
typename Construct_visitor::Subcurve>
|
||||
Ss2::No_intersection_surface_sweep_2<Construct_visitor>
|
||||
surface_sweep(&traits, &visitor);
|
||||
surface_sweep.sweep(begin_xcurves, end_xcurves, begin_points, end_points);
|
||||
}
|
||||
|
|
@ -931,9 +913,7 @@ void non_intersecting_insert_non_empty(Arrangement_on_surface_2<GeometryTraits_2
|
|||
&traits);
|
||||
|
||||
// Define a basic surface-sweep instance and perform the sweep.
|
||||
Ss2::No_intersection_surface_sweep_2<Igt2, Insert_visitor,
|
||||
typename Insert_visitor::Event,
|
||||
typename Insert_visitor::Subcurve>
|
||||
Ss2::No_intersection_surface_sweep_2<Insert_visitor>
|
||||
surface_sweep(&traits, &visitor);
|
||||
surface_sweep.sweep(ex_cvs.begin(), ex_cvs.end(),
|
||||
ex_pts.begin(), ex_pts.end());
|
||||
|
|
@ -1210,10 +1190,7 @@ bool is_valid(const Arrangement_on_surface_2<GeometryTraits_2, TopTraits>& arr)
|
|||
|
||||
// The surface-sweep types:
|
||||
typedef Ss2::Surface_sweep_do_curves_x_visitor<Gt2> Visitor;
|
||||
typedef typename Visitor::Event Event;
|
||||
typedef typename Visitor::Subcurve Subcurve;
|
||||
typedef Ss2::Surface_sweep_2<Gt2, Visitor, Event, Subcurve>
|
||||
Surface_sweep_2;
|
||||
typedef Ss2::Surface_sweep_2<Visitor> Surface_sweep_2;
|
||||
|
||||
// The arrangement iterator and circulator types:
|
||||
typedef typename Arr::Edge_const_iterator Edge_const_iterator;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Efi Fogel <efifogel@gmail.com>
|
||||
// Efi Fogel <efifogel@gmail.com>
|
||||
// (based on old version by Tali Zvi)
|
||||
|
||||
#ifndef CGAL_BASIC_SWEEP_LINE_2_H
|
||||
|
|
@ -111,26 +111,23 @@ namespace Surface_sweep_2 {
|
|||
* The x-montone curve type and the point type are defined by the traits class
|
||||
* that is one of the template parameters.
|
||||
*/
|
||||
template <typename GeometryTraits_2,
|
||||
typename Visitor_,
|
||||
typename Event_ = No_overlap_event<GeometryTraits_2>,
|
||||
typename Subcurve_ = No_overlap_subcurve<GeometryTraits_2, Event_>,
|
||||
typename Allocator_ = CGAL_ALLOCATOR(int)>
|
||||
template <typename Visitor_>
|
||||
class No_intersection_surface_sweep_2 {
|
||||
public:
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef Visitor_ Visitor;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef Allocator_ Allocator;
|
||||
|
||||
typedef typename Visitor::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Visitor::Event Event;
|
||||
typedef typename Visitor::Subcurve Subcurve;
|
||||
typedef typename Visitor::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
||||
public:
|
||||
typedef Arr_traits_basic_adaptor_2<Gt2> Traits_adaptor_2;
|
||||
typedef typename Traits_adaptor_2::Point_2 Point_2;
|
||||
typedef typename Traits_adaptor_2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef Arr_traits_basic_adaptor_2<Gt2> Traits_adaptor_2;
|
||||
typedef typename Traits_adaptor_2::Point_2 Point_2;
|
||||
typedef typename Traits_adaptor_2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
|
||||
typedef typename Traits_adaptor_2::Left_side_category Left_side_category;
|
||||
typedef typename Traits_adaptor_2::Bottom_side_category Bottom_side_category;
|
||||
|
|
|
|||
|
|
@ -78,28 +78,20 @@ namespace Surface_sweep_2 {
|
|||
*
|
||||
*/
|
||||
|
||||
template <typename GeometryTraits_2,
|
||||
typename Visitor_,
|
||||
typename Event_ = Default_event<GeometryTraits_2>,
|
||||
typename Subcurve_ = Default_subcurve<GeometryTraits_2, Event_>,
|
||||
typename Allocator_ = CGAL_ALLOCATOR(int) >
|
||||
class Surface_sweep_2 :
|
||||
public No_intersection_surface_sweep_2<GeometryTraits_2, Visitor_, Event_,
|
||||
Subcurve_, Allocator_>
|
||||
{
|
||||
template <typename Visitor_>
|
||||
class Surface_sweep_2 : public No_intersection_surface_sweep_2<Visitor_> {
|
||||
public:
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef Visitor_ Visitor;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef Allocator_ Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef No_intersection_surface_sweep_2<Gt2, Visitor, Event, Subcurve,
|
||||
Allocator> Base;
|
||||
typedef No_intersection_surface_sweep_2<Visitor> Base;
|
||||
|
||||
public:
|
||||
typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
typedef typename Base::Allocator Allocator;
|
||||
|
||||
typedef typename Base::Traits_adaptor_2 Traits_adaptor_2;
|
||||
typedef typename Traits_adaptor_2::Point_2 Point_2;
|
||||
typedef typename Traits_adaptor_2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
|
|
@ -149,7 +141,7 @@ public:
|
|||
* \param traits A pointer to a sweep-line traits object.
|
||||
* \param visitor A pointer to a sweep-line visitor object.
|
||||
*/
|
||||
Surface_sweep_2(const Gt2* traits, Visitor* visitor) :
|
||||
Surface_sweep_2(const Geometry_traits_2* traits, Visitor* visitor) :
|
||||
Base(traits, visitor),
|
||||
m_curves_pair_set(0)
|
||||
{}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_BATCHED_PL_SL_VISITOR_H
|
||||
#define CGAL_ARR_BATCHED_PL_SL_VISITOR_H
|
||||
|
|
@ -27,34 +28,53 @@
|
|||
|
||||
#include <CGAL/Arr_point_location_result.h>
|
||||
#include <CGAL/Object.h>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Ss2 = Surface_sweep_2;
|
||||
|
||||
/*! \class Arr_batched_pl_sl_visitor
|
||||
*
|
||||
* A surface-sweep visitor for performing batched point-location queries on an
|
||||
* arrangement embedded on a surface.
|
||||
*/
|
||||
template <typename Helper_, typename OutputIterator_>
|
||||
class Arr_batched_pl_sl_visitor : public Helper_::Base_visitor {
|
||||
template <typename Helper_, typename OutputIterator, typename Visitor_ = Default>
|
||||
class Arr_batched_pl_sl_visitor :
|
||||
public Ss2::Visitor_base<typename Helper_::Geometry_traits_2,
|
||||
typename Helper_::Event,
|
||||
typename Helper_::Subcurve,
|
||||
typename Helper_::Allocator,
|
||||
typename Default::Get<Visitor_,
|
||||
Arr_batched_pl_sl_visitor<
|
||||
Helper_, OutputIterator,
|
||||
Visitor_> >::type>
|
||||
{
|
||||
public:
|
||||
typedef Helper_ Helper;
|
||||
typedef OutputIterator_ OutputIterator;
|
||||
typedef OutputIterator Output_iterator;
|
||||
|
||||
typedef typename Helper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Helper::Event Event;
|
||||
typedef typename Helper::Subcurve Subcurve;
|
||||
typedef typename Helper::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Arr_batched_pl_sl_visitor<Helper, Output_iterator, Visitor_>
|
||||
Self;
|
||||
typedef typename Default::Get<Visitor_, Self>::type Visitor;
|
||||
typedef typename Ss2::Visitor_base<Gt2, Event, Subcurve, Allocator, Visitor>
|
||||
Base;
|
||||
|
||||
public:
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle;
|
||||
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle;
|
||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||
|
||||
protected:
|
||||
typedef typename Helper::Base_visitor Base;
|
||||
typedef typename Base::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef Arr_point_location_result<Arrangement_2> Pl_result;
|
||||
|
|
@ -62,7 +82,7 @@ protected:
|
|||
|
||||
// Data members:
|
||||
Helper m_helper; // The helper class.
|
||||
OutputIterator& m_out; // An output iterator for the result.
|
||||
Output_iterator& m_out; // An output iterator for the result.
|
||||
|
||||
template<typename T>
|
||||
Pl_result_type pl_make_result(T t) { return Pl_result::make_result(t); }
|
||||
|
|
@ -75,7 +95,7 @@ public:
|
|||
* \param arr The arrangement.
|
||||
* \param oi A pointer to the output iterator that will store the result.
|
||||
*/
|
||||
Arr_batched_pl_sl_visitor(const Arrangement_2* arr, OutputIterator& oi) :
|
||||
Arr_batched_pl_sl_visitor(const Arrangement_2* arr, Output_iterator& oi) :
|
||||
m_helper(arr),
|
||||
m_out(oi)
|
||||
{}
|
||||
|
|
@ -102,8 +122,8 @@ public:
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification issued before the sweep process starts.
|
||||
//
|
||||
template <class Hlpr, class OutIt>
|
||||
void Arr_batched_pl_sl_visitor<Hlpr, OutIt>::before_sweep()
|
||||
template <typename Hlpr, typename OutIt, typename Vis>
|
||||
void Arr_batched_pl_sl_visitor<Hlpr, OutIt, Vis>::before_sweep()
|
||||
{
|
||||
// We just have to notify the helper that the sweep process now starts.
|
||||
m_helper.before_sweep();
|
||||
|
|
@ -113,8 +133,8 @@ void Arr_batched_pl_sl_visitor<Hlpr, OutIt>::before_sweep()
|
|||
// A notification invoked after the surface-sweep finishes handling the given
|
||||
// event.
|
||||
//
|
||||
template <class Hlpr, class OutIt>
|
||||
bool Arr_batched_pl_sl_visitor<Hlpr, OutIt>::
|
||||
template <typename Hlpr, typename OutIt, typename Vis>
|
||||
bool Arr_batched_pl_sl_visitor<Hlpr, OutIt, Vis>::
|
||||
after_handle_event(Event* event, Status_line_iterator above, bool on_above)
|
||||
{
|
||||
// Notify the helper on the event.
|
||||
|
|
|
|||
|
|
@ -30,12 +30,17 @@
|
|||
* Definition of the Arr_construction_sl_visitor class-template.
|
||||
*/
|
||||
|
||||
#include <CGAL/Arr_accessor.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
#include <vector>
|
||||
|
||||
#include <CGAL/Arr_accessor.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Ss2 = Surface_sweep_2;
|
||||
|
||||
/*! \struct Integer_hash_function
|
||||
* An auxiliary hash functor for integers.
|
||||
*/
|
||||
|
|
@ -48,25 +53,37 @@ struct Integer_hash_function {
|
|||
/*! \class Arr_construction_sl_visitor
|
||||
* A sweep-line visitor for constructing an arrangement embedded on a surface.
|
||||
*/
|
||||
template <typename Helper_>
|
||||
class Arr_construction_sl_visitor : public Helper_::Base_visitor {
|
||||
template <typename Helper_, typename Visitor_ = Default>
|
||||
class Arr_construction_sl_visitor :
|
||||
public Ss2::Visitor_base<typename Helper_::Geometry_traits_2,
|
||||
typename Helper_::Event,
|
||||
typename Helper_::Subcurve,
|
||||
typename Helper_::Allocator,
|
||||
typename Default::Get<Visitor_,
|
||||
Arr_construction_sl_visitor<
|
||||
Helper_, Visitor_> >::type>
|
||||
{
|
||||
public:
|
||||
typedef Helper_ Helper;
|
||||
|
||||
typedef typename Helper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Helper::Base_visitor Base;
|
||||
typedef typename Helper::Event Event;
|
||||
typedef typename Helper::Subcurve Subcurve;
|
||||
typedef typename Helper::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Arr_construction_sl_visitor<Helper, Visitor_> Self;
|
||||
typedef typename Default::Get<Visitor_, Self>::type Visitor;
|
||||
typedef Ss2::Visitor_base<Gt2, Event, Subcurve, Allocator, Visitor>
|
||||
Base;
|
||||
|
||||
public:
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
protected:
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Arrangement_2::Topology_traits Topology_traits;
|
||||
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
|
||||
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
|
||||
|
|
@ -75,7 +92,7 @@ protected:
|
|||
typedef typename Base::Event_subcurve_iterator Event_subcurve_iterator;
|
||||
typedef typename Base::Event_subcurve_reverse_iterator
|
||||
Event_subcurve_reverse_iterator;
|
||||
typedef typename Base::Status_line_iterator Status_line_iterator;
|
||||
typedef typename Subcurve::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef typename Helper::Indices_list Indices_list;
|
||||
typedef typename Helper::Halfedge_indices_map Halfedge_indices_map;
|
||||
|
|
@ -251,16 +268,16 @@ private:
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification issued before the sweep process starts.
|
||||
// Notifies the helper that the sweep process now starts.
|
||||
template <typename Hlpr>
|
||||
void Arr_construction_sl_visitor<Hlpr>::before_sweep()
|
||||
template <typename Hlpr, typename Vis>
|
||||
void Arr_construction_sl_visitor<Hlpr, Vis>::before_sweep()
|
||||
{ m_helper.before_sweep(); }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// A notification invoked before the sweep-line starts handling the given
|
||||
// event.
|
||||
//
|
||||
template <class Hlpr>
|
||||
void Arr_construction_sl_visitor<Hlpr>::before_handle_event(Event* event)
|
||||
template <class Hlpr, typename Vis>
|
||||
void Arr_construction_sl_visitor<Hlpr, Vis>::before_handle_event(Event* event)
|
||||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
std::cout << "CGAL_CSLV before_handle_event" << std::endl;
|
||||
|
|
@ -273,8 +290,8 @@ void Arr_construction_sl_visitor<Hlpr>::before_handle_event(Event* event)
|
|||
// A notification invoked after the sweep-line finishes handling the given
|
||||
// event.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
bool Arr_construction_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
bool Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
after_handle_event(Event* event, Status_line_iterator iter, bool /* flag */)
|
||||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
|
|
@ -359,11 +376,8 @@ after_handle_event(Event* event, Status_line_iterator iter, bool /* flag */)
|
|||
// to their right endpoint).
|
||||
Event_subcurve_iterator left_it;
|
||||
for (left_it = event->left_curves_begin();
|
||||
left_it != event->left_curves_end();
|
||||
++left_it)
|
||||
{
|
||||
left_it != event->left_curves_end(); ++left_it)
|
||||
(*left_it)->set_last_event(event);
|
||||
}
|
||||
|
||||
// In case there are no right subcurves, the event can be deallocated.
|
||||
if (event->number_of_right_curves() == 0) {
|
||||
|
|
@ -380,11 +394,8 @@ after_handle_event(Event* event, Status_line_iterator iter, bool /* flag */)
|
|||
// to their left endpoint).
|
||||
Event_subcurve_iterator right_it;
|
||||
for (right_it = event->right_curves_begin();
|
||||
right_it != event->right_curves_end();
|
||||
++right_it)
|
||||
{
|
||||
right_it != event->right_curves_end(); ++right_it)
|
||||
(*right_it)->set_last_event(event);
|
||||
}
|
||||
|
||||
// Mark that the event cannot be deallocated just yet.
|
||||
return false;
|
||||
|
|
@ -393,8 +404,8 @@ after_handle_event(Event* event, Status_line_iterator iter, bool /* flag */)
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification invoked when a new subcurve is created.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
void Arr_construction_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
void Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc)
|
||||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
|
|
@ -412,33 +423,25 @@ add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
const Halfedge_handle invalid_he;
|
||||
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
if (last_event->is_closed()) {
|
||||
if (last_event->is_closed())
|
||||
std::cout << "CGAL_CSLG lastevent: " << last_event->point() << std::endl;
|
||||
}
|
||||
if (he_left != invalid_he) {
|
||||
std::cout << "he_left : " << &(*he_left) << std::endl;
|
||||
if (!he_left->is_fictitious()) {
|
||||
if (!he_left->is_fictitious())
|
||||
std::cout << "he_leftcv : " << he_left->curve() << std::endl;
|
||||
} else {
|
||||
std::cout << "he_left : fictitious" << std::endl;
|
||||
}
|
||||
else std::cout << "he_left : fictitious" << std::endl;
|
||||
std::cout << "he_leftdir : " << he_left->direction() << std::endl;
|
||||
std::cout << "he_leftfac : " << &(*he_left->face()) << std::endl;
|
||||
} else {
|
||||
std::cout << "he_left : invalid" << std::endl;
|
||||
}
|
||||
else std::cout << "he_left : invalid" << std::endl;
|
||||
if (he_right != invalid_he) {
|
||||
std::cout << "he_right : " << &(*he_right) << std::endl;
|
||||
if (!he_right->is_fictitious()) {
|
||||
if (!he_right->is_fictitious())
|
||||
std::cout << "he_rightcv : " << he_right->curve() << std::endl;
|
||||
} else {
|
||||
std::cout << "he_right : fictitious" << std::endl;
|
||||
}
|
||||
else std::cout << "he_right : fictitious" << std::endl;
|
||||
std::cout << "he_rightdir: " << he_right->direction() << std::endl;
|
||||
std::cout << "he_rightfac: " << &(*he_right->face()) << std::endl;
|
||||
} else {
|
||||
std::cout << "he_right : invalid" << std::endl;
|
||||
}
|
||||
} else std::cout << "he_right : invalid" << std::endl;
|
||||
#endif
|
||||
|
||||
// Check whether the previous event on the curve is not in the arrangement
|
||||
|
|
@ -464,17 +467,14 @@ add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
// Therefore, we use it to insert the subcurve.
|
||||
// First, we skip some halfedges around the left vertex to get the true
|
||||
// predecessor halfedge for the insertion.
|
||||
for (int i = 0; i < jump; i++)
|
||||
he_left = (he_left->next())->twin();
|
||||
for (int i = 0; i < jump; i++) he_left = (he_left->next())->twin();
|
||||
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
if (jump != 0) {
|
||||
std::cout << "CGAL_CSLV JUMP: " << jump << std::endl;
|
||||
if (!he_left->is_fictitious()) {
|
||||
if (!he_left->is_fictitious())
|
||||
std::cout << "he_leftcv : " << he_left->curve() << std::endl;
|
||||
} else {
|
||||
std::cout << "he_left : fictitious" << std::endl;
|
||||
}
|
||||
else std::cout << "he_left : fictitious" << std::endl;
|
||||
std::cout << "he_leftdir : " << he_left->direction() << std::endl;
|
||||
std::cout << "he_leftfac : " << &(*he_left->face()) << std::endl;
|
||||
}
|
||||
|
|
@ -563,9 +563,9 @@ add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve in the interior of an arrangement face.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_construction_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_construction_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_construction_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
||||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
|
|
@ -612,9 +612,9 @@ insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve using its two end-vertices.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_construction_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_construction_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_construction_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
insert_at_vertices(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev1,
|
||||
Halfedge_handle prev2,
|
||||
|
|
@ -623,20 +623,14 @@ insert_at_vertices(const X_monotone_curve_2& cv,
|
|||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
std::cout << "CGAL_CSLV insert_at_vertices:\ncurve:" << cv << std::endl;
|
||||
if (!prev1->is_fictitious()) {
|
||||
if (!prev1->is_fictitious())
|
||||
std::cout << "prev1cv : " << prev1->curve() << std::endl;
|
||||
}
|
||||
else {
|
||||
std::cout << "prev1 : fictitious" << std::endl;
|
||||
}
|
||||
else std::cout << "prev1 : fictitious" << std::endl;
|
||||
std::cout << "prev1dir : " << prev1->direction() << std::endl;
|
||||
std::cout << "prev1fac : " << &(*prev1->face()) << std::endl;
|
||||
if (!prev2->is_fictitious()) {
|
||||
if (!prev2->is_fictitious())
|
||||
std::cout << "prev2cv : " << prev2->curve() << std::endl;
|
||||
}
|
||||
else {
|
||||
std::cout << "prev2 : fictitious" << std::endl;
|
||||
}
|
||||
else std::cout << "prev2 : fictitious" << std::endl;
|
||||
std::cout << "prev2dir : " << prev2->direction() << std::endl;
|
||||
std::cout << "prev2fac : " << &(*prev2->face()) << std::endl;
|
||||
#endif
|
||||
|
|
@ -716,9 +710,9 @@ insert_at_vertices(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve from a vertex that corresponds to its right end.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_construction_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_construction_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_construction_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
insert_from_right_vertex(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev,
|
||||
Subcurve* sc)
|
||||
|
|
@ -764,20 +758,18 @@ insert_from_right_vertex(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve from a vertex that corresponds to its left end.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_construction_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_construction_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_construction_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
insert_from_left_vertex(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev,
|
||||
Subcurve* sc)
|
||||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
std::cout << "CGAL_CSLV insert_from_left_vertex:\ncurve:" << cv << std::endl;
|
||||
if (!prev->is_fictitious()) {
|
||||
if (!prev->is_fictitious())
|
||||
std::cout << "prevcv : " << prev->curve() << std::endl;
|
||||
} else {
|
||||
std::cout << "prev : fictitious" << std::endl;
|
||||
}
|
||||
else std::cout << "prev : fictitious" << std::endl;
|
||||
std::cout << "prevdir : " << prev->direction() << std::endl;
|
||||
std::cout << "prevfac : " << &(*prev->face()) << std::endl;
|
||||
#endif
|
||||
|
|
@ -812,9 +804,9 @@ insert_from_left_vertex(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert an isolated vertex into the arrangement.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_construction_sl_visitor<Hlpr>::Vertex_handle
|
||||
Arr_construction_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_construction_sl_visitor<Hlpr, Vis>::Vertex_handle
|
||||
Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
insert_isolated_vertex(const Point_2& pt, Status_line_iterator /* iter */)
|
||||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
|
|
@ -823,14 +815,15 @@ insert_isolated_vertex(const Point_2& pt, Status_line_iterator /* iter */)
|
|||
|
||||
// Insert the isolated vertex in the interior of the current top face, as
|
||||
// given by the helper class.
|
||||
return (m_arr->insert_in_face_interior(_point(pt), m_helper.top_face()));
|
||||
return m_arr->insert_in_face_interior(_point(pt), m_helper.top_face());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Reloacte holes and isolated vertices inside a newly created face.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
void Arr_construction_sl_visitor<Hlpr>::relocate_in_new_face(Halfedge_handle he)
|
||||
template <typename Hlpr, typename Vis>
|
||||
void Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
relocate_in_new_face(Halfedge_handle he)
|
||||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
std::cout << "CGAL_CSLV relocate" << std::endl;
|
||||
|
|
@ -909,8 +902,8 @@ void Arr_construction_sl_visitor<Hlpr>::relocate_in_new_face(Halfedge_handle he)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Map the given subcurve index to the given halfedge handle.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
void Arr_construction_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
void Arr_construction_sl_visitor<Hlpr, Vis>::
|
||||
_map_new_halfedge(unsigned int i, Halfedge_handle he)
|
||||
{
|
||||
#if CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE
|
||||
|
|
@ -925,6 +918,6 @@ _map_new_halfedge(unsigned int i, Halfedge_handle he)
|
|||
m_sc_he_table[i] = he;
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
} // namespace CGAL
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_2/Arr_no_intersection_insertion_sl_visitor.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -37,23 +38,33 @@ namespace CGAL {
|
|||
* A sweep-line visitor for inserting new curves into an existing arrangement
|
||||
* embedded on a surface.
|
||||
*/
|
||||
template <typename Helper_>
|
||||
template <typename Helper_, typename Visitor_ = Default>
|
||||
class Arr_insertion_sl_visitor :
|
||||
public Arr_no_intersection_insertion_sl_visitor<Helper_>
|
||||
public Arr_no_intersection_insertion_sl_visitor<
|
||||
Helper_,
|
||||
typename Default::Get<Visitor_,
|
||||
Arr_insertion_sl_visitor<Helper_, Visitor_> >::type>
|
||||
{
|
||||
public:
|
||||
typedef Helper_ Helper;
|
||||
|
||||
typedef Arr_no_intersection_insertion_sl_visitor<Helper> Base;
|
||||
typedef typename Helper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Helper::Event Event;
|
||||
typedef typename Helper::Subcurve Subcurve;
|
||||
|
||||
typedef typename Base::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Base::Arrangement_2 Arrangement_2;
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Arr_insertion_sl_visitor<Helper, Visitor_> Self;
|
||||
typedef typename Default::Get<Visitor_, Self>::type Visitor;
|
||||
typedef Arr_no_intersection_insertion_sl_visitor<Helper, Visitor>
|
||||
Base;
|
||||
|
||||
typedef typename Base::Halfedge_handle Halfedge_handle;
|
||||
typedef typename Base::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Base::Point_2 Point_2;
|
||||
public:
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
|
||||
|
||||
private:
|
||||
X_monotone_curve_2 sub_cv1; // Auxiliary variables
|
||||
|
|
@ -95,8 +106,9 @@ public:
|
|||
// Check if the halfedge associated with the given subcurve will be split
|
||||
// at the given event.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
bool Arr_insertion_sl_visitor<Hlpr>::is_split_event(Subcurve* sc, Event* event)
|
||||
template <typename Hlpr, typename Vis>
|
||||
bool Arr_insertion_sl_visitor<Hlpr, Vis>::
|
||||
is_split_event(Subcurve* sc, Event* event)
|
||||
{
|
||||
if (sc->last_curve().halfedge_handle() == Halfedge_handle(NULL)) return false;
|
||||
|
||||
|
|
@ -109,10 +121,10 @@ bool Arr_insertion_sl_visitor<Hlpr>::is_split_event(Subcurve* sc, Event* event)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Split an edge.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_insertion_sl_visitor<Hlpr>::split_edge(Halfedge_handle he, Subcurve* sc,
|
||||
const Point_2& pt)
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_insertion_sl_visitor<Hlpr, Vis>::split_edge(Halfedge_handle he, Subcurve* sc,
|
||||
const Point_2& pt)
|
||||
{
|
||||
// Make sure that the halfedge associated with sc is the directed from
|
||||
// right to left, since we always "look" above , and the incident face
|
||||
|
|
@ -133,8 +145,8 @@ Arr_insertion_sl_visitor<Hlpr>::split_edge(Halfedge_handle he, Subcurve* sc,
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification invoked when a new subcurve is created.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
void Arr_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
void Arr_insertion_sl_visitor<Hlpr, Vis>::
|
||||
add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc)
|
||||
{
|
||||
if (Base::add_subcurve_(cv, sc)) return;
|
||||
|
|
@ -151,6 +163,6 @@ add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
this->current_event()->set_halfedge_handle(next_ccw_he);
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
} // namespace CGAL
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ private:
|
|||
typedef Arr_basic_insertion_traits_2<Gt2, Arr2> Base;
|
||||
|
||||
public:
|
||||
|
||||
typedef typename Gt2::Intersect_2 Base_intersect_2;
|
||||
typedef typename Gt2::Split_2 Base_split_2;
|
||||
typedef typename Base::Base_x_monotone_curve_2 Base_x_monotone_curve_2;
|
||||
|
|
@ -76,9 +75,7 @@ public:
|
|||
|
||||
public:
|
||||
/*! Constructor with a traits class. */
|
||||
Arr_insertion_traits_2(const Gt2& tr) :
|
||||
Base (tr)
|
||||
{}
|
||||
Arr_insertion_traits_2(const Gt2& tr) : Base(tr) {}
|
||||
|
||||
/*! A functor that compares compares the y-coordinates of two x-monotone
|
||||
* curves immediately to the right of their intersection point.
|
||||
|
|
@ -139,7 +136,7 @@ public:
|
|||
}
|
||||
else {
|
||||
intersect_p =
|
||||
object_cast<std::pair<Base_point_2, unsigned int> > (&(*oi));
|
||||
object_cast<std::pair<Base_point_2, unsigned int> >(&(*oi));
|
||||
|
||||
CGAL_assertion (intersect_p != NULL);
|
||||
|
||||
|
|
@ -155,13 +152,13 @@ public:
|
|||
|
||||
/*! Obtain a Intersect_2 function object */
|
||||
Intersect_2 intersect_2_object () const
|
||||
{ return (Intersect_2 (this->m_base_traits->intersect_2_object())); }
|
||||
{ return (Intersect_2(this->m_base_traits->intersect_2_object())); }
|
||||
|
||||
/*! A functor that splits an arc at a point. */
|
||||
class Split_2 {
|
||||
protected:
|
||||
//! The base operator.
|
||||
Base_split_2 m_base_split;
|
||||
Base_split_2 m_base_split;
|
||||
|
||||
/*! Constructor.
|
||||
* The constructor is declared private to allow only the functor
|
||||
|
|
@ -183,9 +180,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
/*! Obtain a plit_2 function object */
|
||||
/*! Obtain a Split_2 function object */
|
||||
Split_2 split_2_object() const
|
||||
{ return (Split_2 (this->m_base_traits->split_2_object())); }
|
||||
{ return (Split_2(this->m_base_traits->split_2_object())); }
|
||||
};
|
||||
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
* inserting non-intersecting curves into a empty arrangement.
|
||||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_2/Arr_construction_sl_visitor.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
/*! \class Arr_no_intersection_insertion_sl_visitor
|
||||
|
|
@ -36,33 +39,41 @@ namespace CGAL {
|
|||
* embedded on a surface, where these curves are interior-disjoint from all
|
||||
* existing arrangement edges and vertices (so no intersections occur).
|
||||
*/
|
||||
template <typename Helper_>
|
||||
class Arr_no_intersection_insertion_sl_visitor : public Helper_::Parent_visitor {
|
||||
template <typename Helper_, typename Visitor_ = Default>
|
||||
class Arr_no_intersection_insertion_sl_visitor :
|
||||
public Arr_construction_sl_visitor<
|
||||
Helper_,
|
||||
typename Default::Get<Visitor_, Arr_no_intersection_insertion_sl_visitor<
|
||||
Helper_, Visitor_> >::type>
|
||||
{
|
||||
public:
|
||||
typedef Helper_ Helper;
|
||||
|
||||
typedef typename Helper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Helper::Parent_visitor Base;
|
||||
typedef typename Helper::Event Event;
|
||||
typedef typename Helper::Subcurve Subcurve;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Arr_no_intersection_insertion_sl_visitor<Helper, Visitor_>
|
||||
Self;
|
||||
typedef typename Default::Get<Visitor_, Self>::type Visitor;
|
||||
typedef Arr_construction_sl_visitor<Helper, Visitor> Base;
|
||||
|
||||
public:
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
protected:
|
||||
typedef typename Base::Status_line_iterator Status_line_iterator;
|
||||
typedef typename Base::Vertex_handle Vertex_handle;
|
||||
typedef typename Base::Halfedge_handle Halfedge_handle;
|
||||
typedef typename Base::Face_handle Face_handle;
|
||||
typedef typename Base::Event_subcurve_iterator Event_subcurve_iterator;
|
||||
typedef typename Subcurve::Status_line_iterator Status_line_iterator;
|
||||
typedef typename Base::Event_subcurve_reverse_iterator
|
||||
Event_subcurve_reverse_iterator;
|
||||
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
|
||||
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
|
||||
typedef typename Arrangement_2::Face_handle Face_handle;
|
||||
|
||||
public:
|
||||
/*! Constructor. */
|
||||
Arr_no_intersection_insertion_sl_visitor(Arrangement_2* arr) : Base(arr) {}
|
||||
|
|
@ -217,16 +228,16 @@ protected:
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification issued before the sweep process starts.
|
||||
// Notifies the helper that the sweep process now starts.
|
||||
template <typename Hlpr>
|
||||
void Arr_no_intersection_insertion_sl_visitor<Hlpr>::before_sweep()
|
||||
template <typename Hlpr, typename Vis>
|
||||
void Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::before_sweep()
|
||||
{ this->m_helper.before_sweep(); }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// A notification invoked before the sweep-line starts handling the given
|
||||
// event.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
void Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
void Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
before_handle_event(Event* event)
|
||||
{
|
||||
// First we notify the helper class on the event.
|
||||
|
|
@ -319,8 +330,8 @@ before_handle_event(Event* event)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Add a new curve.
|
||||
//
|
||||
template <typename Helper_>
|
||||
bool Arr_no_intersection_insertion_sl_visitor<Helper_>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
bool Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
add_subcurve_(const X_monotone_curve_2& cv, Subcurve* sc)
|
||||
{
|
||||
const Halfedge_handle invalid_he;
|
||||
|
|
@ -336,8 +347,8 @@ add_subcurve_(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification invoked when a new subcurve is created.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
void Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
void Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc)
|
||||
{
|
||||
if (add_subcurve_(cv, sc)) return;
|
||||
|
|
@ -350,9 +361,9 @@ add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve in the interior of an arrangement face.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
||||
{
|
||||
Event* last_event = this->last_event_on_subcurve(sc);
|
||||
|
|
@ -375,9 +386,9 @@ insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve from a vertex that corresponds to its left end.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
insert_from_left_vertex(const X_monotone_curve_2& cv, Halfedge_handle he,
|
||||
Subcurve* sc)
|
||||
{
|
||||
|
|
@ -391,9 +402,9 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, Halfedge_handle he,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve from a vertex that corresponds to its right end.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
insert_from_right_vertex(const X_monotone_curve_2& cv, Halfedge_handle he,
|
||||
Subcurve* sc)
|
||||
{
|
||||
|
|
@ -407,9 +418,9 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, Halfedge_handle he,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve using its two end-vertices.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
insert_at_vertices(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev1, Halfedge_handle prev2,
|
||||
Subcurve* sc, bool &new_face_created)
|
||||
|
|
@ -418,9 +429,9 @@ insert_at_vertices(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert an isolated vertex into the arrangement.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Vertex_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Vertex_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
insert_isolated_vertex(const Point_2& pt, Status_line_iterator iter)
|
||||
{
|
||||
// If the isolated vertex is already at the arrangement, return:
|
||||
|
|
@ -435,9 +446,9 @@ insert_isolated_vertex(const Point_2& pt, Status_line_iterator iter)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Perform the actual insertion
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
_insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
||||
{
|
||||
// Check if the vertex to be associated with the left end of the curve has
|
||||
|
|
@ -496,7 +507,7 @@ _insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
|
||||
// Look up and insert the edge in the interior of the incident face of the
|
||||
// halfedge we see.
|
||||
Face_handle f = _ray_shoot_up(this->status_line_position(sc));
|
||||
Face_handle f = _ray_shoot_up(sc->hint());
|
||||
return (this->m_arr_access.insert_in_face_interior_ex(f, cv.base(),
|
||||
ARR_LEFT_TO_RIGHT,
|
||||
v1, v2));
|
||||
|
|
@ -505,9 +516,9 @@ _insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Perform the actual insertion
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
_insert_from_left_vertex(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev, Subcurve* sc)
|
||||
{
|
||||
|
|
@ -542,9 +553,9 @@ _insert_from_left_vertex(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Perform the actual insertion
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
_insert_from_right_vertex(const X_monotone_curve_2& cv, Halfedge_handle prev,
|
||||
Subcurve* sc)
|
||||
{
|
||||
|
|
@ -579,9 +590,9 @@ _insert_from_right_vertex(const X_monotone_curve_2& cv, Halfedge_handle prev,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Perform the actual insertion
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Halfedge_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
_insert_at_vertices(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev1, Halfedge_handle prev2,
|
||||
Subcurve* sc, bool& new_face_created)
|
||||
|
|
@ -624,9 +635,9 @@ _insert_at_vertices(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Locate the face containing the current object in its interior.
|
||||
//
|
||||
template <typename Hlpr>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr>::Face_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr>::
|
||||
template <typename Hlpr, typename Vis>
|
||||
typename Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::Face_handle
|
||||
Arr_no_intersection_insertion_sl_visitor<Hlpr, Vis>::
|
||||
_ray_shoot_up(Status_line_iterator iter)
|
||||
{
|
||||
// Go up the status line and try to locate a curve which is associated
|
||||
|
|
@ -643,6 +654,6 @@ _ray_shoot_up(Status_line_iterator iter)
|
|||
return (this->m_helper.top_face());
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
} // namespace CGAL
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include <CGAL/license/Surface_sweep_2.h>
|
||||
|
||||
/*! \file
|
||||
*
|
||||
* Definition of the Arr_overlay_sl_visitor class-template.
|
||||
*/
|
||||
|
||||
|
|
@ -33,6 +34,7 @@
|
|||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/Surface_sweep_2/Arr_construction_sl_visitor.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -42,13 +44,18 @@ namespace CGAL {
|
|||
* arrangement, creating a result arrangement. All three arrangements are
|
||||
* embedded on the same type of surface and use the same geometry traits.
|
||||
*/
|
||||
template <typename OverlayHelper_, typename OverlayTraits_>
|
||||
class Arr_overlay_sl_visitor : public
|
||||
Arr_construction_sl_visitor<typename OverlayHelper_::Construction_helper>
|
||||
template <typename OverlayHelper, typename OverlayTraits,
|
||||
typename Visitor_ = Default>
|
||||
class Arr_overlay_sl_visitor :
|
||||
public Arr_construction_sl_visitor<
|
||||
typename OverlayHelper::Construction_helper,
|
||||
typename Default::Get<Visitor_,
|
||||
Arr_overlay_sl_visitor<OverlayHelper, OverlayTraits,
|
||||
Visitor_> >::type>
|
||||
{
|
||||
public:
|
||||
typedef OverlayHelper_ Overlay_helper;
|
||||
typedef OverlayTraits_ Overlay_traits;
|
||||
typedef OverlayHelper Overlay_helper;
|
||||
typedef OverlayTraits Overlay_traits;
|
||||
|
||||
typedef typename Overlay_helper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Overlay_helper::Event Event;
|
||||
|
|
@ -57,11 +64,20 @@ public:
|
|||
typedef typename Overlay_helper::Arrangement_red_2 Arrangement_red_2;
|
||||
typedef typename Overlay_helper::Arrangement_blue_2 Arrangement_blue_2;
|
||||
|
||||
typedef typename Overlay_helper::Construction_helper Construction_helper;
|
||||
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Arrangement_red_2 Ar2;
|
||||
typedef Arrangement_blue_2 Ab2;
|
||||
|
||||
typedef Arr_overlay_sl_visitor<Overlay_helper, Overlay_traits, Visitor_>
|
||||
Self;
|
||||
typedef typename Default::Get<Visitor_, Self>::type Visitor;
|
||||
typedef Arr_construction_sl_visitor<Construction_helper, Visitor>
|
||||
Base;
|
||||
|
||||
public:
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
|
@ -84,10 +100,6 @@ public:
|
|||
Ccb_halfedge_circulator;
|
||||
typedef typename Arrangement_2::Outer_ccb_iterator Outer_ccb_iterator;
|
||||
|
||||
// The base construction visitor:
|
||||
typedef typename Overlay_helper::Construction_helper Construction_helper;
|
||||
typedef Arr_construction_sl_visitor<Construction_helper> Base;
|
||||
|
||||
typedef typename Base::Event_subcurve_iterator
|
||||
Event_subcurve_iterator;
|
||||
typedef typename Base::Event_subcurve_reverse_iterator
|
||||
|
|
@ -397,8 +409,8 @@ protected:
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification issued before the sweep process starts.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::before_sweep()
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::before_sweep()
|
||||
{
|
||||
// Initialize the necessary fields in the base construction visitor.
|
||||
// Note that the construction visitor also informs its helper class that
|
||||
|
|
@ -413,8 +425,9 @@ void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::before_sweep()
|
|||
// A notification invoked before the sweep-line starts handling the given
|
||||
// event.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::before_handle_event(Event* event)
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::before_handle_event(Event* event)
|
||||
{
|
||||
// Let the base construction visitor do the work (and also inform its helper
|
||||
// class on the event).
|
||||
|
|
@ -428,8 +441,8 @@ void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::before_handle_event(Event* event)
|
|||
// A notification invoked after the sweep-line finishes handling the given
|
||||
// event.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
bool Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
bool Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
after_handle_event(Event* event, Status_line_iterator iter, bool flag)
|
||||
{
|
||||
// Let the base construction visitor handle the event.
|
||||
|
|
@ -480,8 +493,8 @@ after_handle_event(Event* event, Status_line_iterator iter, bool flag)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Update an event that corresponds to a curve endpoint.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
update_event(Event* e,
|
||||
const Point_2& end_point,
|
||||
const X_monotone_curve_2& /* cv */,
|
||||
|
|
@ -500,9 +513,9 @@ update_event(Event* e,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Update an event.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::update_event(Event* e,
|
||||
Subcurve* sc)
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::update_event(Event* e,
|
||||
Subcurve* sc)
|
||||
{
|
||||
// Update the red and blue halfedges associated with the point as necessary.
|
||||
Point_2& pt = e->point();
|
||||
|
|
@ -523,8 +536,9 @@ void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::update_event(Event* e,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Update an event.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::update_event(Event* e,
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::update_event(Event* e,
|
||||
const Point_2& p,
|
||||
bool /* is_new */)
|
||||
{
|
||||
|
|
@ -537,8 +551,8 @@ void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::update_event(Event* e,
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification issued when the sweep process has ended.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::after_sweep()
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::after_sweep()
|
||||
{
|
||||
// Notify boundary vertices:
|
||||
typename Vertex_map::iterator it;
|
||||
|
|
@ -563,9 +577,9 @@ void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::after_sweep()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve in the interior of an arrangement face.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::Halfedge_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::Halfedge_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
||||
{
|
||||
// Insert the halfedge using the base construction visitor.
|
||||
|
|
@ -596,9 +610,9 @@ insert_in_face_interior(const X_monotone_curve_2& cv, Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve given its left end-vertex.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::Halfedge_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::Halfedge_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
insert_from_left_vertex(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev,
|
||||
Subcurve* sc)
|
||||
|
|
@ -628,9 +642,9 @@ insert_from_left_vertex(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve given its right end-vertex.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::Halfedge_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::Halfedge_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
insert_from_right_vertex(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev,
|
||||
Subcurve* sc)
|
||||
|
|
@ -659,9 +673,9 @@ insert_from_right_vertex(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert the given subcurve given its two end-vertices.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::Halfedge_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::Halfedge_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
insert_at_vertices(const X_monotone_curve_2& cv,
|
||||
Halfedge_handle prev1,
|
||||
Halfedge_handle prev2,
|
||||
|
|
@ -697,17 +711,17 @@ insert_at_vertices(const X_monotone_curve_2& cv,
|
|||
// Traverse the boundary of the new face, and locate halfedge originated
|
||||
// by red or by blue halfedges along its boundary.
|
||||
// We stop the traversal earlier if we locate a red and a blue halfedge.
|
||||
const Halfedge_handle_red invalid_red_he;
|
||||
const Halfedge_handle_blue invalid_blue_he;
|
||||
const Halfedge_handle_red invalid_red_he;
|
||||
const Halfedge_handle_blue invalid_blue_he;
|
||||
|
||||
Halfedge_handle_red red_he;
|
||||
Halfedge_handle_blue blue_he;
|
||||
Halfedge_handle_red red_he;
|
||||
Halfedge_handle_blue blue_he;
|
||||
|
||||
CGAL_assertion(new_face->number_of_outer_ccbs() > 0);
|
||||
Outer_ccb_iterator occb_it = new_face->outer_ccbs_begin();
|
||||
// msvc CL requires the breakdown to the following 2 statements:
|
||||
Ccb_halfedge_circulator ccb_first = *occb_it;
|
||||
Ccb_halfedge_circulator ccb_circ = ccb_first;
|
||||
Ccb_halfedge_circulator ccb_first = *occb_it;
|
||||
Ccb_halfedge_circulator ccb_circ = ccb_first;
|
||||
|
||||
do {
|
||||
// Get the current halfedge on the face boundary and obtain its
|
||||
|
|
@ -777,9 +791,9 @@ insert_at_vertices(const X_monotone_curve_2& cv,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Insert an isolated vertex into the arrangement.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::Vertex_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
typename Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::Vertex_handle
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
insert_isolated_vertex(const Point_2& pt,
|
||||
Status_line_iterator iter)
|
||||
{
|
||||
|
|
@ -879,8 +893,8 @@ insert_isolated_vertex(const Point_2& pt,
|
|||
// Map a newly created halfedge in the result arrangement to its originator
|
||||
// red and blue halfedges.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
_map_halfedge_and_twin(Halfedge_handle he,
|
||||
Halfedge_handle_red red_he,
|
||||
Halfedge_handle_blue blue_he)
|
||||
|
|
@ -906,8 +920,8 @@ _map_halfedge_and_twin(Halfedge_handle he,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Update the boundary vertices map.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
_map_boundary_vertices(Event* event, Vertex_handle v, boost::mpl::bool_<true>)
|
||||
{
|
||||
// Update the red and blue object if the last event on sc is on the boundary.
|
||||
|
|
@ -943,9 +957,10 @@ _map_boundary_vertices(Event* event, Vertex_handle v, boost::mpl::bool_<true>)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Update the boundary vertices map.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
_map_boundary_vertices(Event* /* event */, Vertex_handle /* v */, boost::mpl::bool_<false>)
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
_map_boundary_vertices(Event* /* event */, Vertex_handle /* v */,
|
||||
boost::mpl::bool_<false>)
|
||||
{}
|
||||
|
||||
/* Notify the overlay traits about a newly created vertex.
|
||||
|
|
@ -954,8 +969,8 @@ _map_boundary_vertices(Event* /* event */, Vertex_handle /* v */, boost::mpl::bo
|
|||
* this case, we postpone the notification for all (contracted and identified)
|
||||
* boundary side vertices to the end of the sweep.
|
||||
*/
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
_create_vertex(Event* event,
|
||||
Vertex_handle new_v,
|
||||
Subcurve* sc,
|
||||
|
|
@ -1000,8 +1015,8 @@ _create_vertex(Event* event,
|
|||
}
|
||||
|
||||
/* Notify the overlay traits about a newly created vertex. */
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
_create_vertex(Event* event,
|
||||
Vertex_handle new_v,
|
||||
Subcurve* sc,
|
||||
|
|
@ -1045,10 +1060,10 @@ _create_vertex(Event* event,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Update a newly created result edge using the overlay traits.
|
||||
//
|
||||
template <typename OvlHlpr, typename OvlTr>
|
||||
void
|
||||
Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::_create_edge(Subcurve* sc,
|
||||
Halfedge_handle new_he)
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_sl_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
_create_edge(Subcurve* sc,
|
||||
Halfedge_handle new_he)
|
||||
{
|
||||
// Note that the "red" and "blue" halfedges are always directed from right
|
||||
// to left, so we make sure the overlaid halfedge is also directed from
|
||||
|
|
@ -1084,6 +1099,6 @@ Arr_overlay_sl_visitor<OvlHlpr, OvlTr>::_create_edge(Subcurve* sc,
|
|||
}
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
} // namespace CGAL
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efifogel@gmail.com>
|
||||
|
||||
#ifndef CGAL_ARR_VERT_DECOMP_SL_VISITOR_H
|
||||
#define CGAL_ARR_VERT_DECOMP_SL_VISITOR_H
|
||||
|
|
@ -26,29 +27,47 @@
|
|||
namespace CGAL {
|
||||
|
||||
#include <CGAL/Object.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
/*! \class Arr_vert_decomp_sl_visitor
|
||||
* A sweep-line visitor for performing vertical decomposition on an
|
||||
* arrangement embedded on a surface.
|
||||
*/
|
||||
template <typename Helper_, typename OutputIterator>
|
||||
class Arr_vert_decomp_sl_visitor : public Helper_::Base_visitor {
|
||||
template <typename Helper_, typename OutputIterator, typename Visitor_ = Default>
|
||||
class Arr_vert_decomp_sl_visitor :
|
||||
public Ss2::Visitor_base<typename Helper_::Geometry_traits_2,
|
||||
typename Helper_::Event,
|
||||
typename Helper_::Subcurve,
|
||||
typename Helper_::Allocator,
|
||||
typename Default::Get<Visitor_,
|
||||
Arr_batched_pl_sl_visitor<
|
||||
Helper_, OutputIterator,
|
||||
Visitor_> >::type>
|
||||
{
|
||||
public:
|
||||
typedef Helper_ Helper;
|
||||
typedef OutputIterator Output_iterator;
|
||||
|
||||
typedef typename Helper::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Helper::Event Event;
|
||||
typedef typename Helper::Subcurve Subcurve;
|
||||
typedef typename Helper::Allocator Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Arr_vert_decomp_sl_visitor<Helper, Output_iterator, Visitor_>
|
||||
Self;
|
||||
typedef typename Default::Get<Visitor_, Self>::type Visitor;
|
||||
typedef typename Ss2::Visitor_base<Gt2, Event, Subcurve, Allocator, Visitor>
|
||||
Base;
|
||||
public:
|
||||
typedef typename Helper::Arrangement_2 Arrangement_2;
|
||||
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle;
|
||||
|
||||
typedef std::pair<CGAL::Object, CGAL::Object> Vert_pair;
|
||||
typedef std::pair<Vertex_const_handle, Vert_pair> Vert_entry;
|
||||
|
||||
protected:
|
||||
typedef typename Helper::Base_visitor Base;
|
||||
typedef typename Base::Status_line_iterator Status_line_iterator;
|
||||
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle;
|
||||
//typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle;
|
||||
|
|
@ -108,8 +127,8 @@ public:
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification issued before the sweep process starts.
|
||||
//
|
||||
template <typename Hlpr, typename OutIt>
|
||||
void Arr_vert_decomp_sl_visitor<Hlpr, OutIt>::before_sweep()
|
||||
template <typename Hlpr, typename OutIt, typename Vis>
|
||||
void Arr_vert_decomp_sl_visitor<Hlpr, OutIt, Vis>::before_sweep()
|
||||
{
|
||||
// Notify the helper that the sweep process now starts.
|
||||
m_helper.before_sweep();
|
||||
|
|
@ -122,8 +141,8 @@ void Arr_vert_decomp_sl_visitor<Hlpr, OutIt>::before_sweep()
|
|||
// A notification invoked after the sweep-line finishes handling the given
|
||||
// event.
|
||||
//
|
||||
template <class Hlpr, class OutIt>
|
||||
bool Arr_vert_decomp_sl_visitor<Hlpr, OutIt>::
|
||||
template <class Hlpr, class OutIt, typename Vis>
|
||||
bool Arr_vert_decomp_sl_visitor<Hlpr, OutIt, Vis>::
|
||||
after_handle_event(Event* event,
|
||||
Status_line_iterator above, bool /* on_above */)
|
||||
{
|
||||
|
|
@ -278,8 +297,8 @@ after_handle_event(Event* event,
|
|||
//-----------------------------------------------------------------------------
|
||||
// A notification issued when the sweep process is over.
|
||||
//
|
||||
template <typename Hlpr, typename OutIt>
|
||||
void Arr_vert_decomp_sl_visitor<Hlpr, OutIt>::after_sweep()
|
||||
template <typename Hlpr, typename OutIt, typename Vis>
|
||||
void Arr_vert_decomp_sl_visitor<Hlpr, OutIt, Vis>::after_sweep()
|
||||
{
|
||||
// Create an entry for the last vertex (the xy-largest one).
|
||||
if (m_prev_vh != invalid_vh) {
|
||||
|
|
@ -289,6 +308,6 @@ void Arr_vert_decomp_sl_visitor<Hlpr, OutIt>::after_sweep()
|
|||
}
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
} // namespace CGAL
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ class Default_subcurve :
|
|||
public Default_subcurve_base<GeometryTraits_2, Event_,
|
||||
typename Default::Get<Subcurve_,
|
||||
Default_subcurve<
|
||||
GeometryTraits_2,
|
||||
GeometryTraits_2, Event_,
|
||||
Subcurve_> >::type>
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Eric Berberich <ericb@post.tau.ac.il>
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
// Eric Berberich <ericb@post.tau.ac.il>
|
||||
// (based on old version by Tali Zvi)
|
||||
|
||||
#ifndef CGAL_NO_INTERSECTION_SURFACE_SWEEP_2_IMPL_H
|
||||
|
|
@ -33,9 +33,8 @@ namespace Surface_sweep_2 {
|
|||
//-----------------------------------------------------------------------------
|
||||
// Constructor.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
template <typename Vis>
|
||||
No_intersection_surface_sweep_2<Vis>::
|
||||
No_intersection_surface_sweep_2(Visitor* visitor) :
|
||||
m_traits(new Traits_adaptor_2()),
|
||||
m_traitsOwner(true),
|
||||
|
|
@ -55,9 +54,8 @@ No_intersection_surface_sweep_2(Visitor* visitor) :
|
|||
//-----------------------------------------------------------------------------
|
||||
// Constructor with a given traits-class.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
template <typename Vis>
|
||||
No_intersection_surface_sweep_2<Vis>::
|
||||
No_intersection_surface_sweep_2(const Gt2* traits, Visitor* visitor) :
|
||||
m_traits(static_cast<const Traits_adaptor_2*>(traits)),
|
||||
m_traitsOwner(false),
|
||||
|
|
@ -77,10 +75,8 @@ No_intersection_surface_sweep_2(const Gt2* traits, Visitor* visitor) :
|
|||
//-----------------------------------------------------------------------------
|
||||
// Destrcutor.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
~No_intersection_surface_sweep_2()
|
||||
template <typename Vis>
|
||||
No_intersection_surface_sweep_2<Vis>::~No_intersection_surface_sweep_2()
|
||||
{
|
||||
// Free the traits-class object, if we own it.
|
||||
if (m_traitsOwner) delete m_traits;
|
||||
|
|
@ -101,9 +97,8 @@ No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
|||
//-----------------------------------------------------------------------------
|
||||
// Stop the sweep-line process.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::stop_sweep()
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::stop_sweep()
|
||||
{
|
||||
// Clear the event queue, deallocating all events but the current one
|
||||
// (the first event in the queue).
|
||||
|
|
@ -131,10 +126,8 @@ void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::stop_sweep()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Deallocate event object..
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
deallocate_event(Event* event)
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::deallocate_event(Event* event)
|
||||
{
|
||||
// Remove the event from the set of allocated events.
|
||||
m_allocated_events.erase(event);
|
||||
|
|
@ -147,9 +140,8 @@ deallocate_event(Event* event)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Perform the main sweep-line loop.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_sweep()
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_sweep()
|
||||
{
|
||||
CGAL_SL_PRINT_TEXT("Ordered sequence of ");
|
||||
CGAL_SL_PRINT(m_queue->size());
|
||||
|
|
@ -208,10 +200,8 @@ void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_sweep()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Initialize the data structures for the sweep-line algorithm.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_init_structures()
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_init_structures()
|
||||
{
|
||||
CGAL_assertion(m_queue->empty());
|
||||
CGAL_assertion((m_statusLine.size() == 0));
|
||||
|
|
@ -225,10 +215,8 @@ _init_structures()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Complete the sweep (complete the data structures).
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_complete_sweep()
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_complete_sweep()
|
||||
{
|
||||
CGAL_assertion(m_queue->empty());
|
||||
CGAL_assertion((m_statusLine.size() == 0));
|
||||
|
|
@ -244,10 +232,9 @@ _complete_sweep()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Initialize an event associated with a point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_init_point(const Point_2& pt, Attribute type)
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_init_point(const Point_2& pt,
|
||||
Attribute type)
|
||||
{
|
||||
// Create the event, or obtain an existing event in the queue.
|
||||
// Note that an isolated point does not have any boundary conditions.
|
||||
|
|
@ -261,9 +248,8 @@ _init_point(const Point_2& pt, Attribute type)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Initialize the events associated with an x-monotone curve.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::
|
||||
_init_curve(const X_monotone_curve_2& curve, unsigned int index)
|
||||
{
|
||||
// Construct and initialize a subcurve object.
|
||||
|
|
@ -279,9 +265,8 @@ _init_curve(const X_monotone_curve_2& curve, unsigned int index)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Initialize an event associated with an x-monotone curve end.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::
|
||||
_init_curve_end(const X_monotone_curve_2& cv, Arr_curve_end ind, Subcurve* sc)
|
||||
{
|
||||
// Get the boundary conditions of the curve end.
|
||||
|
|
@ -323,10 +308,8 @@ _init_curve_end(const X_monotone_curve_2& cv, Arr_curve_end ind, Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Handle the subcurves to the left of the current event point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_handle_left_curves()
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_handle_left_curves()
|
||||
{
|
||||
CGAL_SL_PRINT_START_EOL("handling left curves at (");
|
||||
CGAL_SL_DEBUG(PrintEvent(m_currentEvent));
|
||||
|
|
@ -398,10 +381,8 @@ _handle_left_curves()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Handle an event that does not have any incident left curves.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_handle_event_without_left_curves()
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_handle_event_without_left_curves()
|
||||
{
|
||||
// Check if the event is a boundary event or not.
|
||||
const Arr_parameter_space ps_x = m_currentEvent->parameter_space_in_x();
|
||||
|
|
@ -451,10 +432,8 @@ _handle_event_without_left_curves()
|
|||
// Sort the left subcurves of an event point according to their order in
|
||||
// their status line (no geometric comprasions are needed).
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_sort_left_curves()
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_sort_left_curves()
|
||||
{
|
||||
CGAL_SL_PRINT_START_EOL("sorting left curves");
|
||||
CGAL_assertion(m_currentEvent->has_left_curves());
|
||||
|
|
@ -517,10 +496,8 @@ _sort_left_curves()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Handle the subcurves to the right of the current event point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_handle_right_curves()
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_handle_right_curves()
|
||||
{
|
||||
CGAL_SL_PRINT_START("Handling right curves at (");
|
||||
CGAL_SL_DEBUG(PrintEvent(m_currentEvent));
|
||||
|
|
@ -561,9 +538,8 @@ _handle_right_curves()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Add a subcurve to the right of an event point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
bool No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
template <typename Vis>
|
||||
bool No_intersection_surface_sweep_2<Vis>::
|
||||
_add_curve_to_right(Event* event, Subcurve* curve, bool /* overlap_exist */)
|
||||
{
|
||||
#if defined(CGAL_NO_ASSERTIONS)
|
||||
|
|
@ -580,9 +556,8 @@ _add_curve_to_right(Event* event, Subcurve* curve, bool /* overlap_exist */)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Remove a curve from the status line.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::
|
||||
_remove_curve_from_status_line(Subcurve* sc)
|
||||
{
|
||||
CGAL_SL_PRINT_START("removing a curve from the status line, ");
|
||||
|
|
@ -607,12 +582,12 @@ _remove_curve_from_status_line(Subcurve* sc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Allocate an event object associated with a valid point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
typename No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::Event*
|
||||
No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_allocate_event(const Point_2& pt, Attribute type,
|
||||
Arr_parameter_space ps_x, Arr_parameter_space ps_y)
|
||||
template <typename Vis>
|
||||
typename No_intersection_surface_sweep_2<Vis>::Event*
|
||||
No_intersection_surface_sweep_2<Vis>::_allocate_event(const Point_2& pt,
|
||||
Attribute type,
|
||||
Arr_parameter_space ps_x,
|
||||
Arr_parameter_space ps_y)
|
||||
{
|
||||
// Allocate the event.
|
||||
Event* e = m_eventAlloc.allocate(1);
|
||||
|
|
@ -628,10 +603,9 @@ _allocate_event(const Point_2& pt, Attribute type,
|
|||
// Allocate an event at open boundary,
|
||||
// which is not associated with a valid point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
typename No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::Event*
|
||||
No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
template <typename Vis>
|
||||
typename No_intersection_surface_sweep_2<Vis>::Event*
|
||||
No_intersection_surface_sweep_2<Vis>::
|
||||
_allocate_event_at_open_boundary(Attribute type,
|
||||
Arr_parameter_space ps_x,
|
||||
Arr_parameter_space ps_y)
|
||||
|
|
@ -647,13 +621,13 @@ _allocate_event_at_open_boundary(Attribute type,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Push a closed event point into the event queue.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
std::pair<typename No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt,
|
||||
Alloc>::Event*, bool>
|
||||
No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_push_event(const Point_2& pt, Attribute type,
|
||||
Arr_parameter_space ps_x, Arr_parameter_space ps_y, Subcurve* sc)
|
||||
template <typename Vis>
|
||||
std::pair<typename No_intersection_surface_sweep_2<Vis>::Event*, bool>
|
||||
No_intersection_surface_sweep_2<Vis>::_push_event(const Point_2& pt,
|
||||
Attribute type,
|
||||
Arr_parameter_space ps_x,
|
||||
Arr_parameter_space ps_y,
|
||||
Subcurve* sc)
|
||||
{
|
||||
// Look for the point in the event queue.
|
||||
Event* e;
|
||||
|
|
@ -698,14 +672,14 @@ _push_event(const Point_2& pt, Attribute type,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Push an event point associated with a curve end into the event queue.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
std::pair<typename No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt,
|
||||
Alloc>::Event*,
|
||||
bool>
|
||||
No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_push_event(const X_monotone_curve_2& cv, Arr_curve_end ind, Attribute type,
|
||||
Arr_parameter_space ps_x, Arr_parameter_space ps_y, Subcurve* sc)
|
||||
template <typename Vis>
|
||||
std::pair<typename No_intersection_surface_sweep_2<Vis>::Event*, bool>
|
||||
No_intersection_surface_sweep_2<Vis>::_push_event(const X_monotone_curve_2& cv,
|
||||
Arr_curve_end ind,
|
||||
Attribute type,
|
||||
Arr_parameter_space ps_x,
|
||||
Arr_parameter_space ps_y,
|
||||
Subcurve* sc)
|
||||
{
|
||||
// Look for the curve end in the event queue.
|
||||
Event* e;
|
||||
|
|
@ -762,10 +736,9 @@ _push_event(const X_monotone_curve_2& cv, Arr_curve_end ind, Attribute type,
|
|||
// add a curve as a right curve or left curve when the event is created
|
||||
// or updated.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void No_intersection_surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_add_curve(Event* e, Subcurve* sc, Attribute type)
|
||||
template <typename Vis>
|
||||
void No_intersection_surface_sweep_2<Vis>::_add_curve(Event* e, Subcurve* sc,
|
||||
Attribute type)
|
||||
{
|
||||
if (sc == NULL) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
// Author(s) : Tali Zvi <talizvi@post.tau.ac.il>,
|
||||
// Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@gmail.com>
|
||||
// Efi Fogel <efifogel@gmail.com>
|
||||
|
||||
#ifndef CGAL_SURFACE_SWEEP_2_NO_OVERLAP_EVENT_H
|
||||
#define CGAL_SURFACE_SWEEP_2_NO_OVERLAP_EVENT_H
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
#include <CGAL/license/Surface_sweep_2.h>
|
||||
|
||||
/*! \file
|
||||
*
|
||||
* Defintion of the No_overlap_event class.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -66,13 +66,14 @@ public:
|
|||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef Event_ Event;
|
||||
typedef CGAL_ALLOCATOR(int) Allocator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
|
||||
public:
|
||||
typedef Curve_comparer<Gt2, Event, Subcurve> Compare_curves;
|
||||
typedef Multiset<Subcurve*, Compare_curves, CGAL_ALLOCATOR(int)>
|
||||
typedef Multiset<Subcurve*, Compare_curves, Allocator>
|
||||
Status_line;
|
||||
typedef typename Status_line::iterator Status_line_iterator;
|
||||
|
||||
|
|
@ -143,7 +144,8 @@ private:
|
|||
typedef Geometry_traits_2 Gt2;
|
||||
typedef No_overlap_subcurve<Gt2, Event, Subcurve_> Self;
|
||||
typedef typename Default::Get<Subcurve_, Self>::type Subcurve;
|
||||
typedef No_overlap_subcurve_base<Gt2, Event, Subcurve> Base;
|
||||
typedef No_overlap_subcurve_base<Gt2, Event, Subcurve>
|
||||
Base;
|
||||
|
||||
public:
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
|
|
|
|||
|
|
@ -32,9 +32,8 @@ namespace Surface_sweep_2 {
|
|||
//-----------------------------------------------------------------------------
|
||||
// Initialize the data structures for the sweep-line algorithm.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_init_structures()
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_init_structures()
|
||||
{
|
||||
// Initailize the structures maintained by the base sweep-line class.
|
||||
Base::_init_structures();
|
||||
|
|
@ -46,9 +45,8 @@ void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_init_structures()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Complete the sweep (complete the data structures).
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_complete_sweep()
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_complete_sweep()
|
||||
{
|
||||
CGAL_SL_PRINT_START_EOL("completing the sweep");
|
||||
|
||||
|
|
@ -75,9 +73,8 @@ void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_complete_sweep()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Handle the subcurves to the left of the current event point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_handle_left_curves()
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_handle_left_curves()
|
||||
{
|
||||
CGAL_SL_PRINT_START("handling left curves at (");
|
||||
CGAL_SL_DEBUG(this->PrintEvent(this->m_currentEvent));
|
||||
|
|
@ -206,9 +203,8 @@ void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_handle_left_curves()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Handle the subcurves to the right of the current event point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_handle_right_curves()
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_handle_right_curves()
|
||||
{
|
||||
CGAL_SL_PRINT_START("handling right curves at (");
|
||||
CGAL_SL_DEBUG(this->PrintEvent(this->m_currentEvent));
|
||||
|
|
@ -285,9 +281,8 @@ void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_handle_right_curves()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Add a subcurve to the right of an event point.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
bool Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
template <typename Vis>
|
||||
bool Surface_sweep_2<Vis>::
|
||||
_add_curve_to_right(Event* event, Subcurve* curve, bool overlap_exist)
|
||||
{
|
||||
CGAL_SL_PRINT_START("adding a Curve to the right of (");
|
||||
|
|
@ -365,10 +360,9 @@ _add_curve_to_right(Event* event, Subcurve* curve, bool overlap_exist)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Remove a curve from the status line.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_remove_curve_from_status_line(Subcurve* leftCurve, bool remove_for_good)
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_remove_curve_from_status_line(Subcurve* leftCurve,
|
||||
bool remove_for_good)
|
||||
{
|
||||
CGAL_SL_PRINT_START("removing a curve from the status line, ");
|
||||
CGAL_SL_PRINT_CURVE(leftCurve);
|
||||
|
|
@ -412,10 +406,8 @@ _remove_curve_from_status_line(Subcurve* leftCurve, bool remove_for_good)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Compute intersections between the two given curves.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_intersect(Subcurve* c1,
|
||||
Subcurve* c2)
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_intersect(Subcurve* c1, Subcurve* c2)
|
||||
{
|
||||
CGAL_SL_PRINT_START("computing intersection of ");
|
||||
CGAL_SL_PRINT_CURVE(c1);
|
||||
|
|
@ -423,7 +415,7 @@ void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_intersect(Subcurve* c1,
|
|||
CGAL_SL_PRINT_CURVE(c2);
|
||||
CGAL_SL_PRINT_EOL();
|
||||
|
||||
typedef typename Tr::Multiplicity Multiplicity;
|
||||
typedef typename Geometry_traits_2::Multiplicity Multiplicity;
|
||||
|
||||
CGAL_assertion(c1 != c2);
|
||||
|
||||
|
|
@ -583,13 +575,12 @@ void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_intersect(Subcurve* c1,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Create an intersection-point event between two curves.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_create_intersection_point(const Point_2& xp,
|
||||
unsigned int multiplicity,
|
||||
Subcurve*& c1, Subcurve*& c2,
|
||||
bool is_overlap)
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_create_intersection_point(const Point_2& xp,
|
||||
unsigned int multiplicity,
|
||||
Subcurve*& c1,
|
||||
Subcurve*& c2,
|
||||
bool is_overlap)
|
||||
{
|
||||
CGAL_SL_PRINT_START_EOL("createing an intersection point netween");
|
||||
CGAL_SL_PRINT_CURVE(c1);
|
||||
|
|
@ -687,9 +678,8 @@ _create_intersection_point(const Point_2& xp,
|
|||
//-----------------------------------------------------------------------------
|
||||
// Fix overlap Subcurves before handling the current event.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_fix_overlap_subcurves()
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_fix_overlap_subcurves()
|
||||
{
|
||||
CGAL_SL_PRINT_START_EOL("fixing overlap subcurves");
|
||||
|
||||
|
|
@ -727,11 +717,10 @@ void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::_fix_overlap_subcurves()
|
|||
* \param overlap_exist a flag indicates if the overlap X_monotone_curve_2 was
|
||||
* computed already (is true than its stored at sub_cv1 data member).
|
||||
*/
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_handle_overlap(Event* event, Subcurve* curve, Event_subcurve_iterator iter,
|
||||
bool overlap_exist)
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_handle_overlap(Event* event, Subcurve* curve,
|
||||
Event_subcurve_iterator iter,
|
||||
bool overlap_exist)
|
||||
{
|
||||
// An overlap occurs:
|
||||
CGAL_SL_PRINT_START_EOL("handling overlap at right insertion");
|
||||
|
|
@ -740,7 +729,7 @@ _handle_overlap(Event* event, Subcurve* curve, Event_subcurve_iterator iter,
|
|||
if (overlap_exist) overlap_cv = sub_cv1;
|
||||
else {
|
||||
// compute the overlap.
|
||||
std::vector<Object> obj_vec;
|
||||
std::vector<Object> obj_vec;
|
||||
vector_inserter vit(obj_vec);
|
||||
this->m_traits->intersect_2_object()(curve->last_curve(),
|
||||
(*iter)->last_curve(),
|
||||
|
|
@ -879,10 +868,8 @@ _handle_overlap(Event* event, Subcurve* curve, Event_subcurve_iterator iter,
|
|||
// sc - some originating subcurve of a aubcurve that stores an overlap
|
||||
// notice thah this function is recursive since an originating subcurve of
|
||||
// an overlap can be itself a subcurve that stores overlap and so on.
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_fix_finished_overlap_subcurve(Subcurve* sc)
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_fix_finished_overlap_subcurve(Subcurve* sc)
|
||||
{
|
||||
CGAL_SL_PRINT_START("fixing finished overlap subcurve ");
|
||||
CGAL_SL_PRINT_CURVE(sc);
|
||||
|
|
@ -925,10 +912,8 @@ _fix_finished_overlap_subcurve(Subcurve* sc)
|
|||
// add a curve as a right curve or left curve when the event is created
|
||||
// or updated.
|
||||
//
|
||||
template <typename Tr, typename Vis, typename Subcv, typename Evnt,
|
||||
typename Alloc>
|
||||
void Surface_sweep_2<Tr, Vis, Subcv, Evnt, Alloc>::
|
||||
_add_curve(Event* e, Subcurve* sc, Attribute type)
|
||||
template <typename Vis>
|
||||
void Surface_sweep_2<Vis>::_add_curve(Event* e, Subcurve* sc, Attribute type)
|
||||
{
|
||||
if (sc == NULL) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@
|
|||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_SURFACE_SWEEP_2_VISITORS_H
|
||||
#define CGAL_SURFACE_SWEEP_2_VISITORS_H
|
||||
|
|
@ -26,45 +27,47 @@
|
|||
* sweep-line functions.
|
||||
*/
|
||||
|
||||
#include <CGAL/Surface_sweep_2/Surface_sweep_2_utils.h>
|
||||
#include <CGAL/Surface_sweep_empty_visitor.h>
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
|
||||
#include <CGAL/Surface_sweep_2.h>
|
||||
#include <CGAL/Surface_sweep_2/Surface_sweep_2_utils.h>
|
||||
#include <CGAL/Surface_sweep_2/Visitor.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Surface_sweep_2 {
|
||||
|
||||
/*! \class
|
||||
/*! \class Surface_sweep_points_visitor
|
||||
*
|
||||
* A simple sweep-line visitor that reports all intersection points among a
|
||||
* set of input curves.
|
||||
*/
|
||||
template <typename GeometryTraits_2, typename OutputIerator_>
|
||||
template <typename GeometryTraits_2, typename OutputIerator>
|
||||
class Surface_sweep_points_visitor :
|
||||
public Surface_sweep_empty_visitor<GeometryTraits_2>
|
||||
public Default_visitor<Surface_sweep_points_visitor<GeometryTraits_2,
|
||||
OutputIerator>,
|
||||
GeometryTraits_2>
|
||||
{
|
||||
public:
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef OutputIerator_ Output_ierator;
|
||||
typedef OutputIerator Output_ierator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Surface_sweep_points_visitor<Gt2, Output_ierator>
|
||||
Self;
|
||||
typedef Surface_sweep_empty_visitor<Gt2> Base;
|
||||
typedef Default_visitor<Self, Gt2> Base;
|
||||
|
||||
public:
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
typedef typename Base::Event_subcurve_iterator Event_subcurve_iterator;
|
||||
typedef typename Base::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef typename Subcurve::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
typedef CGAL::Surface_sweep_2::Surface_sweep_2<Gt2, Self>
|
||||
Surface_sweep_2;
|
||||
typedef CGAL::Surface_sweep_2::Surface_sweep_2<Self> Surface_sweep_2;
|
||||
|
||||
protected:
|
||||
Output_ierator m_out; // The output points.
|
||||
|
|
@ -113,22 +116,26 @@ public:
|
|||
Output_ierator output_iterator() { return m_out; }
|
||||
};
|
||||
|
||||
/*! \class
|
||||
/*! \class Surface_sweep_subcurves_visitor
|
||||
*
|
||||
* A simple sweep-line visitor that reports all non-intersecting
|
||||
* x-monotone curves induced by a set of input curves.
|
||||
*/
|
||||
template <typename GeometryTraits_2, typename OutputIerator_>
|
||||
template <typename GeometryTraits_2, typename OutputIerator>
|
||||
class Surface_sweep_subcurves_visitor :
|
||||
public Surface_sweep_empty_visitor<GeometryTraits_2>
|
||||
public Default_visitor<Surface_sweep_subcurves_visitor<
|
||||
GeometryTraits_2, OutputIerator>,
|
||||
GeometryTraits_2>
|
||||
{
|
||||
public:
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef OutputIerator_ Output_ierator;
|
||||
typedef OutputIerator Output_ierator;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Surface_sweep_subcurves_visitor<Gt2, Output_ierator>
|
||||
Self;
|
||||
typedef Surface_sweep_empty_visitor<Gt2> Base;
|
||||
typedef Default_visitor<Self, Gt2> Base;
|
||||
|
||||
public:
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
|
|
@ -136,10 +143,10 @@ public:
|
|||
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
typedef typename Base::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef CGAL::Surface_sweep_2::Surface_sweep_2<Gt2, Self>
|
||||
Surface_sweep_2;
|
||||
typedef typename Subcurve::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef CGAL::Surface_sweep_2::Surface_sweep_2<Self> Surface_sweep_2;
|
||||
|
||||
protected:
|
||||
// Data members:
|
||||
|
|
@ -191,31 +198,34 @@ public:
|
|||
Output_ierator output_iterator() { return m_out; }
|
||||
};
|
||||
|
||||
/*! \class
|
||||
/*! \class Surface_sweep_do_curves_x_visitor
|
||||
*
|
||||
* A simple sweep-line visitor that determines if there are intersections
|
||||
* in the interiors of the given curve set.
|
||||
*/
|
||||
template <typename GeometryTraits_2>
|
||||
class Surface_sweep_do_curves_x_visitor :
|
||||
public Surface_sweep_empty_visitor<GeometryTraits_2>
|
||||
public Default_visitor<Surface_sweep_do_curves_x_visitor<GeometryTraits_2>,
|
||||
GeometryTraits_2>
|
||||
{
|
||||
public:
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Surface_sweep_do_curves_x_visitor<Gt2> Self;
|
||||
typedef Surface_sweep_empty_visitor<Gt2> Base;
|
||||
typedef Default_visitor<Self, Gt2> Base;
|
||||
|
||||
public:
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
|
||||
typedef typename Subcurve::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
typedef typename Base::Event Event;
|
||||
typedef typename Base::Subcurve Subcurve;
|
||||
typedef typename Base::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef CGAL::Surface_sweep_2::Surface_sweep_2<Gt2, Self>
|
||||
Surface_sweep_2;
|
||||
typedef CGAL::Surface_sweep_2::Surface_sweep_2<Self> Surface_sweep_2;
|
||||
|
||||
protected:
|
||||
// Data members:
|
||||
|
|
|
|||
|
|
@ -13,9 +13,10 @@
|
|||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_SURFACE_SWEEP_EMPTY_VISITOR_H
|
||||
#define CGAL_SURFACE_SWEEP_EMPTY_VISITOR_H
|
||||
#ifndef CGAL_SURFACE_SWEEP_2_VISITOR_H
|
||||
#define CGAL_SURFACE_SWEEP_2_VISITOR_H
|
||||
|
||||
#include <CGAL/license/Surface_sweep_2.h>
|
||||
|
||||
|
|
@ -31,90 +32,52 @@
|
|||
namespace CGAL {
|
||||
namespace Surface_sweep_2 {
|
||||
|
||||
/*! \class
|
||||
/*! \class Visitor_base
|
||||
*
|
||||
* An empty surface-sweep visitor that does nothing. It is used as a base-class
|
||||
* for other concrete visitors that produce some output.
|
||||
*/
|
||||
template <typename GeometryTraits_2,
|
||||
typename Event_ = Default_event<GeometryTraits_2>,
|
||||
typename Subcurve_ = Default_subcurve<GeometryTraits_2, Event_>,
|
||||
typename Allocator_ = CGAL_ALLOCATOR(int)>
|
||||
class Surface_sweep_empty_visitor {
|
||||
template <typename GeometryTraits_2, typename Event_, typename Subcurve_,
|
||||
typename Allocator_, typename Visitor_>
|
||||
class Visitor_base {
|
||||
public:
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef Allocator_ Allocator;
|
||||
typedef Visitor_ Visitor;
|
||||
|
||||
private:
|
||||
typedef Geometry_traits_2 Gt2;
|
||||
typedef Surface_sweep_empty_visitor<Gt2, Event, Subcurve, Allocator>
|
||||
typedef Visitor_base<Gt2, Event, Subcurve, Allocator, Visitor>
|
||||
Self;
|
||||
|
||||
// we want to hide the Surface_sweep type
|
||||
typedef No_intersection_surface_sweep_2<Gt2, Self, Event, Subcurve, Allocator>
|
||||
Surface_sweep;
|
||||
|
||||
typedef typename Surface_sweep::Status_line_iterator Base_status_line_iter;
|
||||
|
||||
public:
|
||||
typedef typename Subcurve::Status_line_iterator Status_line_iterator;
|
||||
|
||||
typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Gt2::Point_2 Point_2;
|
||||
|
||||
public:
|
||||
/*! \class
|
||||
* A wrapper for the base status-line iterator.
|
||||
*/
|
||||
class Status_line_iterator : public Base_status_line_iter {
|
||||
public:
|
||||
typedef Subcurve* value_type;
|
||||
typedef value_type& reference;
|
||||
typedef value_type* pointer;
|
||||
typedef typename Base_status_line_iter::difference_type difference_type;
|
||||
typedef typename Base_status_line_iter::iterator_category
|
||||
iterator_category;
|
||||
/*! Constructor. */
|
||||
Status_line_iterator() {}
|
||||
|
||||
/*! Constructor from a base iterator. */
|
||||
Status_line_iterator(Base_status_line_iter iter) :
|
||||
Base_status_line_iter(iter)
|
||||
{}
|
||||
|
||||
// Overriden operator*
|
||||
reference operator*()
|
||||
{
|
||||
return (reinterpret_cast<reference>
|
||||
(((Base_status_line_iter*)this)->operator*()));
|
||||
}
|
||||
|
||||
// Overriden operator->
|
||||
pointer operator->()
|
||||
{
|
||||
return (reinterpret_cast<pointer>(Base_status_line_iter::operator->()));
|
||||
}
|
||||
};
|
||||
|
||||
typedef typename Event::Subcurve_iterator Event_subcurve_iterator;
|
||||
typedef typename Event::Subcurve_iterator Event_subcurve_iterator;
|
||||
typedef typename Event::Subcurve_reverse_iterator
|
||||
Event_subcurve_reverse_iterator;
|
||||
|
||||
typedef No_intersection_surface_sweep_2<Visitor> Surface_sweep_2;
|
||||
|
||||
protected:
|
||||
// Data members:
|
||||
void* m_surface_sweep; // The sweep-line object.
|
||||
Surface_sweep_2* m_surface_sweep; // The sweep-line object.
|
||||
|
||||
public:
|
||||
/*! Constructor. */
|
||||
Surface_sweep_empty_visitor () :
|
||||
m_surface_sweep(NULL)
|
||||
{}
|
||||
|
||||
/*! Attach the a sweep-line object. */
|
||||
void attach(void* sl) { m_surface_sweep = sl; }
|
||||
Visitor_base () : m_surface_sweep(NULL) {}
|
||||
|
||||
/*! Destructor */
|
||||
virtual ~Surface_sweep_empty_visitor() {}
|
||||
virtual ~Visitor_base() {}
|
||||
|
||||
/*! Attach the a sweep-line object. */
|
||||
void attach(const Surface_sweep_2* sl)
|
||||
{ m_surface_sweep = (Surface_sweep_2*)(sl); }
|
||||
|
||||
/*!
|
||||
* A notification invoked before the sweep-line starts handling the given
|
||||
|
|
@ -185,47 +148,52 @@ public:
|
|||
|
||||
/*! Obtain the first subcurve in the status line. */
|
||||
Status_line_iterator status_line_begin()
|
||||
{ return (this->_surface_sweep()->status_line_begin()); }
|
||||
{ return surface_sweep()->status_line_begin(); }
|
||||
|
||||
/*! Obtain a past-the-end iterator for the subcurves in the status line. */
|
||||
Status_line_iterator status_line_end()
|
||||
{ return (this->_surface_sweep()->status_line_end()); }
|
||||
|
||||
/*! Obtain the position of the given subcurve in the status line. */
|
||||
Status_line_iterator status_line_position(Subcurve* sc)
|
||||
{ return (sc->hint()); }
|
||||
{ return surface_sweep()->status_line_end(); }
|
||||
|
||||
/*! Obtain the number of subcurves in the status line. */
|
||||
unsigned status_line_size() const
|
||||
{ return (this->_surface_sweep()->status_line_size()); }
|
||||
{ return surface_sweep()->status_line_size(); }
|
||||
|
||||
/*! Check if the status line is empty. */
|
||||
bool is_status_line_empty() const
|
||||
{ return (this->_surface_sweep()->is_status_line_empty()); }
|
||||
{ return surface_sweep()->is_status_line_empty(); }
|
||||
|
||||
/*! Deallocate the given event. */
|
||||
void deallocate_event(Event* e)
|
||||
{ this->_surface_sweep()->deallocate_event(e); }
|
||||
void deallocate_event(Event* e) { surface_sweep()->deallocate_event(e); }
|
||||
|
||||
/*! Stop the sweep-line process. */
|
||||
void stop_sweep() { this->_surface_sweep()->stop_sweep(); }
|
||||
void stop_sweep() { surface_sweep()->stop_sweep(); }
|
||||
|
||||
/*! Obtain the sweep-line object. */
|
||||
void* surface_sweep() { return m_surface_sweep; }
|
||||
Surface_sweep_2* surface_sweep() { return m_surface_sweep; }
|
||||
|
||||
/*! Obtain the sweep-line object. */
|
||||
const Surface_sweep_2* surface_sweep() const { return m_surface_sweep; }
|
||||
|
||||
/*! Obtain the current event. */
|
||||
Event* current_event() { return (this->_surface_sweep()->current_event()); }
|
||||
Event* current_event() { return surface_sweep()->current_event(); }
|
||||
|
||||
/*! Obtain the geometry-traits class. */
|
||||
const Gt2* traits() { return (this->_surface_sweep()->traits()); }
|
||||
const Gt2* traits() { return surface_sweep()->traits(); }
|
||||
};
|
||||
|
||||
private:
|
||||
/*! Obtain the sweep-line object. */
|
||||
Surface_sweep* _surface_sweep()
|
||||
{ return (reinterpret_cast<Surface_sweep*>(m_surface_sweep)); }
|
||||
|
||||
const Surface_sweep* _surface_sweep() const
|
||||
{ return (reinterpret_cast<const Surface_sweep*>(m_surface_sweep)); }
|
||||
template <typename Visitor_,
|
||||
typename GeometryTraits_2,
|
||||
typename Event_ = Default_event<GeometryTraits_2>,
|
||||
typename Subcurve_ = Default_subcurve<GeometryTraits_2, Event_>,
|
||||
typename Allocator_ = CGAL_ALLOCATOR(int)>
|
||||
class Default_visitor : public Visitor_base<GeometryTraits_2, Event_, Subcurve_,
|
||||
Allocator_, Visitor_>
|
||||
{
|
||||
public:
|
||||
typedef GeometryTraits_2 Geometry_traits_2;
|
||||
typedef Event_ Event;
|
||||
typedef Subcurve_ Subcurve;
|
||||
typedef Allocator_ Allocator;
|
||||
};
|
||||
|
||||
} // namespace Surface_sweep_2
|
||||
|
|
@ -119,14 +119,14 @@ OutputIterator compute_intersection_points(CurveInputIterator curves_begin,
|
|||
// Define the surface-sweep types:
|
||||
typedef Ss2::Surface_sweep_points_visitor<Traits, OutputIterator>
|
||||
Visitor;
|
||||
typedef Ss2::Surface_sweep_2<Traits, Visitor> Surface_sweep;
|
||||
typedef Ss2::Surface_sweep_2<Visitor> Surface_sweep;
|
||||
|
||||
// Perform the sweep and obtain the intersection points.
|
||||
Visitor visitor(points, report_endpoints);
|
||||
Surface_sweep surface_sweep(&tr, &visitor);
|
||||
visitor.sweep(curves_begin, curves_end);
|
||||
|
||||
return (visitor.output_iterator());
|
||||
return visitor.output_iterator();
|
||||
}
|
||||
|
||||
template <typename CurveInputIterator, typename OutputIterator>
|
||||
|
|
@ -139,8 +139,8 @@ OutputIterator compute_intersection_points(CurveInputIterator curves_begin,
|
|||
|
||||
typename Default_arr_traits<Curve>::Traits traits;
|
||||
|
||||
return (compute_intersection_points(curves_begin, curves_end, points,
|
||||
report_endpoints, traits));
|
||||
return compute_intersection_points(curves_begin, curves_end, points,
|
||||
report_endpoints, traits);
|
||||
}
|
||||
|
||||
/*! Compute all x-monotone subcurves that are disjoint in their interiors
|
||||
|
|
@ -163,14 +163,14 @@ OutputIterator compute_subcurves(CurveInputIterator curves_begin,
|
|||
// Define the surface-sweep types:
|
||||
typedef Ss2::Surface_sweep_subcurves_visitor<Traits, OutputIterator>
|
||||
Visitor;
|
||||
typedef Ss2::Surface_sweep_2<Traits, Visitor> Surface_sweep;
|
||||
typedef Ss2::Surface_sweep_2<Visitor> Surface_sweep;
|
||||
|
||||
// Perform the sweep and obtain the subcurves.
|
||||
Visitor visitor(subcurves, mult_overlaps);
|
||||
Surface_sweep surface_sweep(&tr, &visitor);
|
||||
visitor.sweep(curves_begin, curves_end);
|
||||
|
||||
return (visitor.output_iterator());
|
||||
return visitor.output_iterator();
|
||||
}
|
||||
|
||||
template <typename CurveInputIterator, typename OutputIterator>
|
||||
|
|
@ -197,14 +197,13 @@ bool do_curves_intersect(CurveInputIterator curves_begin,
|
|||
{
|
||||
// Define the surface-sweep types:
|
||||
typedef Ss2::Surface_sweep_do_curves_x_visitor<Traits> Visitor;
|
||||
typedef Ss2::Surface_sweep_2<Traits, Visitor> Surface_sweep;
|
||||
typedef Ss2::Surface_sweep_2<Visitor> Surface_sweep;
|
||||
|
||||
// Perform the sweep and obtain the subcurves.
|
||||
Visitor visitor;
|
||||
Surface_sweep surface_sweep(&tr, &visitor);
|
||||
visitor.sweep(curves_begin, curves_end);
|
||||
|
||||
return (visitor.found_intersection());
|
||||
return visitor.found_intersection();
|
||||
}
|
||||
|
||||
template <typename CurveInputIterator>
|
||||
|
|
|
|||
Loading…
Reference in New Issue