Qt Virtual Chart Table (QVCT)
CTrackPoint.hpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 #ifndef QVCT_CTRACKPOINT_HPP
20 #define QVCT_CTRACKPOINT_HPP
21 
22 // QT
23 #include <QDataStream>
24 #include <QDomElement> // QtXml module
25 #include <QPainter>
26 #include <QPointF>
27 #include <QTreeWidgetItem>
28 #include <QXmlStreamWriter>
29 
30 // QVCT
32 
33 
35 
40 {
41 
42  //------------------------------------------------------------------------------
43  // FIELDS
44  //------------------------------------------------------------------------------
45 
46 private:
48  QString qsFixType;
54  double fdDopVertical;
57 
58 
59  //------------------------------------------------------------------------------
60  // CONSTRUCTORS / DESTRUCTOR
61  //------------------------------------------------------------------------------
62 
63 public:
64  CTrackPoint( const QString& _rqsName );
65  CTrackPoint( const QString& _rqsName, const CDataPosition& _roDataPosition );
66  virtual ~CTrackPoint() {};
67 
68 
69  //------------------------------------------------------------------------------
70  // METHODS: COverlayObject (implement/override)
71  //------------------------------------------------------------------------------
72 
73 public:
74  virtual void unserialize( QDataStream& _rqDataStream );
75 
76 public:
77  virtual COverlay* useOverlay() { return (COverlay*)QTreeWidgetItem::parent()->parent()->parent(); };
78 
79 public:
80  virtual void draw( const CChart* _poChart, QPainter* _pqPainter ) {};
81  virtual void showDetail();
82  virtual void showEdit() {};
83 
84 
85  //------------------------------------------------------------------------------
86  // METHODS: COverlayPoint (implement/override)
87  //------------------------------------------------------------------------------
88 
89 public:
90  virtual bool matchScrPosition( const CChart* _poChart, const QPointF& _rqPointFScrPosition ) const;
91 
92 
93  //------------------------------------------------------------------------------
94  // METHODS: COverlayVisibility (override)
95  //------------------------------------------------------------------------------
96 
97 public:
98  virtual void toggleVisibility() { COverlayVisibility::toggleVisibility( false, true ); };
99 
100 
101  //------------------------------------------------------------------------------
102  // METHODS
103  //------------------------------------------------------------------------------
104 
105  // SETTERS
106 public:
108  void toggleMultiSelected();
110  void setFixType( const QString& _rqsFixType ) { qsFixType = _rqsFixType; };
112  void setSatelliteCount( int _iSatelliteCount ) { iSatelliteCount = _iSatelliteCount; };
114  void setDopHorizontal( double _fdDopHorizontal ) { fdDopHorizontal = _fdDopHorizontal; };
116  void setDopVertical( double _fdDopVertical ) { fdDopVertical = _fdDopVertical; };
118  void setDopPositional( double _fdDopPositional ) { fdDopPositional = _fdDopPositional; };
119 
120  // GETTERS
121 public:
123  QString getFixType() { return qsFixType; };
127  double getDopHorizontal() { return fdDopHorizontal; };
129  double getDopVertical() { return fdDopVertical; };
131  double getDopPositional() { return fdDopPositional; };
132 
133  // OTHER
134 public:
136  void parseQVCT( const QDomElement& _rqDomElement );
138  void parseGPX( const QDomElement& _rqDomElement );
140  void dumpQVCT( QXmlStreamWriter & _rqXmlStreamWriter ) const;
142  void dumpGPX( QXmlStreamWriter & _rqXmlStreamWriter ) const;
143 
144 protected:
146 };
147 
148 #endif // QVCT_CTRACKPOINT_HPP
[UI] Chart (view)
Definition: CChart.hpp:44
(Geographical) Position data [long,lat,elev]
Generic overlay point.
virtual void toggleVisibility(bool _bIncludeCourse, bool _bIncludeRouting)
Toggle the visibility status.
Generic overlay.
Definition: COverlay.hpp:45
[UI] Track overlay point (item)
Definition: CTrackPoint.hpp:40
void parseQVCT(const QDomElement &_rqDomElement)
Retrieves this object's content from the given QVCT source (file)
double getDopHorizontal()
Sets this track point's horizontal Dilution-of-Precision (HDOP)
void toggleMultiSelected()
Toggles this track point's selection status.
CTrackPoint(const QString &_rqsName)
Definition: CTrackPoint.cpp:38
void parseGPX(const QDomElement &_rqDomElement)
Retrieves this object's content from the given GPX source (file)
double getDopPositional()
Sets this track point's positional Dilution-of-Precision (PDOP)
void setDopPositional(double _fdDopPositional)
Sets this track point's positional Dilution-of-Precision (PDOP)
virtual void unserialize(QDataStream &_rqDataStream)
Unserializes (restore) this object's data from binary format.
Definition: CTrackPoint.cpp:71
void dumpQVCT(QXmlStreamWriter &_rqXmlStreamWriter) const
Stores this object's content to the given QVCT destination (file)
virtual void showEdit()
Displays this object's edit widget/view.
Definition: CTrackPoint.hpp:82
int getSatelliteCount()
Sets this track point's satellite count.
void setSatelliteCount(int _iSatelliteCount)
Sets this track point's satellite count.
virtual void draw(const CChart *_poChart, QPainter *_pqPainter)
Draws this object (itself or its content)
Definition: CTrackPoint.hpp:80
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
Definition: CTrackPoint.hpp:77
void dumpGPX(QXmlStreamWriter &_rqXmlStreamWriter) const
Stores this object's content to the given GPX destination (file)
double getDopVertical()
Sets this track point's vertical Dilution-of-Precision (VDOP)
QString qsFixType
Track point's fix type.
Definition: CTrackPoint.hpp:48
virtual void toggleVisibility()
Definition: CTrackPoint.hpp:98
int iSatelliteCount
Track point's satellites count.
Definition: CTrackPoint.hpp:50
double fdDopHorizontal
Track point's horizontal Dilution-of-Precision (HDOP)
Definition: CTrackPoint.hpp:52
QString getFixType()
Sets this track point's fix type.
double fdDopVertical
Track point's vertical Dilution-of-Precision (VDOP)
Definition: CTrackPoint.hpp:54
virtual bool matchScrPosition(const CChart *_poChart, const QPointF &_rqPointFScrPosition) const
Returns whether this point matches the given screen position.
Definition: CTrackPoint.cpp:91
void setFixType(const QString &_rqsFixType)
Sets this track point's fix type.
void setDopVertical(double _fdDopVertical)
Sets this track point's vertical Dilution-of-Precision (VDOP)
virtual void showDetail()
Displays this object's details (in the appropriate widget/view)
Definition: CTrackPoint.cpp:77
double fdDopPositional
Track point's positional Dilution-of-Precision (PDOP)
Definition: CTrackPoint.hpp:56
void setDopHorizontal(double _fdDopHorizontal)
Sets this track point's horizontal Dilution-of-Precision (HDOP)
virtual ~CTrackPoint()
Definition: CTrackPoint.hpp:66