diff --git a/coding/CMakeLists.txt b/coding/CMakeLists.txt index 908c2d0fb6..f8d9cd9f6f 100644 --- a/coding/CMakeLists.txt +++ b/coding/CMakeLists.txt @@ -53,6 +53,8 @@ set( multilang_utf8_string.cpp multilang_utf8_string.hpp parse_xml.hpp + point_to_integer.cpp + point_to_integer.hpp polymorph_reader.hpp read_write_utils.hpp reader.cpp diff --git a/coding/coding.pro b/coding/coding.pro index 94ead8140d..a6f03f95c4 100644 --- a/coding/coding.pro +++ b/coding/coding.pro @@ -22,6 +22,7 @@ SOURCES += \ internal/file_data.cpp \ mmap_reader.cpp \ multilang_utf8_string.cpp \ + point_to_integer.cpp \ reader.cpp \ reader_streambuf.cpp \ reader_writer_ops.cpp \ @@ -67,6 +68,7 @@ HEADERS += \ mmap_reader.hpp \ multilang_utf8_string.hpp \ parse_xml.hpp \ + point_to_integer.hpp \ polymorph_reader.hpp \ read_write_utils.hpp \ reader.hpp \ diff --git a/coding/coding_tests/CMakeLists.txt b/coding/coding_tests/CMakeLists.txt index c4a2d1eb81..944730f8c7 100644 --- a/coding/coding_tests/CMakeLists.txt +++ b/coding/coding_tests/CMakeLists.txt @@ -24,6 +24,7 @@ set( mem_file_writer_test.cpp multilang_utf8_string_test.cpp png_decoder_test.cpp + point_to_integer_test.cpp reader_cache_test.cpp reader_test.cpp reader_test.hpp diff --git a/coding/coding_tests/coding_tests.pro b/coding/coding_tests/coding_tests.pro index 232d5eac79..20bf404214 100644 --- a/coding/coding_tests/coding_tests.pro +++ b/coding/coding_tests/coding_tests.pro @@ -32,6 +32,7 @@ SOURCES += ../../testing/testingmain.cpp \ mem_file_writer_test.cpp \ multilang_utf8_string_test.cpp \ png_decoder_test.cpp \ + point_to_integer_test.cpp \ reader_cache_test.cpp \ reader_test.cpp \ reader_writer_ops_test.cpp \ diff --git a/indexer/indexer_tests/point_to_int64_test.cpp b/coding/coding_tests/point_to_integer_test.cpp similarity index 55% rename from indexer/indexer_tests/point_to_int64_test.cpp rename to coding/coding_tests/point_to_integer_test.cpp index 84bf3ce544..6b871818b4 100644 --- a/indexer/indexer_tests/point_to_int64_test.cpp +++ b/coding/coding_tests/point_to_integer_test.cpp @@ -1,39 +1,38 @@ #include "testing/testing.hpp" -#include "indexer/indexer_tests/test_polylines.hpp" +#include "coding/point_to_integer.hpp" -#include "indexer/cell_id.hpp" +#include "geometry/mercator.hpp" #include "base/logging.hpp" #include "std/cmath.hpp" #include "std/utility.hpp" - namespace { - double const g_eps = MercatorBounds::GetCellID2PointAbsEpsilon(); - uint32_t const g_coordBits = POINT_COORD_BITS; +double const g_eps = MercatorBounds::GetCellID2PointAbsEpsilon(); +uint32_t const g_coordBits = POINT_COORD_BITS; - void CheckEqualPoints(m2::PointD const & p1, m2::PointD const & p2) - { - TEST(fabs(p1.x - p2.x) < g_eps && fabs(p1.y - p2.y) < g_eps, (p1, p2)); +void CheckEqualPoints(m2::PointD const & p1, m2::PointD const & p2) +{ + TEST(p1.EqualDxDy(p2, g_eps), (p1, p2)); - TEST_GREATER_OR_EQUAL(p1.x, -180.0, ()); - TEST_GREATER_OR_EQUAL(p1.y, -180.0, ()); - TEST_LESS_OR_EQUAL(p1.x, 180.0, ()); - TEST_LESS_OR_EQUAL(p1.y, 180.0, ()); + TEST_GREATER_OR_EQUAL(p1.x, -180.0, ()); + TEST_GREATER_OR_EQUAL(p1.y, -180.0, ()); + TEST_LESS_OR_EQUAL(p1.x, 180.0, ()); + TEST_LESS_OR_EQUAL(p1.y, 180.0, ()); - TEST_GREATER_OR_EQUAL(p2.x, -180.0, ()); - TEST_GREATER_OR_EQUAL(p2.y, -180.0, ()); - TEST_LESS_OR_EQUAL(p2.x, 180.0, ()); - TEST_LESS_OR_EQUAL(p2.y, 180.0, ()); - } + TEST_GREATER_OR_EQUAL(p2.x, -180.0, ()); + TEST_GREATER_OR_EQUAL(p2.y, -180.0, ()); + TEST_LESS_OR_EQUAL(p2.x, 180.0, ()); + TEST_LESS_OR_EQUAL(p2.y, 180.0, ()); +} } UNIT_TEST(PointToInt64_Smoke) { - m2::PointD const arr[] = { {1.25, 1.3}, {180, 90}, {-180, -90}, {0, 0} }; + m2::PointD const arr[] = {{1.25, 1.3}, {180, 90}, {-180, -90}, {0, 0}}; for (size_t i = 0; i < ARRAY_SIZE(arr); ++i) CheckEqualPoints(arr[i], Int64ToPoint(PointToInt64(arr[i], g_coordBits), g_coordBits)); @@ -58,12 +57,10 @@ UNIT_TEST(PointToInt64_Grid) UNIT_TEST(PointToInt64_Bounds) { - double const arrEps[] = { -1.0E-2, -1.0E-3, -1.0E-4, 0, 1.0E-4, 1.0E-3, 1.0E-2 }; + double const arrEps[] = {-1.0E-2, -1.0E-3, -1.0E-4, 0, 1.0E-4, 1.0E-3, 1.0E-2}; - m2::PointD const arrPt[] = { {0, 0}, - {-180, -180}, {-180, 180}, {180, 180}, {180, -180}, - {-90, -90}, {-90, 90}, {90, 90}, {90, -90} - }; + m2::PointD const arrPt[] = {{0, 0}, {-180, -180}, {-180, 180}, {180, 180}, {180, -180}, + {-90, -90}, {-90, 90}, {90, 90}, {90, -90}}; for (size_t iP = 0; iP < ARRAY_SIZE(arrPt); ++iP) for (size_t iX = 0; iX < ARRAY_SIZE(arrEps); ++iX) @@ -73,29 +70,15 @@ UNIT_TEST(PointToInt64_Bounds) m2::PointD const pt1 = Int64ToPoint(PointToInt64(pt, g_coordBits), g_coordBits); TEST(fabs(pt.x - pt1.x) <= (fabs(arrEps[iX]) + g_eps) && - fabs(pt.y - pt1.y) <= (fabs(arrEps[iY]) + g_eps), (pt, pt1)); + fabs(pt.y - pt1.y) <= (fabs(arrEps[iY]) + g_eps), + (pt, pt1)); } } -UNIT_TEST(PointToInt64_DataSet1) -{ - for (size_t i = 0; i < ARRAY_SIZE(index_test::arr1); ++i) - { - m2::PointD const pt(index_test::arr1[i].x, index_test::arr1[i].y); - int64_t const id = PointToInt64(pt, g_coordBits); - m2::PointD const pt1 = Int64ToPoint(id, g_coordBits); - - CheckEqualPoints(pt, pt1); - - int64_t const id1 = PointToInt64(pt1, g_coordBits); - TEST_EQUAL(id, id1, (pt, pt1)); - } -} - UNIT_TEST(PointD2PointU_Epsilons) { - m2::PointD const arrPt[] = { {-180, -180}, {-180, 180}, {180, 180}, {180, -180} }; - m2::PointD const arrD[] = { {1, 1}, {1, -1}, {-1, -1}, {-1, 1} }; + m2::PointD const arrPt[] = {{-180, -180}, {-180, 180}, {180, 180}, {180, -180}}; + m2::PointD const arrD[] = {{1, 1}, {1, -1}, {-1, -1}, {-1, 1}}; size_t const count = ARRAY_SIZE(arrPt); /* diff --git a/coding/point_to_integer.cpp b/coding/point_to_integer.cpp new file mode 100644 index 0000000000..f1a9044134 --- /dev/null +++ b/coding/point_to_integer.cpp @@ -0,0 +1,83 @@ +#include "coding/point_to_integer.hpp" + +#include "geometry/mercator.hpp" +#include "geometry/pointu_to_uint64.hpp" + +#include "base/bits.hpp" + +#include + +namespace +{ +inline double CoordSize(uint32_t coordBits) { return (1 << coordBits) - 1; } +} + +m2::PointU PointD2PointU(double x, double y, uint32_t coordBits) +{ + x = my::clamp(x, MercatorBounds::minX, MercatorBounds::maxX); + y = my::clamp(y, MercatorBounds::minY, MercatorBounds::maxY); + + uint32_t const ix = static_cast(0.5 + + (x - MercatorBounds::minX) / + (MercatorBounds::maxX - MercatorBounds::minX) * + CoordSize(coordBits)); + uint32_t const iy = static_cast(0.5 + + (y - MercatorBounds::minY) / + (MercatorBounds::maxY - MercatorBounds::minY) * + CoordSize(coordBits)); + + ASSERT_LESS_OR_EQUAL(ix, CoordSize(coordBits), ()); + ASSERT_LESS_OR_EQUAL(iy, CoordSize(coordBits), ()); + + return m2::PointU(ix, iy); +} + +int64_t PointToInt64(double x, double y, uint32_t coordBits) +{ + int64_t const res = static_cast(m2::PointUToUint64(PointD2PointU(x, y, coordBits))); + + ASSERT_LESS_OR_EQUAL(res, 3ULL << 2 * POINT_COORD_BITS, ()); + ASSERT_GREATER_OR_EQUAL(res, 0, ("Highest bits of (ix, iy) are not used, so res should be > 0.")); + return res; +} + +m2::PointD PointU2PointD(m2::PointU const & pt, uint32_t coordBits) +{ + return m2::PointD(static_cast(pt.x) * (MercatorBounds::maxX - MercatorBounds::minX) / + CoordSize(coordBits) + + MercatorBounds::minX, + static_cast(pt.y) * (MercatorBounds::maxY - MercatorBounds::minY) / + CoordSize(coordBits) + + MercatorBounds::minY); +} + +m2::PointD Int64ToPoint(int64_t v, uint32_t coordBits) +{ + ASSERT_LESS_OR_EQUAL(v, 3ULL << 2 * POINT_COORD_BITS, ()); + return PointU2PointD(m2::Uint64ToPointU(static_cast(v)), coordBits); +} + +std::pair RectToInt64(m2::RectD const & r, uint32_t coordBits) +{ + int64_t const p1 = PointToInt64(r.minX(), r.minY(), coordBits); + int64_t const p2 = PointToInt64(r.maxX(), r.maxY(), coordBits); + return std::make_pair(p1, p2); +} + +m2::RectD Int64ToRect(std::pair const & p, uint32_t coordBits) +{ + m2::PointD const pt1 = Int64ToPoint(p.first, coordBits); + m2::PointD const pt2 = Int64ToPoint(p.second, coordBits); + return m2::RectD(pt1, pt2); +} + +uint32_t DoubleToUint32(double x, double min, double max, uint32_t coordBits) +{ + x = my::clamp(x, min, max); + return static_cast(0.5 + (x - min) / (max - min) * ((1 << coordBits) - 1)); +} + +double Uint32ToDouble(uint32_t x, double min, double max, uint32_t coordBits) +{ + return min + static_cast(x) * (max - min) / ((1 << coordBits) - 1); +} diff --git a/indexer/point_to_int64.hpp b/coding/point_to_integer.hpp similarity index 65% rename from indexer/point_to_int64.hpp rename to coding/point_to_integer.hpp index 2e8eef3166..068dd65193 100644 --- a/indexer/point_to_int64.hpp +++ b/coding/point_to_integer.hpp @@ -3,8 +3,7 @@ #include "geometry/cellid.hpp" #include "geometry/rect2d.hpp" -#include "std/utility.hpp" - +#include #define POINT_COORD_BITS 30 @@ -26,5 +25,9 @@ inline int64_t PointToInt64(m2::PointD const & pt, uint32_t coordBits) m2::PointD Int64ToPoint(int64_t v, uint32_t coordBits); -pair RectToInt64(m2::RectD const & r, uint32_t coordBits); -m2::RectD Int64ToRect(pair const & p, uint32_t coordBits); +std::pair RectToInt64(m2::RectD const & r, uint32_t coordBits); +m2::RectD Int64ToRect(std::pair const & p, uint32_t coordBits); + +uint32_t DoubleToUint32(double x, double min, double max, uint32_t coordBits); + +double Uint32ToDouble(uint32_t x, double min, double max, uint32_t coordBits); diff --git a/coding/traffic.cpp b/coding/traffic.cpp index aa34a40711..4894bcbf6a 100644 --- a/coding/traffic.cpp +++ b/coding/traffic.cpp @@ -11,17 +11,4 @@ double const TrafficGPSEncoder::kMinDeltaLat = ms::LatLon::kMinLat - ms::LatLon: double const TrafficGPSEncoder::kMaxDeltaLat = ms::LatLon::kMaxLat - ms::LatLon::kMinLat; double const TrafficGPSEncoder::kMinDeltaLon = ms::LatLon::kMinLon - ms::LatLon::kMaxLon; double const TrafficGPSEncoder::kMaxDeltaLon = ms::LatLon::kMaxLon - ms::LatLon::kMinLon; - -// static -uint32_t TrafficGPSEncoder::DoubleToUint32(double x, double min, double max) -{ - x = my::clamp(x, min, max); - return static_cast(0.5 + (x - min) / (max - min) * ((1 << kCoordBits) - 1)); -} - -// static -double TrafficGPSEncoder::Uint32ToDouble(uint32_t x, double min, double max) -{ - return min + static_cast(x) * (max - min) / ((1 << kCoordBits) - 1); -} } // namespace coding diff --git a/coding/traffic.hpp b/coding/traffic.hpp index 0df9ee0a64..216590b4da 100644 --- a/coding/traffic.hpp +++ b/coding/traffic.hpp @@ -1,5 +1,6 @@ #pragma once +#include "coding/point_to_integer.hpp" #include "coding/reader.hpp" #include "coding/varint.hpp" #include "coding/writer.hpp" @@ -79,10 +80,6 @@ public: } private: - static uint32_t DoubleToUint32(double x, double min, double max); - - static double Uint32ToDouble(uint32_t x, double min, double max); - template static size_t SerializeDataPointsV0(Writer & writer, Collection const & points) { @@ -91,10 +88,10 @@ private: if (!points.empty()) { uint64_t const firstTimestamp = points[0].m_timestamp; - uint32_t const firstLat = - DoubleToUint32(points[0].m_latLon.lat, ms::LatLon::kMinLat, ms::LatLon::kMaxLat); - uint32_t const firstLon = - DoubleToUint32(points[0].m_latLon.lon, ms::LatLon::kMinLon, ms::LatLon::kMaxLon); + uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.lat, ms::LatLon::kMinLat, + ms::LatLon::kMaxLat, kCoordBits); + uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.lon, ms::LatLon::kMinLon, + ms::LatLon::kMaxLon, kCoordBits); WriteVarUint(writer, firstTimestamp); WriteVarUint(writer, firstLat); WriteVarUint(writer, firstLon); @@ -106,9 +103,9 @@ private: uint64_t const deltaTimestamp = points[i].m_timestamp - points[i - 1].m_timestamp; uint32_t deltaLat = DoubleToUint32(points[i].m_latLon.lat - points[i - 1].m_latLon.lat, - kMinDeltaLat, kMaxDeltaLat); + kMinDeltaLat, kMaxDeltaLat, kCoordBits); uint32_t deltaLon = DoubleToUint32(points[i].m_latLon.lon - points[i - 1].m_latLon.lon, - kMinDeltaLon, kMaxDeltaLon); + kMinDeltaLon, kMaxDeltaLon, kCoordBits); WriteVarUint(writer, deltaTimestamp); WriteVarUint(writer, deltaLat); @@ -128,10 +125,10 @@ private: if (!points.empty()) { uint64_t const firstTimestamp = points[0].m_timestamp; - uint32_t const firstLat = - DoubleToUint32(points[0].m_latLon.lat, ms::LatLon::kMinLat, ms::LatLon::kMaxLat); - uint32_t const firstLon = - DoubleToUint32(points[0].m_latLon.lon, ms::LatLon::kMinLon, ms::LatLon::kMaxLon); + uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.lat, ms::LatLon::kMinLat, + ms::LatLon::kMaxLat, kCoordBits); + uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.lon, ms::LatLon::kMinLon, + ms::LatLon::kMaxLon, kCoordBits); uint32_t const traffic = points[0].m_traffic; WriteVarUint(writer, firstTimestamp); WriteVarUint(writer, firstLat); @@ -145,9 +142,9 @@ private: uint64_t const deltaTimestamp = points[i].m_timestamp - points[i - 1].m_timestamp; uint32_t deltaLat = DoubleToUint32(points[i].m_latLon.lat - points[i - 1].m_latLon.lat, - kMinDeltaLat, kMaxDeltaLat); + kMinDeltaLat, kMaxDeltaLat, kCoordBits); uint32_t deltaLon = DoubleToUint32(points[i].m_latLon.lon - points[i - 1].m_latLon.lon, - kMinDeltaLon, kMaxDeltaLon); + kMinDeltaLon, kMaxDeltaLon, kCoordBits); uint32_t const traffic = points[i - 1].m_traffic; WriteVarUint(writer, deltaTimestamp); @@ -175,18 +172,20 @@ private: if (first) { lastTimestamp = ReadVarUint(src); - lastLat = - Uint32ToDouble(ReadVarUint(src), ms::LatLon::kMinLat, ms::LatLon::kMaxLat); - lastLon = - Uint32ToDouble(ReadVarUint(src), ms::LatLon::kMinLon, ms::LatLon::kMaxLon); + lastLat = Uint32ToDouble(ReadVarUint(src), ms::LatLon::kMinLat, + ms::LatLon::kMaxLat, kCoordBits); + lastLon = Uint32ToDouble(ReadVarUint(src), ms::LatLon::kMinLon, + ms::LatLon::kMaxLon, kCoordBits); result.emplace_back(lastTimestamp, ms::LatLon(lastLat, lastLon), traffic); first = false; } else { lastTimestamp += ReadVarUint(src); - lastLat += Uint32ToDouble(ReadVarUint(src), kMinDeltaLat, kMaxDeltaLat); - lastLon += Uint32ToDouble(ReadVarUint(src), kMinDeltaLon, kMaxDeltaLon); + lastLat += + Uint32ToDouble(ReadVarUint(src), kMinDeltaLat, kMaxDeltaLat, kCoordBits); + lastLon += + Uint32ToDouble(ReadVarUint(src), kMinDeltaLon, kMaxDeltaLon, kCoordBits); result.emplace_back(lastTimestamp, ms::LatLon(lastLat, lastLon), traffic); } } @@ -206,10 +205,10 @@ private: if (first) { lastTimestamp = ReadVarUint(src); - lastLat = - Uint32ToDouble(ReadVarUint(src), ms::LatLon::kMinLat, ms::LatLon::kMaxLat); - lastLon = - Uint32ToDouble(ReadVarUint(src), ms::LatLon::kMinLon, ms::LatLon::kMaxLon); + lastLat = Uint32ToDouble(ReadVarUint(src), ms::LatLon::kMinLat, + ms::LatLon::kMaxLat, kCoordBits); + lastLon = Uint32ToDouble(ReadVarUint(src), ms::LatLon::kMinLon, + ms::LatLon::kMaxLon, kCoordBits); traffic = base::asserted_cast(ReadVarUint(src)); result.emplace_back(lastTimestamp, ms::LatLon(lastLat, lastLon), traffic); first = false; @@ -217,8 +216,10 @@ private: else { lastTimestamp += ReadVarUint(src); - lastLat += Uint32ToDouble(ReadVarUint(src), kMinDeltaLat, kMaxDeltaLat); - lastLon += Uint32ToDouble(ReadVarUint(src), kMinDeltaLon, kMaxDeltaLon); + lastLat += + Uint32ToDouble(ReadVarUint(src), kMinDeltaLat, kMaxDeltaLat, kCoordBits); + lastLon += + Uint32ToDouble(ReadVarUint(src), kMinDeltaLon, kMaxDeltaLon, kCoordBits); traffic = base::asserted_cast(ReadVarUint(src)); result.emplace_back(lastTimestamp, ms::LatLon(lastLat, lastLon), traffic); } diff --git a/drape_frontend/apply_feature_functors.hpp b/drape_frontend/apply_feature_functors.hpp index 92f6f0a9cf..ecfe345ec0 100644 --- a/drape_frontend/apply_feature_functors.hpp +++ b/drape_frontend/apply_feature_functors.hpp @@ -8,7 +8,8 @@ #include "drape/pointers.hpp" #include "indexer/ftypes_matcher.hpp" -#include "indexer/point_to_int64.hpp" + +#include "coding/point_to_integer.hpp" #include "geometry/point2d.hpp" #include "geometry/polyline2d.hpp" diff --git a/generator/coastlines_generator.cpp b/generator/coastlines_generator.cpp index 0c104e9f80..4b6581379c 100644 --- a/generator/coastlines_generator.cpp +++ b/generator/coastlines_generator.cpp @@ -1,7 +1,7 @@ #include "generator/coastlines_generator.hpp" #include "generator/feature_builder.hpp" -#include "indexer/point_to_int64.hpp" +#include "coding/point_to_integer.hpp" #include "geometry/region2d/binary_operators.hpp" diff --git a/generator/feature_merger.cpp b/generator/feature_merger.cpp index 229b30bd5f..a22cb15b09 100644 --- a/generator/feature_merger.cpp +++ b/generator/feature_merger.cpp @@ -2,9 +2,9 @@ #include "indexer/feature.hpp" #include "indexer/feature_visibility.hpp" -#include "indexer/point_to_int64.hpp" #include "indexer/classificator.hpp" +#include "coding/point_to_integer.hpp" MergedFeatureBuilder1::MergedFeatureBuilder1(FeatureBuilder1 const & fb) : FeatureBuilder1(fb), m_isRound(false) diff --git a/generator/generator_tests/triangles_tree_coding_test.cpp b/generator/generator_tests/triangles_tree_coding_test.cpp index 99414f4844..a3da04d6dc 100644 --- a/generator/generator_tests/triangles_tree_coding_test.cpp +++ b/generator/generator_tests/triangles_tree_coding_test.cpp @@ -2,9 +2,9 @@ #include "indexer/geometry_serialization.hpp" #include "geometry/mercator.hpp" -#include "indexer/point_to_int64.hpp" #include "indexer/coding_params.hpp" +#include "coding/point_to_integer.hpp" #include "coding/reader.hpp" #include "coding/writer.hpp" diff --git a/generator/routing_index_generator.cpp b/generator/routing_index_generator.cpp index 3e233db72a..f4e01e0ca9 100644 --- a/generator/routing_index_generator.cpp +++ b/generator/routing_index_generator.cpp @@ -21,10 +21,10 @@ #include "indexer/data_header.hpp" #include "indexer/feature.hpp" #include "indexer/feature_processor.hpp" -#include "indexer/point_to_int64.hpp" #include "coding/file_container.hpp" #include "coding/file_name_utils.hpp" +#include "coding/point_to_integer.hpp" #include "base/checked_cast.hpp" #include "base/logging.hpp" diff --git a/indexer/CMakeLists.txt b/indexer/CMakeLists.txt index b7c93770d1..c9efbfef20 100644 --- a/indexer/CMakeLists.txt +++ b/indexer/CMakeLists.txt @@ -101,8 +101,6 @@ set( old/interval_index_101.hpp osm_editor.cpp osm_editor.hpp - point_to_int64.cpp - point_to_int64.hpp postcodes_matcher.cpp # it's in indexer due to editor which is in indexer and depends on postcodes_marcher postcodes_matcher.hpp # it's in indexer due to editor which is in indexer and depends on postcodes_marcher rank_table.cpp diff --git a/indexer/cell_id.hpp b/indexer/cell_id.hpp index 7d64d339ac..a0ef68a120 100644 --- a/indexer/cell_id.hpp +++ b/indexer/cell_id.hpp @@ -1,6 +1,7 @@ #pragma once +#include "coding/point_to_integer.hpp" + #include "geometry/mercator.hpp" -#include "indexer/point_to_int64.hpp" #include "base/assert.hpp" diff --git a/indexer/centers_table.cpp b/indexer/centers_table.cpp index 4b82d4be9a..4334e40872 100644 --- a/indexer/centers_table.cpp +++ b/indexer/centers_table.cpp @@ -2,11 +2,11 @@ #include "indexer/feature_processor.hpp" #include "indexer/geometry_coding.hpp" -#include "indexer/point_to_int64.hpp" #include "coding/endianness.hpp" #include "coding/file_container.hpp" #include "coding/memory_region.hpp" +#include "coding/point_to_integer.hpp" #include "coding/reader.hpp" #include "coding/succinct_mapper.hpp" #include "coding/varint.hpp" diff --git a/indexer/coding_params.cpp b/indexer/coding_params.cpp index d570eeaa13..8f165e1bdb 100644 --- a/indexer/coding_params.cpp +++ b/indexer/coding_params.cpp @@ -1,5 +1,6 @@ #include "indexer/coding_params.hpp" -#include "indexer/point_to_int64.hpp" + +#include "coding/point_to_integer.hpp" #include "geometry/pointu_to_uint64.hpp" diff --git a/indexer/data_header.cpp b/indexer/data_header.cpp index 52b914b990..32095e8e85 100644 --- a/indexer/data_header.cpp +++ b/indexer/data_header.cpp @@ -1,13 +1,13 @@ #include "indexer/data_header.hpp" -#include "indexer/point_to_int64.hpp" #include "indexer/scales.hpp" #include "platform/platform.hpp" #include "coding/file_container.hpp" #include "coding/file_writer.hpp" -#include "coding/write_to_sink.hpp" +#include "coding/point_to_integer.hpp" #include "coding/varint.hpp" +#include "coding/write_to_sink.hpp" #include "defines.hpp" diff --git a/indexer/feature_covering.hpp b/indexer/feature_covering.hpp index ce34bdc5f4..83efd421ed 100644 --- a/indexer/feature_covering.hpp +++ b/indexer/feature_covering.hpp @@ -1,8 +1,8 @@ #pragma once -#include "indexer/point_to_int64.hpp" - #include "geometry/rect2d.hpp" +#include "coding/point_to_integer.hpp" + #include "std/utility.hpp" #include "std/vector.hpp" diff --git a/indexer/geometry_serialization.cpp b/indexer/geometry_serialization.cpp index e92304551c..686763d78c 100644 --- a/indexer/geometry_serialization.cpp +++ b/indexer/geometry_serialization.cpp @@ -1,8 +1,9 @@ #include "indexer/geometry_serialization.hpp" #include "geometry/mercator.hpp" -#include "indexer/point_to_int64.hpp" #include "indexer/geometry_coding.hpp" +#include "coding/point_to_integer.hpp" + #include "geometry/pointu_to_uint64.hpp" #include "std/algorithm.hpp" diff --git a/indexer/geometry_serialization.hpp b/indexer/geometry_serialization.hpp index 2f43b37214..31751be8cc 100644 --- a/indexer/geometry_serialization.hpp +++ b/indexer/geometry_serialization.hpp @@ -2,14 +2,14 @@ #include "indexer/geometry_coding.hpp" #include "indexer/tesselator_decl.hpp" -#include "indexer/point_to_int64.hpp" #include "indexer/coding_params.hpp" #include "geometry/point2d.hpp" +#include "coding/point_to_integer.hpp" #include "coding/reader.hpp" -#include "coding/writer.hpp" #include "coding/varint.hpp" +#include "coding/writer.hpp" #include "base/buffer_vector.hpp" #include "base/stl_add.hpp" diff --git a/indexer/indexer.pro b/indexer/indexer.pro index 54d9194d6d..1645f67bc1 100644 --- a/indexer/indexer.pro +++ b/indexer/indexer.pro @@ -53,7 +53,6 @@ SOURCES += \ new_feature_categories.cpp \ # it's in indexer because of CategoriesHolder dependency. old/feature_loader_101.cpp \ osm_editor.cpp \ - point_to_int64.cpp \ postcodes_matcher.cpp \ # it's in indexer due to editor wich is in indexer and depends on postcodes_marcher rank_table.cpp \ road_shields_parser.cpp \ @@ -116,7 +115,6 @@ HEADERS += \ old/feature_loader_101.hpp \ old/interval_index_101.hpp \ osm_editor.hpp \ - point_to_int64.hpp \ postcodes_matcher.hpp \ # it's in indexer due to editor wich is in indexer and depends on postcodes_marcher rank_table.hpp \ road_shields_parser.hpp \ diff --git a/indexer/indexer_tests/CMakeLists.txt b/indexer/indexer_tests/CMakeLists.txt index 3e49a1e8ed..3fcf24f0d7 100644 --- a/indexer/indexer_tests/CMakeLists.txt +++ b/indexer/indexer_tests/CMakeLists.txt @@ -22,7 +22,7 @@ set( mwm_set_test.cpp osm_editor_test.cpp osm_editor_test.hpp - point_to_int64_test.cpp + polyline_point_to_int64_test.cpp postcodes_matcher_tests.cpp rank_table_test.cpp scales_test.cpp diff --git a/indexer/indexer_tests/geometry_coding_test.cpp b/indexer/indexer_tests/geometry_coding_test.cpp index 57ddad2a49..251e65c1e8 100644 --- a/indexer/indexer_tests/geometry_coding_test.cpp +++ b/indexer/indexer_tests/geometry_coding_test.cpp @@ -1,7 +1,6 @@ #include "testing/testing.hpp" #include "indexer/geometry_coding.hpp" -#include "indexer/point_to_int64.hpp" #include "geometry/mercator.hpp" #include "indexer/coding_params.hpp" @@ -12,6 +11,7 @@ #include "geometry/simplification.hpp" #include "coding/byte_stream.hpp" +#include "coding/point_to_integer.hpp" #include "coding/varint.hpp" #include "coding/writer.hpp" diff --git a/indexer/indexer_tests/indexer_tests.pro b/indexer/indexer_tests/indexer_tests.pro index 2bfd28cd1a..e324f2a352 100644 --- a/indexer/indexer_tests/indexer_tests.pro +++ b/indexer/indexer_tests/indexer_tests.pro @@ -47,7 +47,7 @@ SOURCES += \ interval_index_test.cpp \ mwm_set_test.cpp \ osm_editor_test.cpp \ - point_to_int64_test.cpp \ + polyline_point_to_int64_test.cpp \ postcodes_matcher_tests.cpp \ rank_table_test.cpp \ scales_test.cpp \ diff --git a/indexer/indexer_tests/polyline_point_to_int64_test.cpp b/indexer/indexer_tests/polyline_point_to_int64_test.cpp new file mode 100644 index 0000000000..ff0524fee1 --- /dev/null +++ b/indexer/indexer_tests/polyline_point_to_int64_test.cpp @@ -0,0 +1,48 @@ +#include "testing/testing.hpp" + +#include "indexer/indexer_tests/test_polylines.hpp" + +#include "indexer/cell_id.hpp" + +#include "coding/point_to_integer.hpp" + +#include "base/logging.hpp" + +#include "std/cmath.hpp" +#include "std/utility.hpp" + +namespace +{ +double const g_eps = MercatorBounds::GetCellID2PointAbsEpsilon(); +uint32_t const g_coordBits = POINT_COORD_BITS; + +void CheckEqualPoints(m2::PointD const & p1, m2::PointD const & p2) +{ + TEST(p1.EqualDxDy(p2, g_eps), (p1, p2)); + + TEST_GREATER_OR_EQUAL(p1.x, -180.0, ()); + TEST_GREATER_OR_EQUAL(p1.y, -180.0, ()); + TEST_LESS_OR_EQUAL(p1.x, 180.0, ()); + TEST_LESS_OR_EQUAL(p1.y, 180.0, ()); + + TEST_GREATER_OR_EQUAL(p2.x, -180.0, ()); + TEST_GREATER_OR_EQUAL(p2.y, -180.0, ()); + TEST_LESS_OR_EQUAL(p2.x, 180.0, ()); + TEST_LESS_OR_EQUAL(p2.y, 180.0, ()); +} +} + +UNIT_TEST(PointToInt64_DataSet1) +{ + for (size_t i = 0; i < ARRAY_SIZE(index_test::arr1); ++i) + { + m2::PointD const pt(index_test::arr1[i].x, index_test::arr1[i].y); + int64_t const id = PointToInt64(pt, g_coordBits); + m2::PointD const pt1 = Int64ToPoint(id, g_coordBits); + + CheckEqualPoints(pt, pt1); + + int64_t const id1 = PointToInt64(pt1, g_coordBits); + TEST_EQUAL(id, id1, (pt, pt1)); + } +} diff --git a/indexer/point_to_int64.cpp b/indexer/point_to_int64.cpp deleted file mode 100644 index 2090b5a12f..0000000000 --- a/indexer/point_to_int64.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "indexer/cell_id.hpp" - -#include "geometry/pointu_to_uint64.hpp" - -#include "base/bits.hpp" - -#include "std/algorithm.hpp" - - -namespace -{ - inline double CoordSize(uint32_t coordBits) { return (1 << coordBits) - 1; } -} - -m2::PointU PointD2PointU(double x, double y, uint32_t coordBits) -{ - x = my::clamp(x, MercatorBounds::minX, MercatorBounds::maxX); - y = my::clamp(y, MercatorBounds::minY, MercatorBounds::maxY); - - uint32_t const ix = static_cast(0.5 + (x - MercatorBounds::minX) - / (MercatorBounds::maxX - MercatorBounds::minX) * CoordSize(coordBits)); - uint32_t const iy = static_cast(0.5 + (y - MercatorBounds::minY) - / (MercatorBounds::maxY - MercatorBounds::minY) * CoordSize(coordBits)); - - ASSERT_LESS_OR_EQUAL(ix, CoordSize(coordBits), ()); - ASSERT_LESS_OR_EQUAL(iy, CoordSize(coordBits), ()); - - return m2::PointU(ix, iy); -} - -int64_t PointToInt64(double x, double y, uint32_t coordBits) -{ - int64_t const res = static_cast(m2::PointUToUint64(PointD2PointU(x, y, coordBits))); - - ASSERT_LESS_OR_EQUAL(res, 3ULL << 2 * POINT_COORD_BITS, ()); - ASSERT_GREATER_OR_EQUAL(res, 0, - ("Highest bits of (ix, iy) are not used, so res should be > 0.")); - return res; -} - -m2::PointD PointU2PointD(m2::PointU const & pt, uint32_t coordBits) -{ - return m2::PointD( - static_cast(pt.x) * (MercatorBounds::maxX - MercatorBounds::minX) - / CoordSize(coordBits) + MercatorBounds::minX, - static_cast(pt.y) * (MercatorBounds::maxY - MercatorBounds::minY) - / CoordSize(coordBits) + MercatorBounds::minY); -} - -m2::PointD Int64ToPoint(int64_t v, uint32_t coordBits) -{ - ASSERT_LESS_OR_EQUAL(v, 3ULL << 2 * POINT_COORD_BITS, ()); - return PointU2PointD(m2::Uint64ToPointU(static_cast(v)), coordBits); -} - -pair RectToInt64(m2::RectD const & r, uint32_t coordBits) -{ - int64_t const p1 = PointToInt64(r.minX(), r.minY(), coordBits); - int64_t const p2 = PointToInt64(r.maxX(), r.maxY(), coordBits); - return make_pair(p1, p2); -} - -m2::RectD Int64ToRect(pair const & p, uint32_t coordBits) -{ - m2::PointD const pt1 = Int64ToPoint(p.first, coordBits); - m2::PointD const pt2 = Int64ToPoint(p.second, coordBits); - return m2::RectD(pt1, pt2); -} diff --git a/routing/cross_routing_context.cpp b/routing/cross_routing_context.cpp index 555f5e8b01..312fbde201 100644 --- a/routing/cross_routing_context.cpp +++ b/routing/cross_routing_context.cpp @@ -1,6 +1,6 @@ #include "routing/cross_routing_context.hpp" -#include "indexer/point_to_int64.hpp" +#include "coding/point_to_integer.hpp" namespace { diff --git a/search/search_trie.hpp b/search/search_trie.hpp index 2248d1694d..b709a18071 100644 --- a/search/search_trie.hpp +++ b/search/search_trie.hpp @@ -1,7 +1,8 @@ #pragma once #include "indexer/coding_params.hpp" -#include "indexer/point_to_int64.hpp" + +#include "coding/point_to_integer.hpp" namespace search { diff --git a/storage/country_polygon.hpp b/storage/country_polygon.hpp index 425e739907..3d08630243 100644 --- a/storage/country_polygon.hpp +++ b/storage/country_polygon.hpp @@ -2,9 +2,9 @@ #include "storage/country_decl.hpp" -#include "indexer/point_to_int64.hpp" #include "indexer/coding_params.hpp" +#include "coding/point_to_integer.hpp" #include "coding/read_write_utils.hpp" diff --git a/xcode/coding/coding.xcodeproj/project.pbxproj b/xcode/coding/coding.xcodeproj/project.pbxproj index f47f14eb3d..2b1431e0d7 100644 --- a/xcode/coding/coding.xcodeproj/project.pbxproj +++ b/xcode/coding/coding.xcodeproj/project.pbxproj @@ -27,6 +27,10 @@ 3D489BC11D3D21A40052AA38 /* simple_dense_coding_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BB91D3D217E0052AA38 /* simple_dense_coding_test.cpp */; }; 3D489BC21D3D21AA0052AA38 /* fixed_bits_ddvector_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BB81D3D217E0052AA38 /* fixed_bits_ddvector_test.cpp */; }; 3D489BC31D3D21AE0052AA38 /* elias_coder_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BB71D3D217E0052AA38 /* elias_coder_test.cpp */; }; + 45C108B41E9CFE69000FE1F6 /* point_to_integer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45C108B21E9CFE69000FE1F6 /* point_to_integer.cpp */; }; + 45C108B51E9CFE69000FE1F6 /* point_to_integer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 45C108B31E9CFE69000FE1F6 /* point_to_integer.hpp */; }; + 45C108B81E9CFE7B000FE1F6 /* point_to_integer_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45C108B61E9CFE78000FE1F6 /* point_to_integer_test.cpp */; }; + 45C108BA1E9CFF8E000FE1F6 /* libgeometry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C108B91E9CFF8E000FE1F6 /* libgeometry.a */; }; 670BAACB1D0B0C1E000302DA /* huffman.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 394917221BAC3C2F002A8C4F /* huffman.cpp */; }; 670D04BD1B0BA92D0013A7AC /* expat_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 670D04B31B0BA9050013A7AC /* expat_impl.h */; }; 670D04BE1B0BA92D0013A7AC /* file64_api.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670D04B41B0BA9050013A7AC /* file64_api.hpp */; }; @@ -165,6 +169,10 @@ 3D489BB81D3D217E0052AA38 /* fixed_bits_ddvector_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fixed_bits_ddvector_test.cpp; sourceTree = ""; }; 3D489BB91D3D217E0052AA38 /* simple_dense_coding_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = simple_dense_coding_test.cpp; sourceTree = ""; }; 3D489BBA1D3D217E0052AA38 /* succinct_mapper_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = succinct_mapper_test.cpp; sourceTree = ""; }; + 45C108B21E9CFE69000FE1F6 /* point_to_integer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = point_to_integer.cpp; sourceTree = ""; }; + 45C108B31E9CFE69000FE1F6 /* point_to_integer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = point_to_integer.hpp; sourceTree = ""; }; + 45C108B61E9CFE78000FE1F6 /* point_to_integer_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = point_to_integer_test.cpp; sourceTree = ""; }; + 45C108B91E9CFF8E000FE1F6 /* libgeometry.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgeometry.a; path = "/Users/r.kuznetsov/Dev/Projects/omim/xcode/geometry/../../../omim-build/xcode/Debug/libgeometry.a"; sourceTree = ""; }; 670D04B31B0BA9050013A7AC /* expat_impl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = expat_impl.h; sourceTree = ""; }; 670D04B41B0BA9050013A7AC /* file64_api.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = file64_api.hpp; sourceTree = ""; }; 670D04B51B0BA9050013A7AC /* file_data.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = file_data.cpp; sourceTree = ""; }; @@ -273,6 +281,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 45C108BA1E9CFF8E000FE1F6 /* libgeometry.a in Frameworks */, 3496AB6E1DC1F53500C5DDBA /* libalohalitics.a in Frameworks */, 3D489BB61D3D21510052AA38 /* libplatform.a in Frameworks */, 394917301BAC3CC9002A8C4F /* libz.tbd in Frameworks */, @@ -296,6 +305,7 @@ 3496AB6C1DC1F53500C5DDBA /* Frameworks */ = { isa = PBXGroup; children = ( + 45C108B91E9CFF8E000FE1F6 /* libgeometry.a */, 3496AB6D1DC1F53500C5DDBA /* libalohalitics.a */, ); name = Frameworks; @@ -329,6 +339,7 @@ 67E8DB1A1BBC16C70053C5BA /* mem_file_writer_test.cpp */, 67E8DB1B1BBC16C70053C5BA /* multilang_utf8_string_test.cpp */, 67E8DB1C1BBC16C70053C5BA /* png_decoder_test.cpp */, + 45C108B61E9CFE78000FE1F6 /* point_to_integer_test.cpp */, 67E8DB1D1BBC16C70053C5BA /* reader_cache_test.cpp */, 67E8DB1E1BBC16C70053C5BA /* reader_test.cpp */, 67E8DB1F1BBC16C70053C5BA /* reader_test.hpp */, @@ -384,6 +395,8 @@ 6753421D1A3F586300A0A8C3 /* coding */ = { isa = PBXGroup; children = ( + 45C108B21E9CFE69000FE1F6 /* point_to_integer.cpp */, + 45C108B31E9CFE69000FE1F6 /* point_to_integer.hpp */, BB537C5D1E8490120074D9D3 /* transliteration.cpp */, BB537C5E1E8490120074D9D3 /* transliteration.hpp */, 34A129D11DF99E43001B4531 /* zlib.cpp */, @@ -526,6 +539,7 @@ 675342A11A3F588C00A0A8C3 /* file_sort.hpp in Headers */, 675342971A3F588C00A0A8C3 /* diff_patch_common.hpp in Headers */, 675342861A3F588C00A0A8C3 /* bit_streams.hpp in Headers */, + 45C108B51E9CFE69000FE1F6 /* point_to_integer.hpp in Headers */, 675342A01A3F588C00A0A8C3 /* file_reader.hpp in Headers */, 675342C71A3F588C00A0A8C3 /* url_encode.hpp in Headers */, 675342BC1A3F588C00A0A8C3 /* reader.hpp in Headers */, @@ -625,6 +639,7 @@ 3D489BC31D3D21AE0052AA38 /* elias_coder_test.cpp in Sources */, 67E8DB671BBC17490053C5BA /* png_decoder_test.cpp in Sources */, 394917201BAC3BE0002A8C4F /* testingmain.cpp in Sources */, + 45C108B81E9CFE7B000FE1F6 /* point_to_integer_test.cpp in Sources */, 67E8DB5D1BBC17490053C5BA /* endianness_test.cpp in Sources */, 3D489BC11D3D21A40052AA38 /* simple_dense_coding_test.cpp in Sources */, 67E8DB641BBC17490053C5BA /* mem_file_reader_test.cpp in Sources */, @@ -679,6 +694,7 @@ 675342B91A3F588C00A0A8C3 /* reader_writer_ops.cpp in Sources */, 675E889C1DB7B0D000F8EBDA /* traffic.cpp in Sources */, 675342AE1A3F588C00A0A8C3 /* mmap_reader.cpp in Sources */, + 45C108B41E9CFE69000FE1F6 /* point_to_integer.cpp in Sources */, 6753429A1A3F588C00A0A8C3 /* file_container.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/xcode/indexer/indexer.xcodeproj/project.pbxproj b/xcode/indexer/indexer.xcodeproj/project.pbxproj index 93865c3c2b..70ac7812cf 100644 --- a/xcode/indexer/indexer.xcodeproj/project.pbxproj +++ b/xcode/indexer/indexer.xcodeproj/project.pbxproj @@ -62,6 +62,9 @@ 3D51BC451D5E4EBF00F1FA8D /* libsearch_tests_support.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D51BC441D5E4EBF00F1FA8D /* libsearch_tests_support.a */; }; 3D928F671D50F9FE001670E0 /* index_helpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D928F651D50F9FE001670E0 /* index_helpers.cpp */; }; 3D928F681D50F9FE001670E0 /* index_helpers.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3D928F661D50F9FE001670E0 /* index_helpers.hpp */; }; + 45C108B11E9CFE41000FE1F6 /* polyline_point_to_int64_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45C108AF1E9CFE3E000FE1F6 /* polyline_point_to_int64_test.cpp */; }; + 45C108BD1E9D0067000FE1F6 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C108BC1E9D0067000FE1F6 /* libicu.a */; }; + 45C108BF1E9D008D000FE1F6 /* librouting_common.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C108BE1E9D008D000FE1F6 /* librouting_common.a */; }; 56C74C1C1C749E4700B71B9F /* categories_holder_loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56C74C121C749E4700B71B9F /* categories_holder_loader.cpp */; }; 56C74C1D1C749E4700B71B9F /* categories_holder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56C74C131C749E4700B71B9F /* categories_holder.cpp */; }; 56C74C1E1C749E4700B71B9F /* categories_holder.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 56C74C141C749E4700B71B9F /* categories_holder.hpp */; }; @@ -91,7 +94,6 @@ 670BAA9C1D0B06E1000302DA /* index_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61011AB065B100C38A8C /* index_test.cpp */; }; 670BAA9D1D0B06E1000302DA /* interval_index_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61021AB065B100C38A8C /* interval_index_test.cpp */; }; 670BAA9E1D0B06E1000302DA /* mwm_set_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61041AB065B100C38A8C /* mwm_set_test.cpp */; }; - 670BAA9F1D0B06E1000302DA /* point_to_int64_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61051AB065B100C38A8C /* point_to_int64_test.cpp */; }; 670BAAA01D0B06E1000302DA /* scales_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61061AB065B100C38A8C /* scales_test.cpp */; }; 670BAAA11D0B06E1000302DA /* sort_and_merge_intervals_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61071AB065B100C38A8C /* sort_and_merge_intervals_test.cpp */; }; 670BAAA21D0B06E1000302DA /* test_polylines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61081AB065B100C38A8C /* test_polylines.cpp */; }; @@ -184,8 +186,6 @@ 675341341A3F540F00A0A8C3 /* interval_index.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340E11A3F540F00A0A8C3 /* interval_index.hpp */; }; 675341371A3F540F00A0A8C3 /* mwm_set.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340E41A3F540F00A0A8C3 /* mwm_set.cpp */; }; 675341381A3F540F00A0A8C3 /* mwm_set.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340E51A3F540F00A0A8C3 /* mwm_set.hpp */; }; - 6753413B1A3F540F00A0A8C3 /* point_to_int64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340E91A3F540F00A0A8C3 /* point_to_int64.cpp */; }; - 6753413C1A3F540F00A0A8C3 /* point_to_int64.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340EA1A3F540F00A0A8C3 /* point_to_int64.hpp */; }; 6753413D1A3F540F00A0A8C3 /* scale_index_builder.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340EB1A3F540F00A0A8C3 /* scale_index_builder.hpp */; }; 6753413F1A3F540F00A0A8C3 /* scale_index.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340ED1A3F540F00A0A8C3 /* scale_index.hpp */; }; 675341401A3F540F00A0A8C3 /* scales.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340EE1A3F540F00A0A8C3 /* scales.cpp */; }; @@ -281,6 +281,9 @@ 3D51BC441D5E4EBF00F1FA8D /* libsearch_tests_support.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsearch_tests_support.a; path = "../../../omim-xcode-build/Debug/libsearch_tests_support.a"; sourceTree = ""; }; 3D928F651D50F9FE001670E0 /* index_helpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index_helpers.cpp; sourceTree = ""; }; 3D928F661D50F9FE001670E0 /* index_helpers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = index_helpers.hpp; sourceTree = ""; }; + 45C108AF1E9CFE3E000FE1F6 /* polyline_point_to_int64_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = polyline_point_to_int64_test.cpp; sourceTree = ""; }; + 45C108BC1E9D0067000FE1F6 /* libicu.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicu.a; path = "/Users/r.kuznetsov/Dev/Projects/omim/xcode/icu/../../../omim-build/xcode/Debug/libicu.a"; sourceTree = ""; }; + 45C108BE1E9D008D000FE1F6 /* librouting_common.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = librouting_common.a; path = "/Users/r.kuznetsov/Dev/Projects/omim/xcode/routing_common/../../../omim-build/xcode/Debug/librouting_common.a"; sourceTree = ""; }; 56C74C121C749E4700B71B9F /* categories_holder_loader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = categories_holder_loader.cpp; sourceTree = ""; }; 56C74C131C749E4700B71B9F /* categories_holder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = categories_holder.cpp; sourceTree = ""; }; 56C74C141C749E4700B71B9F /* categories_holder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = categories_holder.hpp; sourceTree = ""; }; @@ -328,7 +331,6 @@ 670C61011AB065B100C38A8C /* index_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index_test.cpp; sourceTree = ""; }; 670C61021AB065B100C38A8C /* interval_index_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = interval_index_test.cpp; sourceTree = ""; }; 670C61041AB065B100C38A8C /* mwm_set_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mwm_set_test.cpp; sourceTree = ""; }; - 670C61051AB065B100C38A8C /* point_to_int64_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = point_to_int64_test.cpp; sourceTree = ""; }; 670C61061AB065B100C38A8C /* scales_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scales_test.cpp; sourceTree = ""; }; 670C61071AB065B100C38A8C /* sort_and_merge_intervals_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sort_and_merge_intervals_test.cpp; sourceTree = ""; }; 670C61081AB065B100C38A8C /* test_polylines.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_polylines.cpp; sourceTree = ""; }; @@ -407,8 +409,6 @@ 675340E11A3F540F00A0A8C3 /* interval_index.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = interval_index.hpp; sourceTree = ""; }; 675340E41A3F540F00A0A8C3 /* mwm_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mwm_set.cpp; sourceTree = ""; }; 675340E51A3F540F00A0A8C3 /* mwm_set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mwm_set.hpp; sourceTree = ""; }; - 675340E91A3F540F00A0A8C3 /* point_to_int64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = point_to_int64.cpp; sourceTree = ""; }; - 675340EA1A3F540F00A0A8C3 /* point_to_int64.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = point_to_int64.hpp; sourceTree = ""; }; 675340EB1A3F540F00A0A8C3 /* scale_index_builder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scale_index_builder.hpp; sourceTree = ""; }; 675340ED1A3F540F00A0A8C3 /* scale_index.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scale_index.hpp; sourceTree = ""; }; 675340EE1A3F540F00A0A8C3 /* scales.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scales.cpp; sourceTree = ""; }; @@ -449,6 +449,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 45C108BF1E9D008D000FE1F6 /* librouting_common.a in Frameworks */, + 45C108BD1E9D0067000FE1F6 /* libicu.a in Frameworks */, 34AF87E71DBE567C00E5E7DC /* libindexer_tests_support.a in Frameworks */, 3D51BC451D5E4EBF00F1FA8D /* libsearch_tests_support.a in Frameworks */, 3D51BC421D5E4D3800F1FA8D /* libgenerator.a in Frameworks */, @@ -519,6 +521,15 @@ path = ../../indexer/indexer_tests_support; sourceTree = ""; }; + 45C108BB1E9D0067000FE1F6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 45C108BE1E9D008D000FE1F6 /* librouting_common.a */, + 45C108BC1E9D0067000FE1F6 /* libicu.a */, + ); + name = Frameworks; + sourceTree = ""; + }; 670BAACC1D0B0F0A000302DA /* libs */ = { isa = PBXGroup; children = ( @@ -554,6 +565,7 @@ 670C60F81AB0657700C38A8C /* indexer_tests */ = { isa = PBXGroup; children = ( + 45C108AF1E9CFE3E000FE1F6 /* polyline_point_to_int64_test.cpp */, 3D489BF11D4F87740052AA38 /* osm_editor_test.cpp */, 3D489BF21D4F87740052AA38 /* osm_editor_test.hpp */, 3D489BA71D3D1F8A0052AA38 /* editable_map_object_test.cpp */, @@ -580,7 +592,6 @@ 670C61011AB065B100C38A8C /* index_test.cpp */, 670C61021AB065B100C38A8C /* interval_index_test.cpp */, 670C61041AB065B100C38A8C /* mwm_set_test.cpp */, - 670C61051AB065B100C38A8C /* point_to_int64_test.cpp */, 670C61061AB065B100C38A8C /* scales_test.cpp */, 670C61071AB065B100C38A8C /* sort_and_merge_intervals_test.cpp */, 670C61081AB065B100C38A8C /* test_polylines.cpp */, @@ -613,6 +624,7 @@ 6753409C1A3F53CB00A0A8C3 /* indexer */, 6753409B1A3F53CB00A0A8C3 /* Products */, 3496ABB01DC1FB1500C5DDBA /* Resources */, + 45C108BB1E9D0067000FE1F6 /* Frameworks */, ); sourceTree = ""; }; @@ -743,8 +755,6 @@ 675340E41A3F540F00A0A8C3 /* mwm_set.cpp */, 675340E51A3F540F00A0A8C3 /* mwm_set.hpp */, 340DF9CF1C1FF04D00B5C7EC /* osm_editor.cpp */, - 675340E91A3F540F00A0A8C3 /* point_to_int64.cpp */, - 675340EA1A3F540F00A0A8C3 /* point_to_int64.hpp */, 675340EB1A3F540F00A0A8C3 /* scale_index_builder.hpp */, 675340ED1A3F540F00A0A8C3 /* scale_index.hpp */, 675340EE1A3F540F00A0A8C3 /* scales.cpp */, @@ -825,7 +835,6 @@ 6753413F1A3F540F00A0A8C3 /* scale_index.hpp in Headers */, 6753410E1A3F540F00A0A8C3 /* drawing_rules.hpp in Headers */, 670C615C1AB0691900C38A8C /* features_offsets_table.hpp in Headers */, - 6753413C1A3F540F00A0A8C3 /* point_to_int64.hpp in Headers */, 6758AED41BB4413000C26E27 /* drules_selector.hpp in Headers */, 675341061A3F540F00A0A8C3 /* coding_params.hpp in Headers */, 3454E05D1DF00D2D00F40F46 /* banners.hpp in Headers */, @@ -1007,6 +1016,7 @@ 670BAAA41D0B06E1000302DA /* visibility_test.cpp in Sources */, 670BAA931D0B06B4000302DA /* feature_metadata_test.cpp in Sources */, 670BAA941D0B06B4000302DA /* feature_xml_test.cpp in Sources */, + 45C108B11E9CFE41000FE1F6 /* polyline_point_to_int64_test.cpp in Sources */, 670BAA901D0B06B4000302DA /* postcodes_matcher_tests.cpp in Sources */, 670BAA921D0B06B4000302DA /* drules_selector_parser_test.cpp in Sources */, 670BAA8F1D0B06A6000302DA /* rank_table_test.cpp in Sources */, @@ -1021,7 +1031,6 @@ 670BAAA11D0B06E1000302DA /* sort_and_merge_intervals_test.cpp in Sources */, 670BAA9C1D0B06E1000302DA /* index_test.cpp in Sources */, 670BAA9B1D0B06E1000302DA /* index_builder_test.cpp in Sources */, - 670BAA9F1D0B06E1000302DA /* point_to_int64_test.cpp in Sources */, 670C612C1AB0663400C38A8C /* testingmain.cpp in Sources */, 3D489BC61D3D220F0052AA38 /* editable_map_object_test.cpp in Sources */, 670BAA8D1D0B069A000302DA /* succinct_trie_test.cpp in Sources */, @@ -1087,7 +1096,6 @@ 6758AED11BB4413000C26E27 /* drules_selector_parser.cpp in Sources */, E906DE3B1CF44934004C4F5E /* postcodes_matcher.cpp in Sources */, 3D489BF31D4F87740052AA38 /* osm_editor_test.cpp in Sources */, - 6753413B1A3F540F00A0A8C3 /* point_to_int64.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };