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
path: root/map
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2019-04-17 14:12:52 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2019-04-18 16:53:21 +0300
commit0b9a22ea84872625ef8a5c90cbdf3ae0c51a5e6c (patch)
treee4766d9b8f96ac02c80b2a395b1024ee70e64c93 /map
parent585e1eec5af5b868e958a862724cfedd1b49f1be (diff)
[indexer] enum feature::EGeomType is changed to enum class feature::GeomType
Diffstat (limited to 'map')
-rw-r--r--map/framework.cpp16
-rw-r--r--map/mwm_tests/mwm_foreach_test.cpp8
-rw-r--r--map/style_tests/classificator_tests.cpp17
3 files changed, 20 insertions, 21 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index 49adcb7db5..56a7f97bfd 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -2237,15 +2237,15 @@ FeatureID Framework::GetFeatureAtPoint(m2::PointD const & mercator) const
bool haveBuilding = false;
indexer::ForEachFeatureAtPoint(m_model.GetDataSource(), [&](FeatureType & ft)
{
- switch (ft.GetFeatureType())
+ switch (ft.GetGeomType())
{
- case feature::GEOM_POINT:
+ case feature::GeomType::Point:
poi = ft.GetID();
break;
- case feature::GEOM_LINE:
+ case feature::GeomType::Line:
line = ft.GetID();
break;
- case feature::GEOM_AREA:
+ case feature::GeomType::Area:
// Buildings have higher priority over other types.
if (haveBuilding)
return;
@@ -2255,8 +2255,8 @@ FeatureID Framework::GetFeatureAtPoint(m2::PointD const & mercator) const
area = ft.GetID();
haveBuilding = ftypes::IsBuildingChecker::Instance()(ft);
break;
- case feature::GEOM_UNDEFINED:
- ASSERT(false, ("case feature::GEOM_UNDEFINED"));
+ case feature::GeomType::Undefined:
+ ASSERT(false, ("case feature::Undefined"));
break;
}
}, mercator);
@@ -2446,7 +2446,7 @@ FeatureID Framework::FindBuildingAtPoint(m2::PointD const & mercator) const
m_model.ForEachFeature(rect, [&](FeatureType & ft)
{
if (!featureId.IsValid() &&
- ft.GetFeatureType() == feature::GEOM_AREA &&
+ ft.GetGeomType() == feature::GeomType::Area &&
ftypes::IsBuildingChecker::Instance()(ft) &&
ft.GetLimitRect(kScale).IsPointInside(mercator) &&
feature::GetMinDistanceMeters(ft, mercator) == 0.0)
@@ -3474,7 +3474,7 @@ void Framework::VisualizeCityRoadsInRect(m2::RectD const & rect)
size_t counter = 0;
GetDataSource().ForEachInRect(
[this, &rect, &cityRoads, &counter](FeatureType & ft) {
- if (ft.GetFeatureType() != feature::GEOM_LINE)
+ if (ft.GetGeomType() != feature::GeomType::Line)
return;
auto const & mwmId = ft.GetID().m_mwmId;
diff --git a/map/mwm_tests/mwm_foreach_test.cpp b/map/mwm_tests/mwm_foreach_test.cpp
index 17a015b930..43869a4a09 100644
--- a/map/mwm_tests/mwm_foreach_test.cpp
+++ b/map/mwm_tests/mwm_foreach_test.cpp
@@ -149,11 +149,11 @@ class AccumulatorEtalon : public AccumulatorBase
IntersectCheck check(m_rect);
using namespace feature;
- switch (f.GetFeatureType())
+ switch (f.GetGeomType())
{
- case GEOM_POINT: check.TestPoint(f.GetCenter()); break;
- case GEOM_LINE: f.ForEachPoint(check, m_scale); break;
- case GEOM_AREA: f.ForEachTriangle(check, m_scale); break;
+ case GeomType::Point: check.TestPoint(f.GetCenter()); break;
+ case GeomType::Line: f.ForEachPoint(check, m_scale); break;
+ case GeomType::Area: f.ForEachTriangle(check, m_scale); break;
default:
CHECK ( false, () );
}
diff --git a/map/style_tests/classificator_tests.cpp b/map/style_tests/classificator_tests.cpp
index 181240026d..117a896380 100644
--- a/map/style_tests/classificator_tests.cpp
+++ b/map/style_tests/classificator_tests.cpp
@@ -61,11 +61,11 @@ namespace
class DoCheckStyles
{
Classificator const & m_c;
- EGeomType m_geomType;
+ GeomType m_geomType;
int m_rules;
public:
- DoCheckStyles(Classificator const & c, EGeomType geomType, int rules)
+ DoCheckStyles(Classificator const & c, GeomType geomType, int rules)
: m_c(c), m_geomType(geomType), m_rules(rules)
{
}
@@ -86,8 +86,8 @@ public:
}
};
-void ForEachObject(Classificator const & c, vector<string> const & path,
- EGeomType geomType, int rules)
+void ForEachObject(Classificator const & c, vector<string> const & path, GeomType geomType,
+ int rules)
{
uint32_t const type = c.GetTypeByPath(path);
ClassifObject const * pObj = c.GetObject(type);
@@ -97,8 +97,7 @@ void ForEachObject(Classificator const & c, vector<string> const & path,
pObj->ForEachObjectInTree(doCheck, type);
}
-void ForEachObject(Classificator const & c, string const & name,
- EGeomType geomType, int rules)
+void ForEachObject(Classificator const & c, string const & name, GeomType geomType, int rules)
{
vector<string> path;
strings::Tokenize(name, "-", base::MakeBackInsertFunctor(path));
@@ -107,12 +106,12 @@ void ForEachObject(Classificator const & c, string const & name,
void CheckPointStyles(Classificator const & c, string const & name)
{
- ForEachObject(c, name, GEOM_POINT, RULE_CAPTION | RULE_SYMBOL);
+ ForEachObject(c, name, GeomType::Point, RULE_CAPTION | RULE_SYMBOL);
}
void CheckLineStyles(Classificator const & c, string const & name)
{
- ForEachObject(c, name, GEOM_LINE, RULE_PATH_TEXT);
+ ForEachObject(c, name, GeomType::Line, RULE_PATH_TEXT);
}
} // namespace
@@ -154,7 +153,7 @@ pair<int, int> GetMinMax(int level, vector<uint32_t> const & types, drule::rule_
pair<int, int> res(numeric_limits<int>::max(), numeric_limits<int>::min());
drule::KeysT keys;
- feature::GetDrawRule(types, level, feature::GEOM_AREA, keys);
+ feature::GetDrawRule(types, level, feature::GeomType::Area, keys);
for (size_t i = 0; i < keys.size(); ++i)
{