QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
QgsMapLayerElevationProperties Class Referenceabstract

Base class for storage of map layer elevation properties. More...

#include <qgsmaplayerelevationproperties.h>

Inheritance diagram for QgsMapLayerElevationProperties:
Inheritance graph
[legend]

Public Types

enum  Flag { FlagDontInvalidateCachedRendersWhenRangeChanges = 1 }
 Flags attached to the elevation property. More...
 
typedef QFlags< FlagFlags
 
enum class  Property : int { ZOffset , ExtrusionHeight , RasterPerBandLowerElevation , RasterPerBandUpperElevation }
 Data definable properties. More...
 

Signals

void changed ()
 Emitted when any of the elevation properties have changed.
 
void profileGenerationPropertyChanged ()
 Emitted when any of the elevation properties which relate solely to generation of elevation profiles have changed.
 
void profileRenderingPropertyChanged ()
 Emitted when any of the elevation properties which relate solely to presentation of elevation results have changed.
 
void zOffsetChanged ()
 Emitted when the z offset changes.
 
void zScaleChanged ()
 Emitted when the z scale changes.
 

Public Member Functions

 QgsMapLayerElevationProperties (QObject *parent)
 Constructor for QgsMapLayerElevationProperties, with the specified parent object.
 
virtual QgsDoubleRange calculateZRange (QgsMapLayer *layer) const
 Attempts to calculate the overall elevation or z range for the specified layer, using the settings defined by this elevation properties object.
 
virtual QgsMapLayerElevationPropertiesclone () const =0
 Creates a clone of the properties.
 
QgsPropertyCollectiondataDefinedProperties ()
 Returns a reference to the object's property collection, used for data defined overrides.
 
const QgsPropertyCollectiondataDefinedProperties () const
 Returns a reference to the object's property collection, used for data defined overrides.
 
virtual QgsMapLayerElevationProperties::Flags flags () const
 Returns flags associated to the elevation properties.
 
virtual bool hasElevation () const
 Returns true if the layer has an elevation or z component.
 
virtual QString htmlSummary () const
 Returns a HTML formatted summary of the properties.
 
virtual bool isVisibleInZRange (const QgsDoubleRange &range, QgsMapLayer *layer=nullptr) const
 Returns true if the layer should be visible and rendered for the specified z range.
 
virtual bool readXml (const QDomElement &element, const QgsReadWriteContext &context)=0
 Reads the elevation properties from a DOM element previously written by writeXml().
 
void setDataDefinedProperties (const QgsPropertyCollection &collection)
 Sets the object's property collection, used for data defined overrides.
 
virtual void setDefaultsFromLayer (QgsMapLayer *layer)
 Sets default properties based on sensible choices for the given map layer.
 
void setZOffset (double offset)
 Sets the z offset, which is a fixed offset amount which will be added to z values from the layer.
 
void setZScale (double scale)
 Sets the z scale, which is a scaling factor which will be applied to z values from the layer.
 
virtual bool showByDefaultInElevationProfilePlots () const
 Returns true if the layer should be visible by default in newly created elevation profile plots.
 
virtual QList< double > significantZValues (QgsMapLayer *layer) const
 Returns a list of significant elevation/z-values for the specified layer, using the settings defined by this elevation properties object.
 
virtual QDomElement writeXml (QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
 Writes the properties to a DOM element, to be used later with readXml().
 
double zOffset () const
 Returns the z offset, which is a fixed offset amount which should be added to z values from the layer.
 
double zScale () const
 Returns the z scale, which is a scaling factor which should be applied to z values from the layer.
 

Static Public Member Functions

static QgsPropertiesDefinition propertyDefinitions ()
 Returns the definitions for data defined properties available for use in elevation properties.
 

Protected Member Functions

void copyCommonProperties (const QgsMapLayerElevationProperties *other)
 Copies common properties from another object.
 
void readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context)
 Reads common class properties from a DOM element previously written by writeXml().
 
void writeCommonProperties (QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)
 Writes common class properties to a DOM element, to be used later with readXml().
 

Protected Attributes

QgsPropertyCollection mDataDefinedProperties
 Property collection for data defined elevation settings.
 
double mZOffset = 0.0
 Z offset.
 
double mZScale = 1.0
 Z scale.
 

Static Protected Attributes

static QgsPropertiesDefinition sPropertyDefinitions
 Property definitions.
 

Detailed Description

Base class for storage of map layer elevation properties.

QgsMapLayerElevationProperties exposes user-configurable settings for controlling how an individual QgsMapLayer behaves with relation to z values or elevations.

Since
QGIS 3.18

Definition at line 44 of file qgsmaplayerelevationproperties.h.

Member Typedef Documentation

◆ Flags

Definition at line 109 of file qgsmaplayerelevationproperties.h.

Member Enumeration Documentation

◆ Flag

Flags attached to the elevation property.

Enumerator
FlagDontInvalidateCachedRendersWhenRangeChanges 

Any cached rendering will not be invalidated when z range context is modified.

Definition at line 105 of file qgsmaplayerelevationproperties.h.

◆ Property

Data definable properties.

Since
QGIS 3.26
Enumerator
ZOffset 

Z offset.

ExtrusionHeight 

Extrusion height.

RasterPerBandLowerElevation 

Lower elevation for each raster band.

Since
QGIS 3.38
RasterPerBandUpperElevation 

Upper elevation for each raster band.

Since
QGIS 3.38

Definition at line 93 of file qgsmaplayerelevationproperties.h.

Constructor & Destructor Documentation

◆ QgsMapLayerElevationProperties()

QgsMapLayerElevationProperties::QgsMapLayerElevationProperties ( QObject *  parent)

Constructor for QgsMapLayerElevationProperties, with the specified parent object.

Definition at line 24 of file qgsmaplayerelevationproperties.cpp.

Member Function Documentation

◆ calculateZRange()

QgsDoubleRange QgsMapLayerElevationProperties::calculateZRange ( QgsMapLayer layer) const
virtual

Attempts to calculate the overall elevation or z range for the specified layer, using the settings defined by this elevation properties object.

May return an infinite range if the extent could not be calculated.

Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, QgsTiledSceneLayerElevationProperties, and QgsVectorLayerElevationProperties.

Definition at line 76 of file qgsmaplayerelevationproperties.cpp.

◆ changed

void QgsMapLayerElevationProperties::changed ( )
signal

Emitted when any of the elevation properties have changed.

See renderingPropertyChanged() and profileGenerationPropertyChanged() for more fine-grained signals.

◆ clone()

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

◆ copyCommonProperties()

void QgsMapLayerElevationProperties::copyCommonProperties ( const QgsMapLayerElevationProperties other)
protected

Copies common properties from another object.

Since
QGIS 3.26

Definition at line 64 of file qgsmaplayerelevationproperties.cpp.

◆ dataDefinedProperties() [1/2]

QgsPropertyCollection & QgsMapLayerElevationProperties::dataDefinedProperties ( )
inline

Returns a reference to the object's property collection, used for data defined overrides.

See also
setDataDefinedProperties()
Since
QGIS 3.26

Definition at line 248 of file qgsmaplayerelevationproperties.h.

◆ dataDefinedProperties() [2/2]

const QgsPropertyCollection & QgsMapLayerElevationProperties::dataDefinedProperties ( ) const
inline

Returns a reference to the object's property collection, used for data defined overrides.

See also
setDataDefinedProperties()
Property
Note
not available in Python bindings
Since
QGIS 3.26

Definition at line 257 of file qgsmaplayerelevationproperties.h.

◆ flags()

virtual QgsMapLayerElevationProperties::Flags QgsMapLayerElevationProperties::flags ( ) const
inlinevirtual

Returns flags associated to the elevation properties.

Reimplemented in QgsMeshLayerElevationProperties, and QgsRasterLayerElevationProperties.

Definition at line 166 of file qgsmaplayerelevationproperties.h.

◆ hasElevation()

bool QgsMapLayerElevationProperties::hasElevation ( ) const
virtual

◆ htmlSummary()

QString QgsMapLayerElevationProperties::htmlSummary ( ) const
virtual

◆ isVisibleInZRange()

bool QgsMapLayerElevationProperties::isVisibleInZRange ( const QgsDoubleRange range,
QgsMapLayer layer = nullptr 
) const
virtual

Returns true if the layer should be visible and rendered for the specified z range.

Since QGIS 3.38 the layer argument can be used to specify the target layer.

Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, and QgsVectorLayerElevationProperties.

Definition at line 71 of file qgsmaplayerelevationproperties.cpp.

◆ profileGenerationPropertyChanged

void QgsMapLayerElevationProperties::profileGenerationPropertyChanged ( )
signal

Emitted when any of the elevation properties which relate solely to generation of elevation profiles have changed.

See also
changed()
profileRenderingPropertyChanged()
Since
QGIS 3.26

◆ profileRenderingPropertyChanged

void QgsMapLayerElevationProperties::profileRenderingPropertyChanged ( )
signal

Emitted when any of the elevation properties which relate solely to presentation of elevation results have changed.

See also
changed()
profileGenerationPropertyChanged()
Since
QGIS 3.26

◆ propertyDefinitions()

QgsPropertiesDefinition QgsMapLayerElevationProperties::propertyDefinitions ( )
static

Returns the definitions for data defined properties available for use in elevation properties.

Since
QGIS 3.26

Definition at line 123 of file qgsmaplayerelevationproperties.cpp.

◆ readCommonProperties()

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

Reads common class properties from a DOM element previously written by writeXml().

See also
writeCommonProperties()
Since
QGIS 3.26

Definition at line 54 of file qgsmaplayerelevationproperties.cpp.

◆ readXml()

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

◆ setDataDefinedProperties()

void QgsMapLayerElevationProperties::setDataDefinedProperties ( const QgsPropertyCollection collection)

Sets the object's property collection, used for data defined overrides.

Any existing properties will be discarded.

See also
dataDefinedProperties()
Property
Since
QGIS 3.26

Definition at line 113 of file qgsmaplayerelevationproperties.cpp.

◆ setDefaultsFromLayer()

void QgsMapLayerElevationProperties::setDefaultsFromLayer ( QgsMapLayer layer)
virtual

Sets default properties based on sensible choices for the given map layer.

Since
QGIS 3.26

Reimplemented in QgsVectorLayerElevationProperties.

Definition at line 34 of file qgsmaplayerelevationproperties.cpp.

◆ setZOffset()

void QgsMapLayerElevationProperties::setZOffset ( double  offset)

Sets the z offset, which is a fixed offset amount which will be added to z values from the layer.

Note
Any scaling specified via zScale() is applied before any offset value specified via zOffset()
See also
zOffset()

Definition at line 91 of file qgsmaplayerelevationproperties.cpp.

◆ setZScale()

void QgsMapLayerElevationProperties::setZScale ( double  scale)

Sets the z scale, which is a scaling factor which will be applied to z values from the layer.

This can be used to correct or manually adjust for incorrect elevation values in a layer, such as conversion of elevation values in feet to meters.

Note
Any scaling specified via zScale() is applied before any offset value specified via zOffset()
See also
zScale()

Definition at line 102 of file qgsmaplayerelevationproperties.cpp.

◆ showByDefaultInElevationProfilePlots()

bool QgsMapLayerElevationProperties::showByDefaultInElevationProfilePlots ( ) const
virtual

Returns true if the layer should be visible by default in newly created elevation profile plots.

Subclasses should override this with logic which determines whether the layer is likely desirable to be initially checked in these plots.

Since
QGIS 3.26

Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, and QgsVectorLayerElevationProperties.

Definition at line 86 of file qgsmaplayerelevationproperties.cpp.

◆ significantZValues()

QList< double > QgsMapLayerElevationProperties::significantZValues ( QgsMapLayer layer) const
virtual

Returns a list of significant elevation/z-values for the specified layer, using the settings defined by this elevation properties object.

These values will be highlighted in elevation related widgets for the layer.

Since
QGIS 3.38

Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, and QgsTiledSceneLayerElevationProperties.

Definition at line 81 of file qgsmaplayerelevationproperties.cpp.

◆ writeCommonProperties()

void QgsMapLayerElevationProperties::writeCommonProperties ( QDomElement &  element,
QDomDocument &  doc,
const QgsReadWriteContext context 
)
protected

Writes common class properties to a DOM element, to be used later with readXml().

See also
readCommonProperties()
Since
QGIS 3.26

Definition at line 44 of file qgsmaplayerelevationproperties.cpp.

◆ writeXml()

virtual QDomElement QgsMapLayerElevationProperties::writeXml ( QDomElement &  element,
QDomDocument &  doc,
const QgsReadWriteContext context 
)
pure virtual

◆ zOffset()

double QgsMapLayerElevationProperties::zOffset ( ) const
inline

Returns the z offset, which is a fixed offset amount which should be added to z values from the layer.

Note
Any scaling specified via zScale() is applied before any offset value specified via zOffset()
See also
setZOffset()

Definition at line 205 of file qgsmaplayerelevationproperties.h.

◆ zOffsetChanged

void QgsMapLayerElevationProperties::zOffsetChanged ( )
signal

Emitted when the z offset changes.

Since
QGIS 3.26

◆ zScale()

double QgsMapLayerElevationProperties::zScale ( ) const
inline

Returns the z scale, which is a scaling factor which should be applied to z values from the layer.

This can be used to correct or manually adjust for incorrect elevation values in a layer, such as conversion of elevation values in feet to meters.

Note
Any scaling specified via zScale() is applied before any offset value specified via zOffset()
See also
setZScale()

Definition at line 228 of file qgsmaplayerelevationproperties.h.

◆ zScaleChanged

void QgsMapLayerElevationProperties::zScaleChanged ( )
signal

Emitted when the z scale changes.

Since
QGIS 3.26

Member Data Documentation

◆ mDataDefinedProperties

QgsPropertyCollection QgsMapLayerElevationProperties::mDataDefinedProperties
protected

Property collection for data defined elevation settings.

Definition at line 327 of file qgsmaplayerelevationproperties.h.

◆ mZOffset

double QgsMapLayerElevationProperties::mZOffset = 0.0
protected

Z offset.

Definition at line 324 of file qgsmaplayerelevationproperties.h.

◆ mZScale

double QgsMapLayerElevationProperties::mZScale = 1.0
protected

Z scale.

Definition at line 322 of file qgsmaplayerelevationproperties.h.

◆ sPropertyDefinitions

QgsPropertiesDefinition QgsMapLayerElevationProperties::sPropertyDefinitions
staticprotected

Property definitions.

Definition at line 330 of file qgsmaplayerelevationproperties.h.


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