forked from organicmaps/organicmaps-tmp
SpeedCameraMark and ColoredDebugMark added.
This commit is contained in:
parent
444cde73d4
commit
833bd37e7e
10 changed files with 241 additions and 29 deletions
|
@ -855,7 +855,7 @@ drape_ptr<UserMarkRenderParams> DrapeEngine::GenerateMarkRenderInfo(UserPointMar
|
|||
renderInfo->m_symbolSizes = mark->GetSymbolSizes();
|
||||
renderInfo->m_symbolOffsets = mark->GetSymbolOffsets();
|
||||
renderInfo->m_color = mark->GetColorConstant();
|
||||
renderInfo->m_hasSymbolPriority = mark->HasSymbolPriority();
|
||||
renderInfo->m_hasSymbolShapes = mark->HasSymbolShapes();
|
||||
renderInfo->m_hasTitlePriority = mark->HasTitlePriority();
|
||||
renderInfo->m_priority = mark->GetPriority();
|
||||
renderInfo->m_index = mark->GetIndex();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "drape_frontend/map_shape.hpp"
|
||||
#include "drape_frontend/poi_symbol_shape.hpp"
|
||||
#include "drape_frontend/shape_view_params.hpp"
|
||||
#include "drape_frontend/text_layout.hpp"
|
||||
#include "drape_frontend/text_shape.hpp"
|
||||
#include "drape_frontend/tile_utils.hpp"
|
||||
#include "drape_frontend/visual_params.hpp"
|
||||
|
@ -113,16 +114,50 @@ void GenerateColoredSymbolShapes(ref_ptr<dp::GraphicsContext> context,
|
|||
m2::PointD const & tileCenter, ref_ptr<dp::TextureManager> textures,
|
||||
m2::PointF & symbolSize, dp::Batcher & batcher)
|
||||
{
|
||||
for (auto itSym = renderInfo.m_coloredSymbols->rbegin();
|
||||
itSym != renderInfo.m_coloredSymbols->rend(); ++itSym)
|
||||
auto const needOverlay = renderInfo.m_coloredSymbols->m_needOverlay;
|
||||
m2::PointF sizeInc(0.0, 0.0);
|
||||
UserPointMark::SymbolSizes symbolSizesInc;
|
||||
auto const isTextBg = renderInfo.m_coloredSymbols->m_addTextSize;
|
||||
if (isTextBg)
|
||||
{
|
||||
auto const & titleDecl = renderInfo.m_titleDecl->at(0);
|
||||
dp::FontDecl const & fontDecl = titleDecl.m_primaryTextFont;
|
||||
auto isSdf = df::VisualParams::Instance().IsSdfPrefered();
|
||||
isSdf = fontDecl.m_outlineColor != dp::Color::Transparent() ? true : isSdf;
|
||||
auto const vs = static_cast<float>(df::VisualParams::Instance().GetVisualScale());
|
||||
|
||||
TextLayout textLayout;
|
||||
textLayout.Init(strings::MakeUniString(titleDecl.m_primaryText), fontDecl.m_size * vs, isSdf, textures);
|
||||
sizeInc.x = textLayout.GetPixelLength();
|
||||
sizeInc.y = textLayout.GetPixelHeight();
|
||||
|
||||
if (renderInfo.m_symbolSizes != nullptr)
|
||||
{
|
||||
symbolSizesInc.reserve(renderInfo.m_symbolSizes->size());
|
||||
for (auto const & sz : *renderInfo.m_symbolSizes)
|
||||
symbolSizesInc.push_back(sz + sizeInc);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto itSym = renderInfo.m_coloredSymbols->m_zoomInfo.rbegin();
|
||||
itSym != renderInfo.m_coloredSymbols->m_zoomInfo.rend(); ++itSym)
|
||||
{
|
||||
if (itSym->first <= tileKey.m_zoomLevel)
|
||||
{
|
||||
ColoredSymbolViewParams params = itSym->second;
|
||||
|
||||
if (params.m_shape == ColoredSymbolViewParams::Shape::Circle)
|
||||
symbolSize = m2::PointF(params.m_radiusInPixels * 2.0f, params.m_radiusInPixels * 2.0f);
|
||||
{
|
||||
params.m_radiusInPixels = params.m_radiusInPixels + std::max(sizeInc.x, sizeInc.y) / 2.0f;
|
||||
if (!isTextBg)
|
||||
symbolSize = m2::PointF(params.m_radiusInPixels * 2.0f, params.m_radiusInPixels * 2.0f);
|
||||
}
|
||||
else
|
||||
symbolSize = params.m_sizeInPixels;
|
||||
{
|
||||
params.m_sizeInPixels = params.m_sizeInPixels + sizeInc;
|
||||
if (!isTextBg)
|
||||
symbolSize = params.m_sizeInPixels;
|
||||
}
|
||||
|
||||
params.m_featureID = renderInfo.m_featureId;
|
||||
params.m_tileCenter = tileCenter;
|
||||
|
@ -136,13 +171,13 @@ void GenerateColoredSymbolShapes(ref_ptr<dp::GraphicsContext> context,
|
|||
{
|
||||
ColoredSymbolShape(renderInfo.m_pivot, params, tileKey,
|
||||
kStartUserMarkOverlayIndex + renderInfo.m_index,
|
||||
*renderInfo.m_symbolSizes.get())
|
||||
isTextBg ? symbolSizesInc : *renderInfo.m_symbolSizes.get())
|
||||
.Draw(context, &batcher, textures);
|
||||
}
|
||||
else
|
||||
{
|
||||
ColoredSymbolShape(renderInfo.m_pivot, params, tileKey,
|
||||
kStartUserMarkOverlayIndex + renderInfo.m_index)
|
||||
kStartUserMarkOverlayIndex + renderInfo.m_index, needOverlay)
|
||||
.Draw(context, &batcher, textures);
|
||||
}
|
||||
break;
|
||||
|
@ -166,8 +201,10 @@ void GeneratePoiSymbolShape(ref_ptr<dp::GraphicsContext> context,
|
|||
params.m_specialPriority = renderInfo.m_priority;
|
||||
params.m_symbolName = symbolName;
|
||||
params.m_anchor = renderInfo.m_anchor;
|
||||
params.m_startOverlayRank =
|
||||
renderInfo.m_coloredSymbols != nullptr ? dp::OverlayRank1 : dp::OverlayRank0;
|
||||
|
||||
bool const hasColoredOverlay = renderInfo.m_coloredSymbols != nullptr && renderInfo.m_coloredSymbols->m_needOverlay;
|
||||
params.m_startOverlayRank = hasColoredOverlay ? dp::OverlayRank1 : dp::OverlayRank0;
|
||||
|
||||
if (renderInfo.m_symbolOffsets != nullptr)
|
||||
{
|
||||
ASSERT_GREATER(tileKey.m_zoomLevel, 0, ());
|
||||
|
@ -227,11 +264,11 @@ void GenerateTextShapes(ref_ptr<dp::GraphicsContext> context,
|
|||
params.m_specialDisplacement = SpecialDisplacement::UserMark;
|
||||
params.m_specialPriority = renderInfo.m_priority;
|
||||
params.m_startOverlayRank = dp::OverlayRank0;
|
||||
if (renderInfo.m_hasSymbolPriority)
|
||||
if (renderInfo.m_hasSymbolShapes)
|
||||
{
|
||||
if (renderInfo.m_symbolNames != nullptr)
|
||||
params.m_startOverlayRank++;
|
||||
if (renderInfo.m_coloredSymbols != nullptr)
|
||||
if (renderInfo.m_coloredSymbols != nullptr && renderInfo.m_coloredSymbols->m_needOverlay)
|
||||
params.m_startOverlayRank++;
|
||||
ASSERT_LESS(params.m_startOverlayRank, dp::OverlayRanksCount, ());
|
||||
}
|
||||
|
@ -327,7 +364,7 @@ void CacheUserMarks(ref_ptr<dp::GraphicsContext> context, TileKey const & tileKe
|
|||
if (!renderInfo.m_color.empty())
|
||||
color = df::GetColorConstant(renderInfo.m_color);
|
||||
|
||||
if (renderInfo.m_hasSymbolPriority)
|
||||
if (renderInfo.m_hasSymbolShapes)
|
||||
{
|
||||
if (renderInfo.m_coloredSymbols != nullptr)
|
||||
{
|
||||
|
@ -400,7 +437,7 @@ void CacheUserMarks(ref_ptr<dp::GraphicsContext> context, TileKey const & tileKe
|
|||
|
||||
if (renderInfo.m_badgeNames != nullptr)
|
||||
{
|
||||
ASSERT(!renderInfo.m_hasSymbolPriority || renderInfo.m_symbolNames == nullptr,
|
||||
ASSERT(!renderInfo.m_hasSymbolShapes || renderInfo.m_symbolNames == nullptr,
|
||||
("Multiple POI shapes in an usermark are not supported yet"));
|
||||
auto const badgeName = GetSymbolNameForZoomLevel(renderInfo.m_badgeNames, tileKey);
|
||||
if (!badgeName.empty())
|
||||
|
|
|
@ -27,7 +27,7 @@ struct UserMarkRenderParams
|
|||
drape_ptr<UserPointMark::SymbolOffsets> m_symbolOffsets;
|
||||
drape_ptr<UserPointMark::SymbolNameZoomInfo> m_badgeNames;
|
||||
df::ColorConstant m_color;
|
||||
bool m_hasSymbolPriority = false;
|
||||
bool m_hasSymbolShapes = false;
|
||||
bool m_hasTitlePriority = false;
|
||||
uint16_t m_priority = 0;
|
||||
uint32_t m_index = 0;
|
||||
|
|
|
@ -37,7 +37,12 @@ struct IDCollections
|
|||
class UserPointMark
|
||||
{
|
||||
public:
|
||||
using ColoredSymbolZoomInfo = std::map<int, df::ColoredSymbolViewParams>;
|
||||
struct ColoredSymbolZoomInfo
|
||||
{
|
||||
std::map<int, df::ColoredSymbolViewParams> m_zoomInfo;
|
||||
bool m_needOverlay = true;
|
||||
bool m_addTextSize = false;
|
||||
};
|
||||
using SymbolNameZoomInfo = std::map<int, std::string>;
|
||||
using TitlesInfo = std::vector<dp::TitleDecl>;
|
||||
using SymbolSizes = std::vector<m2::PointF>;
|
||||
|
@ -67,7 +72,7 @@ public:
|
|||
virtual drape_ptr<SymbolOffsets> GetSymbolOffsets() const = 0;
|
||||
virtual uint16_t GetPriority() const = 0;
|
||||
virtual uint32_t GetIndex() const = 0;
|
||||
virtual bool HasSymbolPriority() const = 0;
|
||||
virtual bool HasSymbolShapes() const = 0;
|
||||
virtual bool HasTitlePriority() const = 0;
|
||||
virtual int GetMinZoom() const = 0;
|
||||
virtual int GetMinTitleZoom() const = 0;
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
drape_ptr<TitlesInfo> GetTitleDecl() const override;
|
||||
uint16_t GetPriority() const override { return m_data.m_priority; }
|
||||
bool HasSymbolPriority() const override { return true; }
|
||||
bool HasSymbolShapes() const override { return true; }
|
||||
bool HasTitlePriority() const override { return true; }
|
||||
int GetMinZoom() const override { return static_cast<int>(m_data.m_minZoomLevel); }
|
||||
FeatureID GetFeatureID() const override { return m_featureId; }
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "map/routing_mark.hpp"
|
||||
|
||||
#include "drape_frontend/color_constants.hpp"
|
||||
#include "drape_frontend/visual_params.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -20,6 +21,14 @@ float const kRouteMarkPrimaryTextSize = 11.0f;
|
|||
float const kRouteMarkSecondaryTextSize = 10.0f;
|
||||
float const kRouteMarkSecondaryOffsetY = 2.0f;
|
||||
float const kTransitMarkTextSize = 12.0f;
|
||||
|
||||
// TODO(darina): Add to style colors for speed camera marks.
|
||||
static std::string const kSpeedCameraMarkText = "TransitMarkPrimaryTextOutline";
|
||||
float constexpr kSpeedCameraMarkTextSize = 10.0f;
|
||||
float constexpr kSpeedCameraBorderWidth = 2.0f;
|
||||
int constexpr kSpeedCameraZoomS = 11;
|
||||
int constexpr kSpeedCameraZoomM = 16;
|
||||
int constexpr kMinSpeedCameraTitleZoom = 15;
|
||||
} // namespace
|
||||
|
||||
RouteMarkPoint::RouteMarkPoint(m2::PointD const & ptOrg)
|
||||
|
@ -449,7 +458,7 @@ void TransitMark::SetSymbolNames(std::map<int, std::string> const & symbolNames)
|
|||
m_symbolNames = symbolNames;
|
||||
}
|
||||
|
||||
void TransitMark::SetColoredSymbols(std::map<int, df::ColoredSymbolViewParams> const & symbolParams)
|
||||
void TransitMark::SetColoredSymbols(ColoredSymbolZoomInfo const & symbolParams)
|
||||
{
|
||||
SetDirty();
|
||||
m_coloredSymbols = symbolParams;
|
||||
|
@ -457,7 +466,7 @@ void TransitMark::SetColoredSymbols(std::map<int, df::ColoredSymbolViewParams> c
|
|||
|
||||
drape_ptr<df::UserPointMark::ColoredSymbolZoomInfo> TransitMark::GetColoredSymbols() const
|
||||
{
|
||||
if (m_coloredSymbols.empty())
|
||||
if (m_coloredSymbols.m_zoomInfo.empty())
|
||||
return nullptr;
|
||||
return make_unique_dp<ColoredSymbolZoomInfo>(m_coloredSymbols);
|
||||
}
|
||||
|
@ -514,3 +523,78 @@ void TransitMark::GetDefaultTransitTitle(dp::TitleDecl & titleDecl)
|
|||
titleDecl.m_secondaryTextFont.m_outlineColor = df::GetColorConstant(kTransitMarkSecondaryTextOutline);
|
||||
titleDecl.m_secondaryTextFont.m_size = kTransitMarkTextSize;
|
||||
}
|
||||
|
||||
SpeedCameraMark::SpeedCameraMark(m2::PointD const & ptOrg)
|
||||
: UserMark(ptOrg, Type::SPEED_CAM)
|
||||
{
|
||||
auto const vs = static_cast<float>(df::VisualParams::Instance().GetVisualScale());
|
||||
|
||||
m_titleDecl.m_primaryTextFont.m_color = df::GetColorConstant(kSpeedCameraMarkText);
|
||||
m_titleDecl.m_primaryTextFont.m_size = kSpeedCameraMarkTextSize;
|
||||
m_titleDecl.m_anchor = dp::Right;
|
||||
m_titleDecl.m_primaryOffset.x = -kSpeedCameraBorderWidth;
|
||||
|
||||
m_symbolNames.insert(std::make_pair(kSpeedCameraZoomS, "speedcam-s"));
|
||||
m_symbolNames.insert(std::make_pair(kSpeedCameraZoomM, "speedcam-m"));
|
||||
|
||||
df::ColoredSymbolViewParams params;
|
||||
params.m_color = dp::Color::Red();
|
||||
params.m_anchor = dp::Right;
|
||||
params.m_shape = df::ColoredSymbolViewParams::Shape::RoundedRectangle;
|
||||
params.m_radiusInPixels = kSpeedCameraBorderWidth * vs;
|
||||
params.m_sizeInPixels = m2::PointF(2.0f * kSpeedCameraBorderWidth, 2.0f * kSpeedCameraBorderWidth) * vs;
|
||||
m_textBg.m_zoomInfo[kMinSpeedCameraTitleZoom] = params;
|
||||
m_textBg.m_addTextSize = true;
|
||||
}
|
||||
|
||||
void SpeedCameraMark::SetTitle(std::string const & title)
|
||||
{
|
||||
SetDirty();
|
||||
m_titleDecl.m_primaryText = title;
|
||||
}
|
||||
|
||||
void SpeedCameraMark::SetFeatureId(FeatureID featureId)
|
||||
{
|
||||
SetDirty();
|
||||
m_featureId = featureId;
|
||||
}
|
||||
|
||||
void SpeedCameraMark::SetIndex(uint32_t index)
|
||||
{
|
||||
SetDirty();
|
||||
m_index = index;
|
||||
}
|
||||
|
||||
drape_ptr<df::UserPointMark::SymbolNameZoomInfo> SpeedCameraMark::GetSymbolNames() const
|
||||
{
|
||||
return make_unique_dp<SymbolNameZoomInfo>(m_symbolNames);
|
||||
}
|
||||
|
||||
drape_ptr<df::UserPointMark::TitlesInfo> SpeedCameraMark::GetTitleDecl() const
|
||||
{
|
||||
if (m_titleDecl.m_primaryText.empty())
|
||||
return nullptr;
|
||||
auto titleInfo = make_unique_dp<TitlesInfo>();
|
||||
titleInfo->push_back(m_titleDecl);
|
||||
return titleInfo;
|
||||
}
|
||||
|
||||
drape_ptr<df::UserPointMark::ColoredSymbolZoomInfo> SpeedCameraMark::GetColoredSymbols() const
|
||||
{
|
||||
return make_unique_dp<ColoredSymbolZoomInfo>(m_textBg);
|
||||
}
|
||||
|
||||
int SpeedCameraMark::GetMinZoom() const
|
||||
{
|
||||
return kSpeedCameraZoomS;
|
||||
}
|
||||
|
||||
int SpeedCameraMark::GetMinTitleZoom() const
|
||||
{
|
||||
return kMinSpeedCameraTitleZoom;
|
||||
}
|
||||
|
||||
dp::Anchor SpeedCameraMark::GetAnchor() const
|
||||
{
|
||||
return dp::Left;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
|
||||
drape_ptr<TitlesInfo> GetTitleDecl() const override;
|
||||
|
||||
bool HasSymbolPriority() const override { return false; }
|
||||
bool HasSymbolShapes() const override { return false; }
|
||||
bool HasTitlePriority() const override { return true; }
|
||||
|
||||
void SetFollowingMode(bool enabled);
|
||||
|
@ -109,7 +109,7 @@ public:
|
|||
|
||||
df::DepthLayer GetDepthLayer() const override { return df::DepthLayer::TransitMarkLayer; }
|
||||
|
||||
bool HasSymbolPriority() const override { return !m_symbolNames.empty() || !m_coloredSymbols.empty(); }
|
||||
bool HasSymbolShapes() const override { return !m_symbolNames.empty() || !m_coloredSymbols.m_zoomInfo.empty(); }
|
||||
bool HasTitlePriority() const override { return true; }
|
||||
|
||||
void SetAnchor(dp::Anchor anchor);
|
||||
|
@ -160,3 +160,37 @@ private:
|
|||
SymbolOffsets m_symbolOffsets;
|
||||
dp::Anchor m_anchor = dp::Center;
|
||||
};
|
||||
|
||||
class SpeedCameraMark : public UserMark
|
||||
{
|
||||
public:
|
||||
explicit SpeedCameraMark(m2::PointD const & ptOrg);
|
||||
void SetTitle(std::string const & title);
|
||||
|
||||
void SetFeatureId(FeatureID featureId);
|
||||
FeatureID GetFeatureID() const override { return m_featureId; }
|
||||
|
||||
void SetIndex(uint32_t index);
|
||||
uint32_t GetIndex() const override { return m_index; }
|
||||
|
||||
df::DepthLayer GetDepthLayer() const override { return df::DepthLayer::RoutingMarkLayer; }
|
||||
bool HasSymbolShapes() const override { return true; }
|
||||
bool HasTitlePriority() const override { return true; }
|
||||
uint16_t GetPriority() const override { return static_cast<uint16_t>(Priority::SpeedCamera); }
|
||||
|
||||
drape_ptr<SymbolNameZoomInfo> GetSymbolNames() const override;
|
||||
drape_ptr<TitlesInfo> GetTitleDecl() const override;
|
||||
drape_ptr<ColoredSymbolZoomInfo> GetColoredSymbols() const override;
|
||||
|
||||
int GetMinZoom() const override;
|
||||
int GetMinTitleZoom() const override;
|
||||
dp::Anchor GetAnchor() const override;
|
||||
|
||||
private:
|
||||
uint32_t m_index = 0;
|
||||
FeatureID m_featureId;
|
||||
SymbolNameZoomInfo m_symbolNames;
|
||||
ColoredSymbolZoomInfo m_textBg;
|
||||
std::string m_title;
|
||||
dp::TitleDecl m_titleDecl;
|
||||
};
|
||||
|
|
|
@ -543,8 +543,11 @@ void TransitRouteDisplay::CreateTransitMarks()
|
|||
df::ColoredSymbolViewParams params;
|
||||
params.m_radiusInPixels = max(sz.x, sz.y) * 0.5f;
|
||||
params.m_color = dp::Color::Transparent();
|
||||
if (coloredSymbol.empty() || coloredSymbol.rbegin()->second.m_radiusInPixels != params.m_radiusInPixels)
|
||||
coloredSymbol.insert(make_pair(zoomLevel, params));
|
||||
if (coloredSymbol.m_zoomInfo.empty() ||
|
||||
coloredSymbol.m_zoomInfo.rbegin()->second.m_radiusInPixels != params.m_radiusInPixels)
|
||||
{
|
||||
coloredSymbol.m_zoomInfo.insert(make_pair(zoomLevel, params));
|
||||
}
|
||||
}
|
||||
transitMark->SetColoredSymbols(coloredSymbol);
|
||||
transitMark->SetPriority(UserMark::Priority::TransitTransfer);
|
||||
|
@ -574,11 +577,11 @@ void TransitRouteDisplay::CreateTransitMarks()
|
|||
|
||||
auto sz = m_symbolSizes.at(symbolNames[kSmallIconZoom]);
|
||||
params.m_radiusInPixels = max(sz.x, sz.y) * kGateBgScale * 0.5f;
|
||||
coloredSymbol[kSmallIconZoom] = params;
|
||||
coloredSymbol.m_zoomInfo[kSmallIconZoom] = params;
|
||||
|
||||
sz = m_symbolSizes.at(symbolNames[kMediumIconZoom]);
|
||||
params.m_radiusInPixels = max(sz.x, sz.y) * kGateBgScale * 0.5f;
|
||||
coloredSymbol[kMediumIconZoom] = params;
|
||||
coloredSymbol.m_zoomInfo[kMediumIconZoom] = params;
|
||||
|
||||
transitMark->SetColoredSymbols(coloredSymbol);
|
||||
transitMark->SetPriority(UserMark::Priority::TransitKeyStop);
|
||||
|
@ -593,8 +596,11 @@ void TransitRouteDisplay::CreateTransitMarks()
|
|||
df::ColoredSymbolViewParams params;
|
||||
params.m_radiusInPixels = max(sz.x, sz.y) * 0.5f;
|
||||
params.m_color = dp::Color::Transparent();
|
||||
if (coloredSymbol.empty() || coloredSymbol.rbegin()->second.m_radiusInPixels != params.m_radiusInPixels)
|
||||
coloredSymbol.insert(make_pair(zoomLevel, params));
|
||||
if (coloredSymbol.m_zoomInfo.empty() ||
|
||||
coloredSymbol.m_zoomInfo.rbegin()->second.m_radiusInPixels != params.m_radiusInPixels)
|
||||
{
|
||||
coloredSymbol.m_zoomInfo.insert(make_pair(zoomLevel, params));
|
||||
}
|
||||
}
|
||||
transitMark->SetSymbolSizes(stopMarkerSizes);
|
||||
transitMark->SetColoredSymbols(coloredSymbol);
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#include "map/user_mark.hpp"
|
||||
#include "map/user_mark_id_storage.hpp"
|
||||
|
||||
#include "drape_frontend/visual_params.hpp"
|
||||
|
||||
#include "indexer/scales.hpp"
|
||||
|
||||
#include "geometry/mercator.hpp"
|
||||
|
||||
UserMark::UserMark(kml::MarkId id, m2::PointD const & ptOrg, UserMark::Type type)
|
||||
|
@ -71,6 +75,31 @@ drape_ptr<df::UserPointMark::SymbolNameZoomInfo> DebugMarkPoint::GetSymbolNames(
|
|||
return symbol;
|
||||
}
|
||||
|
||||
ColoredDebugMarkPoint::ColoredDebugMarkPoint(m2::PointD const & ptOrg)
|
||||
: UserMark(ptOrg, UserMark::Type::DEBUG_MARK)
|
||||
{
|
||||
auto const vs = static_cast<float>(df::VisualParams::Instance().GetVisualScale());
|
||||
|
||||
df::ColoredSymbolViewParams params;
|
||||
params.m_outlineColor = dp::Color::White();
|
||||
params.m_outlineWidth = 1.5f * vs;
|
||||
params.m_radiusInPixels = 7.0f * vs;
|
||||
params.m_color = dp::Color::Green();
|
||||
m_coloredSymbols.m_needOverlay = false;
|
||||
m_coloredSymbols.m_zoomInfo.insert(make_pair(1, params));
|
||||
}
|
||||
|
||||
void ColoredDebugMarkPoint::SetColor(dp::Color const & color)
|
||||
{
|
||||
SetDirty();
|
||||
m_coloredSymbols.m_zoomInfo.begin()->second.m_color = color;
|
||||
}
|
||||
|
||||
drape_ptr<df::UserPointMark::ColoredSymbolZoomInfo> ColoredDebugMarkPoint::GetColoredSymbols() const
|
||||
{
|
||||
return make_unique_dp<ColoredSymbolZoomInfo>(m_coloredSymbols);
|
||||
}
|
||||
|
||||
string DebugPrint(UserMark::Type type)
|
||||
{
|
||||
switch (type)
|
||||
|
@ -81,6 +110,7 @@ string DebugPrint(UserMark::Type type)
|
|||
case UserMark::Type::BOOKMARK: return "BOOKMARK";
|
||||
case UserMark::Type::DEBUG_MARK: return "DEBUG_MARK";
|
||||
case UserMark::Type::ROUTING: return "ROUTING";
|
||||
case UserMark::Type::SPEED_CAM: return "SPEED_CAM";
|
||||
case UserMark::Type::LOCAL_ADS: return "LOCAL_ADS";
|
||||
case UserMark::Type::TRANSIT: return "TRANSIT";
|
||||
case UserMark::Type::USER_MARK_TYPES_COUNT: return "USER_MARK_TYPES_COUNT";
|
||||
|
|
|
@ -27,7 +27,8 @@ public:
|
|||
TransitStop,
|
||||
TransitGate,
|
||||
TransitTransfer,
|
||||
TransitKeyStop
|
||||
TransitKeyStop,
|
||||
SpeedCamera,
|
||||
};
|
||||
|
||||
enum Type: uint32_t
|
||||
|
@ -37,6 +38,7 @@ public:
|
|||
SEARCH,
|
||||
STATIC,
|
||||
ROUTING,
|
||||
SPEED_CAM,
|
||||
TRANSIT,
|
||||
LOCAL_ADS,
|
||||
DEBUG_MARK,
|
||||
|
@ -69,7 +71,7 @@ public:
|
|||
drape_ptr<SymbolOffsets> GetSymbolOffsets() const override { return nullptr; }
|
||||
uint16_t GetPriority() const override { return static_cast<uint16_t >(Priority::Default); }
|
||||
uint32_t GetIndex() const override { return 0; }
|
||||
bool HasSymbolPriority() const override { return false; }
|
||||
bool HasSymbolShapes() const override { return false; }
|
||||
bool HasTitlePriority() const override { return false; }
|
||||
int GetMinZoom() const override { return 1; }
|
||||
int GetMinTitleZoom() const override { return GetMinZoom(); }
|
||||
|
@ -126,4 +128,18 @@ public:
|
|||
drape_ptr<SymbolNameZoomInfo> GetSymbolNames() const override;
|
||||
};
|
||||
|
||||
class ColoredDebugMarkPoint : public UserMark
|
||||
{
|
||||
public:
|
||||
ColoredDebugMarkPoint(m2::PointD const & ptOrg);
|
||||
|
||||
void SetColor(dp::Color const & color);
|
||||
bool HasSymbolShapes() const override { return true; }
|
||||
drape_ptr<SymbolNameZoomInfo> GetSymbolNames() const override { return nullptr; }
|
||||
drape_ptr<ColoredSymbolZoomInfo> GetColoredSymbols() const override;
|
||||
|
||||
private:
|
||||
ColoredSymbolZoomInfo m_coloredSymbols;
|
||||
};
|
||||
|
||||
string DebugPrint(UserMark::Type type);
|
||||
|
|
Loading…
Add table
Reference in a new issue