33 return QStringLiteral(
"quantizedmesh" );
38 if ( element.hasAttribute( QStringLiteral(
"layer" ) ) )
40 mLayer =
QgsMapLayerRef( element.attribute( QStringLiteral(
"layer" ) ) );
45 const QDomElement elemTerrainGenerator = element.firstChildElement( QStringLiteral(
"generator" ) );
46 mLayer =
QgsMapLayerRef( elemTerrainGenerator.attribute( QStringLiteral(
"layer" ) ) );
54 element.setAttribute( QStringLiteral(
"layer" ), mLayer.
layerId );
66 if ( !otherMeshTerrain )
77 std::unique_ptr<QgsQuantizedMeshTerrainGenerator> generator = std::make_unique<QgsQuantizedMeshTerrainGenerator>();
78 generator->setLayer(
layer() );
80 generator->setExtent( context.
extent() );
91 return qobject_cast<QgsTiledSceneLayer *>( mLayer.
layer.data() );
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...
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.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
bool equals(const QgsAbstractTerrainSettings *other) const final
Returns true if this settings is exactly equal to another other settings.
void resolveReferences(const QgsProject *project) final
After reading settings from XML, resolves references to any layers in a project that have been read a...
QgsTiledSceneLayer * layer() const
Returns the quantized mesh tile layer with elevation model to be used for terrain generation.
QString type() const final
Returns the unique type name for the terrain generator.
static QgsAbstractTerrainSettings * create()
Creates a new instance of a QgsQuantizedMeshTerrainSettings object.
QgsQuantizedMeshTerrainSettings * clone() const final
Returns a copy of the terrain settings.
void readXml(const QDomElement &element, const QgsReadWriteContext &context) final
Reads settings from a DOM element.
std::unique_ptr< QgsTerrainGenerator > createTerrainGenerator(const Qgs3DRenderContext &context) const override
Creates a new instance of a terrain generator which matches the terrain settings.
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const final
Writes settings to a DOM element.
void setLayer(QgsTiledSceneLayer *layer)
Sets the quantized mesh tile layer with elevation model to be used for terrain generation.
The class is used as a container of context for various read/write operations on other objects.
Represents a map layer supporting display of tiled scene objects.
_LayerRef< QgsMapLayer > QgsMapLayerRef
QPointer< TYPE > layer
Weak pointer to map layer.
TYPE * resolve(const QgsProject *project)
Resolves the map layer by attempting to find a layer with matching ID within a project.
QString layerId
Original layer ID.