QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
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...
 
enum  Property { ZOffset , ExtrusionHeight }
 Data definable properties. More...
 

Signals

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

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

static QgsPropertiesDefinition sPropertyDefinitions
 Property definitions. More...
 

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 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 95 of file qgsmaplayerelevationproperties.h.

◆ Property

Data definable properties.

Since
QGIS 3.26
Enumerator
ZOffset 
ExtrusionHeight 

Z offset.

Extrusion height

Definition at line 86 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, 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 226 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 235 of file qgsmaplayerelevationproperties.h.

◆ flags()

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

Returns flags associated to the elevation properties.

Definition at line 154 of file qgsmaplayerelevationproperties.h.

◆ hasElevation()

bool QgsMapLayerElevationProperties::hasElevation ( ) const
virtual

Returns true if the layer has an elevation or z component.

Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, and QgsVectorLayerElevationProperties.

Definition at line 29 of file qgsmaplayerelevationproperties.cpp.

◆ htmlSummary()

QString QgsMapLayerElevationProperties::htmlSummary ( ) const
virtual

Returns a HTML formatted summary of the properties.

Since
QGIS 3.26

Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, and QgsVectorLayerElevationProperties.

Definition at line 39 of file qgsmaplayerelevationproperties.cpp.

◆ isVisibleInZRange()

bool QgsMapLayerElevationProperties::isVisibleInZRange ( const QgsDoubleRange range) const
virtual

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

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 118 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

Reads the elevation properties from a DOM element previously written by writeXml().

See also
writeXml()

Implemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, and QgsVectorLayerElevationProperties.

◆ 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 108 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 86 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 97 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 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 183 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 206 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 305 of file qgsmaplayerelevationproperties.h.

◆ mZOffset

double QgsMapLayerElevationProperties::mZOffset = 0.0
protected

Z offset.

Definition at line 302 of file qgsmaplayerelevationproperties.h.

◆ mZScale

double QgsMapLayerElevationProperties::mZScale = 1.0
protected

Z scale.

Definition at line 300 of file qgsmaplayerelevationproperties.h.

◆ sPropertyDefinitions

QgsPropertiesDefinition QgsMapLayerElevationProperties::sPropertyDefinitions
staticprotected

Property definitions.

Definition at line 308 of file qgsmaplayerelevationproperties.h.


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