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

« back to all changes in this revision

Viewing changes to src/Maps/TrackSegment.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_TRACKSEGMENT_H_
 
2
#define MERKATOR_TRACKSEGMENT_H_
 
3
 
 
4
#include "Maps/MapFeature.h"
 
5
 
 
6
class TrackSegmentPrivate;
 
7
class TrackPoint;
 
8
 
 
9
class QProgressDialog;
 
10
 
 
11
class TrackSegment : public MapFeature
 
12
{
 
13
        Q_OBJECT
 
14
 
 
15
        public:
 
16
                TrackSegment(void);
 
17
                ~TrackSegment(void);
 
18
        private:
 
19
                TrackSegment(const TrackSegment& other);
 
20
 
 
21
                void drawDirectionMarkers(QPainter & P, QPen & pen, const QPointF & FromF, const QPointF & ToF);
 
22
 
 
23
        public:
 
24
                virtual QString getClass() const {return "TrackSegment";}
 
25
                virtual void updateMeta();
 
26
 
 
27
                virtual CoordBox boundingBox() const;
 
28
                virtual void draw(QPainter& P, MapView* theView);
 
29
                virtual void drawFocus(QPainter& P, MapView* theView, bool solid=true);
 
30
                virtual void drawHover(QPainter& P, MapView* theView, bool solid=true);
 
31
                virtual void drawHighlight(QPainter& P, MapView* theView, bool solid=true);
 
32
                virtual double pixelDistance(const QPointF& Target, double ClearEndDistance, const Projection& theProjection, const QTransform& theTransform) const;
 
33
                void cascadedRemoveIfUsing(MapDocument* theDocument, MapFeature* aFeature, CommandList* theList, const QList<MapFeature*>& Alternatives);
 
34
                virtual bool notEverythingDownloaded();
 
35
                virtual QString description() const;
 
36
                virtual RenderPriority renderPriority();
 
37
 
 
38
                void add(TrackPoint* aPoint);
 
39
                void add(TrackPoint* Pt, int Idx);
 
40
                virtual int find(MapFeature* Pt) const;
 
41
                virtual void remove(int idx);
 
42
                virtual void remove(MapFeature* F);
 
43
                virtual MapFeature* get(int idx);
 
44
                virtual int size() const;
 
45
                TrackPoint* getNode(int idx);
 
46
                virtual const MapFeature* get(int Idx) const;
 
47
                virtual bool isNull() const;
 
48
 
 
49
                void sortByTime();
 
50
                virtual void partChanged(MapFeature* F, int ChangeId);
 
51
 
 
52
                double distance();
 
53
                int duration() const;
 
54
 
 
55
                virtual QString toXML(int, QProgressDialog *) {return QString("");}
 
56
                virtual bool toGPX(QDomElement xParent, QProgressDialog & progress, bool forExport=false);
 
57
                static TrackSegment* fromGPX(MapDocument* d, MapLayer* L, const QDomElement e, QProgressDialog & progress);
 
58
                virtual bool toXML(QDomElement xParent, QProgressDialog & progress);
 
59
                static TrackSegment* fromXML(MapDocument* d, MapLayer* L, const QDomElement e, QProgressDialog & progress);
 
60
 
 
61
                virtual QString toHtml() {return "";}
 
62
 
 
63
                virtual void toBinary(QDataStream& /* ds */, QHash <QString, quint64>& /*theIndex*/) { return; }
 
64
 
 
65
private:
 
66
                TrackSegmentPrivate* p;
 
67
};
 
68
 
 
69
#endif
 
70
 
 
71