QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsMeshTerrainProvider Class Reference

A terrain provider that uses the Z values of a mesh layer to build a terrain surface. More...

#include <qgsterrainprovider.h>

Inheritance diagram for QgsMeshTerrainProvider:
Inheritance graph
[legend]

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

A terrain provider that uses the Z values of a mesh layer to build a terrain surface.

Since
QGIS 3.26

Definition at line 284 of file qgsterrainprovider.h.

Constructor & Destructor Documentation

◆ QgsMeshTerrainProvider()

QgsMeshTerrainProvider::QgsMeshTerrainProvider ( )
default

Constructor for QgsMeshTerrainProvider.

Member Function Documentation

◆ clone()

QgsMeshTerrainProvider * QgsMeshTerrainProvider::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 287 of file qgsterrainprovider.cpp.

◆ crs()

QgsCoordinateReferenceSystem QgsMeshTerrainProvider::crs ( ) const
overridevirtual

Returns the native coordinate reference system of the terrain provider.

Implements QgsAbstractTerrainProvider.

Definition at line 274 of file qgsterrainprovider.cpp.

◆ equals()

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

Returns true if the provider is equal to other.

Implements QgsAbstractTerrainProvider.

Definition at line 292 of file qgsterrainprovider.cpp.

◆ heightAt()

double QgsMeshTerrainProvider::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 279 of file qgsterrainprovider.cpp.

◆ layer()

QgsMeshLayer * QgsMeshTerrainProvider::layer ( ) const

Returns the mesh layer to be used as the terrain source.

See also
layer()

Definition at line 321 of file qgsterrainprovider.cpp.

◆ operator=()

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

QgsMeshTerrainProvider cannot be assigned.

◆ prepare()

void QgsMeshTerrainProvider::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 306 of file qgsterrainprovider.cpp.

◆ readXml()

bool QgsMeshTerrainProvider::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 243 of file qgsterrainprovider.cpp.

◆ resolveReferences()

void QgsMeshTerrainProvider::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 235 of file qgsterrainprovider.cpp.

◆ setLayer()

void QgsMeshTerrainProvider::setLayer ( QgsMeshLayer layer)

Sets the mesh layer to be used as the terrain source.

See also
layer()

Definition at line 316 of file qgsterrainprovider.cpp.

◆ type()

QString QgsMeshTerrainProvider::type ( ) const
overridevirtual

Returns the unique type ID string for the provider.

Implements QgsAbstractTerrainProvider.

Definition at line 230 of file qgsterrainprovider.cpp.

◆ writeXml()

QDomElement QgsMeshTerrainProvider::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 259 of file qgsterrainprovider.cpp.


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