QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
35 cloned->mExtent = mExtent;
36 cloned->mResolution = mResolution;
37 cloned->mSkirtHeight = mSkirtHeight;
38 cloned->updateGenerator();
55 if ( mHeightMapGenerator )
56 return mHeightMapGenerator->heightAt( x, y );
64 QDomElement elemExtent = elem.ownerDocument().createElement( QStringLiteral(
"extent" ) );
65 elemExtent.setAttribute( QStringLiteral(
"xmin" ), QString::number( r.
xMinimum() ) );
66 elemExtent.setAttribute( QStringLiteral(
"xmax" ), QString::number( r.
xMaximum() ) );
67 elemExtent.setAttribute( QStringLiteral(
"ymin" ), QString::number( r.
yMinimum() ) );
68 elemExtent.setAttribute( QStringLiteral(
"ymax" ), QString::number( r.
yMaximum() ) );
70 elem.setAttribute( QStringLiteral(
"resolution" ), mResolution );
71 elem.setAttribute( QStringLiteral(
"skirt-height" ), mSkirtHeight );
78 QDomElement elemExtent = elem.firstChildElement( QStringLiteral(
"extent" ) );
79 double xmin = elemExtent.attribute( QStringLiteral(
"xmin" ) ).toDouble();
80 double xmax = elemExtent.attribute( QStringLiteral(
"xmax" ) ).toDouble();
81 double ymin = elemExtent.attribute( QStringLiteral(
"ymin" ) ).toDouble();
82 double ymax = elemExtent.attribute( QStringLiteral(
"ymax" ) ).toDouble();
86 mResolution = elem.attribute( QStringLiteral(
"resolution" ) ).toInt();
87 mSkirtHeight = elem.attribute( QStringLiteral(
"skirt-height" ) ).toFloat();
95 mTransformContext = context;
105 void QgsOnlineTerrainGenerator::updateGenerator()
117 mHeightMapGenerator.reset(
new QgsDemHeightMapGenerator(
nullptr,
mTerrainTilingScheme, mResolution, mTransformContext ) );
Contains information about the context in which a coordinate transform is executed.
const QgsCoordinateReferenceSystem & crs
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
QgsTerrainGenerator * clone() const override
Makes a copy of the current instance.
A rectangle specified with double values.
void setExtent(const QgsRectangle &extent)
Sets extent of the terrain.
QgsChunkLoader * createChunkLoader(QgsChunkNode *node) const override
QgsCoordinateReferenceSystem crs() const
Returns CRS of the terrain.
double xMaximum() const SIP_HOLDGIL
Returns the x maximum value (right side of rectangle).
QgsTerrainEntity * mTerrain
QgsTilingScheme mTerrainTilingScheme
Tiling scheme of the terrain.
3 Base class for generators of terrain.
Type type() const override
What texture generator implementation is this.
void readXml(const QDomElement &elem) override
Read terrain generator's configuration from XML.
void setCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
Sets CRS of the terrain.
Type
Enumeration of the available terrain generators.
3 Definition of the world
~QgsOnlineTerrainGenerator() override
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
QgsRectangle tileToExtent(int x, int y, int z) const
Returns map coordinates of the extent of a tile.
This class represents a coordinate reference system (CRS).
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
void writeXml(QDomElement &elem) const override
Write terrain generator's configuration to XML.
@ Online
Terrain is built from downloaded tiles with digital elevation model.
3 Implementation of terrain generator that uses online resources to download heightmaps.
3 The class encapsulates tiling scheme (just like with WMTS / TMS / XYZ layers).
QgsOnlineTerrainGenerator()
Constructor for QgsOnlineTerrainGenerator.
float heightAt(double x, double y, const Qgs3DMapSettings &map) const override
Returns height at (x,y) in terrain's CRS.
QgsRectangle extent() const override
extent of the terrain in terrain's CRS
bool isNull() const
Test if the rectangle is null (all coordinates zero or after call to setMinimal()).
void setTerrain(QgsTerrainEntity *t)
Sets terrain entity for the generator (does not transfer ownership)