MCPcopy Create free account
hub / github.com/comaps/comaps / SimplifyPoints

Function SimplifyPoints

generator/feature_helpers.hpp:92–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91template <typename DistanceFn, typename PointsContainer>
92void 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

Callers 4

operator()Method · 0.70
SimplifyPointsMethod · 0.70
SimplifyContoursFunction · 0.50
operator()Method · 0.50

Calls 9

Pow2Function · 0.85
GetEpsilonForSimplifyFunction · 0.85
SimplifyNearOptimalFunction · 0.85
ArePointsEqualFunction · 0.85
frontMethod · 0.80
backMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

operator()Method · 0.40