File indexing completed on 2024-04-14 07:25:40

0001 #ifndef NASAWORLDWINDTOOPENSTREETMAPCONVERTER_H
0002 #define NASAWORLDWINDTOOPENSTREETMAPCONVERTER_H
0003 
0004 #include "mapreproject.h"
0005 #include "ReadOnlyMapDefinition.h"
0006 
0007 #include <QDir>
0008 #include <QObject>
0009 #include <QPair>
0010 #include <QVector>
0011 
0012 class OsmTileClusterRenderer;
0013 class Thread;
0014 
0015 // Abbreviations used:
0016 //   Nww, nww: NASA WorldWind
0017 //   Osm, osm: OpenStreetMap
0018 //   Lon, lon: Longitude
0019 //   Lat, lat: Latitude
0020 //   Rad, rad: Radiant
0021 
0022 class NasaWorldWindToOpenStreetMapConverter: public QObject
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit NasaWorldWindToOpenStreetMapConverter( QObject * const parent = nullptr );
0028 
0029     void setMapSources( QVector<ReadOnlyMapDefinition> const & mapSources );
0030     void setOsmBaseDirectory( QDir const & nwwBaseDirectory );
0031     void setOsmTileClusterEdgeLengthTiles( int const clusterEdgeLengthTiles );
0032     void setOsmTileLevel( int const level );
0033     void setThreadCount( int const threadCount );
0034 
0035     QVector<QPair<Thread*, OsmTileClusterRenderer*> > start();
0036 
0037     void testReprojection();
0038 
0039 Q_SIGNALS:
0040     void finished();
0041 
0042 public Q_SLOTS:
0043     void assignNextCluster( OsmTileClusterRenderer * );
0044 
0045 private:
0046     void checkAndCreateLevelDirectory() const;
0047     void incNextCluster();
0048 
0049     int m_threadCount;
0050     QVector<ReadOnlyMapDefinition> m_mapSources;
0051     QDir m_osmBaseDirectory;
0052     int m_osmTileLevel;
0053 
0054     int m_osmTileClusterEdgeLengthTiles;
0055     int m_osmMapEdgeLengthClusters;
0056     int m_nextClusterX;
0057     int m_nextClusterY;
0058 };
0059 
0060 #endif