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

Method CalcDelta

generator/tesselator.cpp:153–166  ·  view source on GitHub ↗

Calc delta of 'from'->'to' graph edge.

Source from the content-addressed store, hash-verified

151
152/// Calc delta of 'from'->'to' graph edge.
153uint64_t TrianglesInfo::ListInfo::CalcDelta(PointsInfo const & points, Triangle const & from, Triangle const & to) const
154{
155 std::pair<int, int> const p = CommonEdge(to, from);
156
157 m2::PointU const prediction = coding::PredictPointInTriangle(points.m_max,
158 // common edge with 'to'
159 points.m_points[from.m_p[(p.second + 1) % 3]],
160 points.m_points[from.m_p[(p.second)]],
161 // diagonal point of 'from'
162 points.m_points[from.m_p[(p.second + 2) % 3]]);
163
164 // delta from prediction to diagonal point of 'to'
165 return coding::EncodePointDeltaAsUint(points.m_points[to.m_p[(p.first + 2) % 3]], prediction);
166}
167
168template <class TPopOrder>
169void TrianglesInfo::ListInfo::MakeTrianglesChainImpl(PointsInfo const & points, TIterator start,

Callers

nothing calls this directly

Calls 3

CommonEdgeFunction · 0.85
PredictPointInTriangleFunction · 0.85
EncodePointDeltaAsUintFunction · 0.85

Tested by

no test coverage detected