QGIS API Documentation  3.20.0-Odense (decaadbb31)
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 
24 #include <QMatrix4x4>
25 
27 class QgsMarkerSymbol;
28 
39 {
40  public:
43 
45  QgsPoint3DSymbol( const QgsPoint3DSymbol &other );
46 
47  ~QgsPoint3DSymbol() override;
48 
54  static QgsAbstract3DSymbol *create() SIP_FACTORY;
55 
56  QString type() const override { return "point"; }
57  QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
58 
59  void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
60  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
61  QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const override;
62 
64  Qgs3DTypes::AltitudeClamping altitudeClamping() const { return mAltClamping; }
66  void setAltitudeClamping( Qgs3DTypes::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
67 
69  QgsAbstractMaterialSettings *material() const;
70 
76  void setMaterial( QgsAbstractMaterialSettings *material SIP_TRANSFER );
77 
79  enum Shape
80  {
90  };
91 
93  static Shape shapeFromString( const QString &shape );
95  static QString shapeToString( Shape shape );
96 
98  Shape shape() const { return mShape; }
100  void setShape( Shape shape ) { mShape = shape; }
101 
103  QVariantMap shapeProperties() const { return mShapeProperties; }
105  void setShapeProperties( const QVariantMap &properties ) { mShapeProperties = properties; }
106 
108  QgsMarkerSymbol *billboardSymbol() const;
110  void setBillboardSymbol( QgsMarkerSymbol *symbol );
111 
113  QMatrix4x4 transform() const { return mTransform; }
115  void setTransform( const QMatrix4x4 &transform ) { mTransform = transform; }
116 
118  QMatrix4x4 billboardTransform() const;
119 
124  bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const override SIP_SKIP;
125  private:
128 
129  std::unique_ptr< QgsAbstractMaterialSettings> mMaterial;
130  Shape mShape = Cylinder;
131  QVariantMap mShapeProperties;
132  QMatrix4x4 mTransform;
133  std::unique_ptr<QgsMarkerSymbol> mBillboardSymbol;
134 #ifdef SIP_RUN
135  QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & );
136 #else
137  QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & ) = delete;
138 #endif
139 };
140 
141 
142 #endif // QGSPOINT3DSYMBOL_H
Entity that handles the exporting of 3D scene.
AltitudeClamping
how to handle altitude of vector features
Definition: qgs3dtypes.h:35
@ AltClampRelative
Z_final = z_terrain + z_geometry.
Definition: qgs3dtypes.h:37
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.
Shape
3D shape types supported by the symbol
@ ExtrudedText
Supported in Qt 5.9+.
void setTransform(const QMatrix4x4 &transform)
Sets transform for individual objects represented by the symbol.
~QgsPoint3DSymbol() override
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.
void setShape(Shape shape)
Sets 3D shape for points.
Shape shape() const
Returns 3D shape for points.
QVariantMap shapeProperties() const
Returns a key-value dictionary of point shape properties.
void setAltitudeClamping(Qgs3DTypes::AltitudeClamping altClamping)
Sets method that determines altitude (whether to clamp to feature to terrain)
The class is used as a container of context for various read/write operations on other objects.
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:42
#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