QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgsabstract3dsymbol.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsabstract3dsymbol.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 QGSABSTRACT3DSYMBOL_H
17#define QGSABSTRACT3DSYMBOL_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
22
23class QDomElement;
24class QString;
25
28
29namespace Qt3DCore SIP_SKIP
30{
31 class QEntity;
32}
33
34
47class CORE_EXPORT QgsAbstract3DSymbol
48{
49 public:
50 virtual ~QgsAbstract3DSymbol() = default;
51
53 virtual QString type() const = 0;
56
58 virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const = 0;
60 virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) = 0;
61
67 virtual QList< Qgis::GeometryType > compatibleGeometryTypes() const;
68
69 // *INDENT-OFF*
72 {
73 Height SIP_MONKEYPATCH_COMPAT_NAME( PropertyHeight ) = 0,
74 ExtrusionHeight SIP_MONKEYPATCH_COMPAT_NAME( PropertyExtrusionHeight ),
75 };
76 // *INDENT-ON*
77
79 static const QgsPropertiesDefinition &propertyDefinitions();
80
83
86
88 void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
89
95 virtual bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const SIP_SKIP;
96
102 virtual void setDefaultPropertiesFromLayer( const QgsVectorLayer *layer );
103
104 protected:
108 virtual void copyBaseSettings( QgsAbstract3DSymbol *destination ) const;
110
111 private:
112 static void initPropertyDefinitions();
113
115 static QgsPropertiesDefinition sPropertyDefinitions;
116};
117
118
119#endif // QGSABSTRACT3DSYMBOL_H
Entity that handles the exporting of 3D scenes.
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
virtual ~QgsAbstract3DSymbol()=default
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads symbol configuration from the given DOM element.
virtual QString type() const =0
Returns identifier of symbol type. Each 3D symbol implementation should return a different type.
virtual QList< Qgis::GeometryType > compatibleGeometryTypes() const
Returns the list of the vector layer geometry types which are compatible with this symbol.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol layer's property collection, used for data defined overrides.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol layer's property collection, used for data defined overrides.
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
virtual void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const =0
Writes symbol configuration to the given DOM element.
QgsPropertyCollection mDataDefinedProperties
Property
Data definable properties.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A container for the context for various read/write operations on objects.
Represents a vector layer which manages a vector based dataset.
#define SIP_SKIP
Definition qgis_sip.h:133
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition qgis_sip.h:267
#define SIP_FACTORY
Definition qgis_sip.h:83
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition qgis_sip.h:269
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.