QGIS API Documentation 3.99.0-Master (a8f284845db)
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 "qgsabstract3dsymbol.h"
22
23#include <QMatrix4x4>
24
26class QgsMarkerSymbol;
27
37{
38 public:
41
42 QgsPoint3DSymbol( const QgsPoint3DSymbol &other );
43
45
52
53 QString type() const override { return "point"; }
54 QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
55
56 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
57 void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
58 QList<Qgis::GeometryType> compatibleGeometryTypes() const override;
59 void setDefaultPropertiesFromLayer( const QgsVectorLayer *layer ) override;
60
62 Qgis::AltitudeClamping altitudeClamping() const { return mAltClamping; }
64 void setAltitudeClamping( Qgis::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
65
67 QgsAbstractMaterialSettings *materialSettings() const;
68
74 void setMaterialSettings( QgsAbstractMaterialSettings *materialSettings SIP_TRANSFER );
75
77 static Qgis::Point3DShape shapeFromString( const QString &shape );
79 static QString shapeToString( Qgis::Point3DShape shape );
80
82 Qgis::Point3DShape shape() const { return mShape; }
84 void setShape( Qgis::Point3DShape shape ) { mShape = shape; }
85
96 QVariantMap shapeProperties() const { return mShapeProperties; }
97
107 QVariant shapeProperty( const QString &property ) const;
108
153 void setShapeProperties( const QVariantMap &properties ) { mShapeProperties = properties; }
154
156 QgsMarkerSymbol *billboardSymbol() const;
158 void setBillboardSymbol( QgsMarkerSymbol *symbol );
159
161 QMatrix4x4 transform() const { return mTransform; }
163 void setTransform( const QMatrix4x4 &transform ) { mTransform = transform; }
164
166 float billboardHeight() const;
167
172 bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const override SIP_SKIP;
173
174 private:
177
178 std::unique_ptr<QgsAbstractMaterialSettings> mMaterialSettings;
180 QVariantMap mShapeProperties;
181 QMatrix4x4 mTransform;
182 std::unique_ptr<QgsMarkerSymbol> mBillboardSymbol;
183#ifdef SIP_RUN
184 QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & );
185#else
186 QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & ) = delete;
187#endif
188};
189
190
191#endif // QGSPOINT3DSYMBOL_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:59
AltitudeClamping
Altitude clamping.
Definition qgis.h:4068
@ Absolute
Elevation is taken directly from feature and is independent of terrain height (final elevation = feat...
Definition qgis.h:4069
Point3DShape
3D point shape types.
Definition qgis.h:4221
@ Cylinder
Cylinder.
Definition qgis.h:4222
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:133
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_FACTORY
Definition qgis_sip.h:83
#define SIP_NODEFAULTCTORS
Definition qgis_sip.h:108