Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/coding
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2018-07-27 15:09:39 +0300
committerVladimir Byko-Ianko <bykoianko@gmail.com>2018-08-01 13:45:25 +0300
commit2bc35257235bd3e4a6c6ba94f44d3eea8ad6a8fd (patch)
tree69e9ba2d4d8730cf56a1aebb0e6721faaee0bb05 /coding
parent159e70c4f76754f884b97f11d869ee0bd4bd338b (diff)
[geometry] Functors instead of factories in simplification.hpp.
Diffstat (limited to 'coding')
-rw-r--r--coding/coding_tests/geometry_coding_test.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/coding/coding_tests/geometry_coding_test.cpp b/coding/coding_tests/geometry_coding_test.cpp
index 08fc66083c..30f6dbae69 100644
--- a/coding/coding_tests/geometry_coding_test.cpp
+++ b/coding/coding_tests/geometry_coding_test.cpp
@@ -68,13 +68,11 @@ vector<m2::PointU> SimplifyPoints(vector<m2::PointU> const & points, double eps)
{
vector<m2::PointU> simpPoints;
- auto distFact = [](m2::PointD const & p0, m2::PointD const & p1) {
- return m2::ParametrizedSegment<m2::PointD>(p0, p1);
- };
+ m2::SquaredDistanceFromSegmentToPoint<m2::PointD> const distFn;
SimplifyNearOptimal(
- 20, points.begin(), points.end(), eps, distFact,
- AccumulateSkipSmallTrg<decltype(distFact), m2::PointU>(distFact, simpPoints, eps));
+ 20, points.begin(), points.end(), eps, distFn,
+ AccumulateSkipSmallTrg<decltype(distFn), m2::PointU>(distFn, simpPoints, eps));
return simpPoints;
}