Root/monav/gpsgrid/gpsgridclient.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 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
30class GPSGridClient : public QObject, public IGPSLookup
31{
32    Q_OBJECT
33    Q_INTERFACES( IGPSLookup )
34public:
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
44signals:
45
46public slots:
47
48protected:
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

Archive Download this file

Branches:
master



interactive