QGIS API Documentation 3.99.0-Master (26c88405ac0)
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.h"
20#include "qgis_3d.h"
21#include "qgs3dtypes.h"
22#include "qgsabstract3dsymbol.h"
23
24#include <QMatrix4x4>
25
27class QgsMarkerSymbol;
28
38{
39 public:
42
43 QgsPoint3DSymbol( const QgsPoint3DSymbol &other );
44
46
53
54 QString type() const override { return "point"; }
55 QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
56
57 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
58 void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
59 QList<Qgis::GeometryType> compatibleGeometryTypes() const override;
60 void setDefaultPropertiesFromLayer( const QgsVectorLayer *layer ) override;
61
63 Qgis::AltitudeClamping altitudeClamping() const { return mAltClamping; }
65 void setAltitudeClamping( Qgis::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
66
68 QgsAbstractMaterialSettings *materialSettings() const;
69
75 void setMaterialSettings( QgsAbstractMaterialSettings *materialSettings SIP_TRANSFER );
76
78 static Qgis::Point3DShape shapeFromString( const QString &shape );
80 static QString shapeToString( Qgis::Point3DShape shape );
81
83 Qgis::Point3DShape shape() const { return mShape; }
85 void setShape( Qgis::Point3DShape shape ) { mShape = shape; }
86
97 QVariantMap shapeProperties() const { return mShapeProperties; }
98
108 QVariant shapeProperty( const QString &property ) const;
109
154 void setShapeProperties( const QVariantMap &properties ) { mShapeProperties = properties; }
155
157 QgsMarkerSymbol *billboardSymbol() const;
159 void setBillboardSymbol( QgsMarkerSymbol *symbol );
160
162 QMatrix4x4 transform() const { return mTransform; }
164 void setTransform( const QMatrix4x4 &transform ) { mTransform = transform; }
165
167 float billboardHeight() const;
168
173 bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const override SIP_SKIP;
174
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
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:56
AltitudeClamping
Altitude clamping.
Definition qgis.h:3982
@ Absolute
Elevation is taken directly from feature and is independent of terrain height (final elevation = feat...
Definition qgis.h:3983
Point3DShape
3D point shape types.
Definition qgis.h:4124
@ Cylinder
Cylinder.
Definition qgis.h:4125
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 QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
Abstract base class for material settings.
A marker symbol type, for rendering Point and MultiPoint geometries.
3D symbol that draws point geometries as 3D objects using one of the predefined shapes.
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.
QString type() const override
Returns identifier of symbol type. Each 3D symbol implementation should return a different type.
static QgsAbstract3DSymbol * create()
Creates a new QgsPoint3DSymbol.
void setShapeProperties(const QVariantMap &properties)
Sets a key-value dictionary of point shape properties.
QgsPoint3DSymbol()
Constructor for QgsPoint3DSymbol with default QgsMarkerSymbol as the billboardSymbol.
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.
Qgis::AltitudeClamping altitudeClamping() const
Returns method that determines altitude (whether to clamp to feature to terrain).
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:134
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:84
#define SIP_NODEFAULTCTORS
Definition qgis_sip.h:109