Catch up examples with addition of robustness policy and others (#787)

The example/c03_custom_linestring_example.cpp requires change from PR #786
These changes make all examples compile again.
Fixes #784
This commit is contained in:
Mateusz Łoskot 2020-12-23 10:30:04 +01:00 committed by GitHub
parent 74b98a95f7
commit f6153724c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -67,12 +67,13 @@ int main(void)
#endif
// Calculate intersection points (turn points)
typedef bg::segment_ratio_type<point_2d, bg::detail::no_rescale_policy>::type segment_ratio;
typedef bg::detail::segment_ratio_type<point_2d, bg::detail::no_rescale_policy>::type segment_ratio;
typedef bg::detail::overlay::turn_info<point_2d, segment_ratio> turn_info;
std::vector<turn_info> turns;
bg::detail::get_turns::no_interrupt_policy policy;
bg::detail::no_rescale_policy rescale_policy;
bg::get_turns<false, false, bg::detail::overlay::assign_null_policy>(ls, p, rescale_policy, turns, policy);
bg::strategy::intersection::services::default_strategy<typename bg::cs_tag<point_2d>::type>::type intersection_strategy;
bg::get_turns<false, false, bg::detail::overlay::assign_null_policy>(ls, p, intersection_strategy, rescale_policy, turns, policy);
std::cout << "Intersection of linestring/polygon" << std::endl;
BOOST_FOREACH(turn_info const& turn, turns)

View File

@ -102,10 +102,11 @@ int main()
// This works because outputs to a normal struct point, no point*
typedef boost::geometry::model::linestring<point_2d> linestring_2d;
boost::geometry::detail::no_rescale_policy rescale_policy;
std::vector<linestring_2d> clipped;
boost::geometry::strategy::intersection::liang_barsky<box_2d, point_2d> strategy;
boost::geometry::detail::intersection::clip_range_with_box<linestring_2d>(cb,
myline, std::back_inserter(clipped), strategy);
myline, rescale_policy, std::back_inserter(clipped), strategy);
std::cout << boost::geometry::length(clipped.front()) << std::endl;

View File

@ -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>();
double a = 0;
for (int i = 0; i < n + 1; i++, a += d)
{