~ubuntu-branches/ubuntu/saucy/merkaartor/saucy

« back to all changes in this revision

Viewing changes to Map/TrackPoint.h

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2009-09-13 00:52:12 UTC
  • mto: (1.2.7 upstream) (0.1.3 upstream) (3.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20090913005212-pjecal8zxm07x0fj
ImportĀ upstreamĀ versionĀ 0.14+svnfixes~20090912

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef MERKATOR_TRACKPOINT_H_
2
 
#define MERKATOR_TRACKPOINT_H_
3
 
 
4
 
#include "Preferences/MerkaartorPreferences.h"
5
 
 
6
 
#include "Map/Coord.h"
7
 
#include "Map/MapFeature.h"
8
 
#include "Map/MapDocument.h"
9
 
#include "Map/MapLayer.h"
10
 
 
11
 
#include <QtCore/QDateTime>
12
 
#include <QtXml>
13
 
 
14
 
class QProgressDialog;
15
 
 
16
 
class TrackPoint : public MapFeature
17
 
{
18
 
        Q_OBJECT
19
 
 
20
 
        public:
21
 
                TrackPoint(const Coord& aCoord);
22
 
                TrackPoint(const TrackPoint& other);
23
 
                virtual ~TrackPoint();
24
 
 
25
 
                virtual QString getClass() const {return "TrackPoint";}
26
 
 
27
 
                virtual CoordBox boundingBox() const;
28
 
                virtual void draw(QPainter& P, const Projection& theProjection);
29
 
                virtual void drawFocus(QPainter& P, const Projection& theProjection, bool solid=true);
30
 
                virtual void drawHover(QPainter& P, const Projection& theProjection, bool solid=true);
31
 
                virtual double pixelDistance(const QPointF& Target, double ClearEndDistance, const Projection& theProjection) const;
32
 
                virtual void cascadedRemoveIfUsing(MapDocument* theDocument, MapFeature* aFeature, CommandList* theList, const std::vector<MapFeature*>& Alternatives);
33
 
                virtual bool notEverythingDownloaded() const;
34
 
                virtual QString description() const;
35
 
                virtual RenderPriority renderPriority(double aPixelPerM) const;
36
 
 
37
 
                virtual unsigned int find(MapFeature* Pt) const;
38
 
                virtual void remove(unsigned int idx);
39
 
                virtual void remove(MapFeature* F);
40
 
                virtual unsigned int size() const;
41
 
                virtual MapFeature* get(unsigned int idx);
42
 
                virtual const MapFeature* get(unsigned int Idx) const;
43
 
                virtual bool isNull() const;
44
 
 
45
 
                const Coord& position() const;
46
 
                void setPosition(const Coord& aCoord);
47
 
                const QPoint& projection() const;
48
 
                void setProjection(const QPoint& aProjection);
49
 
                ProjectionType projectionType() const;
50
 
                void setProjectionType(const ProjectionType aProjectionType);
51
 
 
52
 
                double speed() const;
53
 
                void setSpeed(double aSpeed);
54
 
 
55
 
                double elevation() const;
56
 
                void setElevation(double aElevation);
57
 
 
58
 
                virtual void partChanged(MapFeature* F, unsigned int ChangeId);
59
 
 
60
 
                virtual QString toXML(unsigned int lvl=0, QProgressDialog * progress=NULL);
61
 
                virtual bool toXML(QDomElement xParent, QProgressDialog & progress);
62
 
                virtual bool toGPX(QDomElement xParent, QProgressDialog & progress);
63
 
                static TrackPoint* fromXML(MapDocument* d, MapLayer* L, const QDomElement e);
64
 
                static TrackPoint* fromGPX(MapDocument* d, MapLayer* L, const QDomElement e);
65
 
 
66
 
                virtual QString toHtml();
67
 
 
68
 
                virtual void toBinary(QDataStream& ds, QHash <QString, quint64>& theIndex);
69
 
                static TrackPoint* fromBinary(MapDocument* d, OsbMapLayer* L, QDataStream& ds, qint8 c, qint64 id);
70
 
 
71
 
private:
72
 
                Coord Position;
73
 
 
74
 
                double Elevation;
75
 
                double Speed;
76
 
                QPoint Projected;
77
 
                ProjectionType ProjectedType;
78
 
};
79
 
 
80
 
Q_DECLARE_METATYPE( TrackPoint * );
81
 
 
82
 
#endif
83
 
 
84