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

Vector layer specific subclass of QgsMapLayerElevationProperties. More...

#include <qgsvectorlayerelevationproperties.h>

Inheritance diagram for QgsVectorLayerElevationProperties:
Inheritance graph
[legend]

Public Member Functions

 QgsVectorLayerElevationProperties (QObject *parent)
 Constructor for QgsVectorLayerElevationProperties, with the specified parent object.
 
 ~QgsVectorLayerElevationProperties () override
 
Qgis::AltitudeBinding binding () const
 Returns the altitude binding method, which determines how altitude is bound to individual vertices in features.
 
QgsDoubleRange calculateZRange (QgsMapLayer *layer) const override
 Attempts to calculate the overall elevation or z range for the specified layer, using the settings defined by this elevation properties object.
 
Qgis::AltitudeClamping clamping () const
 Returns the altitude clamping method, which dictates how feature heights are interpreted with respect to terrain heights.
 
QgsVectorLayerElevationPropertiesclone () const override
 Creates a clone of the properties.
 
double elevationLimit () const
 Returns the elevation limit, which is used when profileSymbology() is Qgis::ProfileSurfaceSymbology::FillBelow or Qgis::ProfileSurfaceSymbology::FillAbove to limit the fill to a specific elevation range.
 
bool extrusionEnabled () const
 Returns true if extrusion is enabled.
 
double extrusionHeight () const
 Returns the feature extrusion height.
 
bool hasElevation () const override
 Returns true if the layer has an elevation or z component.
 
QString htmlSummary () const override
 Returns a HTML formatted summary of the properties.
 
bool isVisibleInZRange (const QgsDoubleRange &range, QgsMapLayer *layer=nullptr) const override
 Returns true if the layer should be visible and rendered for the specified z range.
 
QgsFillSymbolprofileFillSymbol () const
 Returns the symbol used to render polygons for the layer in elevation profile plots.
 
QgsLineSymbolprofileLineSymbol () const
 Returns the symbol used to render lines for the layer in elevation profile plots.
 
QgsMarkerSymbolprofileMarkerSymbol () const
 Returns the symbol used to render points for the layer in elevation profile plots.
 
Qgis::ProfileSurfaceSymbology profileSymbology () const
 Returns the symbology option used to render the vector profile in elevation profile plots.
 
bool readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads the elevation properties from a DOM element previously written by writeXml().
 
bool respectLayerSymbology () const
 Returns true if layer symbology should be respected when rendering elevation profile plots.
 
void setBinding (Qgis::AltitudeBinding binding)
 Sets the altitude binding method, which determines how altitude is bound to individual vertices in features.
 
void setClamping (Qgis::AltitudeClamping clamping)
 Sets the altitude clamping method, which dictates how feature heights are interpreted with respect to terrain heights.
 
void setDefaultsFromLayer (QgsMapLayer *layer) override
 Sets default properties based on sensible choices for the given map layer.
 
void setElevationLimit (double limit)
 Sets the elevation limit, which is used when profileSymbology() is Qgis::ProfileSurfaceSymbology::FillBelow or Qgis::ProfileSurfaceSymbology::FillAbove to limit the fill to a specific elevation range.
 
void setExtrusionEnabled (bool enabled)
 Sets whether extrusion is enabled.
 
void setExtrusionHeight (double height)
 Sets the feature extrusion height.
 
void setProfileFillSymbol (QgsFillSymbol *symbol)
 Sets the fill symbol used to render polygons for the layer in elevation profile plots.
 
void setProfileLineSymbol (QgsLineSymbol *symbol)
 Sets the line symbol used to render lines for the layer in elevation profile plots.
 
void setProfileMarkerSymbol (QgsMarkerSymbol *symbol)
 Sets the marker symbol used to render points for the layer in elevation profile plots.
 
void setProfileSymbology (Qgis::ProfileSurfaceSymbology symbology)
 Sets the symbology option used to render the vector profile in elevation profile plots.
 
void setRespectLayerSymbology (bool enabled)
 Sets whether layer symbology should be respected when rendering elevation profile plots.
 
void setShowMarkerSymbolInSurfacePlots (bool show)
 Sets whether the marker symbol should also be shown in continuous surface plots.
 
void setType (Qgis::VectorProfileType type)
 Sets the type of profile the layer represents.
 
bool showByDefaultInElevationProfilePlots () const override
 Returns true if the layer should be visible by default in newly created elevation profile plots.
 
bool showMarkerSymbolInSurfacePlots () const
 Returns true if the marker symbol should also be shown in continuous surface plots.
 
Qgis::VectorProfileType type () const
 Returns the type of profile the layer represents.
 
QDomElement writeXml (QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) override
 Writes the properties to a DOM element, to be used later with readXml().
 
- Public Member Functions inherited from QgsMapLayerElevationProperties
 QgsMapLayerElevationProperties (QObject *parent)
 Constructor for QgsMapLayerElevationProperties, with the specified parent object.
 
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.
 
void setDataDefinedProperties (const QgsPropertyCollection &collection)
 Sets the object's property collection, used for data defined overrides.
 
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 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.
 
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.
 

Additional Inherited Members

- Public Types inherited from QgsMapLayerElevationProperties
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 inherited from QgsMapLayerElevationProperties
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.
 
- Static Public Member Functions inherited from QgsMapLayerElevationProperties
static QgsPropertiesDefinition propertyDefinitions ()
 Returns the definitions for data defined properties available for use in elevation properties.
 
- Protected Member Functions inherited from QgsMapLayerElevationProperties
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 inherited from QgsMapLayerElevationProperties
QgsPropertyCollection mDataDefinedProperties
 Property collection for data defined elevation settings.
 
double mZOffset = 0.0
 Z offset.
 
double mZScale = 1.0
 Z scale.
 
- Static Protected Attributes inherited from QgsMapLayerElevationProperties
static QgsPropertiesDefinition sPropertyDefinitions
 Property definitions.
 

Detailed Description

Vector layer specific subclass of QgsMapLayerElevationProperties.

Since
QGIS 3.26

Definition at line 38 of file qgsvectorlayerelevationproperties.h.

Constructor & Destructor Documentation

◆ QgsVectorLayerElevationProperties()

QgsVectorLayerElevationProperties::QgsVectorLayerElevationProperties ( QObject *  parent)

Constructor for QgsVectorLayerElevationProperties, with the specified parent object.

Definition at line 31 of file qgsvectorlayerelevationproperties.cpp.

◆ ~QgsVectorLayerElevationProperties()

QgsVectorLayerElevationProperties::~QgsVectorLayerElevationProperties ( )
overridedefault

Member Function Documentation

◆ binding()

Qgis::AltitudeBinding QgsVectorLayerElevationProperties::binding ( ) const
inline

Returns the altitude binding method, which determines how altitude is bound to individual vertices in features.

Note
Binding only relevant for line or polygon feature types – it is not applicable for point layers.
See also
setBinding()

Definition at line 84 of file qgsvectorlayerelevationproperties.h.

◆ calculateZRange()

QgsDoubleRange QgsVectorLayerElevationProperties::calculateZRange ( QgsMapLayer layer) const
overridevirtual

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 from QgsMapLayerElevationProperties.

Definition at line 242 of file qgsvectorlayerelevationproperties.cpp.

◆ clamping()

Qgis::AltitudeClamping QgsVectorLayerElevationProperties::clamping ( ) const
inline

Returns the altitude clamping method, which dictates how feature heights are interpreted with respect to terrain heights.

See also
setClamping()

Definition at line 67 of file qgsvectorlayerelevationproperties.h.

◆ clone()

QgsVectorLayerElevationProperties * QgsVectorLayerElevationProperties::clone ( ) const
overridevirtual

Creates a clone of the properties.

Since
QGIS 3.26

Implements QgsMapLayerElevationProperties.

Definition at line 152 of file qgsvectorlayerelevationproperties.cpp.

◆ elevationLimit()

double QgsVectorLayerElevationProperties::elevationLimit ( ) const

Returns the elevation limit, which is used when profileSymbology() is Qgis::ProfileSurfaceSymbology::FillBelow or Qgis::ProfileSurfaceSymbology::FillAbove to limit the fill to a specific elevation range.

By default this is NaN, which indicates that there is no elevation limit.

See also
setElevationLimit()
Since
QGIS 3.32

Definition at line 364 of file qgsvectorlayerelevationproperties.cpp.

◆ extrusionEnabled()

bool QgsVectorLayerElevationProperties::extrusionEnabled ( ) const
inline

Returns true if extrusion is enabled.

See also
setExtrusionEnabled()
extrusionHeight()

Definition at line 115 of file qgsvectorlayerelevationproperties.h.

◆ extrusionHeight()

double QgsVectorLayerElevationProperties::extrusionHeight ( ) const
inline

Returns the feature extrusion height.

Warning
extrusion is only applied if extrusionEnabled() is true.
Note
the zScale() factor is NOT applied to extrusion heights.
See also
setExtrusionHeight()

Definition at line 133 of file qgsvectorlayerelevationproperties.h.

◆ hasElevation()

bool QgsVectorLayerElevationProperties::hasElevation ( ) const
overridevirtual

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

Reimplemented from QgsMapLayerElevationProperties.

Definition at line 42 of file qgsvectorlayerelevationproperties.cpp.

◆ htmlSummary()

QString QgsVectorLayerElevationProperties::htmlSummary ( ) const
overridevirtual

Returns a HTML formatted summary of the properties.

Since
QGIS 3.26

Reimplemented from QgsMapLayerElevationProperties.

Definition at line 171 of file qgsvectorlayerelevationproperties.cpp.

◆ isVisibleInZRange()

bool QgsVectorLayerElevationProperties::isVisibleInZRange ( const QgsDoubleRange range,
QgsMapLayer layer = nullptr 
) const
overridevirtual

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 from QgsMapLayerElevationProperties.

Definition at line 236 of file qgsvectorlayerelevationproperties.cpp.

◆ profileFillSymbol()

QgsFillSymbol * QgsVectorLayerElevationProperties::profileFillSymbol ( ) const

Returns the symbol used to render polygons for the layer in elevation profile plots.

The symbol will be used in the following circumstances:

See also
setProfileFillSymbol()

Definition at line 330 of file qgsvectorlayerelevationproperties.cpp.

◆ profileLineSymbol()

QgsLineSymbol * QgsVectorLayerElevationProperties::profileLineSymbol ( ) const

Returns the symbol used to render lines for the layer in elevation profile plots.

The symbol will be used in the following circumstances:

See also
setProfileLineSymbol()

Definition at line 318 of file qgsvectorlayerelevationproperties.cpp.

◆ profileMarkerSymbol()

QgsMarkerSymbol * QgsVectorLayerElevationProperties::profileMarkerSymbol ( ) const

Returns the symbol used to render points for the layer in elevation profile plots.

The symbol will be used in the following circumstances:

See also
setProfileMarkerSymbol()

Definition at line 342 of file qgsvectorlayerelevationproperties.cpp.

◆ profileSymbology()

Qgis::ProfileSurfaceSymbology QgsVectorLayerElevationProperties::profileSymbology ( ) const
inline

Returns the symbology option used to render the vector profile in elevation profile plots.

Note
This setting is only used when type() is Qgis::VectorProfileType::ContinuousSurface.
See also
setProfileSymbology()

Definition at line 250 of file qgsvectorlayerelevationproperties.h.

◆ readXml()

bool QgsVectorLayerElevationProperties::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
overridevirtual

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

See also
writeXml()

Implements QgsMapLayerElevationProperties.

Definition at line 83 of file qgsvectorlayerelevationproperties.cpp.

◆ respectLayerSymbology()

bool QgsVectorLayerElevationProperties::respectLayerSymbology ( ) const
inline

Returns true if layer symbology should be respected when rendering elevation profile plots.

Specifically, this will result in the layer's symbols (or symbol colors) being used to draw features in the profile plots.

See also
setRespectLayerSymbology()

Definition at line 153 of file qgsvectorlayerelevationproperties.h.

◆ setBinding()

void QgsVectorLayerElevationProperties::setBinding ( Qgis::AltitudeBinding  binding)

Sets the altitude binding method, which determines how altitude is bound to individual vertices in features.

Note
Binding only relevant for line or polygon feature types – it is not applicable for point layers.
See also
binding()

Definition at line 268 of file qgsvectorlayerelevationproperties.cpp.

◆ setClamping()

void QgsVectorLayerElevationProperties::setClamping ( Qgis::AltitudeClamping  clamping)

Sets the altitude clamping method, which dictates how feature heights are interpreted with respect to terrain heights.

See also
clamping()

Definition at line 258 of file qgsvectorlayerelevationproperties.cpp.

◆ setDefaultsFromLayer()

void QgsVectorLayerElevationProperties::setDefaultsFromLayer ( QgsMapLayer layer)
overridevirtual

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

Since
QGIS 3.26

Reimplemented from QgsMapLayerElevationProperties.

Definition at line 126 of file qgsvectorlayerelevationproperties.cpp.

◆ setElevationLimit()

void QgsVectorLayerElevationProperties::setElevationLimit ( double  limit)

Sets the elevation limit, which is used when profileSymbology() is Qgis::ProfileSurfaceSymbology::FillBelow or Qgis::ProfileSurfaceSymbology::FillAbove to limit the fill to a specific elevation range.

Set to NaN to indicate that there is no elevation limit.

See also
elevationLimit()
Since
QGIS 3.32

Definition at line 369 of file qgsvectorlayerelevationproperties.cpp.

◆ setExtrusionEnabled()

void QgsVectorLayerElevationProperties::setExtrusionEnabled ( bool  enabled)

Sets whether extrusion is enabled.

See also
extrusionEnabled()
setExtrusionHeight()

Definition at line 288 of file qgsvectorlayerelevationproperties.cpp.

◆ setExtrusionHeight()

void QgsVectorLayerElevationProperties::setExtrusionHeight ( double  height)

Sets the feature extrusion height.

Warning
extrusion is only applied if extrusionEnabled() is true.
Note
the zScale() factor is NOT applied to extrusion heights.
See also
extrusionHeight()

Definition at line 298 of file qgsvectorlayerelevationproperties.cpp.

◆ setProfileFillSymbol()

void QgsVectorLayerElevationProperties::setProfileFillSymbol ( QgsFillSymbol symbol)

Sets the fill symbol used to render polygons for the layer in elevation profile plots.

Ownership of symbol is transferred to the plot.

The symbol will be used in the following circumstances:

See also
profileFillSymbol()

Definition at line 335 of file qgsvectorlayerelevationproperties.cpp.

◆ setProfileLineSymbol()

void QgsVectorLayerElevationProperties::setProfileLineSymbol ( QgsLineSymbol symbol)

Sets the line symbol used to render lines for the layer in elevation profile plots.

Ownership of symbol is transferred to the plot.

The symbol will be used in the following circumstances:

See also
profileLineSymbol()

Definition at line 323 of file qgsvectorlayerelevationproperties.cpp.

◆ setProfileMarkerSymbol()

void QgsVectorLayerElevationProperties::setProfileMarkerSymbol ( QgsMarkerSymbol symbol)

Sets the marker symbol used to render points for the layer in elevation profile plots.

Ownership of symbol is transferred to the plot.

The symbol will be used in the following circumstances:

See also
profileMarkerSymbol()

Definition at line 347 of file qgsvectorlayerelevationproperties.cpp.

◆ setProfileSymbology()

void QgsVectorLayerElevationProperties::setProfileSymbology ( Qgis::ProfileSurfaceSymbology  symbology)

Sets the symbology option used to render the vector profile in elevation profile plots.

Note
This setting is only used when type() is Qgis::VectorProfileType::ContinuousSurface.
See also
setProfileSymbology()

Definition at line 354 of file qgsvectorlayerelevationproperties.cpp.

◆ setRespectLayerSymbology()

void QgsVectorLayerElevationProperties::setRespectLayerSymbology ( bool  enabled)

Sets whether layer symbology should be respected when rendering elevation profile plots.

Specifically, this will result in the layer's symbols (or symbol colors) being used to draw features in the profile plots.

See also
respectLayerSymbology()

Definition at line 308 of file qgsvectorlayerelevationproperties.cpp.

◆ setShowMarkerSymbolInSurfacePlots()

void QgsVectorLayerElevationProperties::setShowMarkerSymbolInSurfacePlots ( bool  show)

Sets whether the marker symbol should also be shown in continuous surface plots.

Note
This setting is only used when type() is Qgis::VectorProfileType::ContinuousSurface.
See also
showMarkerSymbolInSurfacePlots()

Definition at line 379 of file qgsvectorlayerelevationproperties.cpp.

◆ setType()

void QgsVectorLayerElevationProperties::setType ( Qgis::VectorProfileType  type)

Sets the type of profile the layer represents.

See also
type()

Definition at line 278 of file qgsvectorlayerelevationproperties.cpp.

◆ showByDefaultInElevationProfilePlots()

bool QgsVectorLayerElevationProperties::showByDefaultInElevationProfilePlots ( ) const
overridevirtual

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 from QgsMapLayerElevationProperties.

Definition at line 248 of file qgsvectorlayerelevationproperties.cpp.

◆ showMarkerSymbolInSurfacePlots()

bool QgsVectorLayerElevationProperties::showMarkerSymbolInSurfacePlots ( ) const
inline

Returns true if the marker symbol should also be shown in continuous surface plots.

Note
This setting is only used when type() is Qgis::VectorProfileType::ContinuousSurface.
See also
setShowMarkerSymbolInSurfacePlots()

Definition at line 292 of file qgsvectorlayerelevationproperties.h.

◆ type()

Qgis::VectorProfileType QgsVectorLayerElevationProperties::type ( ) const
inline

Returns the type of profile the layer represents.

See also
setType()

Definition at line 100 of file qgsvectorlayerelevationproperties.h.

◆ writeXml()

QDomElement QgsVectorLayerElevationProperties::writeXml ( QDomElement &  element,
QDomDocument &  doc,
const QgsReadWriteContext context 
)
overridevirtual

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

See also
readXml()

Implements QgsMapLayerElevationProperties.

Definition at line 50 of file qgsvectorlayerelevationproperties.cpp.


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