Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2013-10-09 14:53:21 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:04:15 +0300
commitee6c45e7a925576868f14c502f2ad379aa392157 (patch)
tree5c451c825feaa03278f33fdbf1514a66e9388bcc /map/track.hpp
parentd3bee7c08af11c3045a7430156b67a06e4bd9816 (diff)
[tracks] Code and style review fixes.
Diffstat (limited to 'map/track.hpp')
-rw-r--r--map/track.hpp37
1 files changed, 27 insertions, 10 deletions
diff --git a/map/track.hpp b/map/track.hpp
index dba27e524b..8e17625ae8 100644
--- a/map/track.hpp
+++ b/map/track.hpp
@@ -1,19 +1,31 @@
#pragma once
#include "../geometry/polyline2d.hpp"
-#include "../geometry/point2d.hpp"
+#include "../geometry/screenbase.hpp"
+
#include "../graphics/color.hpp"
-#include "../graphics/display_list.hpp"
-#include "../graphics/screen.hpp"
-#include "events.hpp"
-#include "navigator.hpp"
-class Track
+#include "../std/shared_ptr.hpp"
+#include "../std/noncopyable.hpp"
+
+
+class Navigator;
+class PaintEvent;
+
+namespace graphics
+{
+ class Screen;
+ class DisplayList;
+ class PaintEvent;
+}
+
+
+class Track : private noncopyable
{
public:
~Track();
- typedef m2::Polyline2d<double> PolylineD;
+ typedef m2::PolylineD PolylineD;
Track()
: m_isVisible(true), m_name("unnamed_track"), m_width(5),
@@ -28,6 +40,9 @@ public:
m_dList(0)
{}
+ /// @note Move semantics is used here.
+ Track * CreatePersistent();
+
void Draw(shared_ptr<PaintEvent> const & e);
void UpdateDisplayList(Navigator & navigator, graphics::Screen * dListScreen);
void DeleteDisplayList();
@@ -52,9 +67,11 @@ public:
double GetLength() const { return m_polyline.GetLength(); }
PolylineD const & GetPolyline() const { return m_polyline; }
- double GetShortestSquareDistance(m2::PointD const & point);
+ double GetShortestSquareDistance(m2::PointD const & point) const;
//@}
+ void Swap(Track & rhs);
+
private:
bool m_isVisible;
string m_name;
@@ -66,6 +83,6 @@ private:
ScreenBase m_screenBase;
graphics::DisplayList * m_dList;
- bool IsViewportChanged(ScreenBase const & sb);
- inline bool HasDisplayList() { return m_dList != NULL; }
+ bool IsViewportChanged(ScreenBase const & sb) const;
+ inline bool HasDisplayList() const { return m_dList != 0; }
};