diff options
author | Yury Melnichek <melnichek@gmail.com> | 2011-04-24 05:16:18 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:16:20 +0300 |
commit | 60e2dcfbae9e9a766dfc24c05fa59b846822d8d2 (patch) | |
tree | 6c3c590729949b0235b7ee5717abbf9dd144518e /indexer/point_to_int64.hpp | |
parent | 7e4bb0e4fd0800a9edb38d3b4c2e7d6c1abbd12d (diff) |
Pass CodingParams everywhere.
Diffstat (limited to 'indexer/point_to_int64.hpp')
-rw-r--r-- | indexer/point_to_int64.hpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/indexer/point_to_int64.hpp b/indexer/point_to_int64.hpp index 2c798c987c..eac0517c65 100644 --- a/indexer/point_to_int64.hpp +++ b/indexer/point_to_int64.hpp @@ -5,22 +5,30 @@ #include "../std/utility.hpp" -#define COORD_BITS 30 - typedef double CoordT; typedef pair<CoordT, CoordT> CoordPointT; typedef m2::CellId<19> RectId; -m2::PointU PointD2PointU(CoordT x, CoordT y, uint32_t coordBits = COORD_BITS); -CoordPointT PointU2PointD(m2::PointU const & p, uint32_t coordBits = COORD_BITS); +m2::PointU PointD2PointU(CoordT x, CoordT y, uint32_t coordBits); +inline m2::PointU PointD2PointU(m2::PointD const & pt, uint32_t coordBits) +{ + return PointD2PointU(pt.x, pt.y, coordBits); +} + +CoordPointT PointU2PointD(m2::PointU const & p, uint32_t coordBits); -int64_t PointToInt64(CoordT x, CoordT y, uint32_t coordBits = COORD_BITS); -inline int64_t PointToInt64(CoordPointT const & pt, uint32_t coordBits = COORD_BITS) +int64_t PointToInt64(CoordT x, CoordT y, uint32_t coordBits); +inline int64_t PointToInt64(CoordPointT const & pt, uint32_t coordBits) { return PointToInt64(pt.first, pt.second, coordBits); } -CoordPointT Int64ToPoint(int64_t v, uint32_t coordBits = COORD_BITS); +inline int64_t PointToInt64(m2::PointD const & pt, uint32_t coordBits) +{ + return PointToInt64(pt.x, pt.y, coordBits); +} + +CoordPointT Int64ToPoint(int64_t v, uint32_t coordBits); -pair<int64_t, int64_t> RectToInt64(m2::RectD const & r, uint32_t coordBits = COORD_BITS); -m2::RectD Int64ToRect(pair<int64_t, int64_t> const & p, uint32_t coordBits = COORD_BITS); +pair<int64_t, int64_t> RectToInt64(m2::RectD const & r, uint32_t coordBits); +m2::RectD Int64ToRect(pair<int64_t, int64_t> const & p, uint32_t coordBits); |