QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
Raster layer specific subclass of QgsMapLayerElevationProperties. More...
#include <qgsrasterlayerelevationproperties.h>
Public Member Functions | |
QgsRasterLayerElevationProperties (QObject *parent) | |
Constructor for QgsRasterLayerElevationProperties, with the specified parent object. | |
~QgsRasterLayerElevationProperties () override | |
int | bandForElevationRange (QgsRasterLayer *layer, const QgsDoubleRange &range) const |
Returns the band corresponding to the specified range. | |
int | bandNumber () const |
Returns the band number from which the elevation should be taken. | |
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. | |
QgsRasterLayerElevationProperties * | clone () 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. | |
QgsDoubleRange | elevationRangeForPixelValue (QgsRasterLayer *layer, int band, double pixelValue) const |
Returns the elevation range corresponding to a raw pixel value from the specified band. | |
QgsDoubleRange | fixedRange () const |
Returns the fixed elevation range for the raster. | |
QMap< int, QgsDoubleRange > | fixedRangePerBand () const |
Returns the fixed elevation range for each band. | |
QgsMapLayerElevationProperties::Flags | flags () const override |
Returns flags associated to the elevation properties. | |
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 | isEnabled () const |
Returns true if the elevation properties are enabled, i.e. | |
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. | |
Qgis::RasterElevationMode | mode () const |
Returns the elevation mode. | |
QgsFillSymbol * | profileFillSymbol () const |
Returns the fill symbol used to render the raster profile in elevation profile plots. | |
QgsLineSymbol * | profileLineSymbol () const |
Returns the line symbol used to render the raster profile in elevation profile plots. | |
Qgis::ProfileSurfaceSymbology | profileSymbology () const |
Returns the symbology option used to render the raster 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(). | |
void | setBandNumber (int band) |
Sets the band number from which the elevation should be taken. | |
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 | setEnabled (bool enabled) |
Sets whether the elevation properties are enabled, i.e. | |
void | setFixedRange (const QgsDoubleRange &range) |
Sets the fixed elevation range for the raster. | |
void | setFixedRangePerBand (const QMap< int, QgsDoubleRange > &ranges) |
Sets the fixed elevation range for each band. | |
void | setMode (Qgis::RasterElevationMode mode) |
Sets the elevation mode. | |
void | setProfileFillSymbol (QgsFillSymbol *symbol) |
Sets the fill symbol used to render the raster profile in elevation profile plots. | |
void | setProfileLineSymbol (QgsLineSymbol *symbol) |
Sets the line symbol used to render the raster profile in elevation profile plots. | |
void | setProfileSymbology (Qgis::ProfileSurfaceSymbology symbology) |
Sets the symbology option used to render the raster profile in elevation profile plots. | |
bool | showByDefaultInElevationProfilePlots () const override |
Returns true if the layer should be visible by default in newly created elevation profile plots. | |
QList< double > | significantZValues (QgsMapLayer *layer) const override |
Returns a list of significant elevation/z-values for the specified layer, using the settings defined by this elevation properties object. | |
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. | |
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. | |
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. | |
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 bool | layerLooksLikeDem (QgsRasterLayer *layer) |
Returns true if a raster layer looks like a DEM. | |
Static Public Member Functions inherited from QgsMapLayerElevationProperties | |
static QgsPropertiesDefinition | propertyDefinitions () |
Returns the definitions for data defined properties available for use in elevation properties. | |
Additional Inherited Members | |
Public Types inherited from QgsMapLayerElevationProperties | |
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 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. | |
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. | |
Raster layer specific subclass of QgsMapLayerElevationProperties.
Definition at line 36 of file qgsrasterlayerelevationproperties.h.
QgsRasterLayerElevationProperties::QgsRasterLayerElevationProperties | ( | QObject * | parent | ) |
Constructor for QgsRasterLayerElevationProperties, with the specified parent object.
Definition at line 30 of file qgsrasterlayerelevationproperties.cpp.
|
overridedefault |
int QgsRasterLayerElevationProperties::bandForElevationRange | ( | QgsRasterLayer * | layer, |
const QgsDoubleRange & | range | ||
) | const |
Returns the band corresponding to the specified range.
Definition at line 550 of file qgsrasterlayerelevationproperties.cpp.
|
inline |
Returns the band number from which the elevation should be taken.
Definition at line 97 of file qgsrasterlayerelevationproperties.h.
|
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 276 of file qgsrasterlayerelevationproperties.cpp.
|
overridevirtual |
Creates a clone of the properties.
Implements QgsMapLayerElevationProperties.
Definition at line 168 of file qgsrasterlayerelevationproperties.cpp.
double QgsRasterLayerElevationProperties::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.
Definition at line 664 of file qgsrasterlayerelevationproperties.cpp.
QgsDoubleRange QgsRasterLayerElevationProperties::elevationRangeForPixelValue | ( | QgsRasterLayer * | layer, |
int | band, | ||
double | pixelValue | ||
) | const |
Returns the elevation range corresponding to a raw pixel value from the specified band.
Returns an infinite range if the pixel value does not correspond to an elevation value.
Definition at line 489 of file qgsrasterlayerelevationproperties.cpp.
QgsDoubleRange QgsRasterLayerElevationProperties::fixedRange | ( | ) | const |
Returns the fixed elevation range for the raster.
Definition at line 782 of file qgsrasterlayerelevationproperties.cpp.
QMap< int, QgsDoubleRange > QgsRasterLayerElevationProperties::fixedRangePerBand | ( | ) | const |
Returns the fixed elevation range for each band.
Definition at line 768 of file qgsrasterlayerelevationproperties.cpp.
|
overridevirtual |
Returns flags associated to the elevation properties.
Reimplemented from QgsMapLayerElevationProperties.
Definition at line 437 of file qgsrasterlayerelevationproperties.cpp.
|
overridevirtual |
Returns true
if the layer has an elevation or z component.
Reimplemented from QgsMapLayerElevationProperties.
Definition at line 40 of file qgsrasterlayerelevationproperties.cpp.
|
overridevirtual |
Returns a HTML formatted summary of the properties.
Reimplemented from QgsMapLayerElevationProperties.
Definition at line 184 of file qgsrasterlayerelevationproperties.cpp.
|
inline |
Returns true
if the elevation properties are enabled, i.e.
the raster layer values represent an elevation surface.
Definition at line 65 of file qgsrasterlayerelevationproperties.h.
|
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 215 of file qgsrasterlayerelevationproperties.cpp.
|
static |
Returns true
if a raster layer looks like a DEM.
This method applies some heuristics to layer to determine whether it looks like a candidate for a DEM layer.
Specifically, it checks:
Definition at line 679 of file qgsrasterlayerelevationproperties.cpp.
Qgis::RasterElevationMode QgsRasterLayerElevationProperties::mode | ( | ) | const |
Returns the elevation mode.
Definition at line 465 of file qgsrasterlayerelevationproperties.cpp.
QgsFillSymbol * QgsRasterLayerElevationProperties::profileFillSymbol | ( | ) | const |
Returns the fill symbol used to render the raster profile in elevation profile plots.
Definition at line 642 of file qgsrasterlayerelevationproperties.cpp.
QgsLineSymbol * QgsRasterLayerElevationProperties::profileLineSymbol | ( | ) | const |
Returns the line symbol used to render the raster profile in elevation profile plots.
Definition at line 630 of file qgsrasterlayerelevationproperties.cpp.
|
inline |
Returns the symbology option used to render the raster profile in elevation profile plots.
Definition at line 212 of file qgsrasterlayerelevationproperties.h.
|
overridevirtual |
Reads the elevation properties from a DOM element previously written by writeXml().
Implements QgsMapLayerElevationProperties.
Definition at line 102 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::setBandNumber | ( | int | band | ) |
Sets the band number from which the elevation should be taken.
Definition at line 479 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::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.
Definition at line 669 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::setEnabled | ( | bool | enabled | ) |
Sets whether the elevation properties are enabled, i.e.
the raster layer values represent an elevation surface.
Definition at line 455 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::setFixedRange | ( | const QgsDoubleRange & | range | ) |
Sets the fixed elevation range for the raster.
Definition at line 787 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::setFixedRangePerBand | ( | const QMap< int, QgsDoubleRange > & | ranges | ) |
Sets the fixed elevation range for each band.
Definition at line 773 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::setMode | ( | Qgis::RasterElevationMode | mode | ) |
Sets the elevation mode.
Definition at line 470 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::setProfileFillSymbol | ( | QgsFillSymbol * | symbol | ) |
Sets the fill symbol used to render the raster profile in elevation profile plots.
Ownership of symbol is transferred to the plot.
Definition at line 647 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::setProfileLineSymbol | ( | QgsLineSymbol * | symbol | ) |
Sets the line symbol used to render the raster profile in elevation profile plots.
Ownership of symbol is transferred to the plot.
Definition at line 635 of file qgsrasterlayerelevationproperties.cpp.
void QgsRasterLayerElevationProperties::setProfileSymbology | ( | Qgis::ProfileSurfaceSymbology | symbology | ) |
Sets the symbology option used to render the raster profile in elevation profile plots.
Definition at line 654 of file qgsrasterlayerelevationproperties.cpp.
|
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.
Reimplemented from QgsMapLayerElevationProperties.
Definition at line 432 of file qgsrasterlayerelevationproperties.cpp.
|
overridevirtual |
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 from QgsMapLayerElevationProperties.
Definition at line 360 of file qgsrasterlayerelevationproperties.cpp.
|
overridevirtual |
Writes the properties to a DOM element, to be used later with readXml().
Implements QgsMapLayerElevationProperties.
Definition at line 45 of file qgsrasterlayerelevationproperties.cpp.