24 #include "qgsmesh3dentity_p.h"
49 r->mLayerRef = mLayerRef;
60 return qobject_cast<QgsMeshLayer *>( mLayerRef.
layer );
81 !mSymbol->isEnabled() )
87 Qt3DCore::QEntity *entity =
nullptr;
93 QgsMeshDataset3dEntity *meshEntity =
new QgsMeshDataset3dEntity( map, triangularMesh, meshLayer, mSymbol.get() );
102 QDomDocument doc = elem.ownerDocument();
104 elem.setAttribute( QStringLiteral(
"layer" ), mLayerRef.
layerId );
106 QDomElement elemSymbol = doc.createElement( QStringLiteral(
"symbol" ) );
109 elemSymbol.setAttribute( QStringLiteral(
"type" ), mSymbol->type() );
110 mSymbol->writeXml( elemSymbol, context );
112 elem.appendChild( elemSymbol );
117 mLayerRef =
QgsMapLayerRef( elem.attribute( QStringLiteral(
"layer" ) ) );
119 const QDomElement elemSymbol = elem.firstChildElement( QStringLiteral(
"symbol" ) );
QgsCoordinateReferenceSystem crs() const
Returns coordinate reference system used in the 3D scene.
QgsCoordinateTransformContext transformContext() const
Returns the coordinate transform context, which stores various information regarding which datum tran...
Base class for all renderers that may to participate in 3D view.
QgsCoordinateReferenceSystem crs
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads symbol configuration from the given DOM element.
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
3D renderer that renders all mesh triangles of a mesh layer.
Qt3DCore::QEntity * createEntity(const Qgs3DMapSettings &map) const override
Returns a 3D entity that will be used to show renderer's data in 3D scene.
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.
const QgsMesh3DSymbol * symbol() const
Returns 3D symbol associated with the renderer.
QgsMeshLayer3DRenderer(QgsMesh3DSymbol *s=nullptr)
Takes ownership of the symbol object.
void setLayer(QgsMeshLayer *layer)
Sets vector layer associated with the renderer.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes renderer's properties to given XML element.
void resolveReferences(const QgsProject &project) override
Resolves references to other objects - second phase of loading - after readXml()
QgsMeshLayer * layer() const
Returns mesh layer associated with the renderer.
QgsMeshLayer3DRenderer * clone() const override
Returns a cloned instance.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
void updateTriangularMesh(const QgsCoordinateTransform &transform=QgsCoordinateTransform())
Gets native mesh and updates (creates if it doesn't exist) the base triangular mesh.
QgsTriangularMesh * triangularMeshByLodIndex(int lodIndex) const
Returns triangular corresponding to the index of level of details.
QgsMeshDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
The class is used as a container of context for various read/write operations on other objects.
Triangular/Derived Mesh is mesh with vertices in map coordinates.
_LayerRef< QgsMapLayer > QgsMapLayerRef
QPointer< TYPE > layer
Weak pointer to map layer.
void setLayer(TYPE *l)
Sets the reference to point to a specified layer.
QString layerId
Original layer ID.