Updraft
1.0
Open source glider flight visualisation tool.
|
00001 #ifndef UPDRAFT_SRC_PLUGINS_TASKDECL_TASKDATA_H_ 00002 #define UPDRAFT_SRC_PLUGINS_TASKDECL_TASKDATA_H_ 00003 00004 #include <QVector> 00005 00006 namespace Updraft { 00007 00008 class DataHistory; 00009 class TaskPoint; 00010 00014 class TaskData { 00015 public: 00016 virtual ~TaskData(); 00017 00019 QString toXml() const; 00020 00026 TaskPoint* getTaskPoint(int position); 00027 00029 const TaskPoint* getTaskPoint(int position) const; 00030 00034 bool fromXml(const QString &serialized); 00035 00040 bool insertTaskPoint(TaskPoint *taskPoint, int position); 00041 00046 void moveTaskPoint(int from, int to); 00047 00050 void deleteTaskPoint(int position); 00051 00053 int size() const { 00054 return taskPoints.size(); 00055 } 00056 00059 void setAddTaskPointButton(int position); 00060 00062 int getAddTaskPointButton() const; 00063 00065 qreal totalDistance() const; 00066 00068 qreal officialDistance() const; 00069 00074 bool isClosed() const; 00075 00077 bool isFaiTriangle() const; 00078 00082 qreal distance(int i, int j) const; 00083 00091 qreal distanceAzimuth(int i, int j, qreal *azimuth) const; 00092 00093 private: 00095 TaskData() {} 00096 00101 qreal distanceReduction(int i) const; 00102 00105 float faiTriangleDistance() const; 00106 00108 TaskData(const TaskData& taskData); 00109 00110 typedef QVector<TaskPoint*> PointsContainer; 00111 00113 PointsContainer taskPoints; 00114 00117 int selectedAddButton; 00118 00119 friend class DataHistory; 00120 }; 00121 00122 } // End namespace Updraft 00123 00124 #endif // UPDRAFT_SRC_PLUGINS_TASKDECL_TASKDATA_H_