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--drape/constants.hpp26
-rw-r--r--drape/depth_constants.hpp16
-rw-r--r--drape/drape_common.pri2
-rw-r--r--drape/overlay_handle.cpp9
-rw-r--r--drape/overlay_handle.hpp10
-rw-r--r--drape/overlay_tree.cpp15
-rw-r--r--drape/overlay_tree.hpp3
-rw-r--r--drape/utils/projection.hpp4
-rw-r--r--drape_frontend/apply_feature_functors.cpp52
-rw-r--r--drape_frontend/apply_feature_functors.hpp12
-rw-r--r--drape_frontend/drape_engine.cpp7
-rw-r--r--drape_frontend/drape_engine.hpp2
-rwxr-xr-xdrape_frontend/frontend_renderer.cpp7
-rw-r--r--drape_frontend/message.hpp3
-rw-r--r--drape_frontend/message_subclasses.hpp14
-rw-r--r--drape_frontend/my_position.cpp2
-rw-r--r--drape_frontend/rule_drawer.cpp24
-rw-r--r--drape_frontend/text_shape.cpp12
-rw-r--r--drape_frontend/text_shape.hpp8
-rw-r--r--indexer/ftypes_matcher.cpp25
-rw-r--r--indexer/ftypes_matcher.hpp7
-rw-r--r--map/framework.cpp5
-rw-r--r--map/framework.hpp2
-rw-r--r--qt/search_panel.cpp20
-rw-r--r--qt/search_panel.hpp1
-rw-r--r--xcode/drape/drape.xcodeproj/project.pbxproj8
26 files changed, 250 insertions, 46 deletions
diff --git a/drape/constants.hpp b/drape/constants.hpp
new file mode 100644
index 0000000000..5cbe4d88db
--- /dev/null
+++ b/drape/constants.hpp
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "utils/projection.hpp"
+
+namespace dp
+{
+
+namespace depth
+{
+
+float constexpr POSITION_ACCURACY = minDepth + 1.0f;
+float constexpr MY_POSITION_MARK = maxDepth - 1.0f;
+
+} // namespace depth
+
+namespace displacement
+{
+
+int constexpr kDefaultMode = 0x1;
+int constexpr kHotelMode = 0x2;
+
+int constexpr kAllModes = kDefaultMode | kHotelMode;
+
+} // namespace displacement
+
+} // namespace dp
diff --git a/drape/depth_constants.hpp b/drape/depth_constants.hpp
deleted file mode 100644
index 516f5606ee..0000000000
--- a/drape/depth_constants.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma once
-
-#include "utils/projection.hpp"
-
-namespace dp
-{
-
-namespace depth
-{
-
-float const POSITION_ACCURACY = minDepth + 1.0f;
-float const MY_POSITION_MARK = maxDepth - 1.0f;
-
-} // namespace depth
-
-} // namespace dp
diff --git a/drape/drape_common.pri b/drape/drape_common.pri
index 7cb8e4da16..f8cc8fa8ff 100644
--- a/drape/drape_common.pri
+++ b/drape/drape_common.pri
@@ -60,11 +60,11 @@ HEADERS += \
$$DRAPE_DIR/binding_info.hpp \
$$DRAPE_DIR/buffer_base.hpp \
$$DRAPE_DIR/color.hpp \
+ $$DRAPE_DIR/constants.hpp \
$$DRAPE_DIR/cpu_buffer.hpp \
$$DRAPE_DIR/data_buffer.hpp \
$$DRAPE_DIR/data_buffer_impl.hpp \
$$DRAPE_DIR/debug_rect_renderer.hpp \
- $$DRAPE_DIR/depth_constants.hpp \
$$DRAPE_DIR/drape_global.hpp \
$$DRAPE_DIR/dynamic_texture.hpp \
$$DRAPE_DIR/font_texture.hpp \
diff --git a/drape/overlay_handle.cpp b/drape/overlay_handle.cpp
index 0bcd2b514c..fd1179453a 100644
--- a/drape/overlay_handle.cpp
+++ b/drape/overlay_handle.cpp
@@ -1,5 +1,7 @@
#include "drape/overlay_handle.hpp"
+#include "drape/constants.hpp"
+
#include "base/macros.hpp"
#include "base/internal/message.hpp"
@@ -22,10 +24,8 @@ private:
uint8_t m_bufferID;
};
-OverlayHandle::OverlayHandle(FeatureID const & id,
- dp::Anchor anchor,
- uint64_t priority,
- bool isBillboard)
+OverlayHandle::OverlayHandle(FeatureID const & id, dp::Anchor anchor,
+ uint64_t priority, bool isBillboard)
: m_id(id)
, m_anchor(anchor)
, m_priority(priority)
@@ -34,6 +34,7 @@ OverlayHandle::OverlayHandle(FeatureID const & id,
, m_pivotZ(0.0)
, m_isBillboard(isBillboard)
, m_isVisible(false)
+ , m_displacementMode(displacement::kAllModes)
, m_enableCaching(false)
, m_extendedShapeDirty(true)
, m_extendedRectDirty(true)
diff --git a/drape/overlay_handle.hpp b/drape/overlay_handle.hpp
index ce6bb1fcbb..ab16ab166c 100644
--- a/drape/overlay_handle.hpp
+++ b/drape/overlay_handle.hpp
@@ -39,10 +39,8 @@ class OverlayHandle
public:
typedef vector<m2::RectF> Rects;
- OverlayHandle(FeatureID const & id,
- dp::Anchor anchor,
- uint64_t priority,
- bool isBillboard);
+ OverlayHandle(FeatureID const & id, dp::Anchor anchor,
+ uint64_t priority, bool isBillboard);
virtual ~OverlayHandle() {}
@@ -91,6 +89,9 @@ public:
void SetCachingEnable(bool enable);
+ int GetDisplacementMode() const { return m_displacementMode; }
+ void SetDisplacementMode(int mode) { m_displacementMode = mode; }
+
#ifdef DEBUG_OVERLAYS_OUTPUT
virtual string GetOverlayDebugInfo() { return ""; }
#endif
@@ -113,6 +114,7 @@ protected:
private:
bool const m_isBillboard;
bool m_isVisible;
+ int m_displacementMode;
dp::IndexStorage m_indexes;
struct LessOffsetNode
diff --git a/drape/overlay_tree.cpp b/drape/overlay_tree.cpp
index 394ce7e0a6..c4e8b9fc05 100644
--- a/drape/overlay_tree.cpp
+++ b/drape/overlay_tree.cpp
@@ -1,5 +1,7 @@
#include "drape/overlay_tree.hpp"
+#include "drape/constants.hpp"
+
#include "std/algorithm.hpp"
#include "std/bind.hpp"
@@ -63,6 +65,7 @@ OverlayTree::OverlayTree()
: m_frameCounter(kInvalidFrame)
, m_followingMode(false)
, m_isDisplacementEnabled(true)
+ , m_displacementMode(displacement::kDefaultMode)
{
for (size_t i = 0; i < m_handles.size(); i++)
m_handles[i].reserve(kAverageHandlesCount[i]);
@@ -115,9 +118,15 @@ void OverlayTree::Add(ref_ptr<OverlayHandle> handle)
handle->SetIsVisible(false);
handle->SetCachingEnable(true);
+ // Skip overlays from another displacement mode.
+ if ((handle->GetDisplacementMode() & m_displacementMode) == 0)
+ return;
+
+ // Skip duplicates.
if (m_handlesCache.find(handle) != m_handlesCache.end())
return;
+ // Skip not-ready handles.
if (!handle->Update(modelView))
return;
@@ -397,6 +406,12 @@ void OverlayTree::SetDisplacementEnabled(bool enabled)
m_frameCounter = kInvalidFrame;
}
+void OverlayTree::SetDisplacementMode(int displacementMode)
+{
+ m_displacementMode = displacementMode;
+ m_frameCounter = kInvalidFrame;
+}
+
#ifdef COLLECT_DISPLACEMENT_INFO
OverlayTree::TDisplacementInfo const & OverlayTree::GetDisplacementInfo() const
diff --git a/drape/overlay_tree.hpp b/drape/overlay_tree.hpp
index 3b11413352..bf13ae88b5 100644
--- a/drape/overlay_tree.hpp
+++ b/drape/overlay_tree.hpp
@@ -62,8 +62,8 @@ public:
void Select(m2::PointD const & glbPoint, TOverlayContainer & result) const;
void SetFollowingMode(bool mode);
-
void SetDisplacementEnabled(bool enabled);
+ void SetDisplacementMode(int displacementMode);
#ifdef COLLECT_DISPLACEMENT_INFO
struct DisplacementData
@@ -93,6 +93,7 @@ private:
bool m_followingMode;
bool m_isDisplacementEnabled;
+ int m_displacementMode;
#ifdef COLLECT_DISPLACEMENT_INFO
TDisplacementInfo m_displacementInfo;
diff --git a/drape/utils/projection.hpp b/drape/utils/projection.hpp
index d0051f545d..896be9cf6d 100644
--- a/drape/utils/projection.hpp
+++ b/drape/utils/projection.hpp
@@ -4,8 +4,8 @@
namespace dp
{
- static float const minDepth = -20000.0f;
- static float const maxDepth = 20000.0f;
+ float constexpr minDepth = -20000.0f;
+ float constexpr maxDepth = 20000.0f;
void MakeProjection(array<float, 16> & result, float left, float right, float bottom, float top);
} // namespace dp
diff --git a/drape_frontend/apply_feature_functors.cpp b/drape_frontend/apply_feature_functors.cpp
index e85d0b46dc..0d63191a52 100644
--- a/drape_frontend/apply_feature_functors.cpp
+++ b/drape_frontend/apply_feature_functors.cpp
@@ -23,8 +23,9 @@
#include "base/logging.hpp"
#include "std/algorithm.hpp"
-#include "std/utility.hpp"
#include "std/mutex.hpp"
+#include "std/sstream.hpp"
+#include "std/utility.hpp"
namespace df
{
@@ -34,6 +35,9 @@ namespace
double const kMinVisibleFontSize = 8.0;
+string const kStarSymbol = "★";
+string const kPriceSymbol = "$";
+
dp::Color ToDrapeColor(uint32_t src)
{
return dp::Extract(src, 255 - (src >> 24));
@@ -237,6 +241,26 @@ void BaseApplyFeature::ExtractCaptionParams(CaptionDefProto const * primaryProto
}
}
+string BaseApplyFeature::ExtractHotelInfo() const
+{
+ if (!m_hotelData.m_isHotel)
+ return "";
+
+ ostringstream out;
+ out << m_hotelData.m_rating << kStarSymbol;
+ if (m_hotelData.m_priceCategory != 0)
+ out << " ";
+ for (int i = 0; i < m_hotelData.m_priceCategory; i++)
+ out << kPriceSymbol;
+
+ return out.str();
+}
+
+void BaseApplyFeature::SetHotelData(HotelData && hotelData)
+{
+ m_hotelData = move(hotelData);
+}
+
ApplyPointFeature::ApplyPointFeature(TInsertShapeFn const & insertShape, FeatureID const & id,
int minVisibleScale, uint8_t rank, CaptionDescription const & captions,
float posZ)
@@ -294,10 +318,30 @@ void ApplyPointFeature::ProcessRule(Stylist::TRuleWrapper const & rule)
params.m_posZ = m_posZ;
params.m_hasArea = m_hasArea;
params.m_createdByEditor = m_createdByEditor;
- if(!params.m_primaryText.empty() || !params.m_secondaryText.empty())
+ if (!params.m_primaryText.empty() || !params.m_secondaryText.empty())
+ {
+ int displacementMode = dp::displacement::kAllModes;
+ // For hotels we set only kDefaultMode, because we have a special shape
+ // for kHotelMode and this shape will not be displayed in this case.
+ if (m_hotelData.m_isHotel)
+ displacementMode = dp::displacement::kDefaultMode;
+ m_insertShape(make_unique_dp<TextShape>(m_centerPoint, params,
+ hasPOI, 0 /* textIndex */,
+ true /* affectedByZoomPriority */,
+ displacementMode));
+ }
+ if (m_hotelData.m_isHotel && !params.m_primaryText.empty())
{
- m_insertShape(make_unique_dp<TextShape>(m_centerPoint, params, hasPOI, 0 /* textIndex */,
- true /* affectedByZoomPriority */));
+ params.m_primaryOptional = false;
+ params.m_primaryTextFont.m_size *= 1.2;
+ params.m_primaryTextFont.m_outlineColor = dp::Color(255, 255, 255, 153);
+ params.m_secondaryTextFont = params.m_primaryTextFont;
+ params.m_secondaryText = ExtractHotelInfo();
+ params.m_secondaryOptional = false;
+ m_insertShape(make_unique_dp<TextShape>(m_centerPoint, params,
+ hasPOI, 0 /* textIndex */,
+ true /* affectedByZoomPriority */,
+ dp::displacement::kHotelMode));
}
}
}
diff --git a/drape_frontend/apply_feature_functors.hpp b/drape_frontend/apply_feature_functors.hpp
index 8667f68d03..c96187bef7 100644
--- a/drape_frontend/apply_feature_functors.hpp
+++ b/drape_frontend/apply_feature_functors.hpp
@@ -36,16 +36,28 @@ public:
virtual ~BaseApplyFeature() {}
+ struct HotelData
+ {
+ bool m_isHotel = false;
+ string m_rating;
+ int m_stars = 0;
+ int m_priceCategory = 0;
+ };
+
+ void SetHotelData(HotelData && hotelData);
+
protected:
void ExtractCaptionParams(CaptionDefProto const * primaryProto,
CaptionDefProto const * secondaryProto,
double depth, TextViewParams & params) const;
+ string ExtractHotelInfo() const;
TInsertShapeFn m_insertShape;
FeatureID m_id;
CaptionDescription const & m_captions;
int m_minVisibleScale;
uint8_t m_rank;
+ HotelData m_hotelData;
};
class ApplyPointFeature : public BaseApplyFeature
diff --git a/drape_frontend/drape_engine.cpp b/drape_frontend/drape_engine.cpp
index d176bbcda5..ee62f04e5e 100644
--- a/drape_frontend/drape_engine.cpp
+++ b/drape_frontend/drape_engine.cpp
@@ -484,4 +484,11 @@ void DrapeEngine::SetTimeInBackground(double time)
MessagePriority::High);
}
+void DrapeEngine::SetDisplacementMode(int mode)
+{
+ m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
+ make_unique_dp<SetDisplacementModeMessage>(mode),
+ MessagePriority::Normal);
+}
+
} // namespace df
diff --git a/drape_frontend/drape_engine.hpp b/drape_frontend/drape_engine.hpp
index d8be9f54db..58272583cf 100644
--- a/drape_frontend/drape_engine.hpp
+++ b/drape_frontend/drape_engine.hpp
@@ -144,6 +144,8 @@ public:
void SetTimeInBackground(double time);
+ void SetDisplacementMode(int mode);
+
private:
void AddUserEvent(UserEvent const & e);
void ModelViewChanged(ScreenBase const & screen);
diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp
index b93ddf24c1..96fba67242 100755
--- a/drape_frontend/frontend_renderer.cpp
+++ b/drape_frontend/frontend_renderer.cpp
@@ -717,6 +717,13 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
break;
}
+ case Message::SetDisplacementMode:
+ {
+ ref_ptr<SetDisplacementModeMessage> msg = message;
+ m_overlayTree->SetDisplacementMode(msg->GetMode());
+ break;
+ }
+
case Message::Invalidate:
{
m_myPositionController->ResetRoutingNotFollowTimer();
diff --git a/drape_frontend/message.hpp b/drape_frontend/message.hpp
index ac33cf2521..78b89127f5 100644
--- a/drape_frontend/message.hpp
+++ b/drape_frontend/message.hpp
@@ -55,7 +55,8 @@ public:
SetKineticScrollEnabled,
BlockTapEvents,
SetTimeInBackground,
- SetAddNewPlaceMode
+ SetAddNewPlaceMode,
+ SetDisplacementMode
};
virtual ~Message() {}
diff --git a/drape_frontend/message_subclasses.hpp b/drape_frontend/message_subclasses.hpp
index b42da8c053..508e34119d 100644
--- a/drape_frontend/message_subclasses.hpp
+++ b/drape_frontend/message_subclasses.hpp
@@ -803,4 +803,18 @@ private:
double m_time;
};
+class SetDisplacementModeMessage : public Message
+{
+public:
+ explicit SetDisplacementModeMessage(int mode)
+ : m_mode(mode)
+ {}
+
+ Type GetType() const override { return Message::SetDisplacementMode; }
+ int GetMode() const { return m_mode; }
+
+private:
+ int m_mode;
+};
+
} // namespace df
diff --git a/drape_frontend/my_position.cpp b/drape_frontend/my_position.cpp
index 0344c57809..a5645cc3cd 100644
--- a/drape_frontend/my_position.cpp
+++ b/drape_frontend/my_position.cpp
@@ -1,7 +1,7 @@
#include "drape_frontend/my_position.hpp"
#include "drape_frontend/color_constants.hpp"
-#include "drape/depth_constants.hpp"
+#include "drape/constants.hpp"
#include "drape/glsl_func.hpp"
#include "drape/glsl_types.hpp"
#include "drape/overlay_handle.hpp"
diff --git a/drape_frontend/rule_drawer.cpp b/drape_frontend/rule_drawer.cpp
index d402650bb5..61793b7545 100644
--- a/drape_frontend/rule_drawer.cpp
+++ b/drape_frontend/rule_drawer.cpp
@@ -24,6 +24,24 @@
#include "base/string_utils.hpp"
#endif
+namespace {
+
+df::BaseApplyFeature::HotelData ExtractHotelData(FeatureType const & f)
+{
+ df::BaseApplyFeature::HotelData result;
+ if (ftypes::IsBookingChecker::Instance()(f))
+ {
+ result.m_isHotel = true;
+ // TODO: fill from metadata
+ result.m_rating = "7.8";
+ result.m_stars = 3;
+ result.m_priceCategory = 2;
+ }
+ return result;
+}
+
+} // namespace
+
namespace df
{
@@ -206,7 +224,7 @@ void RuleDrawer::operator()(FeatureType const & f)
ApplyAreaFeature apply(insertShape, f.GetID(), m_globalRect, areaMinHeight, areaHeight,
minVisibleScale, f.GetRank(), s.GetCaptionDescription());
f.ForEachTriangle(apply, zoomLevel);
-
+ apply.SetHotelData(ExtractHotelData(f));
if (applyPointStyle)
apply(featureCenter, true /* hasArea */);
@@ -236,7 +254,9 @@ void RuleDrawer::operator()(FeatureType const & f)
ASSERT(s.PointStyleExists(), ());
minVisibleScale = feature::GetMinDrawableScale(f);
- ApplyPointFeature apply(insertShape, f.GetID(), minVisibleScale, f.GetRank(), s.GetCaptionDescription(), 0.0f /* posZ */);
+ ApplyPointFeature apply(insertShape, f.GetID(), minVisibleScale, f.GetRank(),
+ s.GetCaptionDescription(), 0.0f /* posZ */);
+ apply.SetHotelData(ExtractHotelData(f));
f.ForEachPoint([&apply](m2::PointD const & pt) { apply(pt, false /* hasArea */); }, zoomLevel);
if (CheckCancelled())
diff --git a/drape_frontend/text_shape.cpp b/drape_frontend/text_shape.cpp
index e22ee9ac13..3bb4fc8269 100644
--- a/drape_frontend/text_shape.cpp
+++ b/drape_frontend/text_shape.cpp
@@ -123,12 +123,14 @@ private:
} // namespace
TextShape::TextShape(m2::PointF const & basePoint, TextViewParams const & params,
- bool hasPOI, size_t textIndex, bool affectedByZoomPriority)
+ bool hasPOI, size_t textIndex, bool affectedByZoomPriority,
+ int displacementMode)
: m_basePoint(basePoint)
, m_params(params)
, m_hasPOI(hasPOI)
, m_affectedByZoomPriority(affectedByZoomPriority)
, m_textIndex(textIndex)
+ , m_displacementMode(displacementMode)
{}
void TextShape::Draw(ref_ptr<dp::Batcher> batcher, ref_ptr<dp::TextureManager> textures) const
@@ -219,6 +221,7 @@ void TextShape::DrawSubStringPlain(StraightTextLayout const & layout, dp::FontDe
m_affectedByZoomPriority,
move(dynamicBuffer),
true);
+ handle->SetDisplacementMode(m_displacementMode);
handle->SetPivotZ(m_params.m_posZ);
handle->SetOverlayRank(m_hasPOI ? (isPrimary ? dp::OverlayRank1 : dp::OverlayRank2) : dp::OverlayRank0);
handle->SetExtendingSize(m_params.m_extendingSize);
@@ -265,6 +268,7 @@ void TextShape::DrawSubStringOutlined(StraightTextLayout const & layout, dp::Fon
m_affectedByZoomPriority,
move(dynamicBuffer),
true);
+ handle->SetDisplacementMode(m_displacementMode);
handle->SetPivotZ(m_params.m_posZ);
handle->SetOverlayRank(m_hasPOI ? (isPrimary ? dp::OverlayRank1 : dp::OverlayRank2) : dp::OverlayRank0);
handle->SetExtendingSize(m_params.m_extendingSize);
@@ -275,11 +279,11 @@ void TextShape::DrawSubStringOutlined(StraightTextLayout const & layout, dp::Fon
batcher->InsertListOfStrip(state, make_ref(&provider), move(handle), 4);
}
-
uint64_t TextShape::GetOverlayPriority() const
{
- // Set up maximum priority for shapes which created by user in the editor.
- if (m_params.m_createdByEditor || m_disableDisplacing)
+ // Set up maximum priority for shapes which created by user in the editor, in case of disabling displacement,
+ // in case of a special displacement mode.
+ if (m_params.m_createdByEditor || m_disableDisplacing || (m_displacementMode & dp::displacement::kDefaultMode) == 0)
return dp::kPriorityMaskAll;
// Set up minimal priority for shapes which belong to areas
diff --git a/drape_frontend/text_shape.hpp b/drape_frontend/text_shape.hpp
index 5df93d775f..3982c418f0 100644
--- a/drape_frontend/text_shape.hpp
+++ b/drape_frontend/text_shape.hpp
@@ -3,9 +3,11 @@
#include "drape_frontend/map_shape.hpp"
#include "drape_frontend/shape_view_params.hpp"
-#include "geometry/point2d.hpp"
+#include "drape/constants.hpp"
#include "drape/glsl_types.hpp"
+#include "geometry/point2d.hpp"
+
namespace df
{
@@ -15,7 +17,8 @@ class TextShape : public MapShape
{
public:
TextShape(m2::PointF const & basePoint, TextViewParams const & params,
- bool hasPOI, size_t textIndex, bool affectedByZoomPriority);
+ bool hasPOI, size_t textIndex, bool affectedByZoomPriority,
+ int displacementMode = dp::displacement::kAllModes);
void Draw(ref_ptr<dp::Batcher> batcher, ref_ptr<dp::TextureManager> textures) const override;
MapShapeType GetType() const override { return MapShapeType::OverlayType; }
@@ -44,6 +47,7 @@ private:
size_t m_textIndex;
bool m_disableDisplacing = false;
+ int m_displacementMode;
};
} // namespace df
diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp
index 898327a180..dd2b8c547e 100644
--- a/indexer/ftypes_matcher.cpp
+++ b/indexer/ftypes_matcher.cpp
@@ -329,6 +329,31 @@ IsLocalityChecker const & IsLocalityChecker::Instance()
return inst;
}
+IsBookingChecker::IsBookingChecker()
+{
+ Classificator const & c = classif();
+ char const * arr[][3] = {
+ { "tourism", "alpine_hut", "booking" },
+ { "tourism", "apartment", "booking" },
+ { "tourism", "camp_site", "booking" },
+ { "tourism", "chalet", "booking" },
+ { "tourism", "guest_house", "booking" },
+ { "tourism", "hostel", "booking" },
+ { "tourism", "hotel", "booking" },
+ { "tourism", "motel", "booking" },
+ { "tourism", "resort", "booking" }
+ };
+
+ for (size_t i = 0; i < ARRAY_SIZE(arr); ++i)
+ m_types.push_back(c.GetTypeByPath(vector<string>(arr[i], arr[i] + 3)));
+}
+
+IsBookingChecker const & IsBookingChecker::Instance()
+{
+ static const IsBookingChecker inst;
+ return inst;
+}
+
uint32_t GetPopulation(FeatureType const & ft)
{
uint32_t population = ft.GetPopulation();
diff --git a/indexer/ftypes_matcher.hpp b/indexer/ftypes_matcher.hpp
index d2a11b24b2..0b10e026b7 100644
--- a/indexer/ftypes_matcher.hpp
+++ b/indexer/ftypes_matcher.hpp
@@ -157,6 +157,13 @@ public:
static IsTunnelChecker const & Instance();
};
+class IsBookingChecker : public BaseChecker
+{
+ IsBookingChecker();
+public:
+ static IsBookingChecker const & Instance();
+};
+
/// Type of locality (do not change values and order - they have detalization order)
/// COUNTRY < STATE < CITY < ...
enum Type { NONE = -1, COUNTRY = 0, STATE, CITY, TOWN, VILLAGE, LOCALITY_COUNT };
diff --git a/map/framework.cpp b/map/framework.cpp
index f8022b9dd0..156cfbc7e2 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -861,6 +861,11 @@ void Framework::PrepareToShutdown()
DestroyDrapeEngine();
}
+void Framework::SetDisplacementMode(int mode)
+{
+ CallDrapeFunction(bind(&df::DrapeEngine::SetDisplacementMode, _1, mode));
+}
+
void Framework::SaveViewport()
{
m2::AnyRectD rect;
diff --git a/map/framework.hpp b/map/framework.hpp
index 8869518c1f..783bbad242 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -367,6 +367,8 @@ public:
void PrepareToShutdown();
+ void SetDisplacementMode(int mode);
+
private:
void InitCountryInfoGetter();
void InitSearchEngine();
diff --git a/qt/search_panel.cpp b/qt/search_panel.cpp
index f0d8ee2267..85c6476b65 100644
--- a/qt/search_panel.cpp
+++ b/qt/search_panel.cpp
@@ -4,6 +4,8 @@
#include "map/bookmark_manager.hpp"
#include "map/user_mark_container.hpp"
+#include "drape/constants.hpp"
+
#include "platform/measurement_utils.hpp"
#include "std/bind.hpp"
@@ -240,6 +242,22 @@ bool SearchPanel::TryMigrate(QString const & str)
}
+bool SearchPanel::TryDisplacementModeCmd(QString const & str)
+{
+ bool const isDefaultDisplacementMode = (str == "?dm:default");
+ bool const isHotelDisplacementMode = (str == "?dm:hotel");
+
+ if (!isDefaultDisplacementMode && !isHotelDisplacementMode)
+ return false;
+
+ if (isDefaultDisplacementMode)
+ m_pDrawWidget->GetFramework().SetDisplacementMode(dp::displacement::kDefaultMode);
+ else if (isHotelDisplacementMode)
+ m_pDrawWidget->GetFramework().SetDisplacementMode(dp::displacement::kHotelMode);
+
+ return true;
+}
+
void SearchPanel::OnSearchTextChanged(QString const & str)
{
QString const normalized = str.normalized(QString::NormalizationForm_KC);
@@ -253,6 +271,8 @@ void SearchPanel::OnSearchTextChanged(QString const & str)
return;
if (TryMigrate(normalized))
return;
+ if (TryDisplacementModeCmd(normalized))
+ return;
// search even with empty query
if (!normalized.isEmpty())
diff --git a/qt/search_panel.hpp b/qt/search_panel.hpp
index fd82e20ed3..d1ff5ad1bc 100644
--- a/qt/search_panel.hpp
+++ b/qt/search_panel.hpp
@@ -67,5 +67,6 @@ private slots:
bool TryChangeRouterCmd(QString const & str);
bool Try3dModeCmd(QString const & str);
bool TryMigrate(QString const & str);
+ bool TryDisplacementModeCmd(QString const & str);
};
} // namespace qt
diff --git a/xcode/drape/drape.xcodeproj/project.pbxproj b/xcode/drape/drape.xcodeproj/project.pbxproj
index d8920ae809..bef188ffeb 100644
--- a/xcode/drape/drape.xcodeproj/project.pbxproj
+++ b/xcode/drape/drape.xcodeproj/project.pbxproj
@@ -10,8 +10,8 @@
347F32F91C45383E009758CC /* debug_rect_renderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 347F32F71C45383E009758CC /* debug_rect_renderer.cpp */; };
347F32FA1C45383E009758CC /* debug_rect_renderer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 347F32F81C45383E009758CC /* debug_rect_renderer.hpp */; };
3492DA0B1CA2D91C00C1F3B3 /* visual_scale.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3492DA0A1CA2D91C00C1F3B3 /* visual_scale.hpp */; };
+ 45201E951CE605B1008A4842 /* constants.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 45201E941CE605B1008A4842 /* constants.hpp */; };
670947231BDF9A4F005014C0 /* data_buffer_impl.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670947151BDF9A4F005014C0 /* data_buffer_impl.hpp */; };
- 670947241BDF9A4F005014C0 /* depth_constants.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670947161BDF9A4F005014C0 /* depth_constants.hpp */; };
670947251BDF9A4F005014C0 /* fribidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670947171BDF9A4F005014C0 /* fribidi.cpp */; };
670947261BDF9A4F005014C0 /* fribidi.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670947181BDF9A4F005014C0 /* fribidi.hpp */; };
670947271BDF9A4F005014C0 /* glyph_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670947191BDF9A4F005014C0 /* glyph_manager.cpp */; };
@@ -124,8 +124,8 @@
347F32F71C45383E009758CC /* debug_rect_renderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = debug_rect_renderer.cpp; sourceTree = "<group>"; };
347F32F81C45383E009758CC /* debug_rect_renderer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = debug_rect_renderer.hpp; sourceTree = "<group>"; };
3492DA0A1CA2D91C00C1F3B3 /* visual_scale.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = visual_scale.hpp; sourceTree = "<group>"; };
+ 45201E941CE605B1008A4842 /* constants.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = constants.hpp; sourceTree = "<group>"; };
670947151BDF9A4F005014C0 /* data_buffer_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = data_buffer_impl.hpp; sourceTree = "<group>"; };
- 670947161BDF9A4F005014C0 /* depth_constants.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = depth_constants.hpp; sourceTree = "<group>"; };
670947171BDF9A4F005014C0 /* fribidi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fribidi.cpp; sourceTree = "<group>"; };
670947181BDF9A4F005014C0 /* fribidi.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fribidi.hpp; sourceTree = "<group>"; };
670947191BDF9A4F005014C0 /* glyph_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glyph_manager.cpp; sourceTree = "<group>"; };
@@ -271,8 +271,8 @@
6743D3431C3533AE0095054B /* support_manager.hpp */,
6729A53E1A69213A007D5872 /* shaders */,
6729A55C1A69213A007D5872 /* utils */,
+ 45201E941CE605B1008A4842 /* constants.hpp */,
670947151BDF9A4F005014C0 /* data_buffer_impl.hpp */,
- 670947161BDF9A4F005014C0 /* depth_constants.hpp */,
670947171BDF9A4F005014C0 /* fribidi.cpp */,
670947181BDF9A4F005014C0 /* fribidi.hpp */,
670947191BDF9A4F005014C0 /* glyph_manager.cpp */,
@@ -446,13 +446,13 @@
6729A5AF1A69213A007D5872 /* uniform_values_storage.hpp in Headers */,
6729A5951A69213A007D5872 /* overlay_handle.hpp in Headers */,
6729A57E1A69213A007D5872 /* glfunctions.hpp in Headers */,
+ 45201E951CE605B1008A4842 /* constants.hpp in Headers */,
6709472E1BDF9A4F005014C0 /* index_storage.hpp in Headers */,
6729A5B51A69213A007D5872 /* vertex_array_buffer.hpp in Headers */,
6729A5A71A69213A007D5872 /* texture_manager.hpp in Headers */,
6729A5901A69213A007D5872 /* object_pool.hpp in Headers */,
670947261BDF9A4F005014C0 /* fribidi.hpp in Headers */,
6729A5A11A69213A007D5872 /* shader.hpp in Headers */,
- 670947241BDF9A4F005014C0 /* depth_constants.hpp in Headers */,
6729A5641A69213A007D5872 /* attribute_buffer_mutator.hpp in Headers */,
6729A5811A69213A007D5872 /* glsl_types.hpp in Headers */,
6729A57A1A69213A007D5872 /* glconstants.hpp in Headers */,