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

Function DecodePolylinePrev2

libs/coding/geometry_coding.cpp:152–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void DecodePolylinePrev2(InDeltasT const & deltas, m2::PointU const & basePoint, m2::PointU const & maxPoint,
153 OutPointsT & points)
154{
155 size_t const count = deltas.size();
156 if (count > 0)
157 {
158 points.push_back(DecodePointDeltaFromUint(deltas[0], basePoint));
159 if (count > 1)
160 {
161 m2::PointD const maxPointD(maxPoint);
162 points.push_back(DecodePointDeltaFromUint(deltas[1], points.back()));
163 for (size_t i = 2; i < count; ++i)
164 {
165 size_t const n = points.size();
166 points.push_back(
167 DecodePointDeltaFromUint(deltas[i], PredictPointInPolyline(maxPointD, points[n - 1], points[n - 2])));
168 }
169 }
170 }
171}
172
173void EncodePolylinePrev3(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint,
174 OutDeltasT & deltas)

Callers 1

DecodePolylineFunction · 0.85

Calls 5

DecodePointDeltaFromUintFunction · 0.85
PredictPointInPolylineFunction · 0.85
backMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected