From da2e1357e131745b2e222d04f0e57307ae994f70 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Thu, 23 Oct 2014 12:19:36 +0300 Subject: [PATCH] added default traits parameter --- .../Minkowski_sum_2/CGAL/minkowski_sum_2.h | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/Minkowski_sum_2/doc/Minkowski_sum_2/CGAL/minkowski_sum_2.h b/Minkowski_sum_2/doc/Minkowski_sum_2/CGAL/minkowski_sum_2.h index 375af31926f..647ce7cee78 100644 --- a/Minkowski_sum_2/doc/Minkowski_sum_2/CGAL/minkowski_sum_2.h +++ b/Minkowski_sum_2/doc/Minkowski_sum_2/CGAL/minkowski_sum_2.h @@ -53,32 +53,13 @@ Note that as the input polygons may not be convex, their Minkowski sum may not be a simple polygon. The result is therefore represented as a polygon with holes. -\pre Both `P` and `Q` are simple polygons. -*/ -template -Polygon_with_holes_2 -minkowski_sum_full_convolution_2 (const Polygon_2& P, - const Polygon_2& Q); - -/*! -\ingroup PkgMinkowskiSum2 - -Computes the Minkowski sum \f$ P \oplus Q\f$ of the two given polygons. -The function computes the (full) convolution cycles of the two polygons and -extract the regions having positive winding number with respect to these -cycles. This method work very efficiently, regardless of whether `P` -and `Q` are convex or non-convex. -Note that as the input polygons may not be convex, their Minkowski -sum may not be a simple polygon. The result is therefore represented -as a polygon with holes. - \pre Both `P` and `Q` are simple polygons. */ template Polygon_with_holes_2 minkowski_sum_full_convolution_2(const Polygon_2& P, const Polygon_2& Q, - const Kernel& kernel); + const Kernel& kernel = Kernel()); /*! \ingroup PkgMinkowskiSum2 @@ -96,18 +77,41 @@ sum may not be a simple polygon. The result is therefore represented as a polygon with holes. \pre Both `P` and `Q` are simple polygons. */ -template +template Polygon_with_holes_2 minkowski_sum_2 (const Polygon_2& P, const Polygon_2& Q, - const PolygonConvexDecomposition_2& decomp); + const PolygonConvexDecomposition_2& decomp, + const Gps_segment_traits_2& traits = Gps_segment_traits_2()); /*! \ingroup PkgMinkowskiSum2 -Computes the Minkowski sum \f$ P \oplus Q\f$ of the two given polygons. -If the input polygons `P` and `Q` are not convex, the function +Computes the Minkowski sum \f$ P \oplus Q\f$ of polygon \f$ P\f$ and the +polygon with holes \f$ Q\f$. If the input polygons `P` and `Q` are not +convex, the function decomposes them into convex sub-polygons +\f$ P_1, \ldots, P_k\f$ and \f$ Q_1, \ldots, Q_{\ell}\f$ and computes +the union of pairwise sub-sums (namely \f$ \bigcup_{i,j}{(P_i \oplus Q_j)}\f$). +The decomposition is performed using the given decomposition method +`decomp`, which must be an instance of a class template that models the +concept `PolygonWithHolesConvexDecomposition_2`. +Note that as the input polygons may not be convex, their Minkowski +sum may not be a simple polygon. The result is therefore represented +as a polygon with holes. +*/ +template +Polygon_with_holes_2 +minkowski_sum_2 (const Polygon_2& P, + const Polygon_with_holes_2& Q, + const PolygonWithHolesConvexDecomposition_2& decomp, + const Gps_segment_traits_2& traits = Gps_segment_traits_2()); + +/*! +\ingroup PkgMinkowskiSum2 + +Computes the Minkowski sum \f$ P \oplus Q\f$ of the two given polygons with +holes. If the input polygons `P` and `Q` are not convex, the function decomposes them into convex sub-polygons \f$ P_1, \ldots, P_k\f$ and \f$ Q_1, \ldots, Q_{\ell}\f$ and computes the union of pairwise sub-sums (namely \f$ \bigcup_{i,j}{(P_i \oplus Q_j)}\f$). @@ -119,10 +123,11 @@ sum may not be a simple polygon. The result is therefore represented as a polygon with holes. */ template + class PolygonWithHolesConvexDecomposition_2> Polygon_with_holes_2 minkowski_sum_2 (const Polygon_with_holes_2& P, const Polygon_with_holes_2& Q, - const PolygonWithHolesConvexDecomposition_2& decomp); + const PolygonWithHolesConvexDecomposition_2& decomp, + const Gps_segment_traits_2& traits = Gps_segment_traits_2()); } /* namespace CGAL */