35 return QStringLiteral(
"online" );
40 if ( element.hasAttribute( QStringLiteral(
"resolution" ) ) )
42 mResolution = element.attribute( QStringLiteral(
"resolution" ) ).toInt();
43 mSkirtHeight = element.attribute( QStringLiteral(
"skirt-height" ) ).toDouble();
48 const QDomElement elemTerrainGenerator = element.firstChildElement( QStringLiteral(
"generator" ) );
49 mResolution = elemTerrainGenerator.attribute( QStringLiteral(
"resolution" ) ).toInt();
50 mSkirtHeight = elemTerrainGenerator.attribute( QStringLiteral(
"skirt-height" ) ).toDouble();
58 element.setAttribute( QStringLiteral(
"resolution" ), mResolution );
59 element.setAttribute( QStringLiteral(
"skirt-height" ), mSkirtHeight );
73 return mResolution == otherTerrain->mResolution
79 auto generator = std::make_unique<QgsOnlineTerrainGenerator>();
80 generator->setResolution( mResolution );
81 generator->setSkirtHeight(
static_cast<float>( mSkirtHeight ) );
83 generator->setExtent( context.
extent() );
Rendering context for preparation of 3D entities.
QgsCoordinateReferenceSystem crs() const
Returns the coordinate reference system used in the 3D scene.
QgsRectangle extent() const
Returns the 3D scene's 2D extent in the 3D scene's CRS.
QgsCoordinateTransformContext transformContext() const
Returns the coordinate transform context, which stores various information regarding which datum tran...
Base class for all terrain settings classes.
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.
void readCommonProperties(const QDomElement &element, const QgsReadWriteContext &context)
Reads common properties from the base class from the given DOM element.
Terrain settings for a terrain generator that uses an online DEM to build terrain.
bool equals(const QgsAbstractTerrainSettings *other) const final
Returns true if this settings is exactly equal to another other settings.
void readXml(const QDomElement &element, const QgsReadWriteContext &context) final
Reads settings from a DOM element.
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const final
Writes settings to a DOM element.
static QgsAbstractTerrainSettings * create()
Creates a new instance of a QgsOnlineDemTerrainSettings object.
std::unique_ptr< QgsTerrainGenerator > createTerrainGenerator(const Qgs3DRenderContext &context) const override
Creates a new instance of a terrain generator which matches the terrain settings.
QgsOnlineDemTerrainSettings * clone() const final
Returns a copy of the terrain settings.
QString type() const final
Returns the unique type name for the terrain generator.
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)