QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsmeshlayer3drenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshlayer3drenderer.h
3 ------------------------
4 Date : January 2019
5 Copyright : (C) 2019 by Peter Petrik
6 Email : zilolv at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSMESHLAYER3DRENDERER_H
17#define QGSMESHLAYER3DRENDERER_H
18
19#include "qgis_3d.h"
22#include "qgsmaplayerref.h"
23#include "qgsmesh3dsymbol.h"
25
26#include <QObject>
27
28#define SIP_NO_FILE
29
30class QgsMeshLayer;
31
32
43{
44 public:
46
48 QgsAbstract3DRenderer *createRenderer( QDomElement &elem, const QgsReadWriteContext &context ) override SIP_FACTORY;
49};
50
51
58{
59 public:
62
66 QgsMeshLayer *layer() const;
67
71 const QgsMesh3DSymbol *symbol() const;
72
73 QString type() const override { return "mesh"; }
74 QgsMeshLayer3DRenderer *clone() const override SIP_FACTORY;
75 Qt3DCore::QEntity *createEntity( Qgs3DMapSettings *map ) const override SIP_SKIP;
76
77 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
78 void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
79 void resolveReferences( const QgsProject &project ) override;
80
81
82 private:
83 QgsMapLayerRef mLayerRef;
84 std::unique_ptr<QgsMesh3DSymbol> mSymbol;
85
86 private:
87#ifdef SIP_RUN
90#endif
91};
92
93#endif // QGSMESHLAYER3DRENDERER_H
Definition of the world.
virtual QgsAbstract3DRenderer * createRenderer(QDomElement &elem, const QgsReadWriteContext &context)=0
Returns new instance of the renderer given the DOM element.
Qgs3DRendererAbstractMetadata(const QString &type)
Constructor of the base class.
Base class for all renderers that participate in 3D views.
QgsAbstract3DRenderer()=default
3D symbol that draws mesh geometry as planar triangles.
3D renderer that renders all mesh triangles of a mesh layer.
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.
QgsMeshLayer * layer() const
Returns mesh layer associated with the renderer.
QString type() const override
Returns unique identifier of the renderer class (used to identify subclass).
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
A container for the context for various read/write operations on objects.
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:84
_LayerRef< QgsMapLayer > QgsMapLayerRef