QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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"
21 
22 #include "qgspropertycollection.h"
23 
24 class QDomElement;
25 class QString;
26 
28 class Qgs3DSceneExporter;
29 namespace Qt3DCore { class QEntity; } SIP_SKIP
30 
31 
45 class CORE_EXPORT QgsAbstract3DSymbol
46 {
47  public:
48  virtual ~QgsAbstract3DSymbol() = default;
49 
51  virtual QString type() const = 0;
53  virtual QgsAbstract3DSymbol *clone() const = 0 SIP_FACTORY;
54 
56  virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const = 0;
58  virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) = 0;
59 
65  virtual QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const;
66 
68  enum Property
69  {
70  PropertyHeight = 0,
72  };
73 
75  static const QgsPropertiesDefinition &propertyDefinitions();
76 
78  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
79 
81  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
82 
84  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
85 
91  virtual bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const SIP_SKIP;
92 
93  protected:
94 
98  void copyBaseSettings( QgsAbstract3DSymbol *destination ) const;
100 
101  private:
102  static void initPropertyDefinitions();
103 
105  static QgsPropertiesDefinition sPropertyDefinitions;
106 };
107 
108 
109 #endif // QGSABSTRACT3DSYMBOL_H
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:35
QgsAbstract3DSymbol::readXml
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads symbol configuration from the given DOM element.
QgsAbstract3DSymbol::~QgsAbstract3DSymbol
virtual ~QgsAbstract3DSymbol()=default
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsAbstract3DSymbol
3 Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Definition: qgsabstract3dsymbol.h:46
QgsPropertiesDefinition
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
Definition: qgspropertycollection.h:29
Qgs3DSceneExporter
The Qgs3DSceneExporter class Entity that handles the exporting of 3D scene.
Definition: qgs3dsceneexporter.h:57
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsAbstract3DSymbol::PropertyExtrusionHeight
@ PropertyExtrusionHeight
Extrusion height (zero means no extrusion)
Definition: qgsabstract3dsymbol.h:71
QgsAbstract3DSymbol::dataDefinedProperties
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Definition: qgsabstract3dsymbol.h:81
QgsAbstract3DSymbol::setDataDefinedProperties
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol layer's property collection, used for data defined overrides.
Definition: qgsabstract3dsymbol.h:84
Qt3DCore
Definition: qgsabstract3drenderer.h:31
qgis_sip.h
QgsAbstract3DSymbol::type
virtual QString type() const =0
Returns identifier of symbol type. Each 3D symbol implementation should return a different type.
QgsAbstract3DSymbol::clone
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
QgsAbstract3DSymbol::mDataDefinedProperties
QgsPropertyCollection mDataDefinedProperties
Definition: qgsabstract3dsymbol.h:99
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition: qgspropertycollection.h:319
QgsAbstract3DSymbol::dataDefinedProperties
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Definition: qgsabstract3dsymbol.h:78
qgspropertycollection.h
QgsAbstract3DSymbol::writeXml
virtual void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const =0
Writes symbol configuration to the given DOM element.
QgsAbstract3DSymbol::Property
Property
Data definable properties.
Definition: qgsabstract3dsymbol.h:69