QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
24 #include "qgsmesh3dentity_p.h"
49 r->mLayerRef = mLayerRef;
60 return qobject_cast<QgsMeshLayer *>( mLayerRef.
layer );
81 !mSymbol->isEnabled() )
87 Qt3DCore::QEntity *entity =
nullptr;
92 QgsMeshDataset3dEntity *meshEntity =
new QgsMeshDataset3dEntity( map, meshLayer, *
static_cast<QgsMesh3DSymbol *
>( mSymbol.get() ) );
101 QDomDocument doc = elem.ownerDocument();
103 elem.setAttribute( QStringLiteral(
"layer" ), mLayerRef.
layerId );
105 QDomElement elemSymbol = doc.createElement( QStringLiteral(
"symbol" ) );
108 elemSymbol.setAttribute( QStringLiteral(
"type" ), mSymbol->type() );
109 mSymbol->writeXml( elemSymbol, context );
111 elem.appendChild( elemSymbol );
116 mLayerRef =
QgsMapLayerRef( elem.attribute( QStringLiteral(
"layer" ) ) );
118 QDomElement elemSymbol = elem.firstChildElement( QStringLiteral(
"symbol" ) );
QgsCoordinateReferenceSystem crs
QgsCoordinateReferenceSystem crs() const
Returns coordinate reference system used in the 3D scene.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads symbol configuration from the given DOM element.
const QgsMesh3DSymbol * symbol() const
Returns 3D symbol associated with the renderer.
_LayerRef< QgsMapLayer > QgsMapLayerRef
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
QPointer< TYPE > layer
Weak pointer to map layer.
QgsCoordinateTransformContext transformContext() const
Returns the coordinate transform context, which stores various information regarding which datum tran...
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes renderer's properties to given XML element.
void updateTriangularMesh(const QgsCoordinateTransform &transform=QgsCoordinateTransform())
Gets native mesh and updates (creates if it doesn't exist) the base triangular mesh.
QString layerId
Original layer ID.
void setLayer(TYPE *l)
Sets the reference to point to a specified layer.
QgsMeshLayer * layer() const
Returns mesh layer associated with the renderer.
void setLayer(QgsMeshLayer *layer)
Sets vector layer associated with the renderer.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads renderer's properties from given XML element.
void setSymbol(QgsMesh3DSymbol *symbol)
Sets 3D symbol associated with the renderer.
QgsMeshLayer3DRenderer * clone() const override
Returns a cloned instance.
QgsMeshLayer3DRenderer(QgsMesh3DSymbol *s=nullptr)
Takes ownership of the symbol object.
QgsMeshDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
void resolveReferences(const QgsProject &project) override
Resolves references to other objects - second phase of loading - after readXml()
Qt3DCore::QEntity * createEntity(const Qgs3DMapSettings &map) const override
Returns a 3D entity that will be used to show renderer's data in 3D scene.