33 QDomElement element = document.createElement( QStringLiteral(
"elevation" ) );
34 element.setAttribute( QStringLiteral(
"zoffset" ),
qgsDoubleToString( mZOffset ) );
36 parentElement.appendChild( element );
42 const QDomElement elevationElement = element.firstChildElement( QStringLiteral(
"elevation" ) ).toElement();
43 mZOffset = elevationElement.attribute( QStringLiteral(
"zoffset" ), QStringLiteral(
"0" ) ).toDouble();
44 mZScale = elevationElement.attribute( QStringLiteral(
"zscale" ), QStringLiteral(
"1" ) ).toDouble();
58 if ( pcLayer->dataProvider() )
63 if ( zMin.isValid() && zMax.isValid() )
65 return QgsDoubleRange( zMin.toDouble() * mZScale + mZOffset, zMax.toDouble() * mZScale + mZOffset );
QgsRange which stores a range of double values.
Base class for storage of map layer elevation properties.
Base class for all map layer types.
bool isVisibleInZRange(const QgsDoubleRange &range) const override
Returns true if the layer should be visible and rendered for the specified z range.
bool hasElevation() const override
Returns true if the layer has an elevation or z component.
QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) override
Writes the properties to a DOM element, to be used later with readXml().
bool readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads the elevation properties from a DOM element previously written by writeXml().
QgsDoubleRange calculateZRange(QgsMapLayer *layer) const override
Attempts to calculate the overall elevation or z range for the specified layer, using the settings de...
QgsPointCloudLayerElevationProperties(QObject *parent)
Constructor for QgsPointCloudLayerElevationProperties, with the specified parent object.
Represents a map layer supporting display of point clouds.
The class is used as a container of context for various read/write operations on other objects.
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.