24 QDomDocument doc = elem.ownerDocument();
26 QDomElement elemTiling = doc.createElement( QStringLiteral(
"vector-layer-3d-tiling" ) );
27 elemTiling.setAttribute( QStringLiteral(
"zoom-levels-count" ), mZoomLevelsCount );
28 elemTiling.setAttribute( QStringLiteral(
"show-bounding-boxes" ), mShowBoundingBoxes ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
29 elem.appendChild( elemTiling );
34 QDomElement elemTiling = elem.firstChildElement( QStringLiteral(
"vector-layer-3d-tiling" ) );
35 if ( !elemTiling.isNull() )
37 mZoomLevelsCount = elemTiling.attribute( QStringLiteral(
"zoom-levels-count" ) ).toInt();
38 mShowBoundingBoxes = elemTiling.attribute( QStringLiteral(
"show-bounding-boxes" ) ).toInt();
60 r->mLayerRef = mLayerRef;
61 r->mTilingSettings = mTilingSettings;
67 elem.setAttribute( QStringLiteral(
"layer" ), mLayerRef.layerId );
68 mTilingSettings.writeXml( elem );
74 mLayerRef =
QgsMapLayerRef( elem.attribute( QStringLiteral(
"layer" ) ) );
75 mTilingSettings.readXml( elem );
80 mLayerRef.setLayer( project.
mapLayer( mLayerRef.layerId ) );
void writeXml(QDomElement &elem) const
Writes content of the object to XML.
The class is used as a container of context for various read/write operations on other objects...
void resolveReferences(const QgsProject &project) override
Resolves references to other objects - second phase of loading - after readXml()
QgsAbstractVectorLayer3DRenderer()
_LayerRef< QgsMapLayer > QgsMapLayerRef
QgsVectorLayer * layer() const
Returns vector layer associated with the renderer.
void copyBaseProperties(QgsAbstractVectorLayer3DRenderer *r) const
Copies common properties of this object to another object.
void setLayer(QgsVectorLayer *layer)
Sets vector layer associated with the renderer.
void readXml(const QDomElement &elem)
Reads content of the object from XML.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
void writeXmlBaseProperties(QDomElement &elem, const QgsReadWriteContext &context) const
Writes common properties of this object to DOM element.
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
3 Base class for 3D renderers that are based on vector layers.
Represents a vector layer which manages a vector based data sets.
void readXmlBaseProperties(const QDomElement &elem, const QgsReadWriteContext &context)
Reads common properties of this object from DOM element.