libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-client-qt
include
osmscoutclientqt
DBLoadJob.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_CLIENT_QT_DBLOADJOB_H
2
#define OSMSCOUT_CLIENT_QT_DBLOADJOB_H
3
4
/*
5
OSMScout - a Qt backend for libosmscout and libosmscout-map
6
Copyright (C) 2017 Lukas Karas
7
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Lesser General Public
10
License as published by the Free Software Foundation; either
11
version 2.1 of the License, or (at your option) any later version.
12
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
*/
22
23
#include <QObject>
24
#include <QHash>
25
#include <QList>
26
#include <QThread>
27
#include <QMap>
28
29
#include <
osmscout/projection/MercatorProjection.h
>
30
31
#include <
osmscout/db/BasemapDatabase.h
>
32
33
#include <
osmscoutmap/DataTileCache.h
>
34
35
#include <osmscoutclient/DBInstance.h>
36
#include <osmscoutclient/DBJob.h>
37
38
#include <
osmscoutclientqt/ClientQtImportExport.h
>
39
40
#include <shared_mutex>
41
42
namespace
osmscout
{
43
47
class
OSMSCOUT_CLIENT_QT_API
DBLoadJob
:
public
QObject,
public
DBJob {
48
Q_OBJECT
49
50
private
:
51
bool
closeOnFinish;
52
osmscout::BreakerRef
breaker;
53
osmscout::MercatorProjection
lookupProjection;
54
osmscout::AreaSearchParameter
searchParameter;
55
QMap<QString,osmscout::MapService::CallbackId> callbacks;
56
57
QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> allTiles;
58
QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> loadingTiles;
59
QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> loadedTiles;
60
61
protected
slots:
62
void
onTileStateChanged
(QString dbPath,
const
osmscout::TileRef
tile);
63
64
signals:
68
void
tileStateChanged
(QString dbPath,
const
osmscout::TileRef
tile);
69
70
void
databaseLoaded
(QString dbPath,QList<osmscout::TileRef> tiles);
71
72
void
finished
(QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> tiles);
73
74
public
:
75
DBLoadJob
(
osmscout::MercatorProjection
lookupProjection,
76
unsigned
long
maximumAreaLevel,
77
bool
lowZoomOptimization,
78
bool
closeOnFinish=
true
);
79
80
~DBLoadJob
()
override
;
81
82
void
Run
(
const
osmscout::BasemapDatabaseRef
& basemapDatabase,
83
const
std::list<DBInstanceRef> &databases,
84
ReadLock
&&locker)
override
;
85
86
void
Close
()
override
;
87
88
bool
IsFinished
()
const
;
89
QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>>
GetAllTiles
()
const
;
90
100
bool
AddTileDataToMapData
(QString dbPath,
101
const
QList<osmscout::TileRef> &tiles,
102
osmscout::MapData &data);
103
};
104
105
}
106
107
#endif
/* OSMSCOUT_CLIENT_QT_DBLOADJOB_H */
BasemapDatabase.h
ClientQtImportExport.h
OSMSCOUT_CLIENT_QT_API
#define OSMSCOUT_CLIENT_QT_API
Definition
ClientQtImportExport.h:45
DataTileCache.h
MercatorProjection.h
osmscout::AreaSearchParameter
Definition
MapService.h:54
osmscout::DBLoadJob::DBLoadJob
DBLoadJob(osmscout::MercatorProjection lookupProjection, unsigned long maximumAreaLevel, bool lowZoomOptimization, bool closeOnFinish=true)
osmscout::DBLoadJob::databaseLoaded
void databaseLoaded(QString dbPath, QList< osmscout::TileRef > tiles)
osmscout::DBLoadJob::GetAllTiles
QMap< QString, QMap< osmscout::TileKey, osmscout::TileRef > > GetAllTiles() const
osmscout::DBLoadJob::~DBLoadJob
~DBLoadJob() override
osmscout::DBLoadJob::tileStateChanged
void tileStateChanged(QString dbPath, const osmscout::TileRef tile)
osmscout::DBLoadJob::Close
void Close() override
osmscout::DBLoadJob::Run
void Run(const osmscout::BasemapDatabaseRef &basemapDatabase, const std::list< DBInstanceRef > &databases, ReadLock &&locker) override
osmscout::DBLoadJob::IsFinished
bool IsFinished() const
osmscout::DBLoadJob::finished
void finished(QMap< QString, QMap< osmscout::TileKey, osmscout::TileRef > > tiles)
osmscout::DBLoadJob::AddTileDataToMapData
bool AddTileDataToMapData(QString dbPath, const QList< osmscout::TileRef > &tiles, osmscout::MapData &data)
osmscout::DBLoadJob::onTileStateChanged
void onTileStateChanged(QString dbPath, const osmscout::TileRef tile)
osmscout::MercatorProjection
Definition
MercatorProjection.h:40
osmscout::ReadLock
Definition
ReadWriteLock.h:115
osmscout::TileRef
std::shared_ptr< Tile > TileRef
Definition
DataTileCache.h:443
osmscout
Definition
Area.h:39
osmscout::BreakerRef
std::shared_ptr< Breaker > BreakerRef
Definition
Breaker.h:64
osmscout::BasemapDatabaseRef
std::shared_ptr< BasemapDatabase > BasemapDatabaseRef
Reference counted reference to an Database instance.
Definition
BasemapDatabase.h:88
Generated by
1.17.0