QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsTerrainGenerator Class Referenceabstract

3 More...

#include <qgsterraingenerator.h>

Inheritance diagram for QgsTerrainGenerator:
Inheritance graph
[legend]

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 QgsTerrainGeneratorclone () 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
 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 QgsTilingSchemetilingScheme () const
 Returns tiling scheme of the terrain.
 
virtual Type type () const =0
 What texture generator implementation is this.
 

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.
 

Detailed Description

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).

Note
Not available in Python bindings

Definition at line 49 of file qgsterraingenerator.h.

Member Enumeration Documentation

◆ Type

Enumeration of the available terrain generators.

Enumerator
Flat 

The whole terrain is flat area.

Dem 

Terrain is built from raster layer with digital elevation model.

Online 

Terrain is built from downloaded tiles with digital elevation model.

Mesh 

Terrain is built from mesh layer with z value on vertices.

QuantizedMesh 

Terrain is built from quantized mesh tiles.

Definition at line 54 of file qgsterraingenerator.h.

Member Function Documentation

◆ clone()

virtual QgsTerrainGenerator * QgsTerrainGenerator::clone ( ) const
pure virtual

◆ crs()

virtual QgsCoordinateReferenceSystem QgsTerrainGenerator::crs ( ) const
inlinevirtual

Returns CRS of the terrain.

Reimplemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsOnlineTerrainGenerator.

Definition at line 104 of file qgsterraingenerator.h.

◆ heightAt()

float QgsTerrainGenerator::heightAt ( double  x,
double  y,
const Qgs3DRenderContext context 
) const
virtual

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

Reimplemented in QgsDemTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.

Definition at line 48 of file qgsterraingenerator.cpp.

◆ isValid()

bool QgsTerrainGenerator::isValid ( ) const

Returns whether the terrain generator is valid.

Definition at line 78 of file qgsterraingenerator.cpp.

◆ rootChunkBox3D()

QgsBox3D QgsTerrainGenerator::rootChunkBox3D ( const Qgs3DMapSettings map) const
virtual

Returns 3D box (in map coordinates) of the root chunk.

Definition at line 24 of file qgsterraingenerator.cpp.

◆ rootChunkError()

float QgsTerrainGenerator::rootChunkError ( const Qgs3DMapSettings map) const
virtual

Returns error of the root chunk in world coordinates.

Reimplemented in QgsQuantizedMeshTerrainGenerator.

Definition at line 33 of file qgsterraingenerator.cpp.

◆ rootChunkExtent()

virtual QgsRectangle QgsTerrainGenerator::rootChunkExtent ( ) const
pure virtual

extent of the terrain's root chunk in terrain's CRS

Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.

◆ rootChunkHeightRange()

void QgsTerrainGenerator::rootChunkHeightRange ( float &  hMin,
float &  hMax 
) const
virtual

Returns height range of the root chunk in world coordinates.

Reimplemented in QgsFlatTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.

Definition at line 41 of file qgsterraingenerator.cpp.

◆ setCrs()

void QgsTerrainGenerator::setCrs ( const QgsCoordinateReferenceSystem crs,
const QgsCoordinateTransformContext context 
)
virtual

Sets the CRS associated with the terrain.

See also
crs()

Reimplemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsOnlineTerrainGenerator.

Definition at line 74 of file qgsterraingenerator.cpp.

◆ setExtent()

virtual void QgsTerrainGenerator::setExtent ( const QgsRectangle extent)
inlinevirtual

sets the extent of the terrain in terrain's CRS

Reimplemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.

Definition at line 73 of file qgsterraingenerator.h.

◆ setTerrain()

virtual void QgsTerrainGenerator::setTerrain ( QgsTerrainEntity *  t)
inlinevirtual

Sets terrain entity for the generator (does not transfer ownership)

Reimplemented in QgsQuantizedMeshTerrainGenerator.

Definition at line 64 of file qgsterraingenerator.h.

◆ terrainChanged

void QgsTerrainGenerator::terrainChanged ( )
signal

Emitted when the terrain changed (for example, raster DEM or mesh have data changed)

◆ tilingScheme()

const QgsTilingScheme & QgsTerrainGenerator::tilingScheme ( ) const
inline

Returns tiling scheme of the terrain.

Definition at line 94 of file qgsterraingenerator.h.

◆ type()

virtual Type QgsTerrainGenerator::type ( ) const
pure virtual

What texture generator implementation is this.

Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, QgsOnlineTerrainGenerator, and QgsQuantizedMeshTerrainGenerator.

◆ typeToString()

QString QgsTerrainGenerator::typeToString ( QgsTerrainGenerator::Type  type)
static

Converts terrain generator type enumeration into a string.

Definition at line 56 of file qgsterraingenerator.cpp.

Member Data Documentation

◆ mExtent

QgsRectangle QgsTerrainGenerator::mExtent
protected

Definition at line 117 of file qgsterraingenerator.h.

◆ mIsValid

bool QgsTerrainGenerator::mIsValid = true
protected

Definition at line 119 of file qgsterraingenerator.h.

◆ mTerrain

QgsTerrainEntity* QgsTerrainGenerator::mTerrain = nullptr
protected

Definition at line 116 of file qgsterraingenerator.h.

◆ mTerrainTilingScheme

QgsTilingScheme QgsTerrainGenerator::mTerrainTilingScheme
protected

Tiling scheme of the terrain.

Definition at line 115 of file qgsterraingenerator.h.


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