Root/
| 1 | /* |
| 2 | Copyright 2010 Christian Vetter veaac.fdirct@gmail.com |
| 3 | |
| 4 | This file is part of MoNav. |
| 5 | |
| 6 | MoNav is free software: you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation, either version 3 of the License, or |
| 9 | (at your option) any later version. |
| 10 | |
| 11 | MoNav is distributed in the hope that it will be useful, |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | GNU General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with MoNav. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #ifndef GPSGRIDCLIENT_H |
| 21 | #define GPSGRIDCLIENT_H |
| 22 | |
| 23 | #include <QObject> |
| 24 | #include <QFile> |
| 25 | #include "interfaces/igpslookup.h" |
| 26 | #include "cell.h" |
| 27 | #include "table.h" |
| 28 | #include <QCache> |
| 29 | |
| 30 | class GPSGridClient : public QObject, public IGPSLookup |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | Q_INTERFACES( IGPSLookup ) |
| 34 | public: |
| 35 | GPSGridClient(); |
| 36 | virtual ~GPSGridClient(); |
| 37 | |
| 38 | virtual QString GetName(); |
| 39 | virtual void SetInputDirectory( const QString& dir ); |
| 40 | virtual void ShowSettings(); |
| 41 | virtual bool LoadData(); |
| 42 | virtual bool GetNearestEdge( Result* result, const UnsignedCoordinate& coordinate, double radius, bool headingPenalty, double heading ); |
| 43 | |
| 44 | signals: |
| 45 | |
| 46 | public slots: |
| 47 | |
| 48 | protected: |
| 49 | |
| 50 | void unload(); |
| 51 | double distance( UnsignedCoordinate* nearestPoint, double* percentage, const UnsignedCoordinate source, const UnsignedCoordinate target, const UnsignedCoordinate& coordinate ); |
| 52 | double distance( const UnsignedCoordinate& min, const UnsignedCoordinate& max, const UnsignedCoordinate& coordinate ); |
| 53 | bool checkCell( Result* result, QVector< UnsignedCoordinate >* path, NodeID gridX, NodeID gridY, const UnsignedCoordinate& coordinate, double heading, double headingPenalty ); |
| 54 | |
| 55 | long long cacheSize; |
| 56 | QString directory; |
| 57 | QFile* gridFile; |
| 58 | QCache< qint64, gg::Cell > cache; |
| 59 | gg::Index* index; |
| 60 | }; |
| 61 | |
| 62 | #endif // GPSGRIDCLIENT_H |
| 63 |
Branches:
master
