|
QGIS API Documentation 4.3.0-Master (16eddb2670e)
|
Base class for generators of terrain. More...
#include <qgsterraingenerator.h>

Classes | |
| struct | TerrainTextureResources |
Public Types | |
| typedef QFlags< Capability > | Capabilities |
| enum class | Capability : int { NoCapabilities = 1 << 0 , SupportsTileResolution = 1 << 1 } |
| Specific capabilities of the terrain generator. More... | |
| 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 | |
| QgsTerrainGenerator () | |
| Create new terrain generator. | |
| ~QgsTerrainGenerator () override | |
| virtual QgsTerrainGenerator::Capabilities | capabilities () const |
| Returns flags containing the supported capabilities. | |
| virtual QgsTerrainGenerator * | clone () const =0SIP_FACTORY |
| Makes a copy of the current instance. | |
| virtual QgsCoordinateReferenceSystem | crs () const |
| Returns CRS of the terrain. | |
| virtual float | heightAt (double x, double y, const Qgs3DRenderContext &context) const =0 |
| Returns height at (x,y) in map's CRS. | |
| bool | isValid () const |
| Returns whether the terrain generator is valid. | |
| 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 | setCrs (const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context) |
| Sets the CRS associated with the terrain. | |
| 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. | |
| QFuture< QgsChunkLoaderResult > | updateChunk (QgsChunkNode *node) override |
Static Public Member Functions | |
| static QString | typeToString (Type type) |
| Converts terrain generator type enumeration into a string. | |
Protected Member Functions | |
| void | applyMaterial (const TerrainTextureResources &resources, QgsTerrainTileEntity *entity, bool isShadingEnabled, const QgsPhongMaterialSettings &shadingMaterial, bool useTexture, const Qgs3DRenderContext &context) |
| Creates material component for the entity with the rendered map as a texture. | |
| Qt3DRender::QTexture2D * | applyTexture (QgsTerrainTileEntity *entity, const QgsMaterialContext &context, const TerrainTextureResources &resources) const |
| Creates a new texture that is linked to the entity. | |
| QFuture< TerrainTextureResources > | loadTextureResources (QgsChunkNode *node) |
| Asynchronously loads resources for creating texture. | |
Protected Attributes | |
| QgsRectangle | mExtent |
| bool | mIsValid = true |
| QgsTerrainEntity * | mTerrain = nullptr |
| QgsTilingScheme | mTerrainTilingScheme |
| Tiling scheme of the terrain. | |
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 55 of file qgsterraingenerator.h.
| typedef QFlags< Capability > QgsTerrainGenerator::Capabilities |
Definition at line 81 of file qgsterraingenerator.h.
|
strong |
Specific capabilities of the terrain generator.
| Enumerator | |
|---|---|
| NoCapabilities | No specific capabilities. |
| SupportsTileResolution | Supports tile resolution. |
Definition at line 74 of file qgsterraingenerator.h.
Enumeration of the available terrain generators.
Definition at line 60 of file qgsterraingenerator.h.
|
default |
Create new terrain generator.
|
overridedefault |
|
protected |
Creates material component for the entity with the rendered map as a texture.
Definition at line 127 of file qgsterraingenerator.cpp.
|
protected |
Creates a new texture that is linked to the entity.
Definition at line 176 of file qgsterraingenerator.cpp.
|
virtual |
Returns flags containing the supported capabilities.
Reimplemented in QgsDemTerrainGenerator.
Definition at line 104 of file qgsterraingenerator.cpp.
|
pure virtual |
Makes a copy of the current instance.
Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
|
inlinevirtual |
Returns CRS of the terrain.
Reimplemented in QgsDemTerrainGenerator, and QgsFlatTerrainGenerator.
Definition at line 136 of file qgsterraingenerator.h.
|
pure virtual |
Returns height at (x,y) in map's CRS.
Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
| bool QgsTerrainGenerator::isValid | ( | ) | const |
Returns whether the terrain generator is valid.
Definition at line 86 of file qgsterraingenerator.cpp.
|
protected |
Asynchronously loads resources for creating texture.
Definition at line 109 of file qgsterraingenerator.cpp.
|
virtual |
Returns 3D box (in map coordinates) of the root chunk.
Definition at line 41 of file qgsterraingenerator.cpp.
|
virtual |
Returns error of the root chunk in world coordinates.
Reimplemented in QgsQuantizedMeshTerrainGenerator.
Definition at line 50 of file qgsterraingenerator.cpp.
|
pure virtual |
extent of the terrain's root chunk in terrain's CRS
Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
|
virtual |
Returns height range of the root chunk in world coordinates.
Reimplemented in QgsFlatTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
Definition at line 58 of file qgsterraingenerator.cpp.
|
virtual |
Sets the CRS associated with the terrain.
Reimplemented in QgsDemTerrainGenerator, and QgsFlatTerrainGenerator.
Definition at line 83 of file qgsterraingenerator.cpp.
|
inlinevirtual |
sets the extent of the terrain in terrain's CRS
Reimplemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.
Definition at line 105 of file qgsterraingenerator.h.
|
inlinevirtual |
Sets terrain entity for the generator (does not transfer ownership).
Reimplemented in QgsQuantizedMeshTerrainGenerator.
Definition at line 96 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 126 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 65 of file qgsterraingenerator.cpp.
|
override |
Definition at line 91 of file qgsterraingenerator.cpp.
|
protected |
Definition at line 168 of file qgsterraingenerator.h.
|
protected |
Definition at line 170 of file qgsterraingenerator.h.
|
protected |
Definition at line 167 of file qgsterraingenerator.h.
|
protected |
Tiling scheme of the terrain.
Definition at line 166 of file qgsterraingenerator.h.