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:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2015-12-16 15:15:13 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2015-12-29 16:42:37 +0300
commit1b7f5d825774cbb70389219e6f0984842fb9d265 (patch)
treec9cda70c8d188e6904fd76ca7cdffdad939bc9e9 /drape_frontend/rule_drawer.cpp
parent126ade0d8d056e3ee898baff69b624d380280222 (diff)
Buildings min height.
Diffstat (limited to 'drape_frontend/rule_drawer.cpp')
-rw-r--r--drape_frontend/rule_drawer.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/drape_frontend/rule_drawer.cpp b/drape_frontend/rule_drawer.cpp
index 21ca696732..b973eeeecb 100644
--- a/drape_frontend/rule_drawer.cpp
+++ b/drape_frontend/rule_drawer.cpp
@@ -137,25 +137,35 @@ void RuleDrawer::operator()(FeatureType const & f)
bool const is3dBuilding = m_is3dBuidings ? (ftypes::IsBuildingChecker::Instance()(f) && f.GetLayer() >= 0) : false;
float areaHeight = 0.0f;
+ float areaMinHeight = 0.0f;
if (is3dBuilding)
{
f.ParseMetadata();
feature::Metadata const & md = f.GetMetadata();
- string const & height = md.Get(feature::Metadata::FMD_HEIGHT);
+ string value = md.Get(feature::Metadata::FMD_HEIGHT);
double const kDefaultHeightInMeters = 0.0;
double heightInMeters = kDefaultHeightInMeters;
- if (!height.empty())
- strings::to_double(height, heightInMeters);
+ if (!value.empty())
+ strings::to_double(value, heightInMeters);
+
+ value = md.Get(feature::Metadata::FMD_MIN_HEIGHT);
+ double minHeigthInMeters = 0.0;
+ if (!value.empty())
+ strings::to_double(value, minHeigthInMeters);
m2::PointD const pt = feature::GetCenter(f, zoomLevel);
- m2::RectD const rectMercator = MercatorBounds::MetresToXY(MercatorBounds::XToLon(pt.x),
- MercatorBounds::YToLat(pt.y),
- heightInMeters);
+ double const lon = MercatorBounds::XToLon(pt.x);
+ double const lat = MercatorBounds::YToLat(pt.y);
+
+ m2::RectD rectMercator = MercatorBounds::MetresToXY(lon, lat, heightInMeters);
areaHeight = m2::PointD(rectMercator.SizeX(), rectMercator.SizeY()).Length();
+
+ rectMercator = MercatorBounds::MetresToXY(lon, lat, minHeigthInMeters);
+ areaMinHeight = m2::PointD(rectMercator.SizeX(), rectMercator.SizeY()).Length();
}
- ApplyAreaFeature apply(insertShape, f.GetID(), areaHeight,
+ ApplyAreaFeature apply(insertShape, f.GetID(), areaMinHeight, areaHeight,
minVisibleScale, f.GetRank(), s.GetCaptionDescription());
f.ForEachTriangleRef(apply, zoomLevel);