24 delete mHeightMapGenerator;
41 mTransformContext = context;
49 cloned->mLayer = mLayer;
50 cloned->mResolution = mResolution;
51 cloned->mSkirtHeight = mSkirtHeight;
52 cloned->updateGenerator();
69 return mHeightMapGenerator->heightAt( x, y );
74 elem.setAttribute(
"layer", mLayer.
layerId );
75 elem.setAttribute(
"resolution", mResolution );
76 elem.setAttribute(
"skirt-height", mSkirtHeight );
84 mResolution = elem.attribute(
"resolution" ).toInt();
85 mSkirtHeight = elem.attribute(
"skirt-height" ).toFloat();
98 return new QgsDemTerrainTileLoader(
mTerrain, node );
101 void QgsDemTerrainGenerator::updateGenerator()
108 te = terrainToMapTransform.transformBoundingBox( te );
111 delete mHeightMapGenerator;
117 delete mHeightMapGenerator;
118 mHeightMapGenerator =
nullptr;
A rectangle specified with double values.
QgsTerrainGenerator * clone() const override
Makes a copy of the current instance.
_LayerRef< QgsMapLayer > QgsMapLayerRef
QgsDemTerrainGenerator()=default
Constructor for QgsDemTerrainGenerator.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
QgsCoordinateReferenceSystem crs() const
Returns CRS of the terrain.
float heightAt(double x, double y, const Qgs3DMapSettings &map) const override
Returns height at (x,y) in terrain's CRS.
3 Definition of the world
virtual QgsRectangle extent() const
Returns the extent of the layer.
QString layerId
Original layer ID.
Terrain is built from raster layer with digital elevation model.
void setLayer(QgsRasterLayer *layer)
Sets raster layer with elevation model to be used for terrain generation.
void setCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
Sets CRS of the terrain.
QPointer< TYPE > layer
Weak pointer to map layer.
~QgsDemTerrainGenerator() override
void writeXml(QDomElement &elem) const override
Write terrain generator's configuration to XML.
QgsRectangle extent() const override
extent of the terrain in terrain's CRS
QgsTerrainEntity * mTerrain
QgsCoordinateReferenceSystem crs() const
Returns the layer's spatial reference system.
Reads and writes project states.
Contains information about the context in which a coordinate transform is executed.
void readXml(const QDomElement &elem) override
Read terrain generator's configuration from XML.
Type
Enumeration of the available terrain generators.
QgsTilingScheme mTerrainTilingScheme
Tiling scheme of the terrain.
3 Base class for generators of terrain.
3 Implementation of terrain generator that uses a raster layer with DEM to build terrain.
QgsChunkLoader * createChunkLoader(QgsChunkNode *node) const override
QgsRasterLayer * layer() const
Returns raster layer with elevation model to be used for terrain generation.
This class represents a coordinate reference system (CRS).
QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
void resolveReferences(const QgsProject &project) override
After read of XML, resolve references to any layers that have been read as layer IDs.
3 The class encapsulates tiling scheme (just like with WMTS / TMS / XYZ layers).
QgsRectangle tileToExtent(int x, int y, int z) const
Returns map coordinates of the extent of a tile.
Type type() const override
What texture generator implementation is this.