50 r->mLayerRef = mLayerRef;
66 mSymbol.reset( symbol );
78 if ( !mSymbol || !vl )
81 return new QgsMesh3DSymbolEntity( map, vl, *static_cast<QgsMesh3DSymbol *>( mSymbol.get() ) );
86 QDomDocument doc = elem.ownerDocument();
88 elem.setAttribute( QStringLiteral(
"layer" ), mLayerRef.
layerId );
90 QDomElement elemSymbol = doc.createElement( QStringLiteral(
"symbol" ) );
93 elemSymbol.setAttribute( QStringLiteral(
"type" ), mSymbol->type() );
94 mSymbol->writeXml( elemSymbol, context );
96 elem.appendChild( elemSymbol );
101 mLayerRef =
QgsMapLayerRef( elem.attribute( QStringLiteral(
"layer" ) ) );
103 QDomElement elemSymbol = elem.firstChildElement( QStringLiteral(
"symbol" ) );
105 symbol->
readXml( elemSymbol, context );
106 mSymbol.reset( symbol );
The class is used as a container of context for various read/write operations on other objects...
Qt3DCore::QEntity * createEntity(const Qgs3DMapSettings &map) const override
Returns a 3D entity that will be used to show renderer's data in 3D scene.
3 3D symbol that draws mesh geometry as planar triangles.
_LayerRef< QgsMapLayer > QgsMapLayerRef
Base class for all renderers that may to participate in 3D view.
void resolveReferences(const QgsProject &project) override
Resolves references to other objects - second phase of loading - after readXml()
3D renderer that renders all mesh triangles of a mesh layer.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes renderer's properties to given XML element.
3 Definition of the world
QgsMeshLayer3DRenderer * clone() const override
Returns a cloned instance.
QgsMeshLayer * layer() const
Returns mesh layer associated with the renderer.
QString layerId
Original layer ID.
QPointer< TYPE > layer
Weak pointer to map layer.
const QgsMesh3DSymbol * symbol() const
Returns 3D symbol associated with the renderer.
void setSymbol(QgsMesh3DSymbol *symbol)
Sets 3D symbol associated with the renderer.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
void setLayer(TYPE *l)
Sets the reference to point to a specified layer.
void setLayer(QgsMeshLayer *layer)
Sets vector layer associated with the renderer.
QgsMeshLayer3DRenderer(QgsMesh3DSymbol *s=nullptr)
Takes ownership of the symbol object.
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads renderer's properties from given XML element.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads symbol configuration from the given DOM element.