QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
QgsAbstractTerrainSettings Class Referenceabstract

3 More...

#include <qgsabstractterrainsettings.h>

Inheritance diagram for QgsAbstractTerrainSettings:
Inheritance graph
[legend]

Public Member Functions

virtual ~QgsAbstractTerrainSettings ()
 
virtual QgsAbstractTerrainSettingsclone () const =0
 Returns a copy of the terrain settings.
 
virtual std::unique_ptr< QgsTerrainGeneratorcreateTerrainGenerator (const Qgs3DRenderContext &context) const =0
 Creates a new instance of a terrain generator which matches the terrain settings.
 
double elevationOffset () const
 Returns the elevation offset of the terrain (used to move the terrain up or down).
 
virtual bool equals (const QgsAbstractTerrainSettings *other) const =0
 Returns true if this settings is exactly equal to another other settings.
 
int mapTileResolution () const
 Returns the resolution (in pixels) of the texture of a terrain tile.
 
double maximumGroundError () const
 Returns the maximum ground error of terrain tiles in world units.
 
double maximumScreenError () const
 Returns the maximum allowed screen error of terrain tiles in pixels.
 
virtual void readXml (const QDomElement &element, const QgsReadWriteContext &context)=0
 Reads settings from a DOM element.
 
virtual void resolveReferences (const QgsProject *project)
 After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs.
 
void setElevationOffset (double offset)
 Sets the terrain elevation offset (used to move the terrain up or down).
 
void setMapTileResolution (int resolution)
 Sets the resolution (in pixels) of the texture of a terrain tile.
 
void setMaximumGroundError (double error)
 Sets the maximum ground error of terrain tiles in world units.
 
void setMaximumScreenError (double error)
 Sets the maximum allowed screen error of terrain tiles in pixels.
 
void setVerticalScale (double scale)
 Sets the vertical scale (exaggeration) for terrain.
 
virtual QString type () const =0
 Returns the unique type name for the terrain generator.
 
double verticalScale () const
 Returns the vertical scale (exaggeration) for terrain.
 
virtual void writeXml (QDomElement &element, const QgsReadWriteContext &context) const =0
 Writes settings to a DOM element.
 

Protected Member Functions

void copyCommonProperties (const QgsAbstractTerrainSettings *source)
 Copies common properties from a source object.
 
bool equalsCommon (const QgsAbstractTerrainSettings *other) const
 Returns true if common base class settings from other match this object.
 
void readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context)
 Reads common properties from the base class from the given DOM element.
 
void writeCommonProperties (QDomElement &element, const QgsReadWriteContext &context) const
 Writes common properties from the base class into an XML element.
 

Detailed Description

3

Base class for all terrain settings classes.

QgsAbstractTerrainSettings subclasses are responsible for storing the configuration of terrain generators.

Warning
This is not considered stable API, and may change in future QGIS releases. It is exposed to the Python bindings as a tech preview only.
Since
QGIS 3.42

Definition at line 42 of file qgsabstractterrainsettings.h.

Constructor & Destructor Documentation

◆ ~QgsAbstractTerrainSettings()

QgsAbstractTerrainSettings::~QgsAbstractTerrainSettings ( )
virtualdefault

Member Function Documentation

◆ clone()

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

◆ copyCommonProperties()

void QgsAbstractTerrainSettings::copyCommonProperties ( const QgsAbstractTerrainSettings source)
protected

Copies common properties from a source object.

Definition at line 44 of file qgsabstractterrainsettings.cpp.

◆ createTerrainGenerator()

virtual std::unique_ptr< QgsTerrainGenerator > QgsAbstractTerrainSettings::createTerrainGenerator ( const Qgs3DRenderContext context) const
pure virtual

Creates a new instance of a terrain generator which matches the terrain settings.

Note
Not available in Python bindings

Implemented in QgsDemTerrainSettings, QgsFlatTerrainSettings, QgsMeshTerrainSettings, QgsOnlineDemTerrainSettings, and QgsQuantizedMeshTerrainSettings.

◆ elevationOffset()

double QgsAbstractTerrainSettings::elevationOffset ( ) const
inline

Returns the elevation offset of the terrain (used to move the terrain up or down).

See also
setElevationOffset()

Definition at line 196 of file qgsabstractterrainsettings.h.

◆ equals()

virtual bool QgsAbstractTerrainSettings::equals ( const QgsAbstractTerrainSettings other) const
pure virtual

Returns true if this settings is exactly equal to another other settings.

Implemented in QgsDemTerrainSettings, QgsFlatTerrainSettings, QgsMeshTerrainSettings, QgsOnlineDemTerrainSettings, and QgsQuantizedMeshTerrainSettings.

◆ equalsCommon()

bool QgsAbstractTerrainSettings::equalsCommon ( const QgsAbstractTerrainSettings other) const
protected

Returns true if common base class settings from other match this object.

Definition at line 53 of file qgsabstractterrainsettings.cpp.

◆ mapTileResolution()

int QgsAbstractTerrainSettings::mapTileResolution ( ) const
inline

Returns the resolution (in pixels) of the texture of a terrain tile.

This parameter influences how many zoom levels for terrain tiles there will be (together with maxTerrainGroundError())

See also
setMapTileResolution()

Definition at line 145 of file qgsabstractterrainsettings.h.

◆ maximumGroundError()

double QgsAbstractTerrainSettings::maximumGroundError ( ) const
inline

Returns the maximum ground error of terrain tiles in world units.

This parameter influences how many zoom levels there will be (together with mapTileResolution()). This value tells that when the given ground error is reached (e.g. 10 meters), it makes no sense to further split terrain tiles into finer ones because they will not add extra details anymore.

See also
setMaximumGroundError()

Definition at line 182 of file qgsabstractterrainsettings.h.

◆ maximumScreenError()

double QgsAbstractTerrainSettings::maximumScreenError ( ) const
inline

Returns the maximum allowed screen error of terrain tiles in pixels.

This parameter decides how aggressively less detailed terrain tiles are swapped to more detailed ones as camera gets closer. Each tile has its error defined in world units - this error gets projected to screen pixels according to camera view and if the tile's error is greater than the allowed error, it will be swapped by more detailed tiles with lower error.

see setMaximumScreenError()

Definition at line 164 of file qgsabstractterrainsettings.h.

◆ readCommonProperties()

void QgsAbstractTerrainSettings::readCommonProperties ( const QDomElement &  element,
const QgsReadWriteContext context 
)
protected

Reads common properties from the base class from the given DOM element.

See also
readXml()

Definition at line 35 of file qgsabstractterrainsettings.cpp.

◆ readXml()

virtual void QgsAbstractTerrainSettings::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
pure virtual

Reads settings from a DOM element.

Subclasses should take care to call readCommonProperties() to read common properties from the element.

See also
resolveReferences()
writeXml()

Implemented in QgsDemTerrainSettings, QgsFlatTerrainSettings, QgsMeshTerrainSettings, QgsOnlineDemTerrainSettings, and QgsQuantizedMeshTerrainSettings.

◆ resolveReferences()

void QgsAbstractTerrainSettings::resolveReferences ( const QgsProject project)
virtual

After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs.

See also
readXml()

Reimplemented in QgsDemTerrainSettings, QgsMeshTerrainSettings, and QgsQuantizedMeshTerrainSettings.

Definition at line 22 of file qgsabstractterrainsettings.cpp.

◆ setElevationOffset()

void QgsAbstractTerrainSettings::setElevationOffset ( double  offset)
inline

Sets the terrain elevation offset (used to move the terrain up or down).

See also
elevationOffset()

Definition at line 189 of file qgsabstractterrainsettings.h.

◆ setMapTileResolution()

void QgsAbstractTerrainSettings::setMapTileResolution ( int  resolution)
inline

Sets the resolution (in pixels) of the texture of a terrain tile.

See also
mapTileResolution()

Definition at line 136 of file qgsabstractterrainsettings.h.

◆ setMaximumGroundError()

void QgsAbstractTerrainSettings::setMaximumGroundError ( double  error)
inline

Sets the maximum ground error of terrain tiles in world units.

See also
maximumGroundError()

Definition at line 171 of file qgsabstractterrainsettings.h.

◆ setMaximumScreenError()

void QgsAbstractTerrainSettings::setMaximumScreenError ( double  error)
inline

Sets the maximum allowed screen error of terrain tiles in pixels.

See also
maximumScreenError()

Definition at line 152 of file qgsabstractterrainsettings.h.

◆ setVerticalScale()

void QgsAbstractTerrainSettings::setVerticalScale ( double  scale)
inline

Sets the vertical scale (exaggeration) for terrain.

(1 = true scale, > 1 = hills get more pronounced)

See also
verticalScale()

Definition at line 121 of file qgsabstractterrainsettings.h.

◆ type()

virtual QString QgsAbstractTerrainSettings::type ( ) const
pure virtual

Returns the unique type name for the terrain generator.

Implemented in QgsDemTerrainSettings, QgsFlatTerrainSettings, QgsMeshTerrainSettings, QgsOnlineDemTerrainSettings, and QgsQuantizedMeshTerrainSettings.

◆ verticalScale()

double QgsAbstractTerrainSettings::verticalScale ( ) const
inline

Returns the vertical scale (exaggeration) for terrain.

(1 = true scale, > 1 = hills get more pronounced)

See also
setVerticalScale()

Definition at line 130 of file qgsabstractterrainsettings.h.

◆ writeCommonProperties()

void QgsAbstractTerrainSettings::writeCommonProperties ( QDomElement &  element,
const QgsReadWriteContext context 
) const
protected

Writes common properties from the base class into an XML element.

See also
writeXml()

Definition at line 26 of file qgsabstractterrainsettings.cpp.

◆ writeXml()

virtual void QgsAbstractTerrainSettings::writeXml ( QDomElement &  element,
const QgsReadWriteContext context 
) const
pure virtual

Writes settings to a DOM element.

Subclasses should take care to call writeCommonProperties() to write common properties to the element.

See also
readXml()

Implemented in QgsDemTerrainSettings, QgsFlatTerrainSettings, QgsMeshTerrainSettings, QgsOnlineDemTerrainSettings, and QgsQuantizedMeshTerrainSettings.


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