From 31329332b49b049737e141b3db55cf77b771c143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81oskot?= Date: Tue, 22 Dec 2020 19:24:20 +0100 Subject: [PATCH] Catch up examples with addition of robustness policy and others The example/c03_custom_linestring_example.cpp requires change from PR #786 These changes make all examples compile again. Fixes #784 --- example/05_b_overlay_linestring_polygon_example.cpp | 5 +++-- example/c05_custom_point_pointer_example.cpp | 3 ++- example/c08_custom_non_std_example.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/example/05_b_overlay_linestring_polygon_example.cpp b/example/05_b_overlay_linestring_polygon_example.cpp index 38349decb6..f37165f3ee 100644 --- a/example/05_b_overlay_linestring_polygon_example.cpp +++ b/example/05_b_overlay_linestring_polygon_example.cpp @@ -67,12 +67,13 @@ int main(void) #endif // Calculate intersection points (turn points) - typedef bg::segment_ratio_type::type segment_ratio; + typedef bg::detail::segment_ratio_type::type segment_ratio; typedef bg::detail::overlay::turn_info turn_info; std::vector turns; bg::detail::get_turns::no_interrupt_policy policy; bg::detail::no_rescale_policy rescale_policy; - bg::get_turns(ls, p, rescale_policy, turns, policy); + bg::strategy::intersection::services::default_strategy::type>::type intersection_strategy; + bg::get_turns(ls, p, intersection_strategy, rescale_policy, turns, policy); std::cout << "Intersection of linestring/polygon" << std::endl; BOOST_FOREACH(turn_info const& turn, turns) diff --git a/example/c05_custom_point_pointer_example.cpp b/example/c05_custom_point_pointer_example.cpp index d8059fe04d..a1d9dbef02 100644 --- a/example/c05_custom_point_pointer_example.cpp +++ b/example/c05_custom_point_pointer_example.cpp @@ -102,10 +102,11 @@ int main() // This works because outputs to a normal struct point, no point* typedef boost::geometry::model::linestring linestring_2d; + boost::geometry::detail::no_rescale_policy rescale_policy; std::vector clipped; boost::geometry::strategy::intersection::liang_barsky strategy; boost::geometry::detail::intersection::clip_range_with_box(cb, - myline, std::back_inserter(clipped), strategy); + myline, rescale_policy, std::back_inserter(clipped), strategy); std::cout << boost::geometry::length(clipped.front()) << std::endl; diff --git a/example/c08_custom_non_std_example.cpp b/example/c08_custom_non_std_example.cpp index 0a545a3de9..12bb768405 100644 --- a/example/c08_custom_non_std_example.cpp +++ b/example/c08_custom_non_std_example.cpp @@ -281,7 +281,7 @@ int main() // Create (as an example) a regular polygon const int n = 5; - const double d = (360 / n) * boost::geometry::math::d2r; + const double d = (360 / n) * boost::geometry::math::d2r(); double a = 0; for (int i = 0; i < n + 1; i++, a += d) {