QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
3 More...
#include <qgsterraingenerator.h>
Public Types | |
enum | Type { Flat , Dem , Online , Mesh , QuantizedMesh } |
Enumeration of the available terrain generators. More... | |
Signals | |
void | terrainChanged () |
Emitted when the terrain changed (for example, raster DEM or mesh have data changed) | |
Public Member Functions | |
virtual QgsTerrainGenerator * | clone () const =0SIP_FACTORY |
Makes a copy of the current instance. | |
virtual QgsCoordinateReferenceSystem | crs () const |
Returns CRS of the terrain. | |
virtual QgsRectangle | extent () const |
extent of the terrain in terrain's CRS, might be non-square and smaller than rootChunkExtent() | |
virtual float | heightAt (double x, double y, const Qgs3DRenderContext &context) const |
Returns height at (x,y) in map's CRS. | |
bool | isValid () const |
Returns whether the terrain generator is valid. | |
virtual void | readXml (const QDomElement &elem)=0 |
Read terrain generator's configuration from XML. | |
virtual void | resolveReferences (const QgsProject &project) |
After read of XML, resolve references to any layers that have been read as layer IDs. | |
virtual QgsBox3D | rootChunkBox3D (const Qgs3DMapSettings &map) const |
Returns 3D box (in map coordinates) of the root chunk. | |
virtual float | rootChunkError (const Qgs3DMapSettings &map) const |
Returns error of the root chunk in world coordinates. | |
virtual QgsRectangle | rootChunkExtent () const =0 |
extent of the terrain's root chunk in terrain's CRS | |
virtual void | rootChunkHeightRange (float &hMin, float &hMax) const |
Returns height range of the root chunk in world coordinates. | |
virtual void | setExtent (const QgsRectangle &extent) |
sets the extent of the terrain in terrain's CRS | |
virtual void | setTerrain (QgsTerrainEntity *t) |
Sets terrain entity for the generator (does not transfer ownership) | |
const QgsTilingScheme & | tilingScheme () const |
Returns tiling scheme of the terrain. | |
virtual Type | type () const =0 |
What texture generator implementation is this. | |
virtual void | writeXml (QDomElement &elem) const =0 |
Write terrain generator's configuration to XML. | |
Static Public Member Functions | |
static QString | typeToString (Type type) |
Converts terrain generator type enumeration into a string. | |
Protected Attributes | |
QgsRectangle | mExtent |
bool | mIsValid = true |
QgsTerrainEntity * | mTerrain = nullptr |
QgsTilingScheme | mTerrainTilingScheme |
Tiling scheme of the terrain. | |
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 QgsDemTerrainGenerator, QgsQuantizedMeshTerrainGenerator, QgsFlatTerrainGenerator, and QgsOnlineTerrainGenerator.
|
inlinevirtual |
Returns CRS of the terrain.
Reimplemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsOnlineTerrainGenerator.
Definition at line 110 of file qgsterraingenerator.h.
|
inlinevirtual |
extent of the terrain in terrain's CRS, might be non-square and smaller than rootChunkExtent()
Definition at line 74 of file qgsterraingenerator.h.
|
virtual |
Returns height at (x,y) in map's CRS.
Reimplemented in QgsDemTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
Definition at line 48 of file qgsterraingenerator.cpp.
bool QgsTerrainGenerator::isValid | ( | ) | const |
Returns whether the terrain generator is valid.
Definition at line 74 of file qgsterraingenerator.cpp.
|
pure virtual |
Read terrain generator's configuration from XML.
Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
|
inlinevirtual |
After read of XML, resolve references to any layers that have been read as layer IDs.
Reimplemented in QgsDemTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
Definition at line 101 of file qgsterraingenerator.h.
|
virtual |
Returns 3D box (in map coordinates) of the root chunk.
Definition at line 23 of file qgsterraingenerator.cpp.
|
virtual |
Returns error of the root chunk in world coordinates.
Reimplemented in QgsQuantizedMeshTerrainGenerator.
Definition at line 33 of file qgsterraingenerator.cpp.
|
pure virtual |
extent of the terrain's root chunk in terrain's CRS
Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
|
virtual |
Returns height range of the root chunk in world coordinates.
Reimplemented in QgsFlatTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
Definition at line 41 of file qgsterraingenerator.cpp.
|
inlinevirtual |
sets the extent of the terrain in terrain's CRS
Reimplemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
Definition at line 77 of file qgsterraingenerator.h.
|
inlinevirtual |
Sets terrain entity for the generator (does not transfer ownership)
Reimplemented in QgsQuantizedMeshTerrainGenerator.
Definition at line 65 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 107 of file qgsterraingenerator.h.
|
pure virtual |
What texture generator implementation is this.
Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
|
static |
Converts terrain generator type enumeration into a string.
Definition at line 56 of file qgsterraingenerator.cpp.
|
pure virtual |
Write terrain generator's configuration to XML.
Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
|
protected |
Definition at line 124 of file qgsterraingenerator.h.
|
protected |
Definition at line 126 of file qgsterraingenerator.h.
|
protected |
Definition at line 123 of file qgsterraingenerator.h.
|
protected |
Tiling scheme of the terrain.
Definition at line 122 of file qgsterraingenerator.h.