| 90 | |
| 91 | template <typename DistanceFn, typename PointsContainer> |
| 92 | void SimplifyPoints(DistanceFn distFn, int level, PointsContainer const & in, PointsContainer & out) |
| 93 | { |
| 94 | if (in.size() < 2) |
| 95 | return; |
| 96 | |
| 97 | double const eps = math::Pow2(scales::GetEpsilonForSimplify(level)); |
| 98 | |
| 99 | SimplifyNearOptimal(20, in.begin(), in.end(), eps, distFn, |
| 100 | AccumulateSkipSmallTrg<DistanceFn, m2::PointD>(distFn, out, eps)); |
| 101 | |
| 102 | CHECK_GREATER(out.size(), 1, ()); |
| 103 | CHECK(ArePointsEqual(in.front(), out.front()), ()); |
| 104 | CHECK(ArePointsEqual(in.back(), out.back()), ()); |
| 105 | } |
| 106 | } // namespace feature |