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 IGPSLOOKUP_H |
| 21 | #define IGPSLOOKUP_H |
| 22 | |
| 23 | #include "utils/config.h" |
| 24 | #include "utils/coordinates.h" |
| 25 | #include <QtPlugin> |
| 26 | #include <QVector> |
| 27 | |
| 28 | class IGPSLookup |
| 29 | { |
| 30 | public: |
| 31 | |
| 32 | struct Result { |
| 33 | // source + target + edgeID uniquely identify an edge |
| 34 | NodeID source; |
| 35 | NodeID target; |
| 36 | unsigned edgeID; |
| 37 | // the nearest point on the edge |
| 38 | UnsignedCoordinate nearestPoint; |
| 39 | // the amount of way coordinates on the way before the nearest point |
| 40 | unsigned previousWayCoordinates; |
| 41 | // the position on the way |
| 42 | double percentage; |
| 43 | // the distance to the nearest point |
| 44 | double distance; |
| 45 | |
| 46 | }; |
| 47 | |
| 48 | virtual ~IGPSLookup() {} |
| 49 | |
| 50 | virtual QString GetName() = 0; |
| 51 | virtual void SetInputDirectory( const QString& dir ) = 0; |
| 52 | virtual void ShowSettings() = 0; |
| 53 | virtual bool LoadData() = 0; |
| 54 | // gets the nearest routing edge; a heading penalty can be applied if the way's orientation differs greatly from the current heading. |
| 55 | virtual bool GetNearestEdge( Result* result, const UnsignedCoordinate& coordinate, double radius, bool headingPenalty = 0, double heading = 0 ) = 0; |
| 56 | }; |
| 57 | |
| 58 | Q_DECLARE_INTERFACE( IGPSLookup, "monav.IGPSLookup/1.1" ) |
| 59 | |
| 60 | #endif // IGPSLOOKUP_H |
| 61 |
Branches:
master
