QgsTerrainGenerator class
3 Base class for generators of terrain.
Contents
All terrain generators are tile based to support hierarchical level of detail. Tiling scheme of a generator is defined by the generator itself. Terrain generators are asked to produce new terrain tiles whenever that is deemed necessary by the terrain controller (that caches generated tiles).
Derived classes
- class QgsDemTerrainGenerator
- 3 Implementation of terrain generator that uses a raster layer with DEM to build terrain.
- class QgsFlatTerrainGenerator
- 3 Terrain generator that creates a simple square flat area.
- class QuantizedMeshTerrainGenerator
- 3 Terrain generator using downloaded terrain tiles using quantized mesh specification
Public types
- enum Type { Flat, Dem, QuantizedMesh }
- Enumeration of the available terrain generators.
Public static functions
- static auto typeToString(Type type) -> QString
- Converts terrain generator type enumeration into a string.
Public functions
- auto clone() const =0SIP_FACTORY -> QgsTerrainGenerator* virtual
- Makes a copy of the current instance.
- auto crs() const -> QgsCoordinateReferenceSystem
- Returns CRS of the terrain.
- auto extent() const -> QgsRectangle pure virtual
- extent of the terrain in terrain's CRS
- auto heightAt(double x, double y, const Qgs3DMapSettings& map) const -> float virtual
- Returns height at (x,y) in terrain's CRS.
- void readXml(const QDomElement& elem) pure virtual
- Read terrain generator's configuration from XML.
- void resolveReferences(const QgsProject& project) virtual
- After read of XML, resolve references to any layers that have been read as layer IDs.
- auto rootChunkBbox(const Qgs3DMapSettings& map) const -> QgsAABB virtual
- Returns bounding box of the root chunk.
- auto rootChunkError(const Qgs3DMapSettings& map) const -> float virtual
- Returns error of the root chunk in world coordinates.
- void rootChunkHeightRange(float& hMin, float& hMax) const virtual
- Returns height range of the root chunk in world coordinates.
- void setTerrain(QgsTerrainEntity* t)
- Sets terrain entity for the generator (does not transfer ownership)
- auto tilingScheme() const -> const QgsTilingScheme&
- Returns tiling scheme of the terrain.
- auto type() const -> Type pure virtual
- What texture generator implementation is this.
- void writeXml(QDomElement& elem) const pure virtual
- Write terrain generator's configuration to XML.
Protected variables
- QgsTilingScheme mTerrainTilingScheme
- Tiling scheme of the terrain.
Enum documentation
enum QgsTerrainGenerator:: Type
Enumeration of the available terrain generators.
| Enumerators | |
|---|---|
| Flat |
The whole terrain is flat area. |
| Dem |
Terrain is built from raster layer with digital elevation model. |
| QuantizedMesh |
Terrain is built from downloaded tiles in quantized mesh format. |