Fixed displacement of routing marks.

This commit is contained in:
Daria Volvenkova 2018-11-27 20:56:28 +03:00 committed by Roman Kuznetsov
parent 3d00128158
commit 47767b1f18
12 changed files with 24 additions and 32 deletions

View file

@ -293,7 +293,7 @@ void ColoredSymbolShape::Draw(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::
}
if (m_params.m_specialDisplacement == SpecialDisplacement::UserMark ||
m_params.m_specialDisplacement == SpecialDisplacement::TransitScheme)
m_params.m_specialDisplacement == SpecialDisplacement::SpecialModeUserMark)
{
handle->SetSpecialLayerOverlay(true);
}
@ -314,7 +314,7 @@ uint64_t ColoredSymbolShape::GetOverlayPriority() const
{
// Special displacement mode.
if (m_params.m_specialDisplacement == SpecialDisplacement::SpecialMode ||
m_params.m_specialDisplacement == SpecialDisplacement::TransitScheme)
m_params.m_specialDisplacement == SpecialDisplacement::SpecialModeUserMark)
{
return dp::CalculateSpecialModePriority(m_params.m_specialPriority);
}

View file

@ -858,6 +858,7 @@ drape_ptr<UserMarkRenderParams> DrapeEngine::GenerateMarkRenderInfo(UserPointMar
renderInfo->m_hasSymbolShapes = mark->HasSymbolShapes();
renderInfo->m_hasTitlePriority = mark->HasTitlePriority();
renderInfo->m_priority = mark->GetPriority();
renderInfo->m_displacement = mark->GetDisplacement();
renderInfo->m_index = mark->GetIndex();
renderInfo->m_featureId = mark->GetFeatureID();
renderInfo->m_hasCreationAnimation = mark->HasCreationAnimation();

View file

@ -165,7 +165,7 @@ drape_ptr<dp::OverlayHandle> PoiSymbolShape::CreateOverlayHandle(m2::PointF cons
handle->SetPivotZ(m_params.m_posZ);
handle->SetExtendingSize(m_params.m_extendingSize);
if (m_params.m_specialDisplacement == SpecialDisplacement::UserMark ||
m_params.m_specialDisplacement == SpecialDisplacement::TransitScheme)
m_params.m_specialDisplacement == SpecialDisplacement::SpecialModeUserMark)
{
handle->SetSpecialLayerOverlay(true);
}
@ -181,7 +181,7 @@ uint64_t PoiSymbolShape::GetOverlayPriority() const
// Special displacement mode.
if (m_params.m_specialDisplacement == SpecialDisplacement::SpecialMode ||
m_params.m_specialDisplacement == SpecialDisplacement::TransitScheme)
m_params.m_specialDisplacement == SpecialDisplacement::SpecialModeUserMark)
{
return dp::CalculateSpecialModePriority(m_params.m_specialPriority);
}

View file

@ -29,13 +29,13 @@ struct CommonViewParams
m2::PointD m_tileCenter;
};
enum class SpecialDisplacement
enum class SpecialDisplacement : uint8_t
{
None,
SpecialMode,
UserMark,
SpecialModeUserMark,
HouseNumber,
TransitScheme
};
struct CommonOverlayViewParams : public CommonViewParams

View file

@ -354,7 +354,7 @@ void TextShape::DrawSubStringPlain(ref_ptr<dp::GraphicsContext> context,
handle->SetExtendingSize(m_params.m_extendingSize);
if (m_params.m_specialDisplacement == SpecialDisplacement::UserMark ||
m_params.m_specialDisplacement == SpecialDisplacement::TransitScheme)
m_params.m_specialDisplacement == SpecialDisplacement::SpecialModeUserMark)
{
handle->SetSpecialLayerOverlay(true);
}
@ -417,7 +417,7 @@ void TextShape::DrawSubStringOutlined(ref_ptr<dp::GraphicsContext> context,
handle->SetExtendingSize(m_params.m_extendingSize);
if (m_params.m_specialDisplacement == SpecialDisplacement::UserMark ||
m_params.m_specialDisplacement == SpecialDisplacement::TransitScheme)
m_params.m_specialDisplacement == SpecialDisplacement::SpecialModeUserMark)
{
handle->SetSpecialLayerOverlay(true);
}
@ -437,7 +437,7 @@ uint64_t TextShape::GetOverlayPriority() const
// Special displacement mode.
if (m_params.m_specialDisplacement == SpecialDisplacement::SpecialMode ||
m_params.m_specialDisplacement == SpecialDisplacement::TransitScheme)
m_params.m_specialDisplacement == SpecialDisplacement::SpecialModeUserMark)
{
return dp::CalculateSpecialModePriority(m_params.m_specialPriority);
}

View file

@ -746,7 +746,7 @@ void TransitSchemeBuilder::GenerateTitles(ref_ptr<dp::GraphicsContext> context,
textParams.m_titleDecl.m_anchor = title.m_anchor;
textParams.m_depthTestEnabled = false;
textParams.m_depthLayer = DepthLayer::TransitSchemeLayer;
textParams.m_specialDisplacement = SpecialDisplacement::TransitScheme;
textParams.m_specialDisplacement = SpecialDisplacement::SpecialModeUserMark;
textParams.m_specialPriority = priority;
textParams.m_startOverlayRank = dp::OverlayRank0;
textParams.m_minVisibleScale = minVisibleScale;
@ -762,7 +762,7 @@ void TransitSchemeBuilder::GenerateTitles(ref_ptr<dp::GraphicsContext> context,
colorParams.m_tileCenter = pivot;
colorParams.m_depthTestEnabled = false;
colorParams.m_depthLayer = DepthLayer::TransitSchemeLayer;
colorParams.m_specialDisplacement = SpecialDisplacement::TransitScheme;
colorParams.m_specialDisplacement = SpecialDisplacement::SpecialModeUserMark;
colorParams.m_specialPriority = static_cast<uint16_t>(Priority::Stub);
colorParams.m_startOverlayRank = dp::OverlayRank0;

View file

@ -170,7 +170,7 @@ void GenerateColoredSymbolShapes(ref_ptr<dp::GraphicsContext> context,
params.m_depth = renderInfo.m_depth;
params.m_depthLayer = renderInfo.m_depthLayer;
params.m_minVisibleScale = renderInfo.m_minZoom;
params.m_specialDisplacement = SpecialDisplacement::UserMark;
params.m_specialDisplacement = renderInfo.m_displacement;
params.m_specialPriority = renderInfo.m_priority;
params.m_offset += offset;
if (renderInfo.m_symbolSizes != nullptr)
@ -203,7 +203,7 @@ void GeneratePoiSymbolShape(ref_ptr<dp::GraphicsContext> context,
params.m_depth = renderInfo.m_depth;
params.m_depthLayer = renderInfo.m_depthLayer;
params.m_minVisibleScale = renderInfo.m_minZoom;
params.m_specialDisplacement = SpecialDisplacement::UserMark;
params.m_specialDisplacement = renderInfo.m_displacement;
params.m_specialPriority = renderInfo.m_priority;
params.m_symbolName = symbolName;
params.m_anchor = renderInfo.m_anchor;
@ -267,7 +267,7 @@ void GenerateTextShapes(ref_ptr<dp::GraphicsContext> context,
uint32_t const overlayIndex = kStartUserMarkOverlayIndex + renderInfo.m_index;
if (renderInfo.m_hasTitlePriority)
{
params.m_specialDisplacement = SpecialDisplacement::UserMark;
params.m_specialDisplacement = renderInfo.m_displacement;
params.m_specialPriority = renderInfo.m_priority;
params.m_startOverlayRank = dp::OverlayRank0;
if (renderInfo.m_hasSymbolShapes)

View file

@ -30,6 +30,7 @@ struct UserMarkRenderParams
bool m_hasSymbolShapes = false;
bool m_hasTitlePriority = false;
uint16_t m_priority = 0;
SpecialDisplacement m_displacement = SpecialDisplacement::UserMark;
uint32_t m_index = 0;
bool m_depthTestEnabled = true;
float m_depth = 0.0;

View file

@ -71,6 +71,7 @@ public:
virtual drape_ptr<SymbolSizes> GetSymbolSizes() const = 0;
virtual drape_ptr<SymbolOffsets> GetSymbolOffsets() const = 0;
virtual uint16_t GetPriority() const = 0;
virtual df::SpecialDisplacement GetDisplacement() const = 0;
virtual uint32_t GetIndex() const = 0;
virtual bool HasSymbolShapes() const = 0;
virtual bool HasTitlePriority() const = 0;

View file

@ -64,6 +64,7 @@ public:
bool HasSymbolShapes() const override { return false; }
bool HasTitlePriority() const override { return true; }
df::SpecialDisplacement GetDisplacement() const override { return df::SpecialDisplacement::SpecialModeUserMark; }
void SetFollowingMode(bool enabled);
@ -111,6 +112,7 @@ public:
bool HasSymbolShapes() const override { return !m_symbolNames.empty() || !m_coloredSymbols.m_zoomInfo.empty(); }
bool HasTitlePriority() const override { return true; }
df::SpecialDisplacement GetDisplacement() const override { return df::SpecialDisplacement::SpecialModeUserMark; }
void SetAnchor(dp::Anchor anchor);
dp::Anchor GetAnchor() const override;
@ -174,6 +176,7 @@ public:
bool HasSymbolShapes() const override { return true; }
bool HasTitlePriority() const override { return true; }
uint16_t GetPriority() const override { return static_cast<uint16_t>(Priority::SpeedCamera); }
df::SpecialDisplacement GetDisplacement() const override { return df::SpecialDisplacement::SpecialModeUserMark; }
drape_ptr<SymbolNameZoomInfo> GetSymbolNames() const override;
drape_ptr<TitlesInfo> GetTitleDecl() const override;

View file

@ -30,21 +30,6 @@ m2::PointD const & UserMark::GetPivot() const
return m_ptOrg;
}
m2::PointD UserMark::GetPixelOffset() const
{
return {};
}
dp::Anchor UserMark::GetAnchor() const
{
return dp::Center;
}
df::DepthLayer UserMark::GetDepthLayer() const
{
return df::DepthLayer::UserMarkLayer;
}
ms::LatLon UserMark::GetLatLon() const
{
return MercatorBounds::ToLatLon(m_ptOrg);

View file

@ -59,17 +59,18 @@ public:
void ResetChanges() const override { m_isDirty = false; }
bool IsVisible() const override { return true; }
m2::PointD const & GetPivot() const override;
m2::PointD GetPixelOffset() const override;
dp::Anchor GetAnchor() const override;
m2::PointD GetPixelOffset() const override { return {}; }
dp::Anchor GetAnchor() const override { return dp::Center; }
bool GetDepthTestEnabled() const override { return true; }
float GetDepth() const override { return 0.0f; }
df::DepthLayer GetDepthLayer() const override;
df::DepthLayer GetDepthLayer() const override { return df::DepthLayer::UserMarkLayer; }
drape_ptr<TitlesInfo> GetTitleDecl() const override { return nullptr; }
drape_ptr<ColoredSymbolZoomInfo> GetColoredSymbols() const override { return nullptr; }
drape_ptr<SymbolNameZoomInfo> GetBadgeNames() const override { return nullptr; }
drape_ptr<SymbolSizes> GetSymbolSizes() const override { return nullptr; }
drape_ptr<SymbolOffsets> GetSymbolOffsets() const override { return nullptr; }
uint16_t GetPriority() const override { return static_cast<uint16_t >(Priority::Default); }
df::SpecialDisplacement GetDisplacement() const override { return df::SpecialDisplacement::UserMark; }
uint32_t GetIndex() const override { return 0; }
bool HasSymbolShapes() const override { return false; }
bool HasTitlePriority() const override { return false; }