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-01-15 01:06:38 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:09:55 +0300
commit20d7f8ecb20ab6005d0174fa2d4de62031367168 (patch)
treee1bb11d81db92f74c718ddf2915d928a83e24d89 /indexer/feature_impl.hpp
parentb10bccf22771f1cec2d6a78b8dcabfdc7d5f6ac3 (diff)
New feature structure with inner and outer geometry.
Diffstat (limited to 'indexer/feature_impl.hpp')
-rw-r--r--indexer/feature_impl.hpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/indexer/feature_impl.hpp b/indexer/feature_impl.hpp
index dc7eea151c..bcd74e761a 100644
--- a/indexer/feature_impl.hpp
+++ b/indexer/feature_impl.hpp
@@ -32,13 +32,19 @@ namespace feature
}
template <class TSink>
+ void WriteCellsSimple(vector<int64_t> & cells, TSink & sink)
+ {
+ for (size_t i = 0; i < cells.size(); ++i)
+ WriteVarInt(sink, i == 0 ? cells[0] : cells[i] - cells[i-1]);
+ }
+
+ template <class TSink>
void WriteCells(vector<int64_t> & cells, TSink & sink)
{
vector<char> buffer;
MemWriter<vector<char> > writer(buffer);
- for (size_t i = 0; i < cells.size(); ++i)
- WriteVarInt(writer, i == 0 ? cells[0] : cells[i] - cells[i-1]);
+ WriteCellsSimple(cells, writer);
uint32_t const count = static_cast<uint32_t>(buffer.size());
WriteVarUint(sink, count);
@@ -75,9 +81,20 @@ namespace feature
}
template <class TSink>
+ void SavePointsSimple(vector<m2::PointD> const & points, TSink & sink)
+ {
+ ASSERT_GREATER ( points.size(), 1, () );
+
+ vector<int64_t> cells;
+ detail::TransformPoints(points, cells);
+
+ detail::WriteCellsSimple(cells, sink);
+ }
+
+ template <class TSink>
void SavePoints(vector<m2::PointD> const & points, TSink & sink)
{
- ASSERT_GREATER(points.size(), 1, ());
+ ASSERT_GREATER ( points.size(), 1, () );
vector<int64_t> cells;
detail::TransformPoints(points, cells);
@@ -97,8 +114,8 @@ namespace feature
void SaveTriangles(vector<m2::PointD> const & triangles, TSink & sink)
{
uint32_t const count = triangles.size();
- ASSERT_GREATER(count, 0, ());
- ASSERT_EQUAL(count % 3, 0, (count));
+ ASSERT_GREATER ( count, 0, () );
+ ASSERT_EQUAL ( count % 3, 0, (count) );
vector<int64_t> cells;
detail::TransformPoints(triangles, cells);
@@ -112,8 +129,8 @@ namespace feature
detail::ReadPoints(points, src);
uint32_t const count = points.size();
- ASSERT_GREATER(count, 0, ());
- ASSERT_EQUAL(count % 3, 0, (count));
+ ASSERT_GREATER ( count, 0, () );
+ ASSERT_EQUAL ( count % 3, 0, (count) );
}