1
#ifndef MERKATOR_TRACKPOINT_H_
2
#define MERKATOR_TRACKPOINT_H_
4
#include "Preferences/MerkaartorPreferences.h"
7
#include "Map/MapFeature.h"
8
#include "Map/MapDocument.h"
9
#include "Map/MapLayer.h"
11
#include <QtCore/QDateTime>
14
class QProgressDialog;
16
class TrackPoint : public MapFeature
21
TrackPoint(const Coord& aCoord);
22
TrackPoint(const TrackPoint& other);
23
virtual ~TrackPoint();
25
virtual QString getClass() const {return "TrackPoint";}
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;
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;
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);
53
void setSpeed(double aSpeed);
55
double elevation() const;
56
void setElevation(double aElevation);
58
virtual void partChanged(MapFeature* F, unsigned int ChangeId);
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);
66
virtual QString toHtml();
68
virtual void toBinary(QDataStream& ds, QHash <QString, quint64>& theIndex);
69
static TrackPoint* fromBinary(MapDocument* d, OsbMapLayer* L, QDataStream& ds, qint8 c, qint64 id);
77
ProjectionType ProjectedType;
80
Q_DECLARE_METATYPE( TrackPoint * );