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>2010-12-11 17:47:40 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:08:33 +0300
commited9abd7b505dc4537888c12b29784348c6ed3528 (patch)
treedfde732411dd04c0dfab5e287f2124813409d687 /indexer/scale_index_builder.hpp
parent3e8b50b92510c6ff54e23978468e3d963e290ce2 (diff)
[Refactoring]. Divide Feature class to:
- FeatureBase (base feature class) - FeatureGeom (store geometry itself) - FeatureGeomRef (in future, store reference to geometry).
Diffstat (limited to 'indexer/scale_index_builder.hpp')
-rw-r--r--indexer/scale_index_builder.hpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/indexer/scale_index_builder.hpp b/indexer/scale_index_builder.hpp
index 834b8acbc9..042c3afcac 100644
--- a/indexer/scale_index_builder.hpp
+++ b/indexer/scale_index_builder.hpp
@@ -2,8 +2,8 @@
#include "scale_index.hpp"
#include "feature_visibility.hpp"
#include "covering.hpp"
-#include "feature.hpp"
#include "interval_index_builder.hpp"
+#include "cell_id.hpp"
#include "../geometry/covering_stream_optimizer.hpp"
@@ -52,7 +52,8 @@ public:
{
}
- void operator() (Feature const & f, uint32_t offset) const
+ template <class TFeature>
+ void operator() (TFeature const & f, uint32_t offset) const
{
if (FeatureShouldBeIndexed(f))
{
@@ -64,10 +65,13 @@ public:
}
}
- bool FeatureShouldBeIndexed(Feature const & f) const
+ template <class TFeature>
+ bool FeatureShouldBeIndexed(TFeature const & f) const
{
- uint32_t const minDrawableScale = feature::MinDrawableScaleForFeature(f);
- return m_ScaleRange.first <= minDrawableScale && minDrawableScale < m_ScaleRange.second;
+ (void)f.GetLimitRect(); // dummy call to force TFeature::ParseGeometry
+
+ uint32_t const minScale = feature::MinDrawableScaleForFeature(f);
+ return (m_ScaleRange.first <= minScale && minScale < m_ScaleRange.second);
}
private:
@@ -84,7 +88,8 @@ public:
void operator() (int64_t cellId, uint64_t value) const
{
- CellFeaturePair cellFeaturePair(cellId, value);
+ // uint64_t -> uint32_t : assume that feature dat file not more than 4Gb
+ CellFeaturePair cellFeaturePair(cellId, static_cast<uint32_t>(value));
m_Sink.Write(&cellFeaturePair, sizeof(cellFeaturePair));
}