diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2011-09-19 01:17:12 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:24:00 +0300 |
commit | 751ac71b07a3d915f4da84faa1e04cf3f8122db2 (patch) | |
tree | 70526bfa66e6ec5ef00924d98746a355fd5113cd /geometry | |
parent | daa67eb39b6930dbf7e2328ca5ab79706ceb06a9 (diff) |
added POI, PathTexts and POI Names filtration. closes #240
Diffstat (limited to 'geometry')
-rw-r--r-- | geometry/geometry_tests/aarect_test.cpp | 7 | ||||
-rw-r--r-- | geometry/point2d.hpp | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/geometry/geometry_tests/aarect_test.cpp b/geometry/geometry_tests/aarect_test.cpp index 0db9f895bb..c0c3b1391d 100644 --- a/geometry/geometry_tests/aarect_test.cpp +++ b/geometry/geometry_tests/aarect_test.cpp @@ -32,6 +32,13 @@ UNIT_TEST(AARect_TestConvertFrom) TEST(r.ConvertTo(m2::PointD(100 + 50 * sqrt3 / 2, 100 + 50 * 1.0 / 2)).EqualDxDy(m2::PointD(50, 0), 10e-5), ()); } +UNIT_TEST(AARect_ZeroRect) +{ + m2::AARectD r0(m2::RectD(0, 0, 0, 0)); + m2::AARectD r1(m2::Offset(r0, m2::PointD(300.0, 300.0))); + m2::AARectD r2(m2::Inflate(r0, 2.0, 2.0)); +} + UNIT_TEST(AARect_TestIntersection) { m2::AARectD r0(m2::PointD(93.196, 104.21), 1.03, m2::RectD(2, 0, 4, 15)); diff --git a/geometry/point2d.hpp b/geometry/point2d.hpp index 0d5fe6e3f2..eaaf52dec8 100644 --- a/geometry/point2d.hpp +++ b/geometry/point2d.hpp @@ -280,6 +280,14 @@ namespace m2 return ar; } + template <typename T> + bool operator< (Point<T> const & l, Point<T> const & r) + { + if (l.x != r.x) + return l.x < r.x; + return l.y < r.y; + } + typedef Point<float> PointF; typedef Point<double> PointD; typedef Point<uint32_t> PointU; |