diff options
author | vng <viktor.govako@gmail.com> | 2011-02-04 11:34:56 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:11:36 +0300 |
commit | f0b2633d2ff765c71196a2d9eddb213525e5ce3e (patch) | |
tree | c291535b33634c37cbd4278a2bfaf85f4ad21baf /indexer/geometry_coding.hpp | |
parent | 85b38d169af2d3d2a46363fb9c9dd1e3b2ad1320 (diff) |
Fix PredictPointInTriangle. Add more comments.
Diffstat (limited to 'indexer/geometry_coding.hpp')
-rw-r--r-- | indexer/geometry_coding.hpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/indexer/geometry_coding.hpp b/indexer/geometry_coding.hpp index 373cd5199c..215c8aeca5 100644 --- a/indexer/geometry_coding.hpp +++ b/indexer/geometry_coding.hpp @@ -7,6 +7,8 @@ #include "../std/vector.hpp" #include "../std/tuple.hpp" + +//@{ inline uint64_t EncodeDelta(m2::PointU const & actual, m2::PointU const & prediction) { return bits::BitwiseMerge( @@ -20,18 +22,27 @@ inline m2::PointU DecodeDelta(uint64_t delta, m2::PointU const & prediction) bits::BitwiseSplit(delta, x, y); return m2::PointU(prediction.x + bits::ZigZagDecode(x), prediction.y + bits::ZigZagDecode(y)); } +//@} + -// Predict point p0 given previous (p1, p2). +/// Predict point p0 given previous (p1, p2). m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint, m2::PointU const & p1, m2::PointU const & p2); -// Predict point p0 given previous (p1, p2, p3). +/// Predict point p0 given previous (p1, p2, p3). m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint, m2::PointU const & p1, m2::PointU const & p2, m2::PointU const & p3); +/// Predict point p0 given previous (p1, p2, p3). +m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint, + m2::PointU const & p1, + m2::PointU const & p2, + m2::PointU const & p3); + +/// Geometry Coding-Decoding functions. namespace geo_coding { typedef vector<m2::PointU> InPointsT; @@ -84,20 +95,6 @@ inline void DecodePolyline(DeltasT const & deltas, DecodePolylinePrev2(deltas, basePoint, maxPoint, points); } -typedef vector<tuple<uint32_t, uint32_t, uint32_t> > TrianglesT; - -void EncodeTriangles(InPointsT const & points, - TrianglesT const & triangles, - m2::PointU const & basePoint, - m2::PointU const & maxPoint, - DeltasT & deltas); - -void DecodeTriangles(DeltasT const & deltas, - m2::PointU const & basePoint, - m2::PointU const & maxPoint, - OutPointsT & points, - TrianglesT & triangles); - void EncodeTriangleStrip(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint, |