[editor] GetFeaturesByStatus() for easier search integration.

This commit is contained in:
Alex Zolotarev 2016-01-27 17:24:11 +03:00 committed by Sergey Yershov
parent 701ad96902
commit f8fc871415
2 changed files with 18 additions and 0 deletions

View file

@ -563,6 +563,21 @@ bool Editor::GetEditedFeatureStreet(FeatureType const & feature, string & outFea
return true;
}
vector<uint32_t> Editor::GetFeaturesByStatus(MwmSet::MwmId const & mwmId, FeatureStatus status) const
{
vector<uint32_t> features;
auto const matchedMwm = m_features.find(mwmId);
if (matchedMwm == m_features.end())
return features;
for (auto const & index : matchedMwm->second)
{
if (index.second.m_status == status)
features.push_back(index.first);
}
sort(features.begin(), features.end());
return features;
}
vector<Metadata::EType> Editor::EditableMetadataForType(FeatureType const & feature) const
{
// TODO(mgsergio): Load editable fields into memory from XML and query them here.

View file

@ -82,6 +82,9 @@ public:
/// @param outFeatureStreet is valid only if true was returned.
bool GetEditedFeatureStreet(FeatureType const & feature, string & outFeatureStreet) const;
/// @returns sorted features indices with specified status.
vector<uint32_t> GetFeaturesByStatus(MwmSet::MwmId const & mwmId, FeatureStatus status) const;
/// Editor checks internally if any feature params were actually edited.
/// House number is correctly updated for editedFeature (if it's valid).
void EditFeature(FeatureType & editedFeature,