From 2cd13748c1570a28bebde190e071165ef9f5b832 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Thu, 4 Mar 2021 01:08:37 +0200 Subject: [PATCH] Fixed the text and added missing intersection functions --- .../CGAL/intersection.h | 220 +++++++++++++++++- .../doc/Boolean_set_operations_2/CGAL/join.h | 12 +- .../CGAL/symmetric_difference.h | 12 +- 3 files changed, 228 insertions(+), 16 deletions(-) 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/intersection.h index c0ed236181d..8acf2a666c5 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/intersection.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/intersection.h @@ -311,7 +311,7 @@ OutputIterator intersection(const General_polygon_with_holes_2& pgn1, OutputIterator oi); -/*! Given a range of polygons (resp. general polygons) or a range of general +/*! Given a range of polygons (resp. general polygons) or a range of * polygons with holes (resp. general polygons with holes) computes the * intersection of all polygons in the range and inserts the resulting polygons * with holes (resp. general polygons with holes) into a container via an output @@ -331,7 +331,7 @@ template OutputIterator intersection(InputIterator begin, InputIterator end, OutputIterator oi); -/*! Given a range of polygons (resp. general polygons) or a range of general +/*! Given a range of polygons (resp. general polygons) or a range of * polygons with holes (resp. general polygons with holes) computes the * intersection of all polygons in the range and inserts the resulting polygons * with holes (resp. general polygons with holes) into a container via an output @@ -363,7 +363,7 @@ OutputIterator intersection(InputIterator begin, InputIterator end, OutputIterator oi, UsePolylines = Tag_true()); -/*! Given a range of polygons (resp. general polygons) and a range of general +/*! Given a range of polygons (resp. general polygons) and a range of * polygons with holes (resp. general polygons with holes) computes the * intersection of all polygons in the two ranges and inserts the resulting * polygons with holes (resp. general polygons with holes) into a container via @@ -387,7 +387,7 @@ OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi); -/*! Given a range of polygons (resp. general polygons) and a range of general +/*! Given a range of polygons (resp. general polygons) and a range of * polygons with holes (resp. general polygons with holes) computes the * intersection of all polygons in the two ranges and inserts the resulting * polygons with holes (resp. general polygons with holes) into a container via @@ -422,6 +422,218 @@ OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, OutputIterator oi, UsePolylines = Tag_true()); +//////// With Traits + +/*! computes the intersection between two polygons and inserts the + * resulting polygons with holes into a container via an output iterator. + * \param pgn1 the 1st input polygon. + * \param pgn2 the 2nd input polygon. + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `Polygon_with_holes_2`. + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator intersection(const Polygon_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, + const GpsTraits& traits); + +/*! computes the intersection between two polygons and inserts the + * resulting polygons with holes into a container via an output iterator. + * \param pgn1 the 1st input polygon. + * \param pgn2 the 2nd input polygon. + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `Polygon_with_holes_2`. + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator +intersection(const Polygon_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, + const GpsTraits& traits); + +/*! computes the intersection between two polygons and inserts the + * resulting polygons with holes into a container via an output iterator. + * \param pgn1 the 1st input polygon. + * \param pgn2 the 2nd input polygon. + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `Polygon_with_holes_2`. + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator +intersection(const Polygon_with_holes_2& pgn1, + const Polygon_2& pgn2, + OutputIterator oi, + const GpsTraits& traits); + + +/*! computes the intersection between two polygons with holes and + * inserts the resulting polygons with holes into a container via an output + * iterator. + * \param pgn1 the 1st input polygon. + * \param pgn2 the 2nd input polygon. + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `Polygon_with_holes_2`. + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator +intersection(const Polygon_with_holes_2& pgn1, + const Polygon_with_holes_2& pgn2, + OutputIterator oi, + const GpsTraits& traits); + +/*! computes the intersection between two general polygons and inserts + * the resulting general polygons with holes into a container via an output + * iterator. + * \param pgn1 the 1st input polygon. + * \param pgn2 the 2nd input polygon. + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `General_polygon_with_holes_2>`. + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre `%ArrTraits` must be a model of the concept + * `ArrangementDirectionalXMonotoneTraits_2`. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator intersection(const General_polygon_2& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi, + const GpsTraits& traits); + + +/*! computes the intersection between two general polygons and inserts + * the resulting general polygons with holes into a container via an output + * iterator. + * \param pgn1 the 1st input polygon. + * \param pgn2 the 2nd input polygon. + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `General_polygon_with_holes_2>`. + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre `%ArrTraits` must be a model of the concept + * `ArrangementDirectionalXMonotoneTraits_2`. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator +intersection(const General_polygon_with_holes_2>& pgn1, + const General_polygon_2& pgn2, + OutputIterator oi, + const GpsTraits& traits); + + +/*! computes the intersection between two general polygons and inserts + * the resulting general polygons with holes into a container via an output + * iterator. + * \param pgn1 the 1st input polygon. + * \param pgn2 the 2nd input polygon. + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `General_polygon_with_holes_2>`. + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre `%ArrTraits` must be a model of the concept + * `ArrangementDirectionalXMonotoneTraits_2`. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator +intersection(const General_polygon_2& pgn1, + const General_polygon_with_holes_2>& pgn2, + OutputIterator oi, + const GpsTraits& traits); + +/*! computes the intersection between two general polygons and inserts + * the resulting general polygons with holes into a container via an output + * iterator. + * \param pgn1 the 1st input polygon. + * \param pgn2 the 2nd input polygon. + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `General_polygon_with_holes_2`. + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator +intersection(const General_polygon_with_holes_2& pgn1, + const General_polygon_with_holes_2& pgn2, + OutputIterator oi, + const GpsTraits& traits); + +/*! Given a range of polygons (resp. general polygons) or a range of + * polygons with holes (resp. general polygons with holes) computes the + * intersection of all polygons in the range and inserts the resulting + * polygons with holes (resp. general polygons with holes) into a container via + * an output iterator. + * \param begin the first iterator of the input range. Its value type is + * either `Polygon_2` (resp. `General_polygon_2`) or + * `Polygon_with_holes_2` (resp. `General_polygon_with_holes_2`). + * \param end the past-the-end iterator of the input range. Its value type is + * either `Polygon_2` (resp. `General_polygon_2`) or + * `Polygon_with_holes_2` (resp. `General_polygon_with_holes_2`). + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `Polygon_with_holes_2` (resp. `General_polygons_with_holes_2`). + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator intersection(InputIterator begin, InputIterator end, + OutputIterator oi, + const GpsTraits& traits); + +/*! Given a range of polygons (resp. general polygons) and a range of + * polygons with holes (resp. general polygons with holes) computes the + * intersection between all polygons in the two ranges and inserts the + * resulting polygons with holes (resp. general polygons with holes) into a + * container via an output iterator. + * \param begin1 the first iterator of the 1st input range. Its value type is + * `Polygon_2` (resp. `General_polygon_2`). + * \param end1 the past-the-end iterator of the 1st input range. Its value + * type is `Polygon_2` (resp. `General_polygon_2`). + * \param begin2 the first iterator of the 2nd input range. Its value type + * is `Polygon_with_holes_2` (resp. `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` (resp. `General_polygon_with_holes_2`). + * \param oi the output iterator for the result. + * Its dereference type must be convertible to + * `Polygon_with_holes_2` (resp. `General_polygons_with_holes_2`). + * \param traits a traits object. + * \return the past-the-end iterator of the output container. + * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. + */ +template +OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, + InputIterator2 begin2, InputIterator2 end2, + OutputIterator oi, + const GpsTraits& traits); + /// @} } /* namespace CGAL */ 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/join.h index 8654251f517..88c3fc0e2de 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/join.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/join.h @@ -271,7 +271,7 @@ bool join(const General_polygon_with_holes_2& pgn1, const General_polygon_with_holes_2& pgn2, General_polygon_with_holes_2& res); -/*! Given a range of polygons (resp. general polygons) or a range of general +/*! Given a range of polygons (resp. general polygons) or a range of * polygons with holes (resp. general polygons with holes) computes the * union of all polygons in the range and inserts the resulting polygons * with holes (resp. general polygons with holes) into a container via an output @@ -291,7 +291,7 @@ template OutputIterator join(InputIterator begin, InputIterator end, OutputIterator oi); -/*! Given a range of polygons (resp. general polygons) or a range of general +/*! Given a range of polygons (resp. general polygons) or a range of * polygons with holes (resp. general polygons with holes) computes the * union of all polygons in the range and inserts the resulting polygons * with holes (resp. general polygons with holes) into a container via an output @@ -323,7 +323,7 @@ OutputIterator join(InputIterator begin, InputIterator end, OutputIterator oi, UsePolylines = Tag_true()); -/*! Given a range of polygons (resp. general polygons) and a range of general +/*! Given a range of polygons (resp. general polygons) and a range of * polygons with holes (resp. general polygons with holes) computes the * union of all polygons in the two ranges and inserts the resulting * polygons with holes (resp. general polygons with holes) into a container via @@ -475,7 +475,7 @@ bool join(const General_polygon_with_holes_2& pgn1, General_polygon_with_holes_2& res, const GpsTraits& traits); -/*! Given a range of polygons (resp. general polygons) or a range of general +/*! Given a range of polygons (resp. general polygons) or a range of * polygons with holes (resp. general polygons with holes) computes the * union of all polygons in the range and inserts the resulting polygons * with holes (resp. general polygons with holes) into a container via an output @@ -498,7 +498,7 @@ OutputIterator join(InputIterator begin, InputIterator end, OutputIterator oi, const GpsTraits& traits); -/*! Given a range of polygons (resp. general polygons) and a range of general +/*! Given a range of polygons (resp. general polygons) and a range of * polygons with holes (resp. general polygons with holes) computes the * union of all polygons in the two ranges and inserts the resulting * polygons with holes (resp. general polygons with holes) into a container via @@ -525,7 +525,7 @@ OutputIterator join(InputIterator1 begin1, InputIterator1 end1, OutputIterator oi, const GpsTraits& traits); -/*! Given a range of polygons (resp. general polygons) and a range of general +/*! Given a range of polygons (resp. general polygons) and a range of * polygons with holes (resp. general polygons with holes) computes the * union of all polygons in the two ranges and inserts the resulting * polygons with holes (resp. general polygons with holes) into a container via 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/symmetric_difference.h index 63eee4e70c2..a37551e3e36 100644 --- 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/symmetric_difference.h @@ -328,7 +328,7 @@ symmetric_difference(const General_polygon_with_holes_2& pgn1, const General_polygon_with_holes_2& pgn2, OutputIterator oi); -/*! Given a range of polygons (resp. general polygons) or a range of general +/*! Given a range of polygons (resp. general polygons) or a range of * polygons with holes (resp. general polygons with holes) computes the * symmetric difference of all polygons in the range and inserts the resulting * polygons with holes (resp. general polygons with holes) into a container via @@ -349,7 +349,7 @@ template OutputIterator symmetric_difference(InputIterator begin, InputIterator end, OutputIterator oi); -/*! Given a range of polygons (resp. general polygons) or a range of general +/*! Given a range of polygons (resp. general polygons) or a range of * polygons with holes (resp. general polygons with holes) computes the * symmetric difference of all polygons in the range and inserts the resulting * polygons with holes (resp. general polygons with holes) into a container via @@ -382,7 +382,7 @@ OutputIterator symmetric_difference(InputIterator begin, InputIterator end, OutputIterator oi, UsePolylines = Tag_true()); -/*! Given a range of polygons (resp. general polygons) and a range of general +/*! Given a range of polygons (resp. general polygons) and a range of * polygons with holes (resp. general polygons with holes) computes the * symmetric difference between all polygons in the two ranges and inserts the * resulting polygons with holes (resp. general polygons with holes) into a @@ -408,7 +408,7 @@ OutputIterator symmetric_difference(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi); -/*! Given a range of polygons (resp. general polygons) and a range of general +/*! Given a range of polygons (resp. general polygons) and a range of * polygons with holes (resp. general polygons with holes) computes the * symmetric difference between all polygons in the two ranges and inserts the * resulting polygons with holes (resp. general polygons with holes) into a @@ -608,7 +608,7 @@ symmetric_difference(const General_polygon_with_holes_2& pgn1, OutputIterator oi, const GpsTraits& traits); -/*! Given a range of polygons (resp. general polygons) or a range of general +/*! Given a range of polygons (resp. general polygons) or a range of * polygons with holes (resp. general polygons with holes) computes the * symmetric difference of all polygons in the range and inserts the resulting * polygons with holes (resp. general polygons with holes) into a container via @@ -632,7 +632,7 @@ OutputIterator symmetric_difference(InputIterator begin, InputIterator end, OutputIterator oi, const GpsTraits& traits); -/*! Given a range of polygons (resp. general polygons) and a range of general +/*! Given a range of polygons (resp. general polygons) and a range of * polygons with holes (resp. general polygons with holes) computes the * symmetric difference between all polygons in the two ranges and inserts the * resulting polygons with holes (resp. general polygons with holes) into a