Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API issues in 2D Straight Skeletons (6.0.x) #8690

Open
wants to merge 26 commits into
base: 6.0.x-branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
766040a
Fix wrong tparam name
MaelRL Jan 13, 2025
2805eec
Add missing backticks
MaelRL Jan 13, 2025
dd86cd1
Fix doc group
MaelRL Jan 13, 2025
aac8c49
Remove extra parentheses
MaelRL Jan 13, 2025
b76596a
Fix wrong parameter order in documentation
MaelRL Jan 13, 2025
0ed7e30
Various fixes in the documentation of template parameters
MaelRL Jan 14, 2025
59e1ca5
Clarify comment
MaelRL Jan 14, 2025
56c0696
Add an alias for deduced (or not) return types
MaelRL Jan 14, 2025
60e5e15
Fix compilation
MaelRL Jan 14, 2025
06e970d
Move towards honoring the concepts
MaelRL Jan 14, 2025
2f7db1d
Consistency between doc & code, use OutPolygon if provided, factorize…
MaelRL Jan 14, 2025
595ad9f
Fix using wrong types when converting the offset value
MaelRL Jan 14, 2025
4d62746
Fix typo
MaelRL Jan 14, 2025
97bde2a
Clarify type
MaelRL Jan 14, 2025
13e8428
Add a lot of API tests for non-weighted skeletons
MaelRL Jan 14, 2025
46ab7ef
Add missing default
MaelRL Jan 15, 2025
56a6053
Don't use C++17 yet
MaelRL Jan 15, 2025
baeed4a
Add more tests
MaelRL Jan 15, 2025
92e31b7
Misc tiny fixes
MaelRL Jan 15, 2025
155be97
Merge branch 'SLS-API_fixes-GF' into SLS-API_fixes-6.0.x-GF
MaelRL Jan 15, 2025
22dd382
Do not use c++17 in 5.6.x
MaelRL Jan 15, 2025
2a93bed
Merge branch 'SLS-API_fixes-GF' into SLS-API_fixes-6.0.x-GF
MaelRL Jan 15, 2025
79d6f4c
Fix warnings
MaelRL Jan 20, 2025
bba9db1
Merge branch 'SLS-API_fixes-GF' into SLS-API_fixes-6.0.x-GF
MaelRL Jan 20, 2025
74cab20
Fix warning
MaelRL Jan 21, 2025
892c8c8
Merge branch 'SLS-API_fixes-GF' into SLS-API_fixes-6.0.x-GF
MaelRL Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Straight_skeleton_builder_2& enter_contour( InputPointIterator aBegin, InputPoin
/*!
defines the <I>weights</I> of the contour last entered through `enter_contour()`.

\tparam InputPointIterator must be a model `InputIterator` whose `value_type` is `FT`.
\tparam WeightIterator must be a model `InputIterator` whose `value_type` is `FT`.

\pre `std::distance(aBegin,aEnd)` must be equal to the number of vertices of the contour last entered.
\pre Weights are (strictly) positive.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ If `ss` is the interior skeleton of a polygon with holes, the offset polygons wi
in its interior. If `ss` is the outer skeleton of a polygon with holes, the offset polygons
will be generated in its exterior.

\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam OfKPolygon is a polygon without holes type determined from `OfK`, see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT`.
\tparam StraightSkeleton is an object of type `CGAL::Straight_skeleton_2<SsK>`.
\tparam OfKPolygon is a polygon without holes type determined from `OfK`, see Section \ref SLSOffsetPolygonReturnType.
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.

\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

Expand Down Expand Up @@ -44,16 +44,16 @@ The construction of this skeleton is the most expensive operation, therefore, to
at more than one single distance, it is advised to use `create_interior_straight_skeleton_2()` to create
the skeleton only once, and then call `create_offset_polygons_2()` for each distance.

\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.
\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam HoleIterator must be a model of `InputIterator` with value type being a model of `ConstRange`
with value type `SsK::Point_2`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`).
\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.

\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

Expand Down Expand Up @@ -84,20 +84,20 @@ The construction of this skeleton is the most expensive operation, therefore, to
at more than one single distance, it is advised to use `create_interior_straight_skeleton_2()` to create
the skeleton only once, and then call `create_offset_polygons_2()` for each distance

\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.

\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

\pre `offset` is positive
\pre poly` is weakly simple, counterclockwise polygon.
\pre `poly` is weakly simple, counterclockwise polygon.

\sa `CGAL::create_exterior_skeleton_and_offset_polygons_2()`
\sa `CGAL::create_interior_skeleton_and_offset_polygons_with_holes_2()`
Expand Down Expand Up @@ -125,20 +125,20 @@ to obtain the offsets. The construction of this skeleton is the most expensive o
therefore, to construct offsets at more than one single distance, use the separate functions
`create_exterior_straight_skeleton_2()` and `create_offset_polygons_2()` instead.

\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.

\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

\pre `offset` is positive
\pre poly` is weakly simple, counterclockwise polygon.
\pre `poly` is weakly simple, counterclockwise polygon.

\sa `CGAL::create_interior_skeleton_and_offset_polygons_2()`
\sa `CGAL::create_exterior_skeleton_and_offset_polygons_with_holes_2()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ of the 2D polygon with holes `poly_with_holes`.

This is equivalent to `arrange_offset_polygons_2(create_interior_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk))`.

\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.


\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

Expand All @@ -42,19 +43,19 @@ at distance `offset` of the 2D polygon `poly_with_holes`. Note that the
offset of the outer frame is ignored.

This is equivalent to a call to `CGAL::arrange_offset_polygons_2()` on the
output of \link CGAL::create_exterior_skeleton_and_offset_polygons_2() `create_exterior_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk))` \endlink
output of \link CGAL::create_exterior_skeleton_and_offset_polygons_2() `create_exterior_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk)` \endlink
after having filtered out the polygon corresponding to the offset of the outer frame and
having reversed the orientation of all other polygons.

\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.

\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ The construction of this skeleton is the most expensive operation, therefore, to
at more than one single distance, it is advised to use the separate functions `create_interior_straight_skeleton_2()`
and `create_offset_polygons_2()` instead.

\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.
\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`).
\tparam InKWeights must be a model of `Range` with value type `InK::FT`.
\tparam HoleIterator must be a model of `InputIterator` with value type being a model of `ConstRange`
with value type `SsK::Point_2`.
\tparam HoleWeightsIterator must be a model of `InputIterator` with value type being a model of `ConstRange`
\tparam InKWeights must be a model of `SequenceContainer` whose value type is `InK::FT`.
\tparam HoleWeightsIterator must be a model of `InputIterator` with value type being a model of `SequenceContainer`
with value type `InK::FT`.
\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.

\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

Expand All @@ -45,9 +45,9 @@ template <typename OfKPolygon, typename FT, typename InKPolygon, typename InKWei
std::vector< std::shared_ptr<OfKPolygon> >
create_interior_weighted_skeleton_and_offset_polygons_2(FT offset,
const InKPolygon& outer_boundary,
const InKWeights& outer_boundary_weights,
HoleIterator holes_begin,
HoleIterator holes_end,
const InKWeights& outer_boundary_weights,
HoleWeightsIterator holes_weights_begin,
HoleWeightsIterator holes_weights_end,
OfK ofk = CGAL::Exact_predicates_inexact_constructions_kernel,
Expand All @@ -66,16 +66,16 @@ The construction of this skeleton is the most expensive operation, therefore, to
at more than one single distance, use the separate functions `create_interior_straight_skeleton_2()`
and `create_offset_polygons_2()` instead.

\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam InKWeights must be a model of `SequenceContainer` whose value type is itself a model of `SequenceContainer` with value type `InK::FT`.
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam InKWeights must be a model of `Range` with value type `InK::FT`.
\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.

\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

Expand Down Expand Up @@ -109,21 +109,21 @@ to obtain the offsets. The construction of this skeleton is the most expensive o
therefore, to construct offsets at more than one single distance, use the separate functions
`create_exterior_straight_skeleton_2()` and `create_offset_polygons_2()` instead.

\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam InKWeights must be a model of `SequenceContainer` whose value type is itself a model of `SequenceContainer` with value type `InK::FT`.
\tparam OfK must be a model of `Kernel`. It is used to instantiate
`Polygon_offset_builder_traits_2<OfK>` for constructing the offset polygons.
\tparam SsK must be a model of `Kernel`. It is used to instantiate
`Straight_skeleton_builder_traits_2<SsK>` for constructing the straight skeleton.
\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`.
\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2<InK>`)
or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2<InK>`).
\tparam InKWeights must be a model of `Range` with value type `InK::FT`.
\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`,
see Section \ref SLSOffsetPolygonReturnType.

\note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2<OfK>`.

\pre `offset` is positive
\pre poly` is weakly simple, counterclockwise polygon.
\pre `poly` is weakly simple, counterclockwise polygon.

\sa `CGAL::create_interior_skeleton_and_offset_polygons_2()`
\sa `CGAL::create_exterior_skeleton_and_offset_polygons_with_holes_2()`
Expand Down
Loading
Loading