QGIS API Documentation 4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
qgs3drendererregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgs3drendererregistry.h
3 --------------------------------------
4 Date : July 2017
5 Copyright : (C) 2017 by Martin Dobias
6 Email : wonder dot sk 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 QGS3DRENDERERREGISTRY_H
17#define QGS3DRENDERERREGISTRY_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
21
22#include <QMap>
23
24class QDomElement;
27
28
36{
37 public:
38 virtual ~Qgs3DRendererAbstractMetadata() = default;
39
43 QString type() const;
44
49 virtual QgsAbstract3DRenderer *createRenderer( QDomElement &elem, const QgsReadWriteContext &context ) = 0 SIP_FACTORY;
50
51 protected:
55 explicit Qgs3DRendererAbstractMetadata( const QString &type );
56
57 protected:
59 QString mType;
60};
61
62
69class CORE_EXPORT Qgs3DRendererRegistry
70{
71 public:
73
75
80
84 void removeRenderer( const QString &type );
85
89 Qgs3DRendererAbstractMetadata *rendererMetadata( const QString &type ) const;
90
94 QStringList renderersList() const;
95
96 private:
97 QMap<QString, Qgs3DRendererAbstractMetadata *> mRenderers;
98};
99
100#endif // QGS3DRENDERERREGISTRY_H
Base metadata class for 3D renderers.
QString mType
Type used within QGIS for identification (the same what renderer's type() returns).
virtual ~Qgs3DRendererAbstractMetadata()=default
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.
QString type() const
Returns unique identifier of the 3D renderer class.
void removeRenderer(const QString &type)
Unregisters a 3D renderer type.
QStringList renderersList() const
Returns a list of all available 3D renderer types.
Qgs3DRendererRegistry()=default
Qgs3DRendererAbstractMetadata * rendererMetadata(const QString &type) const
Returns metadata for a 3D renderer type (may be used to create a new instance of the type).
void addRenderer(Qgs3DRendererAbstractMetadata *metadata)
Registers a new 3D renderer type.
Base class for all renderers that participate in 3D views.
A container for the context for various read/write operations on objects.
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_FACTORY
Definition qgis_sip.h:83