28 element.setAttribute( QStringLiteral(
"exaggeration" ), mTerrainVerticalScale );
29 element.setAttribute( QStringLiteral(
"texture-size" ), mMapTileResolution );
30 element.setAttribute( QStringLiteral(
"max-terrain-error" ), mMaxTerrainScreenError );
31 element.setAttribute( QStringLiteral(
"max-ground-error" ), mMaxTerrainGroundError );
32 element.setAttribute( QStringLiteral(
"elevation-offset" ), mTerrainElevationOffset );
37 mTerrainVerticalScale = element.attribute( QStringLiteral(
"exaggeration" ), QStringLiteral(
"1" ) ).toDouble();
38 mMapTileResolution = element.attribute( QStringLiteral(
"texture-size" ), QStringLiteral(
"512" ) ).toInt();
39 mMaxTerrainScreenError = element.attribute( QStringLiteral(
"max-terrain-error" ), QStringLiteral(
"3" ) ).toDouble();
40 mMaxTerrainGroundError = element.attribute( QStringLiteral(
"max-ground-error" ), QStringLiteral(
"1" ) ).toDouble();
41 mTerrainElevationOffset = element.attribute( QStringLiteral(
"elevation-offset" ), QStringLiteral(
"0.0" ) ).toDouble();
46 mTerrainVerticalScale = source->mTerrainVerticalScale;
47 mMapTileResolution = source->mMapTileResolution;
48 mMaxTerrainScreenError = source->mMaxTerrainScreenError;
49 mMaxTerrainGroundError = source->mMaxTerrainGroundError;
50 mTerrainElevationOffset = source->mTerrainElevationOffset;
55 return mMapTileResolution == other->mMapTileResolution
56 &&
qgsDoubleNear( mTerrainVerticalScale, other->mTerrainVerticalScale )
57 &&
qgsDoubleNear( mMaxTerrainScreenError, other->mMaxTerrainScreenError )
58 &&
qgsDoubleNear( mMaxTerrainGroundError, other->mMaxTerrainGroundError )
59 &&
qgsDoubleNear( mTerrainElevationOffset, other->mTerrainElevationOffset );
Base class for all terrain settings classes.
void copyCommonProperties(const QgsAbstractTerrainSettings *source)
Copies common properties from a source object.
void writeCommonProperties(QDomElement &element, const QgsReadWriteContext &context) const
Writes common properties from the base class into an XML element.
bool equalsCommon(const QgsAbstractTerrainSettings *other) const
Returns true if common base class settings from other match this object.
virtual void resolveReferences(const QgsProject *project)
After reading settings from XML, resolves references to any layers in a project that have been read a...
void readCommonProperties(const QDomElement &element, const QgsReadWriteContext &context)
Reads common properties from the base class from the given DOM element.
virtual ~QgsAbstractTerrainSettings()
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
A container for the context for various read/write operations on objects.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)