QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
27 return new QgsDemTerrainTileLoader(
mTerrain, node );
34 cloned->mExtent = mExtent;
35 cloned->mResolution = mResolution;
36 cloned->mSkirtHeight = mSkirtHeight;
37 cloned->updateGenerator();
54 if ( mHeightMapGenerator )
55 return mHeightMapGenerator->heightAt( x, y );
63 QDomElement elemExtent = elem.ownerDocument().createElement( QStringLiteral(
"extent" ) );
64 elemExtent.setAttribute( QStringLiteral(
"xmin" ), QString::number( r.
xMinimum() ) );
65 elemExtent.setAttribute( QStringLiteral(
"xmax" ), QString::number( r.
xMaximum() ) );
66 elemExtent.setAttribute( QStringLiteral(
"ymin" ), QString::number( r.
yMinimum() ) );
67 elemExtent.setAttribute( QStringLiteral(
"ymax" ), QString::number( r.
yMaximum() ) );
69 elem.setAttribute( QStringLiteral(
"resolution" ), mResolution );
70 elem.setAttribute( QStringLiteral(
"skirt-height" ), mSkirtHeight );
77 QDomElement elemExtent = elem.firstChildElement( QStringLiteral(
"extent" ) );
78 double xmin = elemExtent.attribute( QStringLiteral(
"xmin" ) ).toDouble();
79 double xmax = elemExtent.attribute( QStringLiteral(
"xmax" ) ).toDouble();
80 double ymin = elemExtent.attribute( QStringLiteral(
"ymin" ) ).toDouble();
81 double ymax = elemExtent.attribute( QStringLiteral(
"ymax" ) ).toDouble();
85 mResolution = elem.attribute( QStringLiteral(
"resolution" ) ).toInt();
86 mSkirtHeight = elem.attribute( QStringLiteral(
"skirt-height" ) ).toFloat();
94 mTransformContext = context;
104 void QgsOnlineTerrainGenerator::updateGenerator()
116 mHeightMapGenerator.reset(
new QgsDemHeightMapGenerator(
nullptr,
mTerrainTilingScheme, mResolution, mTransformContext ) );
const QgsCoordinateReferenceSystem & crs
double xMaximum() const
Returns the x maximum value (right side of rectangle).
QgsTerrainGenerator * clone() const override
Makes a copy of the current instance.
void setExtent(const QgsRectangle &extent)
Sets extent of the terrain.
QgsChunkLoader * createChunkLoader(QgsChunkNode *node) const override
QgsCoordinateReferenceSystem crs() const
Returns CRS of the terrain.
QgsTerrainEntity * mTerrain
QgsTilingScheme mTerrainTilingScheme
Tiling scheme of the 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.
~QgsOnlineTerrainGenerator() override
QgsRectangle tileToExtent(int x, int y, int z) const
Returns map coordinates of the extent of a tile.
double yMaximum() const
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.
double yMinimum() const
Returns the y minimum value (bottom side of rectangle).
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()).
double xMinimum() const
Returns the x minimum value (left side of rectangle).