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>2012-02-21 21:25:05 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:34:15 +0300
commit78169147bb310663c0cf1fae56900944b7900384 (patch)
tree98cdff285fb493452e3b6896f91e8499f71cf74a
parent0d6c85b09b019b0423449794c930c0b3f7472833 (diff)
Add named constants for feature geometry getting.
-rw-r--r--generator/statistics.cpp6
-rw-r--r--indexer/feature.hpp3
-rw-r--r--indexer/feature_covering.cpp6
-rw-r--r--indexer/scale_index_builder.hpp6
-rw-r--r--indexer/search_index_builder.cpp4
-rw-r--r--map/map_tests/debug_features_test.cpp2
6 files changed, 16 insertions, 11 deletions
diff --git a/generator/statistics.cpp b/generator/statistics.cpp
index 919c669460..ddd9684625 100644
--- a/generator/statistics.cpp
+++ b/generator/statistics.cpp
@@ -86,9 +86,9 @@ namespace stats
m_info.m_inner[1].Add(innerStats.m_Strips);
m_info.m_inner[2].Add(innerStats.m_Size);
- // get geometry size for the best geometry (-1)
- FeatureType::geom_stat_t const geom = f.GetGeometrySize(-1);
- FeatureType::geom_stat_t const trg = f.GetTrianglesSize(-1);
+ // get geometry size for the best geometry
+ FeatureType::geom_stat_t const geom = f.GetGeometrySize(FeatureType::BEST_GEOMETRY);
+ FeatureType::geom_stat_t const trg = f.GetTrianglesSize(FeatureType::BEST_GEOMETRY);
m_info.AddToSet(geom.m_count, geom.m_size, m_info.m_byPointsCount);
m_info.AddToSet(trg.m_count / 3, trg.m_size, m_info.m_byTrgCount);
diff --git a/indexer/feature.hpp b/indexer/feature.hpp
index c2df0e10eb..4e5824086e 100644
--- a/indexer/feature.hpp
+++ b/indexer/feature.hpp
@@ -158,6 +158,9 @@ public:
/// @name Geometry.
//@{
+ /// This constant values should be equal with feature::LoaderBase implementation.
+ enum { BEST_GEOMETRY = -1, WORST_GEOMETRY = -2 };
+
m2::RectD GetLimitRect(int scale) const;
bool IsEmptyGeometry(int scale) const;
diff --git a/indexer/feature_covering.cpp b/indexer/feature_covering.cpp
index c927c26445..101519014a 100644
--- a/indexer/feature_covering.cpp
+++ b/indexer/feature_covering.cpp
@@ -99,11 +99,11 @@ namespace covering
vector<int64_t> CoverFeature(FeatureType const & f, int cellDepth, uint64_t cellPenaltyArea)
{
FeatureIntersector featureIntersector;
- f.ForEachPointRef(featureIntersector, -1);
- f.ForEachTriangleRef(featureIntersector, -1);
+ f.ForEachPointRef(featureIntersector, FeatureType::BEST_GEOMETRY);
+ f.ForEachTriangleRef(featureIntersector, FeatureType::BEST_GEOMETRY);
CHECK(!featureIntersector.m_Trg.empty() || !featureIntersector.m_Polyline.empty(), \
- (f.DebugString(-1)));
+ (f.DebugString(FeatureType::BEST_GEOMETRY)));
if (featureIntersector.m_Trg.empty() && featureIntersector.m_Polyline.size() == 1)
{
diff --git a/indexer/scale_index_builder.hpp b/indexer/scale_index_builder.hpp
index dc0b708f6e..96d7d63e96 100644
--- a/indexer/scale_index_builder.hpp
+++ b/indexer/scale_index_builder.hpp
@@ -2,6 +2,7 @@
#include "scale_index.hpp"
#include "feature_covering.hpp"
#include "feature_visibility.hpp"
+#include "feature.hpp"
#include "interval_index_builder.hpp"
#include "cell_id.hpp"
@@ -18,6 +19,7 @@
#include "../std/vector.hpp"
#include "../std/utility.hpp"
+
class CellFeaturePair
{
public:
@@ -49,8 +51,8 @@ class FeatureCoverer
{
int GetGeometryScale() const
{
- // Do not pass actual level. We should build index for the best geometry (pass -1).
- return -1;
+ // Do not pass actual level. We should build index for the best geometry.
+ return FeatureType::BEST_GEOMETRY;
//return m_ScaleRange.second-1;
}
diff --git a/indexer/search_index_builder.cpp b/indexer/search_index_builder.cpp
index 7145c576e6..fbb29282c5 100644
--- a/indexer/search_index_builder.cpp
+++ b/indexer/search_index_builder.cpp
@@ -154,7 +154,7 @@ class FeatureInserter
case feature::GEOM_LINE:
{
CalcPolyCenter doCalc;
- f.ForEachPointRef(doCalc, -1);
+ f.ForEachPointRef(doCalc, FeatureType::BEST_GEOMETRY);
return doCalc.GetCenter();
}
@@ -162,7 +162,7 @@ class FeatureInserter
{
ASSERT_EQUAL ( type, feature::GEOM_AREA, () );
CalcMassCenter doCalc;
- f.ForEachTriangleRef(doCalc, -1);
+ f.ForEachTriangleRef(doCalc, FeatureType::BEST_GEOMETRY);
return doCalc.GetCenter();
}
}
diff --git a/map/map_tests/debug_features_test.cpp b/map/map_tests/debug_features_test.cpp
index d70234a1c6..3458960ee5 100644
--- a/map/map_tests/debug_features_test.cpp
+++ b/map/map_tests/debug_features_test.cpp
@@ -15,5 +15,5 @@ UNIT_TEST(DebugFeaturesTest_World_6941024)
// FeatureType f;
// vec.Get(6941024, f);
-// f.GetLimitRect(-1);
+// f.GetLimitRect(FeatureType::BEST_GEOMETRY);
}