Root/monav/interfaces/igpslookup.h

1/*
2Copyright 2010 Christian Vetter veaac.fdirct@gmail.com
3
4This file is part of MoNav.
5
6MoNav is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11MoNav is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along 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
28class IGPSLookup
29{
30public:
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
58Q_DECLARE_INTERFACE( IGPSLookup, "monav.IGPSLookup/1.1" )
59
60#endif // IGPSLOOKUP_H
61

Archive Download this file

Branches:
master



interactive