QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
Base class for storage of map layer elevation properties. More...
#include <qgsmaplayerelevationproperties.h>
Public Types | |
enum | Flag { FlagDontInvalidateCachedRendersWhenRangeChanges = 1 } |
Flags attached to the elevation property. More... | |
typedef QFlags< Flag > | Flags |
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 QgsMapLayerElevationProperties * | clone () const =0 |
Creates a clone of the properties. | |
QgsPropertyCollection & | dataDefinedProperties () |
Returns a reference to the object's property collection, used for data defined overrides. | |
const QgsPropertyCollection & | dataDefinedProperties () 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. | |
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.
Definition at line 44 of file qgsmaplayerelevationproperties.h.
typedef QFlags< Flag > QgsMapLayerElevationProperties::Flags |
Definition at line 109 of file qgsmaplayerelevationproperties.h.
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.
|
strong |
Data definable properties.
Definition at line 93 of file qgsmaplayerelevationproperties.h.
QgsMapLayerElevationProperties::QgsMapLayerElevationProperties | ( | QObject * | parent | ) |
Constructor for QgsMapLayerElevationProperties, with the specified parent object.
Definition at line 24 of file qgsmaplayerelevationproperties.cpp.
|
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.
|
signal |
Emitted when any of the elevation properties have changed.
See renderingPropertyChanged() and profileGenerationPropertyChanged() for more fine-grained signals.
|
pure virtual |
Creates a clone of the properties.
Implemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, QgsTiledSceneLayerElevationProperties, and QgsVectorLayerElevationProperties.
|
protected |
Copies common properties from another object.
Definition at line 64 of file qgsmaplayerelevationproperties.cpp.
|
inline |
Returns a reference to the object's property collection, used for data defined overrides.
Definition at line 248 of file qgsmaplayerelevationproperties.h.
|
inline |
Returns a reference to the object's property collection, used for data defined overrides.
Definition at line 257 of file qgsmaplayerelevationproperties.h.
|
inlinevirtual |
Returns flags associated to the elevation properties.
Reimplemented in QgsMeshLayerElevationProperties, and QgsRasterLayerElevationProperties.
Definition at line 166 of file qgsmaplayerelevationproperties.h.
|
virtual |
Returns true
if the layer has an elevation or z component.
Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, QgsTiledSceneLayerElevationProperties, and QgsVectorLayerElevationProperties.
Definition at line 29 of file qgsmaplayerelevationproperties.cpp.
|
virtual |
Returns a HTML formatted summary of the properties.
Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, QgsTiledSceneLayerElevationProperties, and QgsVectorLayerElevationProperties.
Definition at line 39 of file qgsmaplayerelevationproperties.cpp.
|
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.
|
signal |
Emitted when any of the elevation properties which relate solely to generation of elevation profiles have changed.
|
signal |
Emitted when any of the elevation properties which relate solely to presentation of elevation results have changed.
|
static |
Returns the definitions for data defined properties available for use in elevation properties.
Definition at line 123 of file qgsmaplayerelevationproperties.cpp.
|
protected |
Reads common class properties from a DOM element previously written by writeXml().
Definition at line 54 of file qgsmaplayerelevationproperties.cpp.
|
pure virtual |
Reads the elevation properties from a DOM element previously written by writeXml().
Implemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, QgsTiledSceneLayerElevationProperties, and QgsVectorLayerElevationProperties.
void QgsMapLayerElevationProperties::setDataDefinedProperties | ( | const QgsPropertyCollection & | collection | ) |
Sets the object's property collection, used for data defined overrides.
Any existing properties will be discarded.
Definition at line 113 of file qgsmaplayerelevationproperties.cpp.
|
virtual |
Sets default properties based on sensible choices for the given map layer.
Reimplemented in QgsVectorLayerElevationProperties.
Definition at line 34 of file qgsmaplayerelevationproperties.cpp.
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.
Definition at line 91 of file qgsmaplayerelevationproperties.cpp.
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.
Definition at line 102 of file qgsmaplayerelevationproperties.cpp.
|
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.
Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, and QgsVectorLayerElevationProperties.
Definition at line 86 of file qgsmaplayerelevationproperties.cpp.
|
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.
Reimplemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, and QgsTiledSceneLayerElevationProperties.
Definition at line 81 of file qgsmaplayerelevationproperties.cpp.
|
protected |
Writes common class properties to a DOM element, to be used later with readXml().
Definition at line 44 of file qgsmaplayerelevationproperties.cpp.
|
pure virtual |
Writes the properties to a DOM element, to be used later with readXml().
Implemented in QgsMeshLayerElevationProperties, QgsPointCloudLayerElevationProperties, QgsRasterLayerElevationProperties, QgsTiledSceneLayerElevationProperties, and QgsVectorLayerElevationProperties.
|
inline |
Returns the z offset, which is a fixed offset amount which should be added to z values from the layer.
Definition at line 205 of file qgsmaplayerelevationproperties.h.
|
signal |
Emitted when the z offset changes.
|
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.
Definition at line 228 of file qgsmaplayerelevationproperties.h.
|
signal |
Emitted when the z scale changes.
|
protected |
Property collection for data defined elevation settings.
Definition at line 327 of file qgsmaplayerelevationproperties.h.
|
protected |
Z offset.
Definition at line 324 of file qgsmaplayerelevationproperties.h.
|
protected |
Z scale.
Definition at line 322 of file qgsmaplayerelevationproperties.h.
|
staticprotected |
Property definitions.
Definition at line 330 of file qgsmaplayerelevationproperties.h.