QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsRasterDemTerrainProvider Class Reference

A terrain provider where the terrain source is a raster DEM layer. More...

#include <qgsterrainprovider.h>

Inheritance diagram for QgsRasterDemTerrainProvider:
Inheritance graph
[legend]

Public Member Functions

 QgsRasterDemTerrainProvider ()=default
 
QgsRasterDemTerrainProviderclone () const override
 Creates a clone of the provider and returns the new object.
 
QgsCoordinateReferenceSystem crs () const override
 Returns the native coordinate reference system of the terrain provider.
 
bool equals (const QgsAbstractTerrainProvider *other) const override
 Returns true if the provider is equal to other.
 
double heightAt (double x, double y) const override
 Returns the height at the point (x,y) in the terrain provider's native crs().
 
QgsRasterLayerlayer () const
 Returns the raster layer with elevation model to be used as the terrain source.
 
const QgsRasterDemTerrainProvideroperator= (const QgsRasterDemTerrainProvider &other)=delete
 
void prepare () override
 Called on the main thread prior to accessing the provider from a background thread.
 
bool readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads the terrain provider state from a DOM element.
 
void resolveReferences (const QgsProject *project) override
 Resolves reference to layers from stored layer ID (if it has not been resolved already)
 
void setLayer (QgsRasterLayer *layer)
 Sets the raster layer with elevation model to be used as the terrain source.
 
QString type () const override
 Returns the unique type ID string for the provider.
 
QDomElement writeXml (QDomDocument &document, const QgsReadWriteContext &context) const override
 Returns a DOM element representing the state of the terrain provider.
 
- Public Member Functions inherited from QgsAbstractTerrainProvider
virtual ~QgsAbstractTerrainProvider ()
 
double offset () const
 Returns the vertical offset value, used for adjusting the heights from the terrain provider.
 
QgsAbstractTerrainProvideroperator= (const QgsAbstractTerrainProvider &other)=delete
 
double scale () const
 Returns the vertical scale factor, which can be used to exaggerate vertical heights.
 
void setOffset (double offset)
 Returns the vertical offset value, used for adjusting the heights from the terrain provider.
 
void setScale (double scale)
 Sets the vertical scale factor, which can be used to exaggerate vertical heights.
 

Additional Inherited Members

- Protected Member Functions inherited from QgsAbstractTerrainProvider
 QgsAbstractTerrainProvider ()=default
 
 QgsAbstractTerrainProvider (const QgsAbstractTerrainProvider &other)
 
void readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context)
 Reads common properties from a DOM element.
 
void writeCommonProperties (QDomElement &element, const QgsReadWriteContext &context) const
 Writes common properties to a DOM element.
 
- Protected Attributes inherited from QgsAbstractTerrainProvider
double mOffset = 0.0
 Offset amount.
 
double mScale = 1.0
 Scale factor.
 

Detailed Description

A terrain provider where the terrain source is a raster DEM layer.

Since
QGIS 3.26

Definition at line 217 of file qgsterrainprovider.h.

Constructor & Destructor Documentation

◆ QgsRasterDemTerrainProvider()

QgsRasterDemTerrainProvider::QgsRasterDemTerrainProvider ( )
default

Member Function Documentation

◆ clone()

QgsRasterDemTerrainProvider * QgsRasterDemTerrainProvider::clone ( ) const
overridevirtual

Creates a clone of the provider and returns the new object.

Ownership is transferred to the caller.

Implements QgsAbstractTerrainProvider.

Definition at line 181 of file qgsterrainprovider.cpp.

◆ crs()

QgsCoordinateReferenceSystem QgsRasterDemTerrainProvider::crs ( ) const
overridevirtual

Returns the native coordinate reference system of the terrain provider.

Implements QgsAbstractTerrainProvider.

Definition at line 154 of file qgsterrainprovider.cpp.

◆ equals()

bool QgsRasterDemTerrainProvider::equals ( const QgsAbstractTerrainProvider other) const
overridevirtual

Returns true if the provider is equal to other.

Implements QgsAbstractTerrainProvider.

Definition at line 186 of file qgsterrainprovider.cpp.

◆ heightAt()

double QgsRasterDemTerrainProvider::heightAt ( double  x,
double  y 
) const
overridevirtual

Returns the height at the point (x,y) in the terrain provider's native crs().

Returns NaN if the height could not be obtained at the specified point.

Implements QgsAbstractTerrainProvider.

Definition at line 160 of file qgsterrainprovider.cpp.

◆ layer()

QgsRasterLayer * QgsRasterDemTerrainProvider::layer ( ) const

Returns the raster layer with elevation model to be used as the terrain source.

See also
layer()

Definition at line 213 of file qgsterrainprovider.cpp.

◆ operator=()

const QgsRasterDemTerrainProvider * QgsRasterDemTerrainProvider::operator= ( const QgsRasterDemTerrainProvider other)
delete

◆ prepare()

void QgsRasterDemTerrainProvider::prepare ( )
overridevirtual

Called on the main thread prior to accessing the provider from a background thread.

Subclasses must implement suitable logic in order to prepare for thread-safe calculation of terrain heights on background threads.

Implements QgsAbstractTerrainProvider.

Definition at line 200 of file qgsterrainprovider.cpp.

◆ readXml()

bool QgsRasterDemTerrainProvider::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
overridevirtual

Reads the terrain provider state from a DOM element.

See also
writeXml()

Implements QgsAbstractTerrainProvider.

Definition at line 123 of file qgsterrainprovider.cpp.

◆ resolveReferences()

void QgsRasterDemTerrainProvider::resolveReferences ( const QgsProject project)
overridevirtual

Resolves reference to layers from stored layer ID (if it has not been resolved already)

Reimplemented from QgsAbstractTerrainProvider.

Definition at line 115 of file qgsterrainprovider.cpp.

◆ setLayer()

void QgsRasterDemTerrainProvider::setLayer ( QgsRasterLayer layer)

Sets the raster layer with elevation model to be used as the terrain source.

See also
layer()

Definition at line 208 of file qgsterrainprovider.cpp.

◆ type()

QString QgsRasterDemTerrainProvider::type ( ) const
overridevirtual

Returns the unique type ID string for the provider.

Implements QgsAbstractTerrainProvider.

Definition at line 110 of file qgsterrainprovider.cpp.

◆ writeXml()

QDomElement QgsRasterDemTerrainProvider::writeXml ( QDomDocument &  document,
const QgsReadWriteContext context 
) const
overridevirtual

Returns a DOM element representing the state of the terrain provider.

See also
readXml()

Implements QgsAbstractTerrainProvider.

Definition at line 139 of file qgsterrainprovider.cpp.


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