From 25c8197f789cd4882470589fde89c989e2daeefb Mon Sep 17 00:00:00 2001 From: ExMix Date: Mon, 22 Sep 2014 14:32:45 +0300 Subject: [PATCH] review fixes --- map/track.cpp | 8 ++++---- map/track.hpp | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/map/track.cpp b/map/track.cpp index bb2e2a39a8..aa5dbd0421 100644 --- a/map/track.cpp +++ b/map/track.cpp @@ -39,9 +39,9 @@ void Track::DeleteDisplayList() const void Track::AddClosingSymbol(bool isBeginSymbol, string const & symbolName, graphics::EPosition pos, double depth) { if (isBeginSymbol) - m_beginSymbols.push_back(make_pair(symbolName, make_pair(pos, depth))); + m_beginSymbols.push_back(ClosingSymbol(symbolName, pos, depth)); else - m_endSymbols.push_back(make_pair(symbolName, make_pair(pos, depth))); + m_endSymbols.push_back(ClosingSymbol(symbolName, pos, depth)); } void Track::Draw(graphics::Screen * pScreen, MatrixT const & matrix) const @@ -97,9 +97,9 @@ void Track::CreateDisplayList(graphics::Screen * dlScreen, MatrixT const & matri if (!m_beginSymbols.empty() || !m_endSymbols.empty()) { m2::PointD pivot = pts2.front(); - auto symDrawer = [&dlScreen, &pivot](TClosingSymbol const & symbol) + auto symDrawer = [&dlScreen, &pivot](ClosingSymbol const & symbol) { - dlScreen->drawSymbol(pivot, symbol.first, symbol.second.first, symbol.second.second); + dlScreen->drawSymbol(pivot, symbol.m_iconName, symbol.m_position, symbol.m_depth); }; for_each(m_beginSymbols.begin(), m_beginSymbols.end(), symDrawer); diff --git a/map/track.hpp b/map/track.hpp index cd4c10a890..3c0b4756d4 100644 --- a/map/track.hpp +++ b/map/track.hpp @@ -84,7 +84,8 @@ public: m2::RectD const & GetLimitRect() const { return m_rect; } //@} - void AddClosingSymbol(bool isBeginSymbol, string const & symbolName, graphics::EPosition pos, double depth); + void AddClosingSymbol(bool isBeginSymbol, string const & symbolName, + graphics::EPosition pos, double depth); double GetLengthMeters() const; double GetShortestSquareDistance(m2::PointD const & point) const; @@ -101,10 +102,17 @@ private: float m_outlineWidth; graphics::Color m_outlineColor; - typedef pair TSymbolVisParams; - typedef pair TClosingSymbol; - vector m_beginSymbols; - vector m_endSymbols; + struct ClosingSymbol + { + ClosingSymbol(string const & iconName, graphics::EPosition pos, double depth) + : m_iconName(iconName), m_position(pos), m_depth(depth) {} + string m_iconName; + graphics::EPosition m_position; + double m_depth; + }; + + vector m_beginSymbols; + vector m_endSymbols; PolylineD m_polyline; m2::RectD m_rect;