QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
Public Member Functions | List of all members
QgsDemTerrainGenerator Class Reference

3 More...

#include <qgsdemterraingenerator.h>

Inheritance diagram for QgsDemTerrainGenerator:
Inheritance graph
[legend]

Public Member Functions

 QgsDemTerrainGenerator ()=default
 Constructor for QgsDemTerrainGenerator. More...
 
 ~QgsDemTerrainGenerator () override
 
QgsTerrainGeneratorclone () const override
 Makes a copy of the current instance. More...
 
QgsChunkLoader * createChunkLoader (QgsChunkNode *node) const override
 
QgsRectangle extent () const override
 extent of the terrain in terrain's CRS More...
 
float heightAt (double x, double y, const Qgs3DMapSettings &map) const override
 Returns height at (x,y) in terrain's CRS. More...
 
QgsDemHeightMapGenerator * heightMapGenerator ()
 Returns height map generator object - takes care of extraction of elevations from the layer) More...
 
QgsRasterLayerlayer () const
 Returns raster layer with elevation model to be used for terrain generation. More...
 
void readXml (const QDomElement &elem) override
 Read terrain generator's configuration from XML. More...
 
int resolution () const
 Returns resolution of the generator (how many elevation samples on one side of a terrain tile) More...
 
void resolveReferences (const QgsProject &project) override
 After read of XML, resolve references to any layers that have been read as layer IDs. More...
 
void setCrs (const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
 Sets CRS of the terrain. More...
 
void setLayer (QgsRasterLayer *layer)
 Sets raster layer with elevation model to be used for terrain generation. More...
 
void setResolution (int resolution)
 Sets resolution of the generator (how many elevation samples on one side of a terrain tile) More...
 
void setSkirtHeight (float skirtHeight)
 Sets skirt height (in world units). Skirts at the edges of terrain tiles help hide cracks between adjacent tiles. More...
 
float skirtHeight () const
 Returns skirt height (in world units). Skirts at the edges of terrain tiles help hide cracks between adjacent tiles. More...
 
Type type () const override
 What texture generator implementation is this. More...
 
void writeXml (QDomElement &elem) const override
 Write terrain generator's configuration to XML. More...
 
- Public Member Functions inherited from QgsTerrainGenerator
QgsCoordinateReferenceSystem crs () const
 Returns CRS of the terrain. More...
 
bool isValid () const
 Returns whether the terrain generator is valid. More...
 
virtual QgsAABB rootChunkBbox (const Qgs3DMapSettings &map) const
 Returns bounding box of the root chunk. More...
 
virtual float rootChunkError (const Qgs3DMapSettings &map) const
 Returns error of the root chunk in world coordinates. More...
 
virtual void rootChunkHeightRange (float &hMin, float &hMax) const
 Returns height range of the root chunk in world coordinates. More...
 
virtual void setExtent (const QgsRectangle &extent)
 sets the extent of the terrain in terrain's CRS More...
 
void setTerrain (QgsTerrainEntity *t)
 Sets terrain entity for the generator (does not transfer ownership) More...
 
const QgsTilingSchemetilingScheme () const
 Returns tiling scheme of the terrain. More...
 

Additional Inherited Members

- Public Types inherited from QgsTerrainGenerator
enum  Type { Flat , Dem , Online , Mesh }
 Enumeration of the available terrain generators. More...
 
- Signals inherited from QgsTerrainGenerator
void extentChanged ()
 Emitted when the terrain extent has changed. More...
 
void terrainChanged ()
 Emitted when the terrain changed (for example, raster DEM or mesh have data changed) More...
 
- Static Public Member Functions inherited from QgsTerrainGenerator
static QString typeToString (Type type)
 Converts terrain generator type enumeration into a string. More...
 
- Protected Attributes inherited from QgsTerrainGenerator
bool mIsValid = true
 
QgsTerrainEntity * mTerrain = nullptr
 
QgsTilingScheme mTerrainTilingScheme
 Tiling scheme of the terrain. More...
 

Detailed Description

3

Implementation of terrain generator that uses a raster layer with DEM to build terrain.

Note
Not available in Python bindings
Since
QGIS 3.0

Definition at line 41 of file qgsdemterraingenerator.h.

Constructor & Destructor Documentation

◆ QgsDemTerrainGenerator()

QgsDemTerrainGenerator::QgsDemTerrainGenerator ( )
default

Constructor for QgsDemTerrainGenerator.

◆ ~QgsDemTerrainGenerator()

QgsDemTerrainGenerator::~QgsDemTerrainGenerator ( )
override

Definition at line 23 of file qgsdemterraingenerator.cpp.

Member Function Documentation

◆ clone()

QgsTerrainGenerator * QgsDemTerrainGenerator::clone ( ) const
overridevirtual

Makes a copy of the current instance.

Implements QgsTerrainGenerator.

Definition at line 46 of file qgsdemterraingenerator.cpp.

◆ createChunkLoader()

QgsChunkLoader * QgsDemTerrainGenerator::createChunkLoader ( QgsChunkNode *  node) const
override

Definition at line 101 of file qgsdemterraingenerator.cpp.

◆ extent()

QgsRectangle QgsDemTerrainGenerator::extent ( ) const
overridevirtual

extent of the terrain in terrain's CRS

Implements QgsTerrainGenerator.

Definition at line 63 of file qgsdemterraingenerator.cpp.

◆ heightAt()

float QgsDemTerrainGenerator::heightAt ( double  x,
double  y,
const Qgs3DMapSettings map 
) const
overridevirtual

Returns height at (x,y) in terrain's CRS.

Reimplemented from QgsTerrainGenerator.

Definition at line 68 of file qgsdemterraingenerator.cpp.

◆ heightMapGenerator()

QgsDemHeightMapGenerator* QgsDemTerrainGenerator::heightMapGenerator ( )
inline

Returns height map generator object - takes care of extraction of elevations from the layer)

Definition at line 67 of file qgsdemterraingenerator.h.

◆ layer()

QgsRasterLayer * QgsDemTerrainGenerator::layer ( ) const

Returns raster layer with elevation model to be used for terrain generation.

Definition at line 34 of file qgsdemterraingenerator.cpp.

◆ readXml()

void QgsDemTerrainGenerator::readXml ( const QDomElement &  elem)
overridevirtual

Read terrain generator's configuration from XML.

Implements QgsTerrainGenerator.

Definition at line 86 of file qgsdemterraingenerator.cpp.

◆ resolution()

int QgsDemTerrainGenerator::resolution ( ) const
inline

Returns resolution of the generator (how many elevation samples on one side of a terrain tile)

Definition at line 59 of file qgsdemterraingenerator.h.

◆ resolveReferences()

void QgsDemTerrainGenerator::resolveReferences ( const QgsProject project)
overridevirtual

After read of XML, resolve references to any layers that have been read as layer IDs.

Reimplemented from QgsTerrainGenerator.

Definition at line 95 of file qgsdemterraingenerator.cpp.

◆ setCrs()

void QgsDemTerrainGenerator::setCrs ( const QgsCoordinateReferenceSystem crs,
const QgsCoordinateTransformContext context 
)

Sets CRS of the terrain.

Definition at line 39 of file qgsdemterraingenerator.cpp.

◆ setLayer()

void QgsDemTerrainGenerator::setLayer ( QgsRasterLayer layer)

Sets raster layer with elevation model to be used for terrain generation.

Definition at line 28 of file qgsdemterraingenerator.cpp.

◆ setResolution()

void QgsDemTerrainGenerator::setResolution ( int  resolution)
inline

Sets resolution of the generator (how many elevation samples on one side of a terrain tile)

Definition at line 57 of file qgsdemterraingenerator.h.

◆ setSkirtHeight()

void QgsDemTerrainGenerator::setSkirtHeight ( float  skirtHeight)
inline

Sets skirt height (in world units). Skirts at the edges of terrain tiles help hide cracks between adjacent tiles.

Definition at line 62 of file qgsdemterraingenerator.h.

◆ skirtHeight()

float QgsDemTerrainGenerator::skirtHeight ( ) const
inline

Returns skirt height (in world units). Skirts at the edges of terrain tiles help hide cracks between adjacent tiles.

Definition at line 64 of file qgsdemterraingenerator.h.

◆ type()

QgsTerrainGenerator::Type QgsDemTerrainGenerator::type ( ) const
overridevirtual

What texture generator implementation is this.

Implements QgsTerrainGenerator.

Definition at line 58 of file qgsdemterraingenerator.cpp.

◆ writeXml()

void QgsDemTerrainGenerator::writeXml ( QDomElement &  elem) const
overridevirtual

Write terrain generator's configuration to XML.

Implements QgsTerrainGenerator.

Definition at line 77 of file qgsdemterraingenerator.cpp.


The documentation for this class was generated from the following files: