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:
authorMaxim Pimenov <m@maps.me>2018-04-09 14:27:33 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2018-04-10 14:31:32 +0300
commit8651b85289754a09b662e0412b5cae172284c3be (patch)
tree08d176fad5682b2b54397c3066b5cc553846b4c5 /coding/pointd_to_pointu.hpp
parent9666660b84740e6bbe0585e59fccd1347c4c793f (diff)
[coding] [geometry] Deprecated PointToInt.
For some reason we have been using bitwise merge to store a pair of 32-bit unsigned integer coordinates. Since the width of the coordinates is fixed and storage in general has nothing to do with the Z-order curve where bitwise merge is appropriate, this commit marks this method of storage as obsolete (and effectively deprecated). The functions to convert between PointD and PointU are still serviceable. Their usage is slightly refactored.
Diffstat (limited to 'coding/pointd_to_pointu.hpp')
-rw-r--r--coding/pointd_to_pointu.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/coding/pointd_to_pointu.hpp b/coding/pointd_to_pointu.hpp
new file mode 100644
index 0000000000..e5fd99a042
--- /dev/null
+++ b/coding/pointd_to_pointu.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "geometry/point2d.hpp"
+
+#include <cstdint>
+
+#define POINT_COORD_BITS 30
+
+uint32_t DoubleToUint32(double x, double min, double max, uint32_t coordBits);
+
+double Uint32ToDouble(uint32_t x, double min, double max, uint32_t coordBits);
+
+m2::PointU PointDToPointU(double x, double y, uint32_t coordBits);
+
+m2::PointU PointDToPointU(m2::PointD const & pt, uint32_t coordBits);
+
+m2::PointD PointUToPointD(m2::PointU const & p, uint32_t coordBits);