diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/complement.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/complement.h similarity index 100% rename from Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/complement.h rename to Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/complement.h diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/difference.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/difference.h similarity index 100% rename from Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/difference.h rename to Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/difference.h diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/do_intersect.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/do_intersect.h similarity index 100% rename from Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/do_intersect.h rename to Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/do_intersect.h diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/intersection.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/intersection.h similarity index 100% rename from Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/intersection.h rename to Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/intersection.h diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/join.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/join.h similarity index 100% rename from Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/join.h rename to Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/join.h diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/oriented_side.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/oriented_side.h similarity index 100% rename from Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/oriented_side.h rename to Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/oriented_side.h diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/symmetric_difference.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/symmetric_difference.h similarity index 100% rename from Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/symmetric_difference.h rename to Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/symmetric_difference.h diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2.h index e95d7a8db7d..cd39545f86f 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2.h @@ -18,1817 +18,12 @@ #include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace CGAL { - -/// \name do_intersect() functions. -//@{ - -// Polygon_2, Polygon_2 ======================================================== -// With Traits -template -inline bool do_intersect(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Traits& traits) -{ return s_do_intersect(pgn1, pgn2, traits); } - -// With Tag_true -template -inline bool do_intersect(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Tag_true = Tag_true()) -{ return s_do_intersect(pgn1, pgn2); } - -// With Tag_false -template -inline bool do_intersect(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_do_intersect(pgn1, pgn2, traits); -} - -// Polygon_2, Polygon_with_hole_2 ============================================== -// With Traits -template -inline bool do_intersect(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Traits& traits) -{ return s_do_intersect(pgn1, pgn2, traits); } - -// With Tag_true -template -inline bool do_intersect(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Tag_true = Tag_true()) -{ return s_do_intersect(pgn1, pgn2); } - -// With Tag_false -template -inline bool do_intersect(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_do_intersect(pgn1, pgn2, traits); -} - -// Polygon_with_hole_2, Polygon_2 ============================================== -// With Traits -template -inline bool do_intersect(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Traits& traits) -{ return s_do_intersect(pgn1, pgn2, traits); } - -// With Tag_true -template -inline bool do_intersect(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Tag_true = Tag_true()) -{ return s_do_intersect(pgn1, pgn2); } - -// With Tag_false -template -inline bool do_intersect(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_do_intersect(pgn1, pgn2, traits); -} - -// Polygon_with_hole_2, Polygon_with_hole_2 ==================================== -// With Traits -template -inline bool do_intersect(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Traits& traits) -{ return s_do_intersect(pgn1, pgn2, traits); } - -// With Tag_true -template -inline bool do_intersect(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Tag_true = Tag_true()) -{ return s_do_intersect(pgn1, pgn2); } - -// With Tag_false -template -inline bool do_intersect(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_do_intersect(pgn1, pgn2, traits); -} - -// General_polygon_2, General_polygon_2 ======================================== -// With Traits -template -inline bool do_intersect(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - GpsTraits& traits) -{ return s_do_intersect(pgn1, pgn2, traits); } - -// Without Traits -template -inline bool do_intersect(const General_polygon_2& pgn1, - const General_polygon_2& pgn2) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_do_intersect(pgn1, pgn2, traits); -} - -// General_polygon_2, General_polygon_with_holes_2 ============================= -// With Traits -template -inline bool do_intersect(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2, - GpsTraits& traits) -{ return s_do_intersect(pgn1, pgn2, traits); } - -// Without Traits -template -inline bool do_intersect(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_do_intersect(pgn1, pgn2, traits); -} - -// General_polygon_with_holes_2, General_polygon_2 ============================= -// With Traits -template -inline bool do_intersect(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2, - GpsTraits& traits) -{ return s_do_intersect(pgn1, pgn2, traits); } - -// Without Traits -template -inline bool do_intersect(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_do_intersect(pgn1, pgn2, traits); -} - -// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== -// With Traits -template -inline bool do_intersect(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - Traits& traits) -{ return s_do_intersect(pgn1, pgn2, traits); } - -// Without Traits -template -inline bool do_intersect(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_do_intersect(pgn1, pgn2, traits); -} - -//@} - -/// \name intersection() functions. -//@{ - -// Polygon_2, Polygon_2 ======================================================== -// With Traits -template -inline OutputIterator intersection(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator out, Traits& traits) -{ return s_intersection(pgn1, pgn2, out, traits); } - -// With Tag_true -template -inline OutputIterator intersection(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator out, Tag_true = Tag_true()) -{ return s_intersection(pgn1, pgn2, out); } - -// With Tag_false -template -inline OutputIterator intersection(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator out, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_intersection(pgn1, pgn2, out, traits); -} - -// Polygon_2, Polygon_with_holes_2 ============================================= -// With Traits -template -inline OutputIterator -intersection(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator out, Traits& traits) -{ return s_intersection(pgn1, pgn2, out, traits); } - -// With Tag_true -template -inline OutputIterator -intersection(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator out, Tag_true = Tag_true()) -{ return s_intersection(pgn1, pgn2, out); } - -// With Tag_false -template -inline OutputIterator -intersection(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator out, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_intersection(pgn1, pgn2, out, traits); -} - -// Polygon_with_holes_2, Polygon_2 ============================================= -// With Traits -template -inline OutputIterator -intersection(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator out, Traits& traits) -{ return s_intersection(pgn1, pgn2, out, traits); } - -// With Tag_true -template -inline OutputIterator -intersection(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator out, Tag_true = Tag_true()) -{ return s_intersection(pgn1, pgn2, out); } - -// With Tag_false -template -inline OutputIterator -intersection(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator out, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_intersection(pgn1, pgn2, out, traits); -} - -// Polygon_with_holes_2, Polygon_with_holes_2 ================================== -// With Traits -template -inline OutputIterator -intersection(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator out, Traits& traits) -{ return s_intersection(pgn1, pgn2, out, traits); } - -// With Tag_true -template -inline OutputIterator -intersection(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator out, Tag_true = Tag_true()) -{ return s_intersection(pgn1, pgn2, out); } - -// With Tag_false -template -inline OutputIterator -intersection(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator out, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_intersection(pgn1, pgn2, out, traits); -} - -// General_polygon_2, General_polygon_2 ======================================== -// With Traits -template -inline OutputIterator intersection(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - OutputIterator out, Traits& traits) -{ return s_intersection(pgn1, pgn2, out, traits); } - -// Without Traits -template -inline OutputIterator intersection(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - OutputIterator out) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_intersection(pgn1, pgn2, out, traits); -} - -// General_polygon_2, General_polygon_with_holes_2 ============================= -// With traits -template -inline OutputIterator intersection(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2, - OutputIterator out, Traits& traits) -{ return s_intersection(pgn1, pgn2, out, traits); } - -// Without Traits -template -inline OutputIterator intersection(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2, - OutputIterator out) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_intersection(pgn1, pgn2, out, traits); -} - -// General_polygon_with_holes_2, General_polygon_2 ============================= -// With traits -template -inline OutputIterator intersection(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2, - OutputIterator out, Traits& traits) -{ return s_intersection(pgn1, pgn2, out, traits); } - -// Without Traits -template -inline OutputIterator intersection(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2, - OutputIterator out) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_intersection(pgn1, pgn2, out, traits); -} - -// General_polygon_with_holes_2, General_polygon_with_holes_2 ================= -// With traits -template -inline OutputIterator -intersection(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - OutputIterator out, Traits& traits) -{ return s_intersection(pgn1, pgn2, out, traits); } - -// Without Traits -template -inline OutputIterator -intersection(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - OutputIterator out) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_intersection(pgn1, pgn2, out, traits); -} - -//@} - -/// \name join() functions. -//@{ - -// Polygon_2, Polygon_2 ======================================================== -// With traits -template -inline bool join(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Polygon_with_holes_2& res, Traits& traits) -{ return s_join(pgn1, pgn2, res, traits); } - -// With Tag_true -template -inline bool join(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Polygon_with_holes_2& res, - Tag_true = Tag_true()) -{ return s_join(pgn1, pgn2, res); } - -// With Tag_false -template -inline bool join(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Polygon_with_holes_2& res, - Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_join(pgn1, pgn2, res, traits); -} - -// Polygon_2, Polygon_with_holes_2 ============================================= -// With Traits -template -inline bool join(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Polygon_with_holes_2& res, Traits& traits) -{ return s_join(pgn1, pgn2, res, traits); } - -// With Tag_true -template -inline bool join(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Polygon_with_holes_2& res, - Tag_true = Tag_true()) -{ return s_join(pgn1, pgn2, res); } - -// With Tag_false -template -inline bool join(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Polygon_with_holes_2& res, - Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_join(pgn1, pgn2, res, traits); -} - -// Polygon_with_holes_2, Polygon_2 ============================================= -// With Traits -template -inline bool join(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Polygon_with_holes_2& res, Traits& traits) -{ return s_join(pgn1, pgn2, res, traits); } - -// With Tag_true -template -inline bool join(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Polygon_with_holes_2& res, - Tag_true = Tag_true()) -{ return s_join(pgn1, pgn2, res); } - -// With Tag_false -template -inline bool join(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Polygon_with_holes_2& res, - Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_join(pgn1, pgn2, res, traits); -} - -// Polygon_with_holes_2, Polygon_with_holes_2 ================================== -// With Traits -template -inline bool join(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Polygon_with_holes_2& res, Traits& traits) -{ return s_join(pgn1, pgn2, res, traits); } - -// With Tag_true -template -inline bool join(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Polygon_with_holes_2& res, - Tag_true = Tag_true()) -{ return s_join(pgn1, pgn2, res); } - -// With Tag_false -template -inline bool join(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Polygon_with_holes_2& res, - Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_join(pgn1, pgn2, res, traits); -} - -// General_polygon_2, General_polygon_2 ======================================== -// With Traits -template -inline bool -join(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - General_polygon_with_holes_2 >& res, - Traits& traits) -{ return s_join(pgn1, pgn2, res, traits); } - -// Without Traits -template -inline bool -join(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - General_polygon_with_holes_2 >& res) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_join(pgn1, pgn2, res, traits); -} - -// General_polygon_2, General_polygon_with_holes_2 ============================= -// With Traits -template -inline bool -join(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 >& pgn2, - General_polygon_with_holes_2 >& res, - Traits& traits) -{ return s_join(pgn1, pgn2, res, traits); } - -// Without Traits -template -inline bool -join(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 >& pgn2, - General_polygon_with_holes_2 >& res) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_join(pgn1, pgn2, res, traits); -} - -// General_polygon_with_holes_2, General_polygon_2 ============================= -// With Traits -template -inline bool -join(const General_polygon_with_holes_2 >& pgn1, - const General_polygon_2& pgn2, - General_polygon_with_holes_2 >& res, - Traits& traits) -{ return s_join(pgn1, pgn2, res, traits); } - -// Without Traits -template -inline bool -join(const General_polygon_with_holes_2 >& pgn1, - const General_polygon_2& pgn2, - General_polygon_with_holes_2 >& res) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_join(pgn1, pgn2, res, traits); -} - -// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== -// With Traits -template -inline bool join(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - General_polygon_with_holes_2& res, Traits& traits) -{ return s_join(pgn1, pgn2, res, traits); } - -// Without Traits -template -inline bool join(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - General_polygon_with_holes_2& res) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_join(pgn1, pgn2, res, traits); -} - -//@} - -/// \name difference() functions. -//@{ - -// Polygon_2, Polygon_2 ======================================================== -// With Traits -template -inline OutputIterator difference(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Traits& traits) -{ return _difference(pgn1, pgn2, oi, traits); } - -// With Tag_true -template -inline OutputIterator difference(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Tag_true = Tag_true()) -{ return _difference(pgn1, pgn2, oi); } - -// With Tag_false -template -inline OutputIterator difference(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return _difference(pgn1, pgn2, oi, traits); -} - -// Polygon_2, Polygon_with_holes_2 ============================================= -// With Traits -template -inline OutputIterator -difference(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Traits& traits) -{ return _difference(pgn1, pgn2, oi, traits); } - -// With Tag_true -template -inline OutputIterator -difference(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Tag_true = Tag_true()) -{ return _difference(pgn1, pgn2, oi); } - -// With Tag_false -template -inline OutputIterator -difference(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return _difference(pgn1, pgn2, oi, traits); -} - -// Polygon_with_holes_2, Polygon_2 ============================================= -// With Traits -template -inline OutputIterator -difference(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Traits& traits) -{ return _difference(pgn1, pgn2, oi, traits); } - -// With Tag_true -template -inline OutputIterator -difference(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Tag_true = Tag_true()) -{ return _difference(pgn1, pgn2, oi); } - -// With Tag_false -template -inline OutputIterator -difference(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return _difference(pgn1, pgn2, oi, traits); -} - -// Polygon_with_holes_2, Polygon_with_holes_2 ================================== -// With Traits -template -inline OutputIterator -difference(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Traits& traits) -{ return _difference(pgn1, pgn2, oi, traits); } - -// With Tag_true -template - OutputIterator -difference(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Tag_true = Tag_true()) -{ return _difference(pgn1, pgn2, oi); } - -// With Tag_false -template -inline OutputIterator -difference(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return _difference(pgn1, pgn2, oi, traits); -} - -// General_polygon_2, General_polygon_2 ======================================== -// With Traits -template -inline OutputIterator difference(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - OutputIterator oi, - Traits& traits) -{ return _difference(pgn1, pgn2, oi, traits); } - -// Without Traits -template -inline OutputIterator difference(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - OutputIterator oi) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return difference(pgn1, pgn2, oi, traits); -} - -// General_polygon_2, General_polygon_with_holes_2 ============================= -// With Traits -template -inline OutputIterator difference(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2, - OutputIterator oi, Traits& traits) -{ return _difference(pgn1, pgn2, oi, traits); } - -// Without Traits -template -inline OutputIterator difference(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2, - OutputIterator oi) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return difference(pgn1, pgn2, oi, traits); -} - -// General_polygon_with_holes_2, General_polygon_2 ============================= -// With Traits -template -inline OutputIterator difference(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2, - OutputIterator oi, Traits& traits) -{ return _difference(pgn1, pgn2, oi, traits); } - -// Without Traits -template -inline OutputIterator difference(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2, - OutputIterator oi) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return difference(pgn1, pgn2, oi, traits); -} - -// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== -// With Traits -template -inline OutputIterator -difference(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - OutputIterator oi, Traits& traits) -{ return _difference(pgn1, pgn2, oi, traits); } - -// Without Traits -template -inline OutputIterator -difference(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - OutputIterator oi) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return difference(pgn1, pgn2, oi, traits); -} - -//@} - -/// \name symmetric_difference() functions. -//@{ - -// Polygon_2, Polygon_2 ======================================================== -// With Traits -template -inline OutputIterator -symmetric_difference(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Traits& traits) -{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } - -// With Tag_true -template -inline OutputIterator -symmetric_difference(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Tag_true = Tag_true()) -{ return s_symmetric_difference(pgn1, pgn2, oi); } - -// With Tag_false -template -inline OutputIterator -symmetric_difference(const Polygon_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_symmetric_difference(pgn1, pgn2, oi, traits); -} - -// Polygon_2, Polygon_with_holes_2 ============================================= -// With Traits -template -inline OutputIterator -symmetric_difference(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Traits& traits) -{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } - -// With Tag_true -template -inline OutputIterator -symmetric_difference(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Tag_true = Tag_true()) -{ return s_symmetric_difference(pgn1, pgn2, oi); } - -// With Tag_false -template -inline OutputIterator -symmetric_difference(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_symmetric_difference(pgn1, pgn2, oi, traits); -} - -// Polygon_with_holes_2, Polygon_2 ============================================= -// With Traits -template -inline OutputIterator -symmetric_difference(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Traits& traits) -{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } - -// With Tag_true -template -inline OutputIterator -symmetric_difference(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Tag_true = Tag_true()) -{ return s_symmetric_difference(pgn1, pgn2, oi); } - -// With Tag_false -template -inline OutputIterator -symmetric_difference(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - OutputIterator oi, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_symmetric_difference(pgn1, pgn2, oi, traits); -} - -// Polygon_with_holes_2, Polygon_with_holes_2 ================================== -// With Traits -template -inline OutputIterator -symmetric_difference(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Traits& traits) -{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } - -// With Tag_true -template -inline OutputIterator -symmetric_difference(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Tag_true = Tag_true()) -{ return s_symmetric_difference(pgn1, pgn2, oi); } - -// With Tag_false -template -inline OutputIterator -symmetric_difference(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - OutputIterator oi, Tag_false) -{ - // Use the first polygon to determine the (default) traits - typedef Polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_symmetric_difference(pgn1, pgn2, oi, traits); -} - -// General_polygon_2, General_polygon_2 ======================================== -// With Traits -template -inline OutputIterator -symmetric_difference(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - OutputIterator oi, Traits& traits) -{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } - -template -inline OutputIterator -symmetric_difference(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - OutputIterator oi) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_symmetric_difference(pgn1, pgn2, oi, traits); -} - -// General_polygon_2, General_polygon_with_holes_2 ============================= -// With Traits -template -inline OutputIterator -symmetric_difference(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2, - OutputIterator oi, Traits& traits) -{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } - -// Without Traits -template -inline OutputIterator -symmetric_difference(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2, - OutputIterator oi) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return s_symmetric_difference(pgn1, pgn2, oi, traits); -} - -// General_polygon_with_holes_2, General_polygon_2 ============================= -// With Traits -template -inline OutputIterator -symmetric_difference(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2, - OutputIterator oi, Traits& traits) -{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } - -// Without Traits -template -inline OutputIterator -symmetric_difference(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2, - OutputIterator oi) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_symmetric_difference(pgn1, pgn2, oi, traits); -} - -// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== -// With Traits -template -inline OutputIterator -symmetric_difference(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - OutputIterator oi, Traits& traits) -{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } - -// Without Traits -template -inline OutputIterator -symmetric_difference(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - OutputIterator oi) -{ - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return s_symmetric_difference(pgn1, pgn2, oi, traits); -} - -//@} - -/// \name complement() functions. -//@{ - -// Polygon_2 =================================================================== -// With Traits -template -void complement(const Polygon_2& pgn, - Polygon_with_holes_2& res, - Traits& traits) -{ _complement(pgn, res, traits); } - -// With Tag_true -template -void complement(const Polygon_2& pgn, - Polygon_with_holes_2& res, - Tag_true = Tag_true()) -{ _complement(pgn, res); } - -// With Tag_false -template -void complement(const Polygon_2& pgn, - Polygon_with_holes_2& res, - Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - complement(pgn, res, traits); -} - -// Polygon_with_holes_2 ======================================================== -// With Traits -template -OutputIterator complement(const Polygon_with_holes_2& pgn, - OutputIterator oi, Traits& traits) -{ return _complement(pgn, oi, traits); } - -// With Tag_true -template -OutputIterator complement(const Polygon_with_holes_2& pgn, - OutputIterator oi, Tag_true = Tag_true()) -{ return _complement(pgn, oi); } - -// With Tag_false -template -OutputIterator complement(const Polygon_with_holes_2& pgn, - OutputIterator oi, Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return complement(pgn, oi, traits); -} - -// General_polygon_2 =========================================================== -// With Traits -template -void complement(const General_polygon_2& pgn, - General_polygon_with_holes_2 - >& res, - Traits& traits) -{ _complement(pgn, res, traits); } - -// Without Traits -template -void complement(const General_polygon_2& pgn, - General_polygon_with_holes_2 - >& res) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - complement(pgn, res, traits); -} - -// General_polygon_with_holes_2 ================================================ -// With Traits -template -OutputIterator complement(const General_polygon_with_holes_2& pgn, - OutputIterator oi, Traits& traits) -{ return _complement(pgn, oi, traits); } - -// Without Traits -template -OutputIterator complement(General_polygon_with_holes_2& pgn, - OutputIterator oi) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return complement(pgn, oi, traits); -} - -//@} - -/// \name Aggregated join() functions. -//@{ - -template -struct map_iterator_to_traits { - typedef typename std::iterator_traits::value_type InputPolygon; - typedef typename Gps_default_traits::Traits Traits; -}; - -// With Traits -template -inline OutputIterator join(InputIterator begin, InputIterator end, - OutputIterator oi, Traits& traits, unsigned int k=5) -{ return r_join(begin, end, oi, traits, k); } - -// Without Traits -// Tag_true => convert to polylines -template -inline OutputIterator join(InputIterator begin, InputIterator end, - OutputIterator oi, Tag_true = Tag_true(), - unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_join(begin, end, oi, k); } - -// Tag_false => do not convert to polylines -template -inline OutputIterator join(InputIterator begin, InputIterator end, - OutputIterator oi, Tag_false, unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_join(begin, end, oi, traits, k); -} - -// General polygons or polygons with holes -template -inline OutputIterator join(InputIterator begin, InputIterator end, - OutputIterator oi, unsigned int k=5, - Disable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_join(begin, end, oi, traits, k); -} - -// Join two ranges of simple polygons and polygons with holes. -// With Traits -template -inline OutputIterator join(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Traits& traits, unsigned int k=5) -{ return r_join(begin1, end1, begin2, end2, oi, traits, k); } - -// Without Traits -// Tag_true => convert to polylines -template -inline OutputIterator join(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Tag_true = Tag_true(), - unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_join(begin1, end1, begin2, end2, oi, k); } - -// Tag_false => do not convert to polylines -template -inline OutputIterator join(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Tag_false, unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_join(begin1, end1, begin2, end2, oi, traits, k); -} - -// General polygons or polygons with holes -template -inline OutputIterator join(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, unsigned int k=5, - Disable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_join(begin1, end1, begin2, end2, oi, traits, k); -} - -//@} - -/// \name Aggregated intersection() functions. -//@{ - -// With Traits -template -inline OutputIterator intersection(InputIterator begin, InputIterator end, - OutputIterator oi, Traits& traits, - unsigned int k=5) -{ return r_intersection(begin, end, oi, traits, k); } - -// Without Traits -// Tag_true => convert to polylines -template -inline OutputIterator -intersection(InputIterator begin, InputIterator end, - OutputIterator oi, Tag_true = Tag_true(), - unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_intersection(begin, end, oi, k); } - -// Tag_false => do not convert to polylines -template -inline OutputIterator -intersection(InputIterator begin, InputIterator end, - OutputIterator oi, Tag_false, unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_intersection(begin, end, oi, traits, k); -} - -// General polygons or polygons with holes -template -inline OutputIterator -intersection(InputIterator begin, InputIterator end, - OutputIterator oi, unsigned int k=5, - // workaround to avoid ambiguous calls with kernel functions - typename boost::enable_if - >::type* = 0, - Disable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_intersection(begin, end, oi, traits, k); -} - -// Inersect two ranges of simple polygons and polygons with holes. -// With Traits -template -inline OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Traits& traits, - unsigned int k=5) -{ return r_intersection(begin1, end1, begin2, end2, oi, traits, k); } - -// Without Traits -// Tag_true => convert to polylines -template -inline OutputIterator -intersection(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Tag_true = Tag_true(), unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_intersection(begin1, end1, begin2, end2, oi, k); } - -// Tag_false => do not convert to polylines -template -inline OutputIterator -intersection(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Tag_false, unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_intersection(begin1, end1, begin2, end2, oi, traits, k); -} - -// General polygons or polygons with holes -template -inline OutputIterator -intersection(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, unsigned int k=5, - Disable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_intersection(begin1, end1, begin2, end2, oi, traits, k); -} - -//@} - -/// \name Aggregated symmetric_difference() functions. -//@{ - -// With Traits -template -inline -OutputIterator symmetric_difference(InputIterator begin, InputIterator end, - OutputIterator oi, Traits& traits, - unsigned int k=5) -{ return r_symmetric_difference(begin, end, oi, traits, k); } - -// Without Traits -// Tag_true => convert to polylines -template -inline OutputIterator -symmetric_difference(InputIterator begin, InputIterator end, - OutputIterator oi, Tag_true = Tag_true(), unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_symmetric_difference(begin, end, oi, k); } - -// Tag_false => do not convert to polylines -template -inline OutputIterator -symmetric_difference(InputIterator begin, InputIterator end, - OutputIterator oi, Tag_false, unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_symmetric_difference(begin, end, oi, traits, k); -} - -// General polygons or polygons with holes -template -inline OutputIterator -symmetric_difference(InputIterator begin, InputIterator end, - OutputIterator oi, unsigned int k=5, - Disable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_symmetric_difference(begin, end, oi, traits, k); -} - -// Xor two ranges of simple polygons and polygons with holes. -// With Traits -template -inline -OutputIterator symmetric_difference(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Traits& traits, - unsigned int k=5) -{ return r_symmetric_difference(begin1, end1, begin2, end2, oi, traits, k); } - -// Without Traits -// Tag_true => convert to polylines -template -inline OutputIterator -symmetric_difference(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Tag_true = Tag_true(), unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_symmetric_difference(begin1, end1, begin2, end2, oi, k); } - -// Tag_false => do not convert to polylines -template -inline OutputIterator -symmetric_difference(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, Tag_false, unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_symmetric_difference(begin1, end1, begin2, end2, oi, traits, k); -} - -// General polygons or polygons with holes -template -inline OutputIterator -symmetric_difference(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - OutputIterator oi, unsigned int k=5, - Disable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_symmetric_difference(begin1, end1, begin2, end2, oi, traits, k); -} - -//@} - -/// \name Aggregated do_intersect() functions. -//@{ - -// With Traits -template -inline bool do_intersect(InputIterator begin, InputIterator end, Traits& traits, - unsigned int k=5) -{ return r_do_intersect(begin, end, traits, k); } - -// Without Traits -// Tag_true => convert to polylines -template -inline bool do_intersect(InputIterator begin, InputIterator end, - Tag_true = Tag_true(), unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_do_intersect(begin, end, k); } - -// Tag_false => do not convert to polylines -template -inline bool do_intersect(InputIterator begin, InputIterator end, - Tag_false, unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_do_intersect(begin, end, traits, k); -} - -// General polygons or polygons with holes -template -inline bool do_intersect(InputIterator begin, InputIterator end, - unsigned int k=5, - Disable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return do_intersect(begin, end, traits, k); -} - -// With Traits -template -inline bool do_intersect(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - Traits& traits, unsigned int k=5) -{ return r_do_intersect(begin1, end1, begin2, end2, traits, k); } - -// Without Traits -// Tag_true => convert to polylines -template -inline bool do_intersect (InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - Tag_true = Tag_true(), unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_do_intersect(begin1, end1, begin2, end2, k); } - -// Tag_false => do not convert to polylines -template -inline bool do_intersect (InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - Tag_false, unsigned int k=5, - Enable_if_Polygon_2_iterator* = 0) -{ return r_do_intersect(begin1, end1, begin2, end2, k); } - -// General polygons or polygons with holes -template -inline bool do_intersect (InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - unsigned int k=5, - Disable_if_Polygon_2_iterator* = 0) -{ - typename map_iterator_to_traits::Traits traits; - return r_do_intersect(begin1, end1, begin2, end2, traits, k); -} - -//@} - -/// \name oriented_side() functions. -//@{ - -// Polygon_2, Polygon_2 ======================================================== -// With Traits -template -inline Oriented_side oriented_side(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Traits& traits) -{ return _oriented_side(pgn1, pgn2, traits); } - -// With Tag_true -template -inline Oriented_side oriented_side(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Tag_true = Tag_true()) -{ return _oriented_side(pgn1, pgn2); } - -// With Tag_false -template -inline Oriented_side oriented_side(const Polygon_2& pgn1, - const Polygon_2& pgn2, - Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(pgn1, pgn2, traits); -} - -// Polygon_2, Polygon_with_holes_2 ============================================= -// With Traits -template -inline -Oriented_side oriented_side(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Traits& traits) -{ return _oriented_side(pgn1, pgn2, traits); } - -// With Tag_true -template -inline -Oriented_side oriented_side(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Tag_true = Tag_true()) -{ return _oriented_side(pgn1, pgn2); } - -// With Tag_false -template -inline -Oriented_side oriented_side(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(pgn1, pgn2, traits); -} - -// Polygon_with_holes_2, Polygon_2 ============================================= -// With Traits -template -inline -Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Traits& traits) -{ return _oriented_side(pgn1, pgn2, traits); } - -// With Tag_true -template -inline -Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Tag_true = Tag_true()) -{ return _oriented_side(pgn1, pgn2); } - -// With Tag_false -template -inline -Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(pgn1, pgn2, traits); -} - -// Polygon_with_holes_2, Polygon_with_holes_2 ================================== -// With Traits -template -inline -Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Traits& traits) -{ return _oriented_side(pgn1, pgn2, traits); } - -// With Tag_true -template -inline -Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Tag_true = Tag_true()) -{ return _oriented_side(pgn1, pgn2); } - -// With Tag_false -template -inline -Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(pgn1, pgn2, traits); -} - -// General_polygon_2, General_polygon_2 ======================================== -// With Traits -template -inline Oriented_side oriented_side(const General_polygon_2& pgn1, - const General_polygon_2& pgn2, - GpsTraits& traits) -{ return _oriented_side(pgn1, pgn2, traits); } - -// Without Traits -template -inline Oriented_side oriented_side(const General_polygon_2& pgn1, - const General_polygon_2& pgn2) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(pgn1, pgn2, traits); -} - -// General_polygon_2, General_polygon_with_holes_2 ============================= -// With Traits -template -inline Oriented_side oriented_side(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2, - GpsTraits& traits) -{ return _oriented_side(pgn1, pgn2, traits); } - -// Without Traits -template -inline Oriented_side oriented_side(const General_polygon_2& pgn1, - const General_polygon_with_holes_2 - >& pgn2) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(pgn1, pgn2, traits); -} - -// General_polygon_with_holes_2, General_polygon_2 ============================= -// With Traits -template -inline Oriented_side oriented_side(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2, - GpsTraits& traits) -{ return _oriented_side(pgn1, pgn2, traits); } - -// Without Traits -template -inline Oriented_side oriented_side(const General_polygon_with_holes_2 - >& pgn1, - const General_polygon_2& pgn2) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return oriented_side(pgn1, pgn2, traits); -} - -// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== -// With Traits -template -inline -Oriented_side oriented_side(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2, - Traits& traits) -{ return _oriented_side(pgn1, pgn2, traits); } - -// Without Traits -template -inline -Oriented_side oriented_side(const General_polygon_with_holes_2& pgn1, - const General_polygon_with_holes_2& pgn2) -{ - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return oriented_side(pgn1, pgn2, traits); -} - -// Point Query: -// Polygon_2 =================================================================== -// With Traits -template -inline Oriented_side oriented_side(const typename Kernel::Point_2& p, - const Polygon_2& pgn, - Traits& traits) -{ return _oriented_side(p, pgn, traits); } - -// With Tag_true -template -inline Oriented_side oriented_side(const typename Kernel::Point_2& p, - const Polygon_2& pgn, - Tag_true = Tag_true()) -{ return _oriented_side(p, pgn); } - -// With Tag_false -template -inline Oriented_side oriented_side(const typename Kernel::Point_2& p, - const Polygon_2& pgn, - Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(p, pgn, traits); -} - -// Polygon_with_holes_2 ======================================================== -// With Traits -template -inline -Oriented_side oriented_side(const typename Kernel::Point_2& p, - const Polygon_with_holes_2& pgn, - Traits& traits) -{ return _oriented_side(p, pgn, traits); } - -// With Tag_true -template -inline -Oriented_side oriented_side(const typename Kernel::Point_2& p, - const Polygon_with_holes_2& pgn, - Tag_true = Tag_true()) -{ return _oriented_side(p, pgn); } - -// With Tag_false -template -inline -Oriented_side oriented_side(const typename Kernel::Point_2& p, - const Polygon_with_holes_2& pgn, - Tag_false) -{ - typedef Polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(p, pgn, traits); -} - -// General_polygon_2 =========================================================== -// With Traits -template -inline Oriented_side oriented_side(const typename ArrTraits::Point_2& p, - const General_polygon_2& pgn, - GpsTraits& traits) -{ return _oriented_side(p, pgn, traits); } - -// Without Traits -template -inline Oriented_side oriented_side(const typename ArrTraits::Point_2& p, - const General_polygon_2& pgn) -{ - // Use the first polygon to determine the (default) traits - typedef General_polygon_2 Polygon; - typename Gps_default_traits::Traits traits; - return oriented_side(p, pgn, traits); -} - -// General_polygon_with_holes_2 ================================================ -// With Traits -template -inline -Oriented_side oriented_side(const typename Polygon_::Point_2& p, - const General_polygon_with_holes_2& pgn, - Traits& traits) -{ return _oriented_side(p, pgn, traits); } - -// Without Traits -template -inline -Oriented_side oriented_side(const typename Polygon_::Point_2& p, - const General_polygon_with_holes_2& pgn) -{ - typedef General_polygon_with_holes_2 Polygon_with_holes; - typename Gps_default_traits::Traits traits; - return oriented_side(p, pgn, traits); -} - -//@} - -} //namespace CGAL - -#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/complement.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/complement.h new file mode 100644 index 00000000000..cf4de75f554 --- /dev/null +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/complement.h @@ -0,0 +1,139 @@ +// Copyright (c) 2005 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Baruch Zukerman +// Ron Wein +// Efi Fogel +// Simon Giraudot + +#ifndef CGAL_BOOLEAN_SET_OPERATIONS_2_COMPLEMENT_H +#define CGAL_BOOLEAN_SET_OPERATIONS_2_COMPLEMENT_H + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace CGAL +{ + +/// \name complement() functions. +//@{ + +// Polygon_2 =================================================================== +// With Traits +template +void complement(const Polygon_2& pgn, + Polygon_with_holes_2& res, + Traits& traits) +{ _complement(pgn, res, traits); } + +// With Tag_true +template +void complement(const Polygon_2& pgn, + Polygon_with_holes_2& res, + Tag_true = Tag_true()) +{ _complement(pgn, res); } + +// With Tag_false +template +void complement(const Polygon_2& pgn, + Polygon_with_holes_2& res, + Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + complement(pgn, res, traits); +} + +// Polygon_with_holes_2 ======================================================== +// With Traits +template +OutputIterator complement(const Polygon_with_holes_2& pgn, + OutputIterator oi, Traits& traits) +{ return _complement(pgn, oi, traits); } + +// With Tag_true +template +OutputIterator complement(const Polygon_with_holes_2& pgn, + OutputIterator oi, Tag_true = Tag_true()) +{ return _complement(pgn, oi); } + +// With Tag_false +template +OutputIterator complement(const Polygon_with_holes_2& pgn, + OutputIterator oi, Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return complement(pgn, oi, traits); +} + +// General_polygon_2 =========================================================== +// With Traits +template +void complement(const General_polygon_2& pgn, + General_polygon_with_holes_2 + >& res, + Traits& traits) +{ _complement(pgn, res, traits); } + +// Without Traits +template +void complement(const General_polygon_2& pgn, + General_polygon_with_holes_2 + >& res) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + complement(pgn, res, traits); +} + +// General_polygon_with_holes_2 ================================================ +// With Traits +template +OutputIterator complement(const General_polygon_with_holes_2& pgn, + OutputIterator oi, Traits& traits) +{ return _complement(pgn, oi, traits); } + +// Without Traits +template +OutputIterator complement(General_polygon_with_holes_2& pgn, + OutputIterator oi) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return complement(pgn, oi, traits); +} + +//@} + +} //namespace CGAL + +#include + +#endif diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/difference.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/difference.h new file mode 100644 index 00000000000..b2573a88629 --- /dev/null +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/difference.h @@ -0,0 +1,259 @@ +// Copyright (c) 2005 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Baruch Zukerman +// Ron Wein +// Efi Fogel +// Simon Giraudot + +#ifndef CGAL_BOOLEAN_SET_OPERATIONS_2_DIFFERENCE_H +#define CGAL_BOOLEAN_SET_OPERATIONS_2_DIFFERENCE_H + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace CGAL +{ + +/// \name difference() functions. +//@{ + +// Polygon_2, Polygon_2 ======================================================== +// With Traits +template +inline OutputIterator difference(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Traits& traits) +{ return _difference(pgn1, pgn2, oi, traits); } + +// With Tag_true +template +inline OutputIterator difference(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Tag_true = Tag_true()) +{ return _difference(pgn1, pgn2, oi); } + +// With Tag_false +template +inline OutputIterator difference(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return _difference(pgn1, pgn2, oi, traits); +} + +// Polygon_2, Polygon_with_holes_2 ============================================= +// With Traits +template +inline OutputIterator +difference(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Traits& traits) +{ return _difference(pgn1, pgn2, oi, traits); } + +// With Tag_true +template +inline OutputIterator +difference(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Tag_true = Tag_true()) +{ return _difference(pgn1, pgn2, oi); } + +// With Tag_false +template +inline OutputIterator +difference(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return _difference(pgn1, pgn2, oi, traits); +} + +// Polygon_with_holes_2, Polygon_2 ============================================= +// With Traits +template +inline OutputIterator +difference(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Traits& traits) +{ return _difference(pgn1, pgn2, oi, traits); } + +// With Tag_true +template +inline OutputIterator +difference(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Tag_true = Tag_true()) +{ return _difference(pgn1, pgn2, oi); } + +// With Tag_false +template +inline OutputIterator +difference(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return _difference(pgn1, pgn2, oi, traits); +} + +// Polygon_with_holes_2, Polygon_with_holes_2 ================================== +// With Traits +template +inline OutputIterator +difference(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Traits& traits) +{ return _difference(pgn1, pgn2, oi, traits); } + +// With Tag_true +template + OutputIterator +difference(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Tag_true = Tag_true()) +{ return _difference(pgn1, pgn2, oi); } + +// With Tag_false +template +inline OutputIterator +difference(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return _difference(pgn1, pgn2, oi, traits); +} + +// General_polygon_2, General_polygon_2 ======================================== +// With Traits +template +inline OutputIterator difference(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi, + Traits& traits) +{ return _difference(pgn1, pgn2, oi, traits); } + +// Without Traits +template +inline OutputIterator difference(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return difference(pgn1, pgn2, oi, traits); +} + +// General_polygon_2, General_polygon_with_holes_2 ============================= +// With Traits +template +inline OutputIterator difference(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2, + OutputIterator oi, Traits& traits) +{ return _difference(pgn1, pgn2, oi, traits); } + +// Without Traits +template +inline OutputIterator difference(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2, + OutputIterator oi) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return difference(pgn1, pgn2, oi, traits); +} + +// General_polygon_with_holes_2, General_polygon_2 ============================= +// With Traits +template +inline OutputIterator difference(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi, Traits& traits) +{ return _difference(pgn1, pgn2, oi, traits); } + +// Without Traits +template +inline OutputIterator difference(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return difference(pgn1, pgn2, oi, traits); +} + +// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== +// With Traits +template +inline OutputIterator +difference(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + OutputIterator oi, Traits& traits) +{ return _difference(pgn1, pgn2, oi, traits); } + +// Without Traits +template +inline OutputIterator +difference(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + OutputIterator oi) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return difference(pgn1, pgn2, oi, traits); +} + +//@} + +} //namespace CGAL + +#include + +#endif diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/do_intersect.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/do_intersect.h new file mode 100644 index 00000000000..1e84ef04419 --- /dev/null +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/do_intersect.h @@ -0,0 +1,312 @@ +// Copyright (c) 2005 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Baruch Zukerman +// Ron Wein +// Efi Fogel +// Simon Giraudot + +#ifndef CGAL_BOOLEAN_SET_OPERATIONS_2_DO_INTERSECT_H +#define CGAL_BOOLEAN_SET_OPERATIONS_2_DO_INTERSECT_H + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace CGAL +{ + +/// \name do_intersect() functions. +//@{ + +// Polygon_2, Polygon_2 ======================================================== +// With Traits +template +inline bool do_intersect(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Traits& traits) +{ return s_do_intersect(pgn1, pgn2, traits); } + +// With Tag_true +template +inline bool do_intersect(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Tag_true = Tag_true()) +{ return s_do_intersect(pgn1, pgn2); } + +// With Tag_false +template +inline bool do_intersect(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_do_intersect(pgn1, pgn2, traits); +} + +// Polygon_2, Polygon_with_hole_2 ============================================== +// With Traits +template +inline bool do_intersect(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Traits& traits) +{ return s_do_intersect(pgn1, pgn2, traits); } + +// With Tag_true +template +inline bool do_intersect(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Tag_true = Tag_true()) +{ return s_do_intersect(pgn1, pgn2); } + +// With Tag_false +template +inline bool do_intersect(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_do_intersect(pgn1, pgn2, traits); +} + +// Polygon_with_hole_2, Polygon_2 ============================================== +// With Traits +template +inline bool do_intersect(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Traits& traits) +{ return s_do_intersect(pgn1, pgn2, traits); } + +// With Tag_true +template +inline bool do_intersect(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Tag_true = Tag_true()) +{ return s_do_intersect(pgn1, pgn2); } + +// With Tag_false +template +inline bool do_intersect(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_do_intersect(pgn1, pgn2, traits); +} + +// Polygon_with_hole_2, Polygon_with_hole_2 ==================================== +// With Traits +template +inline bool do_intersect(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Traits& traits) +{ return s_do_intersect(pgn1, pgn2, traits); } + +// With Tag_true +template +inline bool do_intersect(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Tag_true = Tag_true()) +{ return s_do_intersect(pgn1, pgn2); } + +// With Tag_false +template +inline bool do_intersect(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_do_intersect(pgn1, pgn2, traits); +} + +// General_polygon_2, General_polygon_2 ======================================== +// With Traits +template +inline bool do_intersect(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + GpsTraits& traits) +{ return s_do_intersect(pgn1, pgn2, traits); } + +// Without Traits +template +inline bool do_intersect(const General_polygon_2& pgn1, + const General_polygon_2& pgn2) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_do_intersect(pgn1, pgn2, traits); +} + +// General_polygon_2, General_polygon_with_holes_2 ============================= +// With Traits +template +inline bool do_intersect(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2, + GpsTraits& traits) +{ return s_do_intersect(pgn1, pgn2, traits); } + +// Without Traits +template +inline bool do_intersect(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_do_intersect(pgn1, pgn2, traits); +} + +// General_polygon_with_holes_2, General_polygon_2 ============================= +// With Traits +template +inline bool do_intersect(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2, + GpsTraits& traits) +{ return s_do_intersect(pgn1, pgn2, traits); } + +// Without Traits +template +inline bool do_intersect(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_do_intersect(pgn1, pgn2, traits); +} + +// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== +// With Traits +template +inline bool do_intersect(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + Traits& traits) +{ return s_do_intersect(pgn1, pgn2, traits); } + +// Without Traits +template +inline bool do_intersect(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_do_intersect(pgn1, pgn2, traits); +} + +//@} + +/// \name Aggregated do_intersect() functions. +//@{ + +// With Traits +template +inline bool do_intersect(InputIterator begin, InputIterator end, Traits& traits, + unsigned int k=5) +{ return r_do_intersect(begin, end, traits, k); } + +// Without Traits +// Tag_true => convert to polylines +template +inline bool do_intersect(InputIterator begin, InputIterator end, + Tag_true = Tag_true(), unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_do_intersect(begin, end, k); } + +// Tag_false => do not convert to polylines +template +inline bool do_intersect(InputIterator begin, InputIterator end, + Tag_false, unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_do_intersect(begin, end, traits, k); +} + +// General polygons or polygons with holes +template +inline bool do_intersect(InputIterator begin, InputIterator end, + unsigned int k=5, + Disable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return do_intersect(begin, end, traits, k); +} + +// With Traits +template +inline bool do_intersect(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + Traits& traits, unsigned int k=5) +{ return r_do_intersect(begin1, end1, begin2, end2, traits, k); } + +// Without Traits +// Tag_true => convert to polylines +template +inline bool do_intersect (InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + Tag_true = Tag_true(), unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_do_intersect(begin1, end1, begin2, end2, k); } + +// Tag_false => do not convert to polylines +template +inline bool do_intersect (InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + Tag_false, unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_do_intersect(begin1, end1, begin2, end2, k); } + +// General polygons or polygons with holes +template +inline bool do_intersect (InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + unsigned int k=5, + Disable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_do_intersect(begin1, end1, begin2, end2, traits, k); +} + +//@} + +} //namespace CGAL + +#include + +#endif diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/intersection.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/intersection.h new file mode 100644 index 00000000000..941d0a22bf6 --- /dev/null +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/intersection.h @@ -0,0 +1,352 @@ +// Copyright (c) 2005 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Baruch Zukerman +// Ron Wein +// Efi Fogel +// Simon Giraudot + +#ifndef CGAL_BOOLEAN_SET_OPERATIONS_2_INTERSECTION_H +#define CGAL_BOOLEAN_SET_OPERATIONS_2_INTERSECTION_H + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace CGAL +{ + +/// \name intersection() functions. +//@{ + +// Polygon_2, Polygon_2 ======================================================== +// With Traits +template +inline OutputIterator intersection(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator out, Traits& traits) +{ return s_intersection(pgn1, pgn2, out, traits); } + +// With Tag_true +template +inline OutputIterator intersection(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator out, Tag_true = Tag_true()) +{ return s_intersection(pgn1, pgn2, out); } + +// With Tag_false +template +inline OutputIterator intersection(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator out, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_intersection(pgn1, pgn2, out, traits); +} + +// Polygon_2, Polygon_with_holes_2 ============================================= +// With Traits +template +inline OutputIterator +intersection(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator out, Traits& traits) +{ return s_intersection(pgn1, pgn2, out, traits); } + +// With Tag_true +template +inline OutputIterator +intersection(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator out, Tag_true = Tag_true()) +{ return s_intersection(pgn1, pgn2, out); } + +// With Tag_false +template +inline OutputIterator +intersection(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator out, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_intersection(pgn1, pgn2, out, traits); +} + +// Polygon_with_holes_2, Polygon_2 ============================================= +// With Traits +template +inline OutputIterator +intersection(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator out, Traits& traits) +{ return s_intersection(pgn1, pgn2, out, traits); } + +// With Tag_true +template +inline OutputIterator +intersection(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator out, Tag_true = Tag_true()) +{ return s_intersection(pgn1, pgn2, out); } + +// With Tag_false +template +inline OutputIterator +intersection(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator out, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_intersection(pgn1, pgn2, out, traits); +} + +// Polygon_with_holes_2, Polygon_with_holes_2 ================================== +// With Traits +template +inline OutputIterator +intersection(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator out, Traits& traits) +{ return s_intersection(pgn1, pgn2, out, traits); } + +// With Tag_true +template +inline OutputIterator +intersection(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator out, Tag_true = Tag_true()) +{ return s_intersection(pgn1, pgn2, out); } + +// With Tag_false +template +inline OutputIterator +intersection(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator out, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_intersection(pgn1, pgn2, out, traits); +} + +// General_polygon_2, General_polygon_2 ======================================== +// With Traits +template +inline OutputIterator intersection(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + OutputIterator out, Traits& traits) +{ return s_intersection(pgn1, pgn2, out, traits); } + +// Without Traits +template +inline OutputIterator intersection(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + OutputIterator out) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_intersection(pgn1, pgn2, out, traits); +} + +// General_polygon_2, General_polygon_with_holes_2 ============================= +// With traits +template +inline OutputIterator intersection(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2, + OutputIterator out, Traits& traits) +{ return s_intersection(pgn1, pgn2, out, traits); } + +// Without Traits +template +inline OutputIterator intersection(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2, + OutputIterator out) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_intersection(pgn1, pgn2, out, traits); +} + +// General_polygon_with_holes_2, General_polygon_2 ============================= +// With traits +template +inline OutputIterator intersection(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2, + OutputIterator out, Traits& traits) +{ return s_intersection(pgn1, pgn2, out, traits); } + +// Without Traits +template +inline OutputIterator intersection(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2, + OutputIterator out) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_intersection(pgn1, pgn2, out, traits); +} + +// General_polygon_with_holes_2, General_polygon_with_holes_2 ================= +// With traits +template +inline OutputIterator +intersection(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + OutputIterator out, Traits& traits) +{ return s_intersection(pgn1, pgn2, out, traits); } + +// Without Traits +template +inline OutputIterator +intersection(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + OutputIterator out) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_intersection(pgn1, pgn2, out, traits); +} + +//@} + +/// \name Aggregated intersection() functions. +//@{ + +// With Traits +template +inline OutputIterator intersection(InputIterator begin, InputIterator end, + OutputIterator oi, Traits& traits, + unsigned int k=5) +{ return r_intersection(begin, end, oi, traits, k); } + +// Without Traits +// Tag_true => convert to polylines +template +inline OutputIterator +intersection(InputIterator begin, InputIterator end, + OutputIterator oi, Tag_true = Tag_true(), + unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_intersection(begin, end, oi, k); } + +// Tag_false => do not convert to polylines +template +inline OutputIterator +intersection(InputIterator begin, InputIterator end, + OutputIterator oi, Tag_false, unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_intersection(begin, end, oi, traits, k); +} + +// General polygons or polygons with holes +template +inline OutputIterator +intersection(InputIterator begin, InputIterator end, + OutputIterator oi, unsigned int k=5, + // workaround to avoid ambiguous calls with kernel functions + typename boost::enable_if + >::type* = 0, + Disable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_intersection(begin, end, oi, traits, k); +} + +// Inersect two ranges of simple polygons and polygons with holes. +// With Traits +template +inline OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Traits& traits, + unsigned int k=5) +{ return r_intersection(begin1, end1, begin2, end2, oi, traits, k); } + +// Without Traits +// Tag_true => convert to polylines +template +inline OutputIterator +intersection(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Tag_true = Tag_true(), unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_intersection(begin1, end1, begin2, end2, oi, k); } + +// Tag_false => do not convert to polylines +template +inline OutputIterator +intersection(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Tag_false, unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_intersection(begin1, end1, begin2, end2, oi, traits, k); +} + +// General polygons or polygons with holes +template +inline OutputIterator +intersection(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, unsigned int k=5, + Disable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_intersection(begin1, end1, begin2, end2, oi, traits, k); +} + +//@} + +} //namespace CGAL + +#include + +#endif diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/join.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/join.h new file mode 100644 index 00000000000..4cb48d3a331 --- /dev/null +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/join.h @@ -0,0 +1,346 @@ +// Copyright (c) 2005 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Baruch Zukerman +// Ron Wein +// Efi Fogel +// Simon Giraudot + +#ifndef CGAL_BOOLEAN_SET_OPERATIONS_2_JOIN_H +#define CGAL_BOOLEAN_SET_OPERATIONS_2_JOIN_H + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace CGAL +{ + +/// \name join() functions. +//@{ + +// Polygon_2, Polygon_2 ======================================================== +// With traits +template +inline bool join(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Polygon_with_holes_2& res, Traits& traits) +{ return s_join(pgn1, pgn2, res, traits); } + +// With Tag_true +template +inline bool join(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Polygon_with_holes_2& res, + Tag_true = Tag_true()) +{ return s_join(pgn1, pgn2, res); } + +// With Tag_false +template +inline bool join(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Polygon_with_holes_2& res, + Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_join(pgn1, pgn2, res, traits); +} + +// Polygon_2, Polygon_with_holes_2 ============================================= +// With Traits +template +inline bool join(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Polygon_with_holes_2& res, Traits& traits) +{ return s_join(pgn1, pgn2, res, traits); } + +// With Tag_true +template +inline bool join(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Polygon_with_holes_2& res, + Tag_true = Tag_true()) +{ return s_join(pgn1, pgn2, res); } + +// With Tag_false +template +inline bool join(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Polygon_with_holes_2& res, + Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_join(pgn1, pgn2, res, traits); +} + +// Polygon_with_holes_2, Polygon_2 ============================================= +// With Traits +template +inline bool join(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Polygon_with_holes_2& res, Traits& traits) +{ return s_join(pgn1, pgn2, res, traits); } + +// With Tag_true +template +inline bool join(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Polygon_with_holes_2& res, + Tag_true = Tag_true()) +{ return s_join(pgn1, pgn2, res); } + +// With Tag_false +template +inline bool join(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Polygon_with_holes_2& res, + Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_join(pgn1, pgn2, res, traits); +} + +// Polygon_with_holes_2, Polygon_with_holes_2 ================================== +// With Traits +template +inline bool join(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Polygon_with_holes_2& res, Traits& traits) +{ return s_join(pgn1, pgn2, res, traits); } + +// With Tag_true +template +inline bool join(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Polygon_with_holes_2& res, + Tag_true = Tag_true()) +{ return s_join(pgn1, pgn2, res); } + +// With Tag_false +template +inline bool join(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Polygon_with_holes_2& res, + Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_join(pgn1, pgn2, res, traits); +} + +// General_polygon_2, General_polygon_2 ======================================== +// With Traits +template +inline bool +join(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + General_polygon_with_holes_2 >& res, + Traits& traits) +{ return s_join(pgn1, pgn2, res, traits); } + +// Without Traits +template +inline bool +join(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + General_polygon_with_holes_2 >& res) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_join(pgn1, pgn2, res, traits); +} + +// General_polygon_2, General_polygon_with_holes_2 ============================= +// With Traits +template +inline bool +join(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 >& pgn2, + General_polygon_with_holes_2 >& res, + Traits& traits) +{ return s_join(pgn1, pgn2, res, traits); } + +// Without Traits +template +inline bool +join(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 >& pgn2, + General_polygon_with_holes_2 >& res) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_join(pgn1, pgn2, res, traits); +} + +// General_polygon_with_holes_2, General_polygon_2 ============================= +// With Traits +template +inline bool +join(const General_polygon_with_holes_2 >& pgn1, + const General_polygon_2& pgn2, + General_polygon_with_holes_2 >& res, + Traits& traits) +{ return s_join(pgn1, pgn2, res, traits); } + +// Without Traits +template +inline bool +join(const General_polygon_with_holes_2 >& pgn1, + const General_polygon_2& pgn2, + General_polygon_with_holes_2 >& res) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_join(pgn1, pgn2, res, traits); +} + +// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== +// With Traits +template +inline bool join(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + General_polygon_with_holes_2& res, Traits& traits) +{ return s_join(pgn1, pgn2, res, traits); } + +// Without Traits +template +inline bool join(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + General_polygon_with_holes_2& res) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_join(pgn1, pgn2, res, traits); +} + +//@} + +/// \name Aggregated join() functions. +//@{ + +template +struct map_iterator_to_traits { + typedef typename std::iterator_traits::value_type InputPolygon; + typedef typename Gps_default_traits::Traits Traits; +}; + +// With Traits +template +inline OutputIterator join(InputIterator begin, InputIterator end, + OutputIterator oi, Traits& traits, unsigned int k=5) +{ return r_join(begin, end, oi, traits, k); } + +// Without Traits +// Tag_true => convert to polylines +template +inline OutputIterator join(InputIterator begin, InputIterator end, + OutputIterator oi, Tag_true = Tag_true(), + unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_join(begin, end, oi, k); } + +// Tag_false => do not convert to polylines +template +inline OutputIterator join(InputIterator begin, InputIterator end, + OutputIterator oi, Tag_false, unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_join(begin, end, oi, traits, k); +} + +// General polygons or polygons with holes +template +inline OutputIterator join(InputIterator begin, InputIterator end, + OutputIterator oi, unsigned int k=5, + Disable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_join(begin, end, oi, traits, k); +} + +// Join two ranges of simple polygons and polygons with holes. +// With Traits +template +inline OutputIterator join(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Traits& traits, unsigned int k=5) +{ return r_join(begin1, end1, begin2, end2, oi, traits, k); } + +// Without Traits +// Tag_true => convert to polylines +template +inline OutputIterator join(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Tag_true = Tag_true(), + unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_join(begin1, end1, begin2, end2, oi, k); } + +// Tag_false => do not convert to polylines +template +inline OutputIterator join(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Tag_false, unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_join(begin1, end1, begin2, end2, oi, traits, k); +} + +// General polygons or polygons with holes +template +inline OutputIterator join(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, unsigned int k=5, + Disable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_join(begin1, end1, begin2, end2, oi, traits, k); +} + +//@} + +} //namespace CGAL + +#include + +#endif diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/oriented_side.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/oriented_side.h new file mode 100644 index 00000000000..8b7d1ad23ce --- /dev/null +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/oriented_side.h @@ -0,0 +1,340 @@ +// Copyright (c) 2005 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Baruch Zukerman +// Ron Wein +// Efi Fogel +// Simon Giraudot + +#ifndef CGAL_BOOLEAN_SET_OPERATIONS_2_ORIENTED_SIDE_H +#define CGAL_BOOLEAN_SET_OPERATIONS_2_ORIENTED_SIDE_H + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace CGAL +{ + +/// \name oriented_side() functions. +//@{ + +// Polygon_2, Polygon_2 ======================================================== +// With Traits +template +inline Oriented_side oriented_side(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Traits& traits) +{ return _oriented_side(pgn1, pgn2, traits); } + +// With Tag_true +template +inline Oriented_side oriented_side(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Tag_true = Tag_true()) +{ return _oriented_side(pgn1, pgn2); } + +// With Tag_false +template +inline Oriented_side oriented_side(const Polygon_2& pgn1, + const Polygon_2& pgn2, + Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(pgn1, pgn2, traits); +} + +// Polygon_2, Polygon_with_holes_2 ============================================= +// With Traits +template +inline +Oriented_side oriented_side(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Traits& traits) +{ return _oriented_side(pgn1, pgn2, traits); } + +// With Tag_true +template +inline +Oriented_side oriented_side(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Tag_true = Tag_true()) +{ return _oriented_side(pgn1, pgn2); } + +// With Tag_false +template +inline +Oriented_side oriented_side(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(pgn1, pgn2, traits); +} + +// Polygon_with_holes_2, Polygon_2 ============================================= +// With Traits +template +inline +Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Traits& traits) +{ return _oriented_side(pgn1, pgn2, traits); } + +// With Tag_true +template +inline +Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Tag_true = Tag_true()) +{ return _oriented_side(pgn1, pgn2); } + +// With Tag_false +template +inline +Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(pgn1, pgn2, traits); +} + +// Polygon_with_holes_2, Polygon_with_holes_2 ================================== +// With Traits +template +inline +Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Traits& traits) +{ return _oriented_side(pgn1, pgn2, traits); } + +// With Tag_true +template +inline +Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Tag_true = Tag_true()) +{ return _oriented_side(pgn1, pgn2); } + +// With Tag_false +template +inline +Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(pgn1, pgn2, traits); +} + +// General_polygon_2, General_polygon_2 ======================================== +// With Traits +template +inline Oriented_side oriented_side(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + GpsTraits& traits) +{ return _oriented_side(pgn1, pgn2, traits); } + +// Without Traits +template +inline Oriented_side oriented_side(const General_polygon_2& pgn1, + const General_polygon_2& pgn2) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(pgn1, pgn2, traits); +} + +// General_polygon_2, General_polygon_with_holes_2 ============================= +// With Traits +template +inline Oriented_side oriented_side(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2, + GpsTraits& traits) +{ return _oriented_side(pgn1, pgn2, traits); } + +// Without Traits +template +inline Oriented_side oriented_side(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(pgn1, pgn2, traits); +} + +// General_polygon_with_holes_2, General_polygon_2 ============================= +// With Traits +template +inline Oriented_side oriented_side(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2, + GpsTraits& traits) +{ return _oriented_side(pgn1, pgn2, traits); } + +// Without Traits +template +inline Oriented_side oriented_side(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return oriented_side(pgn1, pgn2, traits); +} + +// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== +// With Traits +template +inline +Oriented_side oriented_side(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + Traits& traits) +{ return _oriented_side(pgn1, pgn2, traits); } + +// Without Traits +template +inline +Oriented_side oriented_side(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2) +{ + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return oriented_side(pgn1, pgn2, traits); +} + +// Point Query: +// Polygon_2 =================================================================== +// With Traits +template +inline Oriented_side oriented_side(const typename Kernel::Point_2& p, + const Polygon_2& pgn, + Traits& traits) +{ return _oriented_side(p, pgn, traits); } + +// With Tag_true +template +inline Oriented_side oriented_side(const typename Kernel::Point_2& p, + const Polygon_2& pgn, + Tag_true = Tag_true()) +{ return _oriented_side(p, pgn); } + +// With Tag_false +template +inline Oriented_side oriented_side(const typename Kernel::Point_2& p, + const Polygon_2& pgn, + Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(p, pgn, traits); +} + +// Polygon_with_holes_2 ======================================================== +// With Traits +template +inline +Oriented_side oriented_side(const typename Kernel::Point_2& p, + const Polygon_with_holes_2& pgn, + Traits& traits) +{ return _oriented_side(p, pgn, traits); } + +// With Tag_true +template +inline +Oriented_side oriented_side(const typename Kernel::Point_2& p, + const Polygon_with_holes_2& pgn, + Tag_true = Tag_true()) +{ return _oriented_side(p, pgn); } + +// With Tag_false +template +inline +Oriented_side oriented_side(const typename Kernel::Point_2& p, + const Polygon_with_holes_2& pgn, + Tag_false) +{ + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(p, pgn, traits); +} + +// General_polygon_2 =========================================================== +// With Traits +template +inline Oriented_side oriented_side(const typename ArrTraits::Point_2& p, + const General_polygon_2& pgn, + GpsTraits& traits) +{ return _oriented_side(p, pgn, traits); } + +// Without Traits +template +inline Oriented_side oriented_side(const typename ArrTraits::Point_2& p, + const General_polygon_2& pgn) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return oriented_side(p, pgn, traits); +} + +// General_polygon_with_holes_2 ================================================ +// With Traits +template +inline +Oriented_side oriented_side(const typename Polygon_::Point_2& p, + const General_polygon_with_holes_2& pgn, + Traits& traits) +{ return _oriented_side(p, pgn, traits); } + +// Without Traits +template +inline +Oriented_side oriented_side(const typename Polygon_::Point_2& p, + const General_polygon_with_holes_2& pgn) +{ + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return oriented_side(p, pgn, traits); +} + +//@} + +} //namespace CGAL + +#include + +#endif diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/symmetric_difference.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/symmetric_difference.h new file mode 100644 index 00000000000..77efe6d93be --- /dev/null +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/symmetric_difference.h @@ -0,0 +1,357 @@ +// Copyright (c) 2005 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Baruch Zukerman +// Ron Wein +// Efi Fogel +// Simon Giraudot + +#ifndef CGAL_BOOLEAN_SET_OPERATIONS_SYMMETRIC_DIFFERENCE_H +#define CGAL_BOOLEAN_SET_OPERATIONS_SYMMETRIC_DIFFERENCE_H + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace CGAL +{ + +/// \name symmetric_difference() functions. +//@{ + +// Polygon_2, Polygon_2 ======================================================== +// With Traits +template +inline OutputIterator +symmetric_difference(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Traits& traits) +{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } + +// With Tag_true +template +inline OutputIterator +symmetric_difference(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Tag_true = Tag_true()) +{ return s_symmetric_difference(pgn1, pgn2, oi); } + +// With Tag_false +template +inline OutputIterator +symmetric_difference(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_symmetric_difference(pgn1, pgn2, oi, traits); +} + +// Polygon_2, Polygon_with_holes_2 ============================================= +// With Traits +template +inline OutputIterator +symmetric_difference(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Traits& traits) +{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } + +// With Tag_true +template +inline OutputIterator +symmetric_difference(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Tag_true = Tag_true()) +{ return s_symmetric_difference(pgn1, pgn2, oi); } + +// With Tag_false +template +inline OutputIterator +symmetric_difference(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_symmetric_difference(pgn1, pgn2, oi, traits); +} + +// Polygon_with_holes_2, Polygon_2 ============================================= +// With Traits +template +inline OutputIterator +symmetric_difference(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Traits& traits) +{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } + +// With Tag_true +template +inline OutputIterator +symmetric_difference(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Tag_true = Tag_true()) +{ return s_symmetric_difference(pgn1, pgn2, oi); } + +// With Tag_false +template +inline OutputIterator +symmetric_difference(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_symmetric_difference(pgn1, pgn2, oi, traits); +} + +// Polygon_with_holes_2, Polygon_with_holes_2 ================================== +// With Traits +template +inline OutputIterator +symmetric_difference(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Traits& traits) +{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } + +// With Tag_true +template +inline OutputIterator +symmetric_difference(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Tag_true = Tag_true()) +{ return s_symmetric_difference(pgn1, pgn2, oi); } + +// With Tag_false +template +inline OutputIterator +symmetric_difference(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, Tag_false) +{ + // Use the first polygon to determine the (default) traits + typedef Polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_symmetric_difference(pgn1, pgn2, oi, traits); +} + +// General_polygon_2, General_polygon_2 ======================================== +// With Traits +template +inline OutputIterator +symmetric_difference(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi, Traits& traits) +{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } + +template +inline OutputIterator +symmetric_difference(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_symmetric_difference(pgn1, pgn2, oi, traits); +} + +// General_polygon_2, General_polygon_with_holes_2 ============================= +// With Traits +template +inline OutputIterator +symmetric_difference(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2, + OutputIterator oi, Traits& traits) +{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } + +// Without Traits +template +inline OutputIterator +symmetric_difference(const General_polygon_2& pgn1, + const General_polygon_with_holes_2 + >& pgn2, + OutputIterator oi) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typename Gps_default_traits::Traits traits; + return s_symmetric_difference(pgn1, pgn2, oi, traits); +} + +// General_polygon_with_holes_2, General_polygon_2 ============================= +// With Traits +template +inline OutputIterator +symmetric_difference(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi, Traits& traits) +{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } + +// Without Traits +template +inline OutputIterator +symmetric_difference(const General_polygon_with_holes_2 + >& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi) +{ + // Use the first polygon to determine the (default) traits + typedef General_polygon_2 Polygon; + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_symmetric_difference(pgn1, pgn2, oi, traits); +} + +// General_polygon_with_holes_2, General_polygon_with_holes_2 ================== +// With Traits +template +inline OutputIterator +symmetric_difference(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + OutputIterator oi, Traits& traits) +{ return s_symmetric_difference(pgn1, pgn2, oi, traits); } + +// Without Traits +template +inline OutputIterator +symmetric_difference(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + OutputIterator oi) +{ + typedef General_polygon_with_holes_2 Polygon_with_holes; + typename Gps_default_traits::Traits traits; + return s_symmetric_difference(pgn1, pgn2, oi, traits); +} + +//@} + +/// \name Aggregated symmetric_difference() functions. +//@{ + +// With Traits +template +inline +OutputIterator symmetric_difference(InputIterator begin, InputIterator end, + OutputIterator oi, Traits& traits, + unsigned int k=5) +{ return r_symmetric_difference(begin, end, oi, traits, k); } + +// Without Traits +// Tag_true => convert to polylines +template +inline OutputIterator +symmetric_difference(InputIterator begin, InputIterator end, + OutputIterator oi, Tag_true = Tag_true(), unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_symmetric_difference(begin, end, oi, k); } + +// Tag_false => do not convert to polylines +template +inline OutputIterator +symmetric_difference(InputIterator begin, InputIterator end, + OutputIterator oi, Tag_false, unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_symmetric_difference(begin, end, oi, traits, k); +} + +// General polygons or polygons with holes +template +inline OutputIterator +symmetric_difference(InputIterator begin, InputIterator end, + OutputIterator oi, unsigned int k=5, + Disable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_symmetric_difference(begin, end, oi, traits, k); +} + +// Xor two ranges of simple polygons and polygons with holes. +// With Traits +template +inline +OutputIterator symmetric_difference(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Traits& traits, + unsigned int k=5) +{ return r_symmetric_difference(begin1, end1, begin2, end2, oi, traits, k); } + +// Without Traits +// Tag_true => convert to polylines +template +inline OutputIterator +symmetric_difference(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Tag_true = Tag_true(), unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ return r_symmetric_difference(begin1, end1, begin2, end2, oi, k); } + +// Tag_false => do not convert to polylines +template +inline OutputIterator +symmetric_difference(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, Tag_false, unsigned int k=5, + Enable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_symmetric_difference(begin1, end1, begin2, end2, oi, traits, k); +} + +// General polygons or polygons with holes +template +inline OutputIterator +symmetric_difference(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, unsigned int k=5, + Disable_if_Polygon_2_iterator* = 0) +{ + typename map_iterator_to_traits::Traits traits; + return r_symmetric_difference(begin1, end1, begin2, end2, oi, traits, k); +} + +//@} + +} //namespace CGAL + +#include + +#endif