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

Function DecodePolylinePrev3

libs/coding/geometry_coding.cpp:203–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void DecodePolylinePrev3(InDeltasT const & deltas, m2::PointU const & basePoint, m2::PointU const & maxPoint,
204 OutPointsT & points)
205{
206 ASSERT_LESS_OR_EQUAL(basePoint.x, maxPoint.x, (basePoint, maxPoint));
207 ASSERT_LESS_OR_EQUAL(basePoint.y, maxPoint.y, (basePoint, maxPoint));
208
209 size_t const count = deltas.size();
210 if (count > 0)
211 {
212 points.push_back(DecodePointDeltaFromUint(deltas[0], basePoint));
213 if (count > 1)
214 {
215 m2::PointU const pt0 = points.back();
216 points.push_back(DecodePointDeltaFromUint(deltas[1], pt0));
217 if (count > 2)
218 {
219 m2::PointD const maxPointD(maxPoint);
220 points.push_back(DecodePointDeltaFromUint(deltas[2], PredictPointInPolyline(maxPointD, points.back(), pt0)));
221 for (size_t i = 3; i < count; ++i)
222 {
223 size_t const n = points.size();
224 m2::PointU const prediction = PredictPointInPolyline(maxPointD, points[n - 1], points[n - 2], points[n - 3]);
225 points.push_back(DecodePointDeltaFromUint(deltas[i], prediction));
226 }
227 }
228 }
229 }
230}
231
232void EncodePolyline(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint,
233 OutDeltasT & deltas)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected