QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
17 #ifndef QGSTERRAINPROVIDER_H
18 #define QGSTERRAINPROVIDER_H
20 #include "qgis_core.h"
45 if ( sipCpp->type().compare( QLatin1String(
"flat" ) ) == 0 )
47 sipType = sipType_QgsFlatTerrainProvider;
49 else if ( sipCpp->type().compare( QLatin1String(
"raster" ) ) == 0 )
51 sipType = sipType_QgsRasterDemTerrainProvider;
53 else if ( sipCpp->type().compare( QLatin1String(
"mesh" ) ) == 0 )
55 sipType = sipType_QgsMeshTerrainProvider;
81 virtual void resolveReferences(
const QgsProject *project );
93 virtual QDomElement writeXml( QDomDocument &document,
const QgsReadWriteContext &context )
const = 0;
98 virtual QString type()
const = 0;
125 virtual double heightAt(
double x,
double y )
const = 0;
133 double scale()
const {
return mScale; }
149 double offset()
const {
return mOffset; }
177 void writeCommonProperties( QDomElement &element,
const QgsReadWriteContext &context )
const;
182 void readCommonProperties(
const QDomElement &element,
const QgsReadWriteContext &context );
188 double mOffset = 0.0;
214 QString
type()
const override;
218 double heightAt(
double x,
double y )
const override;
244 QString
type()
const override;
249 double heightAt(
double x,
double y )
const override;
273 std::unique_ptr< QgsRasterDataProvider > mRasterProvider;
298 QString
type()
const override;
303 double heightAt(
double x,
double y )
const override;
329 #endif // QGSTERRAINPROVIDER_H
void setScale(double scale)
Sets the vertical scale factor, which can be used to exaggerate vertical heights.
The class is used as a container of context for various read/write operations on other objects.
virtual QgsAbstractTerrainProvider * clone() const =0
Creates a clone of the provider and returns the new object.
const QgsCoordinateReferenceSystem & crs
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads the terrain provider state from a DOM element.
A terrain provider that uses the Z values of a mesh layer to build a terrain surface.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
virtual QString type() const =0
Returns the unique type ID string for the provider.
virtual void prepare()=0
Called on the main thread prior to accessing the provider from a background thread.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
QgsAbstractTerrainProvider & operator=(const QgsAbstractTerrainProvider &other)=delete
QgsAbstractTerrainProvider cannot be assigned.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the native coordinate reference system of the terrain provider.
Represents a raster layer.
This class represents a coordinate reference system (CRS).
void setOffset(double offset)
Returns the vertical offset value, used for adjusting the heights from the terrain provider.
virtual double heightAt(double x, double y) const =0
Returns the height at the point (x,y) in the terrain provider's native crs().
A terrain provider where the terrain source is a raster DEM layer.
virtual QDomElement writeXml(QDomDocument &document, const QgsReadWriteContext &context) const =0
Returns a DOM element representing the state of the terrain provider.
Triangular/Derived Mesh is mesh with vertices in map coordinates.
Abstract base class for terrain providers.
virtual void resolveReferences(const QgsProject *project)
Resolves reference to layers from stored layer ID (if it has not been resolved already)
virtual bool equals(const QgsAbstractTerrainProvider *other) const =0
Returns true if the provider is equal to other.
double scale() const
Returns the vertical scale factor, which can be used to exaggerate vertical heights.
double offset() const
Returns the vertical offset value, used for adjusting the heights from the terrain provider.
A terrain provider where the terrain is a simple flat surface.