QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgspoint3dsymbol.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspoint3dsymbol.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 QGSPOINT3DSYMBOL_H
17#define QGSPOINT3DSYMBOL_H
18
19#include "qgis_3d.h"
20
21#include "qgsabstract3dsymbol.h"
22#include "qgs3dtypes.h"
23#include "qgis.h"
24
25#include <QMatrix4x4>
26
28class QgsMarkerSymbol;
29
39{
40 public:
43
44 QgsPoint3DSymbol( const QgsPoint3DSymbol &other );
45
47
53 static QgsAbstract3DSymbol *create() SIP_FACTORY;
54
55 QString type() const override { return "point"; }
56 QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
57
58 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
59 void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
60 QList< Qgis::GeometryType > compatibleGeometryTypes() const override;
61 void setDefaultPropertiesFromLayer( const QgsVectorLayer *layer ) override;
62
64 Qgis::AltitudeClamping altitudeClamping() const { return mAltClamping; }
66 void setAltitudeClamping( Qgis::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
67
69 QgsAbstractMaterialSettings *materialSettings() const;
70
76 void setMaterialSettings( QgsAbstractMaterialSettings *materialSettings SIP_TRANSFER );
77
79 static Qgis::Point3DShape shapeFromString( const QString &shape );
81 static QString shapeToString( Qgis::Point3DShape shape );
82
84 Qgis::Point3DShape shape() const { return mShape; }
86 void setShape( Qgis::Point3DShape shape ) { mShape = shape; }
87
98 QVariantMap shapeProperties() const { return mShapeProperties; }
99
109 QVariant shapeProperty( const QString &property ) const;
110
155 void setShapeProperties( const QVariantMap &properties ) { mShapeProperties = properties; }
156
158 QgsMarkerSymbol *billboardSymbol() const;
160 void setBillboardSymbol( QgsMarkerSymbol *symbol );
161
163 QMatrix4x4 transform() const { return mTransform; }
165 void setTransform( const QMatrix4x4 &transform ) { mTransform = transform; }
166
168 float billboardHeight() const;
169
174 bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const override SIP_SKIP;
175 private:
178
179 std::unique_ptr< QgsAbstractMaterialSettings> mMaterialSettings;
181 QVariantMap mShapeProperties;
182 QMatrix4x4 mTransform;
183 std::unique_ptr<QgsMarkerSymbol> mBillboardSymbol;
184#ifdef SIP_RUN
185 QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & );
186#else
187 QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & ) = delete;
188#endif
189};
190
191
192#endif // QGSPOINT3DSYMBOL_H
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
AltitudeClamping
Altitude clamping.
Definition qgis.h:3699
@ Relative
Elevation is relative to terrain height (final elevation = terrain elevation + feature elevation)
Point3DShape
3D point shape types.
Definition qgis.h:3841
@ Cylinder
Cylinder.
Entity that handles the exporting of 3D scene.
virtual bool exportGeometries(Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix) const
Exports the geometries contained within the hierarchy of entity.
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
A marker symbol type, for rendering Point and MultiPoint geometries.
void setTransform(const QMatrix4x4 &transform)
Sets transform for individual objects represented by the symbol.
~QgsPoint3DSymbol() override
void setShape(Qgis::Point3DShape shape)
Sets 3D shape for points.
void setShapeProperties(const QVariantMap &properties)
Sets a key-value dictionary of point shape properties.
QMatrix4x4 transform() const
Returns transform for individual objects represented by the symbol.
Qgis::Point3DShape shape() const
Returns 3D shape for points.
void setAltitudeClamping(Qgis::AltitudeClamping altClamping)
Sets method that determines altitude (whether to clamp to feature to terrain)
QVariantMap shapeProperties() const
Returns a key-value dictionary of point shape properties.
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_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76
#define SIP_NODEFAULTCTORS
Definition qgis_sip.h:101