Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2011-02-04 11:34:56 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:11:36 +0300
commitf0b2633d2ff765c71196a2d9eddb213525e5ce3e (patch)
treec291535b33634c37cbd4278a2bfaf85f4ad21baf /indexer/geometry_coding.cpp
parent85b38d169af2d3d2a46363fb9c9dd1e3b2ad1320 (diff)
Fix PredictPointInTriangle. Add more comments.
Diffstat (limited to 'indexer/geometry_coding.cpp')
-rw-r--r--indexer/geometry_coding.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/indexer/geometry_coding.cpp b/indexer/geometry_coding.cpp
index e8eb674ef2..361e17b20f 100644
--- a/indexer/geometry_coding.cpp
+++ b/indexer/geometry_coding.cpp
@@ -25,7 +25,7 @@ m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
{
// return ClampPoint(maxPoint, m2::PointI64(p1) + m2::PointI64(p1) - m2::PointI64(p2));
// return ClampPoint(maxPoint, m2::PointI64(p1) + (m2::PointI64(p1) - m2::PointI64(p2)) / 2);
- return ClampPoint(maxPoint, m2::PointD(p1) + (m2::PointD(p1) - m2::PointD(p2)) / 2);
+ return ClampPoint(maxPoint, m2::PointD(p1) + (m2::PointD(p1) - m2::PointD(p2)) / 2.0);
}
m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
@@ -54,6 +54,16 @@ m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
return ClampPoint(maxPoint, m2::PointD(c0.real(), c0.imag()));
}
+m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint,
+ m2::PointU const & p1,
+ m2::PointU const & p2,
+ m2::PointU const & p3)
+{
+ // parallelogramm prediction
+ return ClampPoint(maxPoint, p1 + p2 - p3);
+}
+
+
namespace geo_coding
{
bool TestDecoding(InPointsT const & points,
@@ -209,16 +219,6 @@ void DecodePolylinePrev3(DeltasT const & deltas,
}
}
-
-m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3)
-{
- // parallelogramm prediction
- return ClampPoint(maxPoint, p2 + p3 - p1);
-}
-
void EncodeTriangleStrip(InPointsT const & points,
m2::PointU const & basePoint,
m2::PointU const & maxPoint,