diff --git a/drape_frontend/rule_drawer.cpp b/drape_frontend/rule_drawer.cpp index b973eeeecb..f7f05032f2 100644 --- a/drape_frontend/rule_drawer.cpp +++ b/drape_frontend/rule_drawer.cpp @@ -134,7 +134,10 @@ void RuleDrawer::operator()(FeatureType const & f) if (s.AreaStyleExists()) { - bool const is3dBuilding = m_is3dBuidings ? (ftypes::IsBuildingChecker::Instance()(f) && f.GetLayer() >= 0) : false; + bool const is3dBuilding = + m_is3dBuidings ? ((ftypes::IsBuildingChecker::Instance()(f) || + ftypes::IsBuildingPartChecker::Instance()(f)) && f.GetLayer() >= 0) + : false; float areaHeight = 0.0f; float areaMinHeight = 0.0f; diff --git a/drape_frontend/stylist.cpp b/drape_frontend/stylist.cpp index c89c3ff7c1..cf9d509a0d 100644 --- a/drape_frontend/stylist.cpp +++ b/drape_frontend/stylist.cpp @@ -333,8 +333,12 @@ CaptionDescription & Stylist::GetCaptionDescriptionImpl() return m_captionDescriptor; } -bool InitStylist(FeatureType const & f, int const zoomLevel, Stylist & s) +bool InitStylist(FeatureType const & f, int const zoomLevel, bool buildings3d, Stylist & s) { + if (!buildings3d && ftypes::IsBuildingPartChecker::Instance()(f) && + !ftypes::IsBuildingChecker::Instance()(f)) + return false; + drule::KeysT keys; pair geomType = feature::GetDrawRule(f, zoomLevel, keys); diff --git a/drape_frontend/stylist.hpp b/drape_frontend/stylist.hpp index 3cbb4fc047..fd2b7df4aa 100644 --- a/drape_frontend/stylist.hpp +++ b/drape_frontend/stylist.hpp @@ -63,6 +63,7 @@ public: private: friend bool InitStylist(FeatureType const &, int const, + bool buildings3d, Stylist &); void RaiseCoastlineFlag(); @@ -82,6 +83,7 @@ private: bool InitStylist(FeatureType const & f, int const zoomLevel, + bool buildings3d, Stylist & s); } // namespace df diff --git a/drape_frontend/tile_info.cpp b/drape_frontend/tile_info.cpp index 46d30f7f23..653eb5779b 100644 --- a/drape_frontend/tile_info.cpp +++ b/drape_frontend/tile_info.cpp @@ -16,7 +16,7 @@ namespace df TileInfo::TileInfo(drape_ptr && context) : m_context(move(context)) - , m_is3dBuidings(false) + , m_is3dBuildings(false) , m_isCanceled(false) { } @@ -74,7 +74,7 @@ void TileInfo::ReadFeatures(MapDataProvider const & model, MemoryFeatureIndex & RuleDrawer drawer(bind(&TileInfo::InitStylist, this, _1 ,_2), bind(&TileInfo::IsCancelled, this), model.m_isCountryLoadedByNameFn, - make_ref(m_context), m_is3dBuidings); + make_ref(m_context), m_is3dBuildings); model.ReadFeatures(bind(ref(drawer), _1), featuresToRead); } } @@ -100,7 +100,7 @@ void TileInfo::ProcessID(FeatureID const & id) void TileInfo::InitStylist(FeatureType const & f, Stylist & s) { CheckCanceled(); - df::InitStylist(f, m_context->GetTileKey().m_styleZoomLevel, s); + df::InitStylist(f, m_context->GetTileKey().m_styleZoomLevel, m_is3dBuildings, s); } bool TileInfo::DoNeedReadIndex() const diff --git a/drape_frontend/tile_info.hpp b/drape_frontend/tile_info.hpp index a0c01cac66..e2166cfccb 100644 --- a/drape_frontend/tile_info.hpp +++ b/drape_frontend/tile_info.hpp @@ -31,8 +31,8 @@ public: void Cancel(MemoryFeatureIndex & memIndex); bool IsCancelled() const; - void Set3dBuildings(bool buildings3d) { m_is3dBuidings = buildings3d; } - bool Get3dBuildings() const { return m_is3dBuidings; } + void Set3dBuildings(bool buildings3d) { m_is3dBuildings = buildings3d; } + bool Get3dBuildings() const { return m_is3dBuildings; } m2::RectD GetGlobalRect() const; TileKey const & GetTileKey() const { return m_context->GetTileKey(); } @@ -50,7 +50,7 @@ private: private: drape_ptr m_context; TFeaturesInfo m_featureInfo; - bool m_is3dBuidings; + bool m_is3dBuildings; atomic m_isCanceled; }; diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index 65c6a150a9..09adfa9465 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -172,7 +172,6 @@ IsBuildingChecker::IsBuildingChecker() Classificator const & c = classif(); m_types.push_back(c.GetTypeByPath({ "building" })); - m_types.push_back(c.GetTypeByPath({ "building:part" })); m_types.push_back(c.GetTypeByPath({ "building", "address" })); } @@ -200,6 +199,21 @@ IsLocalityChecker::IsLocalityChecker() m_types.push_back(c.GetTypeByPath(vector(arr[i], arr[i] + 2))); } +IsBuildingPartChecker::IsBuildingPartChecker() : BaseChecker(3) +{ +} + +IsBuildingPartChecker const & IsBuildingPartChecker::Instance() +{ + static const IsBuildingPartChecker inst; + return inst; +} + +bool IsBuildingPartChecker::IsMatched(uint32_t type) const +{ + return IsTypeConformed(type, {"building:part"}); +} + IsBridgeChecker::IsBridgeChecker() : BaseChecker(3) { } diff --git a/indexer/ftypes_matcher.hpp b/indexer/ftypes_matcher.hpp index 9d985fe0d5..b439fdfb9b 100644 --- a/indexer/ftypes_matcher.hpp +++ b/indexer/ftypes_matcher.hpp @@ -101,6 +101,14 @@ public: uint32_t GetMainType() const { return m_types[0]; } }; +class IsBuildingPartChecker : public BaseChecker +{ + virtual bool IsMatched(uint32_t type) const; +public: + IsBuildingPartChecker(); + static IsBuildingPartChecker const & Instance(); +}; + class IsBridgeChecker : public BaseChecker { virtual bool IsMatched(uint32_t type) const;