QGIS API Documentation  3.8.0-Zanzibar (11aff65)
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"
23 #include "qgs3dtypes.h"
24 
25 #include <QMatrix4x4>
26 
36 class _3D_EXPORT QgsPoint3DSymbol : public QgsAbstract3DSymbol
37 {
38  public:
40  QgsPoint3DSymbol() = default;
41 
42  QString type() const override { return "point"; }
43  QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
44 
45  void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
46  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
47 
49  Qgs3DTypes::AltitudeClamping altitudeClamping() const { return mAltClamping; }
51  void setAltitudeClamping( Qgs3DTypes::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
52 
54  QgsPhongMaterialSettings material() const { return mMaterial; }
56  void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; }
57 
59  enum Shape
60  {
69  };
70 
72  static Shape shapeFromString( const QString &shape );
74  static QString shapeToString( Shape shape );
75 
77  Shape shape() const { return mShape; }
79  void setShape( Shape shape ) { mShape = shape; }
80 
82  QVariantMap shapeProperties() const { return mShapeProperties; }
84  void setShapeProperties( const QVariantMap &properties ) { mShapeProperties = properties; }
85 
87  QMatrix4x4 transform() const { return mTransform; }
89  void setTransform( const QMatrix4x4 &transform ) { mTransform = transform; }
90 
91  private:
94 
95  QgsPhongMaterialSettings mMaterial;
96  Shape mShape = Cylinder;
97  QVariantMap mShapeProperties;
98  QMatrix4x4 mTransform;
99 };
100 
101 
102 #endif // QGSPOINT3DSYMBOL_H
QString type() const override
Returns identifier of symbol type. Each 3D symbol implementation should return a different type...
AltitudeClamping
how to handle altitude of vector features
Definition: qgs3dtypes.h:34
The class is used as a container of context for various read/write operations on other objects...
void setAltitudeClamping(Qgs3DTypes::AltitudeClamping altClamping)
Sets method that determines altitude (whether to clamp to feature to terrain)
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
void setTransform(const QMatrix4x4 &transform)
Sets transform for individual objects represented by the symbol.
Qgs3DTypes::AltitudeClamping altitudeClamping() const
Returns method that determines altitude (whether to clamp to feature to terrain)
Shape shape() const
Returns 3D shape for points.
void setShape(Shape shape)
Sets 3D shape for points.
QVariantMap shapeProperties() const
Returns a key-value dictionary of point shape properties.
3 Basic shading material used for rendering based on the Phong shading model with three color compone...
Supported in Qt 5.9+.
virtual void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const =0
Writes symbol configuration to the given DOM element.
3 Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
QMatrix4x4 transform() const
Returns transform for individual objects represented by the symbol.
3 3D symbol that draws point geometries as 3D objects using one of the predefined shapes...
QgsPhongMaterialSettings material() const
Returns material used for shading of the symbol.
void setShapeProperties(const QVariantMap &properties)
Sets a key-value dictionary of point shape properties.
#define SIP_FACTORY
Definition: qgis_sip.h:69
Shape
3D shape types supported by the symbol
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads symbol configuration from the given DOM element.
Z_final = z_terrain + z_geometry.
Definition: qgs3dtypes.h:37
void setMaterial(const QgsPhongMaterialSettings &material)
Sets material used for shading of the symbol.