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

Abstract base class for terrain providers. More...

#include <qgsterrainprovider.h>

Inheritance diagram for QgsAbstractTerrainProvider:
Inheritance graph
[legend]

Public Member Functions

virtual ~QgsAbstractTerrainProvider ()
 
virtual QgsAbstractTerrainProviderclone () const =0
 Creates a clone of the provider and returns the new object.
 
virtual QgsCoordinateReferenceSystem crs () const =0
 Returns the native coordinate reference system of the terrain provider.
 
virtual bool equals (const QgsAbstractTerrainProvider *other) const =0
 Returns true if the provider is equal to other.
 
virtual double heightAt (double x, double y) const =0
 Returns the height at the point (x,y) in the terrain provider's native crs().
 
double offset () const
 Returns the vertical offset value, used for adjusting the heights from the terrain provider.
 
QgsAbstractTerrainProvideroperator= (const QgsAbstractTerrainProvider &other)=delete
 
virtual void prepare ()=0
 Called on the main thread prior to accessing the provider from a background thread.
 
virtual bool readXml (const QDomElement &element, const QgsReadWriteContext &context)=0
 Reads the terrain provider state from a DOM element.
 
virtual void resolveReferences (const QgsProject *project)
 Resolves reference to layers from stored layer ID (if it has not been resolved already)
 
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.
 
virtual QString type () const =0
 Returns the unique type ID string for the provider.
 
virtual QDomElement writeXml (QDomDocument &document, const QgsReadWriteContext &context) const =0
 Returns a DOM element representing the state of the terrain provider.
 

Protected Member Functions

 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

double mOffset = 0.0
 Offset amount.
 
double mScale = 1.0
 Scale factor.
 

Detailed Description

Abstract base class for terrain providers.

Since
QGIS 3.26

Definition at line 40 of file qgsterrainprovider.h.

Constructor & Destructor Documentation

◆ ~QgsAbstractTerrainProvider()

QgsAbstractTerrainProvider::~QgsAbstractTerrainProvider ( )
virtualdefault

◆ QgsAbstractTerrainProvider() [1/2]

QgsAbstractTerrainProvider::QgsAbstractTerrainProvider ( )
protecteddefault

◆ QgsAbstractTerrainProvider() [2/2]

QgsAbstractTerrainProvider::QgsAbstractTerrainProvider ( const QgsAbstractTerrainProvider other)
protected

Definition at line 29 of file qgsterrainprovider.cpp.

Member Function Documentation

◆ clone()

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

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

Ownership is transferred to the caller.

Implemented in QgsFlatTerrainProvider, QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

◆ crs()

virtual QgsCoordinateReferenceSystem QgsAbstractTerrainProvider::crs ( ) const
pure virtual

Returns the native coordinate reference system of the terrain provider.

Implemented in QgsFlatTerrainProvider, QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

◆ equals()

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

Returns true if the provider is equal to other.

Implemented in QgsFlatTerrainProvider, QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

◆ heightAt()

virtual double QgsAbstractTerrainProvider::heightAt ( double  x,
double  y 
) const
pure virtual

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.

Implemented in QgsFlatTerrainProvider, QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

◆ offset()

double QgsAbstractTerrainProvider::offset ( ) const
inline

Returns the vertical offset value, used for adjusting the heights from the terrain provider.

See also
setOffset()
scale()

Definition at line 146 of file qgsterrainprovider.h.

◆ operator=()

QgsAbstractTerrainProvider & QgsAbstractTerrainProvider::operator= ( const QgsAbstractTerrainProvider other)
delete

◆ prepare()

virtual void QgsAbstractTerrainProvider::prepare ( )
pure virtual

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.

Implemented in QgsFlatTerrainProvider, QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

◆ readCommonProperties()

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

Reads common properties from a DOM element.

Definition at line 42 of file qgsterrainprovider.cpp.

◆ readXml()

virtual bool QgsAbstractTerrainProvider::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
pure virtual

Reads the terrain provider state from a DOM element.

See also
writeXml()

Implemented in QgsFlatTerrainProvider, QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

◆ resolveReferences()

void QgsAbstractTerrainProvider::resolveReferences ( const QgsProject project)
virtual

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

Reimplemented in QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

Definition at line 24 of file qgsterrainprovider.cpp.

◆ scale()

double QgsAbstractTerrainProvider::scale ( ) const
inline

Returns the vertical scale factor, which can be used to exaggerate vertical heights.

See also
setScale()
offset()

Definition at line 130 of file qgsterrainprovider.h.

◆ setOffset()

void QgsAbstractTerrainProvider::setOffset ( double  offset)
inline

Returns the vertical offset value, used for adjusting the heights from the terrain provider.

See also
offset()
setScale()

Definition at line 154 of file qgsterrainprovider.h.

◆ setScale()

void QgsAbstractTerrainProvider::setScale ( double  scale)
inline

Sets the vertical scale factor, which can be used to exaggerate vertical heights.

See also
scale()
setOffset()

Definition at line 138 of file qgsterrainprovider.h.

◆ type()

virtual QString QgsAbstractTerrainProvider::type ( ) const
pure virtual

Returns the unique type ID string for the provider.

Implemented in QgsFlatTerrainProvider, QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

◆ writeCommonProperties()

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

Writes common properties to a DOM element.

Definition at line 36 of file qgsterrainprovider.cpp.

◆ writeXml()

virtual QDomElement QgsAbstractTerrainProvider::writeXml ( QDomDocument &  document,
const QgsReadWriteContext context 
) const
pure virtual

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

See also
readXml()

Implemented in QgsFlatTerrainProvider, QgsRasterDemTerrainProvider, and QgsMeshTerrainProvider.

Member Data Documentation

◆ mOffset

double QgsAbstractTerrainProvider::mOffset = 0.0
protected

Offset amount.

Definition at line 178 of file qgsterrainprovider.h.

◆ mScale

double QgsAbstractTerrainProvider::mScale = 1.0
protected

Scale factor.

Definition at line 175 of file qgsterrainprovider.h.


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