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

Function SimplifySpline

libs/drape_frontend/user_mark_shapes.cpp:314–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314m2::SharedSpline SimplifySpline(m2::SharedSpline const & in, double minSqrLength)
315{
316 m2::SharedSpline spline;
317 spline.Reset(new m2::Spline(in->GetSize()));
318
319 m2::PointD lastAddedPoint;
320 for (auto const & point : in->GetPath())
321 {
322 if (spline->GetSize() > 1 && point.SquaredLength(lastAddedPoint) < minSqrLength)
323 {
324 spline->ReplacePoint(point);
325 }
326 else
327 {
328 spline->AddPoint(point);
329 lastAddedPoint = point;
330 }
331 }
332 return spline;
333}
334
335std::string GetBackgroundSymbolName(std::string const & symbolName)
336{

Callers 1

CacheUserLinesFunction · 0.85

Calls 6

SquaredLengthMethod · 0.80
ReplacePointMethod · 0.80
ResetMethod · 0.45
GetSizeMethod · 0.45
GetPathMethod · 0.45
AddPointMethod · 0.45

Tested by

no test coverage detected