QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
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 }
 Enumeration of the available terrain generators. More...
 

Signals

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

Public Member Functions

virtual QgsTerrainGeneratorclone () const =0SIP_FACTORY
 Makes a copy of the current instance. More...
 
QgsCoordinateReferenceSystem crs () const
 Returns CRS of the terrain. More...
 
virtual QgsRectangle extent () const
 extent of the terrain in terrain's CRS, might be non-square and smaller than rootChunkExtent() 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 QgsRectangle rootChunkExtent () const =0
 extent of the terrain's root chunk in terrain's CRS 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 QgsTilingSchemetilingScheme () 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

QgsRectangle mExtent
 
bool mIsValid = true
 
QgsTerrainEntity * mTerrain = nullptr
 
QgsTilingScheme mTerrainTilingScheme
 Tiling scheme of the terrain. More...
 

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

Definition at line 54 of file qgsterraingenerator.h.

Member Function Documentation

◆ clone()

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

Makes a copy of the current instance.

Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsOnlineTerrainGenerator.

◆ crs()

QgsCoordinateReferenceSystem QgsTerrainGenerator::crs ( ) const
inline

Returns CRS of the terrain.

Definition at line 108 of file qgsterraingenerator.h.

◆ extent()

virtual QgsRectangle QgsTerrainGenerator::extent ( ) const
inlinevirtual

extent of the terrain in terrain's CRS, might be non-square and smaller than rootChunkExtent()

Definition at line 72 of file qgsterraingenerator.h.

◆ heightAt()

float QgsTerrainGenerator::heightAt ( double  x,
double  y,
const Qgs3DMapSettings map 
) const
virtual

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

Reimplemented in QgsDemTerrainGenerator, and QgsOnlineTerrainGenerator.

Definition at line 47 of file qgsterraingenerator.cpp.

◆ isValid()

bool QgsTerrainGenerator::isValid ( ) const

Returns whether the terrain generator is valid.

Definition at line 71 of file qgsterraingenerator.cpp.

◆ readXml()

virtual void QgsTerrainGenerator::readXml ( const QDomElement &  elem)
pure virtual

Read terrain generator's configuration from XML.

Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsOnlineTerrainGenerator.

◆ resolveReferences()

virtual void QgsTerrainGenerator::resolveReferences ( const QgsProject project)
inlinevirtual

After read of XML, resolve references to any layers that have been read as layer IDs.

Reimplemented in QgsDemTerrainGenerator.

Definition at line 99 of file qgsterraingenerator.h.

◆ rootChunkBbox()

QgsAABB QgsTerrainGenerator::rootChunkBbox ( const Qgs3DMapSettings map) const
virtual

Returns bounding box of the root chunk.

Definition at line 23 of file qgsterraingenerator.cpp.

◆ rootChunkError()

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

Returns error of the root chunk in world coordinates.

Definition at line 32 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, and QgsOnlineTerrainGenerator.

◆ rootChunkHeightRange()

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

Returns height range of the root chunk in world coordinates.

Reimplemented in QgsFlatTerrainGenerator.

Definition at line 40 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, and QgsOnlineTerrainGenerator.

Definition at line 75 of file qgsterraingenerator.h.

◆ setTerrain()

void QgsTerrainGenerator::setTerrain ( QgsTerrainEntity *  t)
inline

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

Definition at line 63 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 105 of file qgsterraingenerator.h.

◆ type()

virtual Type QgsTerrainGenerator::type ( ) const
pure virtual

What texture generator implementation is this.

Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsOnlineTerrainGenerator.

◆ typeToString()

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

Converts terrain generator type enumeration into a string.

Definition at line 55 of file qgsterraingenerator.cpp.

◆ writeXml()

virtual void QgsTerrainGenerator::writeXml ( QDomElement &  elem) const
pure virtual

Write terrain generator's configuration to XML.

Implemented in QgsDemTerrainGenerator, QgsFlatTerrainGenerator, and QgsOnlineTerrainGenerator.

Member Data Documentation

◆ mExtent

QgsRectangle QgsTerrainGenerator::mExtent
protected

Definition at line 122 of file qgsterraingenerator.h.

◆ mIsValid

bool QgsTerrainGenerator::mIsValid = true
protected

Definition at line 124 of file qgsterraingenerator.h.

◆ mTerrain

QgsTerrainEntity* QgsTerrainGenerator::mTerrain = nullptr
protected

Definition at line 121 of file qgsterraingenerator.h.

◆ mTerrainTilingScheme

QgsTilingScheme QgsTerrainGenerator::mTerrainTilingScheme
protected

Tiling scheme of the terrain.

Definition at line 120 of file qgsterraingenerator.h.


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