Routing marks priority, minor tuning.

This commit is contained in:
Daria Volvenkova 2017-12-12 18:04:40 +03:00 committed by Ilya Grechuhin
parent 7c7e426ff6
commit 1cc630ef6e
4 changed files with 48 additions and 12 deletions

View file

@ -85,6 +85,34 @@ void RouteMarkPoint::SetPassed(bool isPassed)
m_markData.m_isPassed = isPassed;
}
uint16_t RouteMarkPoint::GetPriority() const
{
switch (m_markData.m_pointType)
{
case RouteMarkType::Start: return static_cast<uint16_t>(Priority::RouteStart);
case RouteMarkType::Finish: return static_cast<uint16_t>(Priority::RouteFinish);
case RouteMarkType::Intermediate:
{
switch (m_markData.m_intermediateIndex)
{
case 0: return static_cast<uint16_t>(Priority::RouteIntermediateA);
case 1: return static_cast<uint16_t>(Priority::RouteIntermediateB);
default: return static_cast<uint16_t>(Priority::RouteIntermediateC);
}
}
}
}
uint32_t RouteMarkPoint::GetIndex() const
{
switch (m_markData.m_pointType)
{
case RouteMarkType::Start: return 0;
case RouteMarkType::Finish: return 1;
case RouteMarkType::Intermediate: return static_cast<uint32_t >(m_markData.m_intermediateIndex + 2);
}
}
void RouteMarkPoint::SetMarkData(RouteMarkData && data)
{
SetDirty();
@ -123,19 +151,19 @@ drape_ptr<df::UserPointMark::SymbolNameZoomInfo> RouteMarkPoint::GetSymbolNames(
std::string name;
switch (m_markData.m_pointType)
{
case RouteMarkType::Start: name = "route-point-start"; break;
case RouteMarkType::Intermediate:
{
switch (m_markData.m_intermediateIndex)
case RouteMarkType::Start: name = "route-point-start"; break;
case RouteMarkType::Finish: name = "route-point-finish"; break;
case RouteMarkType::Intermediate:
{
case 0: name = "route-point-a"; break;
case 1: name = "route-point-b"; break;
case 2: name = "route-point-c"; break;
default: name = ""; break;
switch (m_markData.m_intermediateIndex)
{
case 0: name = "route-point-a"; break;
case 1: name = "route-point-b"; break;
case 2: name = "route-point-c"; break;
default: name = ""; break;
}
break;
}
break;
}
case RouteMarkType::Finish: name = "route-point-finish"; break;
}
auto symbol = make_unique_dp<SymbolNameZoomInfo>();
symbol->insert(std::make_pair(1 /* zoomLevel */, name));

View file

@ -55,6 +55,9 @@ public:
void SetPassed(bool isPassed);
bool IsPassed() const { return m_markData.m_isPassed; }
uint16_t GetPriority() const override;
uint32_t GetIndex() const override;
RouteMarkData const & GetMarkData() const { return m_markData; }
void SetMarkData(RouteMarkData && data);

View file

@ -25,7 +25,7 @@ const int kSmallIconZoom = 1;
const int kMediumIconZoom = 10;
const int kLargeIconZoom = 15;
const int kMinStopTitleZoom = 14;
const int kMinStopTitleZoom = 13;
const int kTransferTitleOffset = 1;
const int kStopTitleOffset = 0;

View file

@ -21,6 +21,11 @@ public:
enum class Priority: uint16_t
{
Default = 0,
RouteStart,
RouteFinish,
RouteIntermediateC,
RouteIntermediateB,
RouteIntermediateA,
TransitStop,
TransitGate,
TransitTransfer,