QGIS API Documentation
3.22.4-Białowieża (ce8e65e95e)
|
3 More...
#include <qgsterraingenerator.h>
Public Types | |
enum | Type { Flat , Dem , Online , Mesh } |
Enumeration of the available terrain generators. More... | |
Signals | |
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... | |
Public Member Functions | |
virtual QgsTerrainGenerator * | clone () const =0SIP_FACTORY |
Makes a copy of the current instance. More... | |
QgsCoordinateReferenceSystem | crs () const |
Returns CRS of the terrain. More... | |
virtual QgsRectangle | extent () const =0 |
extent of the terrain in terrain's CRS More... | |
virtual float | heightAt (double x, double y, const Qgs3DMapSettings &map) const |
Returns height at (x,y) in terrain's CRS. More... | |
bool | isValid () const |
Returns whether the terrain generator is valid. More... | |
virtual void | readXml (const QDomElement &elem)=0 |
Read terrain generator's configuration from XML. More... | |
virtual void | resolveReferences (const QgsProject &project) |
After read of XML, resolve references to any layers that have been read as layer IDs. 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 QgsTilingScheme & | tilingScheme () const |
Returns tiling scheme of the terrain. More... | |
virtual Type | type () const =0 |
What texture generator implementation is this. More... | |
virtual void | writeXml (QDomElement &elem) const =0 |
Write terrain generator's configuration to XML. More... | |
Static Public Member Functions | |
static QString | typeToString (Type type) |
Converts terrain generator type enumeration into a string. More... | |
Protected Attributes | |
bool | mIsValid = true |
QgsTerrainEntity * | mTerrain = nullptr |
QgsTilingScheme | mTerrainTilingScheme |
Tiling scheme of the terrain. More... | |
3
Base class for generators of terrain.
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).
Definition at line 49 of file qgsterraingenerator.h.
Enumeration of the available terrain generators.
Definition at line 55 of file qgsterraingenerator.h.
|
pure virtual |
Makes a copy of the current instance.
Implemented in QgsOnlineTerrainGenerator, QgsFlatTerrainGenerator, and QgsDemTerrainGenerator.
|
inline |
Returns CRS of the terrain.
Definition at line 106 of file qgsterraingenerator.h.
|
pure virtual |
extent of the terrain in terrain's CRS
Implemented in QuantizedMeshTerrainGenerator, QgsOnlineTerrainGenerator, QgsFlatTerrainGenerator, and QgsDemTerrainGenerator.
|
signal |
Emitted when the terrain extent has changed.
|
virtual |
Returns height at (x,y) in terrain's CRS.
Reimplemented in QgsOnlineTerrainGenerator, and QgsDemTerrainGenerator.
Definition at line 53 of file qgsterraingenerator.cpp.
bool QgsTerrainGenerator::isValid | ( | ) | const |
Returns whether the terrain generator is valid.
Definition at line 77 of file qgsterraingenerator.cpp.
|
pure virtual |
Read terrain generator's configuration from XML.
Implemented in QuantizedMeshTerrainGenerator, QgsOnlineTerrainGenerator, QgsFlatTerrainGenerator, and QgsDemTerrainGenerator.
|
inlinevirtual |
After read of XML, resolve references to any layers that have been read as layer IDs.
Reimplemented in QgsDemTerrainGenerator.
Definition at line 97 of file qgsterraingenerator.h.
|
virtual |
Returns bounding box of the root chunk.
Definition at line 22 of file qgsterraingenerator.cpp.
|
virtual |
Returns error of the root chunk in world coordinates.
Definition at line 35 of file qgsterraingenerator.cpp.
|
virtual |
Returns height range of the root chunk in world coordinates.
Reimplemented in QgsFlatTerrainGenerator.
Definition at line 46 of file qgsterraingenerator.cpp.
|
inlinevirtual |
sets the extent of the terrain in terrain's CRS
Reimplemented in QgsOnlineTerrainGenerator, and QgsFlatTerrainGenerator.
Definition at line 76 of file qgsterraingenerator.h.
|
inline |
Sets terrain entity for the generator (does not transfer ownership)
Definition at line 64 of file qgsterraingenerator.h.
|
signal |
Emitted when the terrain changed (for example, raster DEM or mesh have data changed)
|
inline |
Returns tiling scheme of the terrain.
Definition at line 103 of file qgsterraingenerator.h.
|
pure virtual |
What texture generator implementation is this.
Implemented in QuantizedMeshTerrainGenerator, QgsOnlineTerrainGenerator, QgsFlatTerrainGenerator, and QgsDemTerrainGenerator.
|
static |
Converts terrain generator type enumeration into a string.
Definition at line 61 of file qgsterraingenerator.cpp.
|
pure virtual |
Write terrain generator's configuration to XML.
Implemented in QuantizedMeshTerrainGenerator, QgsOnlineTerrainGenerator, QgsFlatTerrainGenerator, and QgsDemTerrainGenerator.
|
protected |
Definition at line 124 of file qgsterraingenerator.h.
|
protected |
Definition at line 122 of file qgsterraingenerator.h.
|
protected |
Tiling scheme of the terrain.
Definition at line 121 of file qgsterraingenerator.h.