/
qgsosgearthtilesource.h
63 lines (46 loc) · 1.56 KB
/
qgsosgearthtilesource.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef OSGEARTH_DRIVER_QGIS_DRIVEROPTIONS
#define OSGEARTH_DRIVER_QGIS_DRIVEROPTIONS 1
#include "qgsmaprenderer.h"
#include <QImage>
class QgisInterface;
#include <osgEarth/Common>
#include <osgEarth/TileSource>
using namespace osgEarth;
namespace osgEarth
{
namespace Drivers
{
class QgsOsgEarthTileSource : public TileSource
{
public:
QgsOsgEarthTileSource( QgisInterface* theQgisInterface, const TileSourceOptions& options = TileSourceOptions() );
void initialize( const std::string& referenceURI, const Profile* overrideProfile = NULL );
osg::Image* createImage( const TileKey& key, ProgressCallback* progress );
virtual osg::HeightField* createHeightField( const TileKey &key, ProgressCallback* progress )
{
Q_UNUSED( key );
Q_UNUSED( progress );
//NI
OE_WARN << "[QGIS] Driver does not support heightfields" << std::endl;
return NULL;
}
virtual std::string getExtension() const
{
//All QGIS tiles are in JPEG format
return "jpg";
}
virtual bool supportsPersistentCaching() const
{
return false;
}
private:
QImage* createQImage( int width, int height ) const;
bool intersects( const TileKey* key );
//! Pointer to the QGIS interface object
QgisInterface *mQGisIface;
QgsCoordinateTransform *mCoordTranform;
QgsMapRenderer* mMapRenderer;
};
}
} // namespace osgEarth::Drivers
#endif // OSGEARTH_DRIVER_QGIS_DRIVEROPTIONS