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:
-rw-r--r--indexer/map_object.cpp12
-rw-r--r--indexer/map_object.hpp5
2 files changed, 17 insertions, 0 deletions
diff --git a/indexer/map_object.cpp b/indexer/map_object.cpp
index bc21e6ee60..7476087f57 100644
--- a/indexer/map_object.cpp
+++ b/indexer/map_object.cpp
@@ -77,6 +77,17 @@ void MapObject::SetFromFeatureType(FeatureType & ft)
m_featureID = ft.GetID();
ASSERT(m_featureID.IsValid(), ());
m_geomType = ft.GetFeatureType();
+ if (m_geomType == feature::GEOM_AREA)
+ {
+ m_triangles = ft.GetTriangesAsPoints(FeatureType::BEST_GEOMETRY);
+ }
+ else if (m_geomType == feature::GEOM_LINE)
+ {
+ ft.ParseGeometry(FeatureType::BEST_GEOMETRY);
+ m_points.reserve(ft.GetPointsCount());
+ ft.ForEachPoint([this](m2::PointD const & p) { m_points.push_back(p); },
+ FeatureType::BEST_GEOMETRY);
+ }
SetInetIfNeeded(ft, m_metadata);
}
@@ -84,6 +95,7 @@ void MapObject::SetFromFeatureType(FeatureType & ft)
FeatureID const & MapObject::GetID() const { return m_featureID; }
ms::LatLon MapObject::GetLatLon() const { return MercatorBounds::ToLatLon(m_mercator); }
m2::PointD const & MapObject::GetMercator() const { return m_mercator; }
+vector<m2::PointD> const & MapObject::GetTriangesAsPoints() const { return m_triangles; }
feature::TypesHolder const & MapObject::GetTypes() const { return m_types; }
string MapObject::GetDefaultName() const
diff --git a/indexer/map_object.hpp b/indexer/map_object.hpp
index 92fba24246..6f8de6ab36 100644
--- a/indexer/map_object.hpp
+++ b/indexer/map_object.hpp
@@ -60,6 +60,7 @@ public:
ms::LatLon GetLatLon() const;
m2::PointD const & GetMercator() const;
+ std::vector<m2::PointD> const & GetTriangesAsPoints() const;
feature::TypesHolder const & GetTypes() const;
std::string GetDefaultName() const;
@@ -107,6 +108,10 @@ protected:
FeatureID m_featureID;
m2::PointD m_mercator;
+
+ std::vector<m2::PointD> m_points;
+ std::vector<m2::PointD> m_triangles;
+
StringUtf8Multilang m_name;
feature::TypesHolder m_types;
feature::Metadata m_metadata;