QGIS API Documentation  3.27.0-Master (0e23467727)
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 
30 namespace Qt3DCore { class QEntity; } SIP_SKIP
31 
32 
46 class CORE_EXPORT QgsAbstract3DSymbol
47 {
48  public:
49  virtual ~QgsAbstract3DSymbol() = default;
50 
52  virtual QString type() const = 0;
54  virtual QgsAbstract3DSymbol *clone() const = 0 SIP_FACTORY;
55 
57  virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const = 0;
59  virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) = 0;
60 
66  virtual QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const;
67 
69  enum Property
70  {
71  PropertyHeight = 0,
73  };
74 
76  static const QgsPropertiesDefinition &propertyDefinitions();
77 
79  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
80 
82  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
83 
85  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
86 
92  virtual bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const SIP_SKIP;
93 
99  virtual void setDefaultPropertiesFromLayer( const QgsVectorLayer *layer );
100 
101  protected:
102 
106  virtual void copyBaseSettings( QgsAbstract3DSymbol *destination ) const;
108 
109  private:
110  static void initPropertyDefinitions();
111 
113  static QgsPropertiesDefinition sPropertyDefinitions;
114 };
115 
116 
117 #endif // QGSABSTRACT3DSYMBOL_H
Entity that handles the exporting of 3D scene.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
virtual ~QgsAbstract3DSymbol()=default
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads symbol configuration from the given DOM element.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol layer's property collection, used for data defined overrides.
virtual QString type() const =0
Returns identifier of symbol type. Each 3D symbol implementation should return a different type.
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
Property
Data definable properties.
@ PropertyExtrusionHeight
Extrusion height (zero means no extrusion)
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol layer's property collection, used for data defined overrides.
virtual void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const =0
Writes symbol configuration to the given DOM element.
QgsPropertyCollection mDataDefinedProperties
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
The class is used as a container of context for various read/write operations on other objects.
Represents a vector layer which manages a vector based data sets.
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_FACTORY
Definition: qgis_sip.h:76
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.