diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2015-01-28 16:15:12 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:36:50 +0300 |
commit | 3b7c568c14f453a6f06aa1a85b7ce48e44ec20f7 (patch) | |
tree | 44e2ace08e3d17761ddfc39d6bc8593a4569d345 /map/route_track.hpp | |
parent | ddabb7b7fe99df38574d18c266c5ad1fdc008082 (diff) |
Hiding the navigation route after current position. Bugfix with arrows on the route near the beginnig.
Diffstat (limited to 'map/route_track.hpp')
-rw-r--r-- | map/route_track.hpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/map/route_track.hpp b/map/route_track.hpp new file mode 100644 index 0000000000..da2bf40e8d --- /dev/null +++ b/map/route_track.hpp @@ -0,0 +1,56 @@ +#pragma once + +#include "track.hpp" + +#include "../routing/turns.hpp" + +#include "../map/location_state.hpp" + +class RouteTrack : public Track +{ + RouteTrack & operator=(RouteTrack const &) = delete; + RouteTrack(RouteTrack const &) = delete; +public: + RouteTrack() {} + explicit RouteTrack(PolylineD const & polyline) : Track(polyline) {} + virtual ~RouteTrack() {} + virtual void CreateDisplayList(graphics::Screen * dlScreen, MatrixT const & matrix, bool isScaleChanged, + int drawScale, double visualScale, + location::RouteMatchingInfo const & matchingInfo) const; + virtual void Draw(graphics::Screen * pScreen, MatrixT const & matrix) const; + virtual RouteTrack * CreatePersistent(); + + void SetTurnsGeometry(routing::turns::TurnsGeomT const & turnsGeom) { m_turnsGeom = turnsGeom; } + + void AddClosingSymbol(bool isBeginSymbol, string const & symbolName, + graphics::EPosition pos, double depth); + +private: + void CreateDisplayListSymbols(graphics::Screen * dlScreen, PointContainerT const & pts) const; + + void CreateDisplayListArrows(graphics::Screen * dlScreen, MatrixT const & matrix, double visualScale) const; + void DeleteClosestSegmentDisplayList() const; + bool HasClosestSegmentDisplayList() const { return m_closestSegmentDL != nullptr; } + void SetClosestSegmentDisplayList(graphics::DisplayList * dl) const { m_closestSegmentDL = dl; } + void Swap(RouteTrack & rhs); + + 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<ClosingSymbol> m_beginSymbols; + vector<ClosingSymbol> m_endSymbols; + + + routing::turns::TurnsGeomT m_turnsGeom; + mutable location::RouteMatchingInfo m_relevantMatchedInfo; + mutable graphics::DisplayList * m_closestSegmentDL = nullptr; +}; + +bool clipArrowBodyAndGetArrowDirection(vector<m2::PointD> & ptsTurn, pair<m2::PointD, m2::PointD> & arrowDirection, + size_t turnIndex, double beforeTurn, double afterTurn, double arrowLength); |