QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgsabstract3dsymbol.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsabstract3dsymbol.cpp
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#include "qgsabstract3dsymbol.h"
17
18#include <QString>
19
20using namespace Qt::StringLiterals;
21
22QgsPropertiesDefinition QgsAbstract3DSymbol::sPropertyDefinitions;
23
24
25QList<Qgis::GeometryType> QgsAbstract3DSymbol::compatibleGeometryTypes() const
26{
27 return QList< Qgis::GeometryType >();
28}
29
31{
32 initPropertyDefinitions();
33 return sPropertyDefinitions;
34}
35
40
41void QgsAbstract3DSymbol::initPropertyDefinitions()
42{
43 if ( !sPropertyDefinitions.isEmpty() )
44 return;
45
46 const QString origin = u"symbol3d"_s;
47
48 sPropertyDefinitions = QgsPropertiesDefinition
49 {
50 { static_cast< int >( Property::Height ), QgsPropertyDefinition( "height", QObject::tr( "Height" ), QgsPropertyDefinition::Double, origin ) },
51 { static_cast< int >( Property::ExtrusionHeight ), QgsPropertyDefinition( "extrusionHeight", QObject::tr( "ExtrusionHeight" ), QgsPropertyDefinition::DoublePositive, origin ) },
52 };
53
54}
55
56bool QgsAbstract3DSymbol::exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const
57{
58 Q_UNUSED( exporter )
59 Q_UNUSED( entity )
60 Q_UNUSED( objectNamePrefix )
61 return false;
62}
63
Entity that handles the exporting of 3D scenes.
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
virtual bool exportGeometries(Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix) const
Exports the geometries contained within the hierarchy of entity.
virtual void copyBaseSettings(QgsAbstract3DSymbol *destination) const
Copies base class settings from this object to a destination object.
virtual void setDefaultPropertiesFromLayer(const QgsVectorLayer *layer)
Sets default properties for the symbol based on a layer's configuration.
virtual QList< Qgis::GeometryType > compatibleGeometryTypes() const
Returns the list of the vector layer geometry types which are compatible with this symbol.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
QgsPropertyCollection mDataDefinedProperties
@ ExtrusionHeight
Extrusion height (zero means no extrusion).
Definition for a property.
Definition qgsproperty.h:47
@ Double
Double value (including negative values).
Definition qgsproperty.h:57
@ DoublePositive
Positive double value (including 0).
Definition qgsproperty.h:58
Represents a vector layer which manages a vector based dataset.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.