From a366725c852258ffee98d3fd676aa263911d9e04 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 27 Aug 2025 14:39:24 +0300 Subject: [PATCH] Enhanced and removed the UsePolylines tag from do_intersect() --- .../CGAL/Boolean_set_operations_2.h | 223 ++++-------------- 1 file changed, 49 insertions(+), 174 deletions(-) diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h index 4fd5c2c9e38..2ba7708f501 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h @@ -19,6 +19,10 @@ namespace CGAL { * 2.`void complement(const Type1& pgn, Type2& res, const GpsTraits& traits);` * * + * \tparam Kernel a model of the concept `PolygonTraits_2`. + * \tparam Container a model of the concept `Container`; defaults to `std::vector. + * \tparam ArrTraits a model of the concept `AosDirectionalXMonotoneTraits_2`. + * \tparam GpsTraits a model of the concept `GeneralPolygonSetTraits_2`, which must be convertible to `ArrTraits`. * \tparam UsePolylines determines whether the boundary of the input polygon is * treated as a cyclic sequence of single (\f$x\f$-monotone) segments or as a * cyclic sequence of (\f$x\f$-monotone) polylines. If substituted with @@ -28,7 +32,7 @@ namespace CGAL { * to a standard polygon. If substituted with `CGAL::Tag_false`, the input * polygon is used as is. Refer to \ref bso_ssectraits_sel for more information. * - * - The types `Type` and `Type2` of the parameters must be convertible to the + * - The types `Type1` and `Type2` of the parameters must be convertible to the * types specified in a row in the table below, respectively. * - The types that apply to signature (1.1.) above are restricted to those * listed in rows 1 and 2 in the table below. @@ -54,6 +58,8 @@ namespace CGAL { * \sa \link boolean_join `CGAL::join()` \endlink * \sa \link boolean_difference `CGAL::difference()` \endlink * \sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink + * \sa Polygon_2 + * \sa Polygon_with_holes_2 */ /// @{ @@ -224,6 +230,10 @@ namespace CGAL { * 2.`OutputIterator difference(const Type1& pgn1, const Type2& pgn2, OutputIterator oi, const GpsTraits& traits);` * * + * \tparam Kernel a model of the concept `PolygonTraits_2` + * \tparam Container a model of the concept `Container`; defaults to `std::vector. + * \tparam ArrTraits a model of the concept `AosDirectionalXMonotoneTraits_2` + * \tparam GpsTraits a model of the concept `GeneralPolygonSetTraits_2`, which must be convertible to `ArrTraits`. * \tparam UsePolylines determines whether the boundaries of the input polygons * are treated as cyclic sequences of single (\f$x\f$-monotone) segments or as * cyclic sequences of (\f$x\f$-monotone) polylines. If substituted with @@ -264,6 +274,8 @@ namespace CGAL { * \sa \link boolean_intersection `CGAL::intersection()` \endlink * \sa \link boolean_join `CGAL::join()` \endlink * \sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink + * \sa Polygon_2 + * \sa Polygon_with_holes_2 */ /// @{ @@ -660,48 +672,22 @@ namespace CGAL { * A function template in this group that accepts two input polygons has one of * the following signatures: * - * - * - * + * + * *
1.1.`bool do_intersect(const Type1& pgn1, const Type2& pgn2, UsePolylines = Tag_true());`
1.2.`bool do_intersect(const Type1& pgn1, const Type2& pgn2);`
2.`bool do_intersect(const Type1& pgn1, const Type2& pgn2, const GpsTraits& traits);`
1.`bool do_intersect(const Type1& pgn1, const Type2& pgn2);`
2.`bool do_intersect(const Type1& pgn1, const Type2& pgn2, const GpsTraits& traits);`
* * There are also function templates that accept one or two ranges of input polygons: * - * - * - * - * - * - * + * + * + * + * *
3.1.`bool do_intersect(InputIterator begin, InputIterator end, UsePolylines = Tag_true());`
3.2.`bool do_intersect(InputIterator begin, InputIterator end);`
4.`bool do_intersect(InputIterator begin, InputIterator end, const GpsTraits& traits);`
5.1.`bool do_intersect(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, UsePolylines = Tag_true());`
5.2.`bool do_intersect(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2);`
6.`bool do_intersect(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, const GpsTraits& traits);`
3.`bool do_intersect(InputIterator begin, InputIterator end);`
4.`bool do_intersect(InputIterator begin, InputIterator end, const GpsTraits& traits);`
5.`bool do_intersect(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2);`
6.`bool do_intersect(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, const GpsTraits& traits);`
* - * \tparam UsePolylines determines whether the boundary of the input polygons - * are treated as a cyclic sequence of single (\f$x\f$-monotone) segments or as - * a cyclic sequence of (\f$x\f$-monotone) polylines. If substituted with - * `CGAL::Tag_true`, which is the default, the input polygons are converted to - * general polygons bounded by polylines before the operation is actually - * performed. If substituted with `CGAL::Tag_false`, the input polygons are used - * as is. Refer to \ref bso_ssectraits_sel for more information. - * - * - The types `Type1` and `Type2` of the parameters of - * `InputIterator1::value_type` and `InputIterator2::value_type` must be - * convertible to the types specified in a row in the table below, - * respectively. - * - * - The types that apply to signatures (1.1.) and (5.1.) above - * are restricted to those listed in rows 1–4 in the table - * below. - * - * - The types that apply to signatures (1.2.) and (5.2.) above - * are restricted to those listed in rows 5–8 in the table - * below. - * - * - The type of `InputIterator::value_type` in (3.1.) above - * must be convertible to either `Polygon_2` or `Polygon_with_holes_2`. - * - * - The type of `InputIterator::value_type` in (3.2.) above must be - * convertible to either `General_polygon_2` or - * `General_polygon_with_holes_2`. + * \tparam Kernel a model of the concept `PolygonTraits_2`. + * \tparam Container a model of the concept `Container`; defaults to `std::vector. + * \tparam ArrTraits a model of the concept `AosDirectionalXMonotoneTraits_2`. + * \tparam GpsTraits a model of the concept `GeneralPolygonSetTraits_2`, which must be convertible to `ArrTraits`. * *
* @@ -728,6 +714,8 @@ namespace CGAL { * \sa \link boolean_join `CGAL::join()` \endlink * \sa \link boolean_difference `CGAL::difference()` \endlink * \sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink + * \sa Polygon_2 + * \sa Polygon_with_holes_2 */ /// @{ @@ -744,25 +732,6 @@ template bool do_intersect(const Polygon_2& pgn1, const Polygon_2& pgn2); -/*! determines whether two polygons intersect in their interior. - * \tparam UsePolylines determines whether the boundaries of `pgn1` and `pgn2` - * are treated as cyclic sequences of single (\f$x\f$-monotone) segments - * or as a cyclic sequences of (\f$x\f$-monotone) polylines. If - * substituted with `CGAL::Tag_true`, which is the default, `pgn1` and - * `pgn2` are converted to general polygons, bounded by polylines - * before the operation is actually performed. If substituted with - * `CGAL::Tag_false`, `pgn1` and `pgn2` are used as is. Refer to \ref - * bso_ssectraits_sel for more information. - * \param pgn1 the 1st input polygon. - * \param pgn2 the 2nd input polygon. - * \return `true` if `pgn1` and `pgn2` intersect in their interior and `false` - * otherwise. - */ -template -bool do_intersect(const Polygon_2& pgn1, - const Polygon_2& pgn2, - UsePolylines = Tag_true()); - /*! determines whether two polygons intersect in their interior. * \param pgn1 the 1st input polygon. * \param pgn2 the 2nd input polygon. @@ -773,26 +742,6 @@ template bool do_intersect(const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2); -/*! determines whether two polygons intersect in their interior. - * \tparam UsePolylines determines whether the boundaries of `pgn1` and `pgn2` - * are treated as cyclic sequences of single (\f$x\f$-monotone) segments - * or as a cyclic sequences of (\f$x\f$-monotone) polylines. If - * substituted with `CGAL::Tag_true`, which is the default, `pgn1` and - * `pgn2` are converted to a general polygon and a general polygon - * with holes, respectively, bounded by polylines before the operation - * is actually performed. If substituted with `CGAL::Tag_false`, `pgn1` - * and `pgn2` are used as is. Refer to \ref bso_ssectraits_sel for more - * information. - * \param pgn1 the 1st input polygon. - * \param pgn2 the 2nd input polygon. - * \return `true` if `pgn1` and `pgn2` intersect in their interior and `false` - * otherwise. - */ -template -bool do_intersect(const Polygon_2& pgn1, - const Polygon_with_holes_2& pgn2, - UsePolylines = Tag_true()); - /*! determines whether two polygons intersect in their interior. * \param pgn1 the 1st input polygon. * \param pgn2 the 2nd input polygon. @@ -803,26 +752,6 @@ template bool do_intersect(const Polygon_with_holes_2& pgn1, const Polygon_2& pgn2); -/*! determines whether two polygons intersect in their interior. - * \tparam UsePolylines determines whether the boundaries of `pgn1` and `pgn2` - * are treated as cyclic sequences of single (\f$x\f$-monotone) segments - * or as a cyclic sequences of (\f$x\f$-monotone) polylines. If - * substituted with `CGAL::Tag_true`, which is the default, `pgn1` and - * `pgn2` are converted to a general polygon with holes and a general - * polygon, respectively, bounded by polylines before the operation - * is actually performed. If substituted with `CGAL::Tag_false`, `pgn1` - * and `pgn2` are used as is. Refer to \ref bso_ssectraits_sel for more - * information. - * \param pgn1 the 1st input polygon. - * \param pgn2 the 2nd input polygon. - * \return `true` if `pgn1` and `pgn2` intersect in their interior and `false` - * otherwise. - */ -template -bool do_intersect(const Polygon_with_holes_2& pgn1, - const Polygon_2& pgn2, - UsePolylines = Tag_true()); - /*! determines whether two polygons with holes intersect in their interior. * \param pgn1 the 1st input polygon. * \param pgn2 the 2nd input polygon. @@ -833,25 +762,6 @@ template bool do_intersect(const Polygon_with_holes_2& pgn1, const Polygon_with_holes_2& pgn2); -/*! determines whether two polygons with holes intersect in their interior. - * \tparam UsePolylines determines whether the boundaries of `pgn1` and `pgn2` - * are treated as cyclic sequences of single (\f$x\f$-monotone) segments - * or as a cyclic sequences of (\f$x\f$-monotone) polylines. If - * substituted with `CGAL::Tag_true`, which is the default, `pgn1` and - * `pgn2` are converted to general polygon with holes , bounded by - * polylines before the operation is actually performed. If substituted - * with `CGAL::Tag_false`, `pgn1` and `pgn2` are used as is. Refer to - * \ref bso_ssectraits_sel for more information. - * \param pgn1 the 1st input polygon. - * \param pgn2 the 2nd input polygon. - * \return `true` if `pgn1` and `pgn2` intersect in their interior and `false` - * otherwise. - */ -template -bool do_intersect(const Polygon_with_holes_2& pgn1, - const Polygon_with_holes_2& pgn2, - UsePolylines = Tag_true()); - /*! determines whether two general polygons intersect in their interior. * \param pgn1 the 1st input polygon. * \param pgn2 the 2nd input polygon. @@ -917,33 +827,6 @@ bool do_intersect(const General_polygon_with_holes_2& pgn1, template bool do_intersect(InputIterator begin, InputIterator end); -/*! Given a range of polygons or a range of polygons with holes (respectively a range - * of general polygons or a range of general polygons with holes) determines - * whether the open polygons (respectively general polygons) in the range have a common - * point. - * \tparam UsePolylines determines whether the boundaries of the polygons in the - * input range are treated as cyclic sequences of single - * (\f$x\f$-monotone) segments or as a cyclic sequences of - * (\f$x\f$-monotone) polylines. If substituted with `CGAL::Tag_true`, - * which is the default, the input polygons are converted to general - * polygon with holes , bounded by polylines before the operation is - * actually performed. If substituted with `CGAL::Tag_false`, `pgn1` and - * `pgn2` are used as is. Refer to \ref bso_ssectraits_sel for more - * information. - * \param begin the first iterator of the input range. Its value type is - * either `Polygon_2` (respectively `General_polygon_2`) or - * `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`). - * \param end the past-the-end iterator of the input range. Its value type is - * either `Polygon_2` (respectively `General_polygon_2`) or - * `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`). - * \return `true` if the pairwise intersections of all open polygons or polygons - * with holes (respectively general polygons or general polygons with holes) in - * the range [*begin,*end) overlap, and `false` otherwise. - */ -template -bool do_intersect(InputIterator begin, InputIterator end, - UsePolylines = Tag_true()); - /*! Given a range of polygons (respectively general polygons) and a range of polygons * with holes (respectively general polygons with holes) determines whether the open * polygons (respectively general polygons) in the two ranges have a common point. @@ -964,37 +847,6 @@ template bool do_intersect(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2); -/*! Given a range of polygons (respectively general polygons) and a range of polygons - * with holes (respectively general polygons with holes) determines whether the open - * polygons (respectively general polygons) in the two ranges have a common point. - * \tparam UsePolylines determines whether the boundaries of the polygons in the - * input ranges are treated as cyclic sequences of single - * (\f$x\f$-monotone) segments or as a cyclic sequences of - * (\f$x\f$-monotone) polylines. If substituted with `CGAL::Tag_true`, - * which is the default, the input polygons are converted to general - * polygon with holes , bounded by polylines before the operation is - * actually performed. If substituted with `CGAL::Tag_false`, `pgn1` and - * `pgn2` are used as is. Refer to \ref bso_ssectraits_sel for more - * information. - * \param begin1 the first iterator of the 1st input range. Its value type is - * `Polygon_2` (respectively `General_polygon_2`). - * \param end1 the past-the-end iterator of the 1st input range. Its value - * type is `Polygon_2` (respectively `General_polygon_2`). - * \param begin2 the first iterator of the 2nd input range. Its value type - * is `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`). - * \param end2 the past-the-end iterator of the 2nd input range. Its value - * type is `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`). - * \return `true` if the pairwise intersections of all open polygons (respectively - * general polygons) and polygons with holes (respectively general polygons with - * holes) in the ranges [*begin1,*end1) and [*begin2,*end2), - * respectively, overlap, and `false` otherwise. - */ -template -bool do_intersect(InputIterator1 begin1, InputIterator1 end1, - InputIterator2 begin2, InputIterator2 end2, - UsePolylines = Tag_true()); - //////// With Traits /*! determines whether two polygons intersect in their interior. @@ -1021,7 +873,6 @@ bool do_intersect(const Polygon_2& pgn1, template bool do_intersect(const Polygon_2& pgn1, const Polygon_with_holes_2& pgn2, - const GpsTraits& traits, const GpsTraits& traits); /*! determines whether two polygons intersect in their interior. @@ -1186,6 +1037,10 @@ namespace CGAL { * *
6.`OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, const GpsTraits& traits);`
* + * \tparam Kernel a model of the concept `PolygonTraits_2`. + * \tparam Container a model of the concept `Container`; defaults to `std::vector. + * \tparam ArrTraits a model of the concept `AosDirectionalXMonotoneTraits_2`. + * \tparam GpsTraits a model of the concept `GeneralPolygonSetTraits_2`, which must be convertible to `ArrTraits`. * \tparam UsePolylines determines whether the boundaries of the input polygons * are treated as cyclic sequences of single (\f$x\f$-monotone) segments or as * cyclic sequences of (\f$x\f$-monotone) polylines. If substituted with @@ -1244,6 +1099,8 @@ namespace CGAL { * \sa \link boolean_join `CGAL::join()` \endlink * \sa \link boolean_difference `CGAL::difference()` \endlink * \sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink + * \sa Polygon_2 + * \sa Polygon_with_holes_2 */ /// @{ @@ -1825,6 +1682,10 @@ namespace CGAL { * 6.`OutputIterator join(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, const GpsTraits& traits);` * * + * \tparam Kernel a model of the concept `PolygonTraits_2`. + * \tparam Container a model of the concept `Container`; defaults to `std::vector. + * \tparam ArrTraits a model of the concept `AosDirectionalXMonotoneTraits_2`. + * \tparam GpsTraits a model of the concept `GeneralPolygonSetTraits_2`, which must be convertible to `ArrTraits`. * \tparam UsePolylines determines whether the boundaries of the input polygons * are treated as cyclic sequences of single (\f$x\f$-monotone) segments or as * cyclic sequences of (\f$x\f$-monotone) polylines. If substituted with @@ -1882,6 +1743,8 @@ namespace CGAL { * \sa \link boolean_intersection `CGAL::intersection()` \endlink * \sa \link boolean_difference `CGAL::difference()` \endlink * \sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink + * \sa Polygon_2 + * \sa Polygon_with_holes_2 */ /// @{ @@ -2407,6 +2270,10 @@ namespace CGAL { * 4.`Oriented_side oriented_side(const Point_2& p, const Type& pgn, const GpsTraits& traits);` * * + * \tparam Kernel a model of the concept `PolygonTraits_2`. + * \tparam Container a model of the concept `Container`; defaults to `std::vector. + * \tparam ArrTraits a model of the concept `AosDirectionalXMonotoneTraits_2`. + * \tparam GpsTraits a model of the concept `GeneralPolygonSetTraits_2`, which must be convertible to `ArrTraits`. * \tparam UsePolylines determines whether the boundaries of the input polygons * are treated as cyclic sequences of single (\f$x\f$-monotone) segments or as * cyclic sequences of (\f$x\f$-monotone) polylines. If substituted with @@ -2446,6 +2313,8 @@ namespace CGAL { * \param traits an optional traits object. * * \sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink + * \sa Polygon_2 + * \sa Polygon_with_holes_2 */ /// @{ @@ -2823,6 +2692,10 @@ namespace CGAL { * 6.`OutputIterator symmetric_difference(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, const GpsTraits& traits);` * * + * \tparam Kernel a model of the concept `PolygonTraits_2`. + * \tparam Container a model of the concept `Container`; defaults to `std::vector. + * \tparam ArrTraits a model of the concept `AosDirectionalXMonotoneTraits_2`. + * \tparam GpsTraits a model of the concept `GeneralPolygonSetTraits_2`, which must be convertible to `ArrTraits`. * \tparam UsePolylines determines whether the boundaries of the input polygons * are treated as cyclic sequences of single (\f$x\f$-monotone) segments or as * cyclic sequences of (\f$x\f$-monotone) polylines. If substituted with @@ -2879,6 +2752,8 @@ namespace CGAL { * \sa \link boolean_intersection `CGAL::intersection()` \endlink * \sa \link boolean_join `CGAL::join()` \endlink * \sa \link boolean_difference `CGAL::difference()` \endlink + * \sa Polygon_2 + * \sa Polygon_with_holes_2 */ /// @{