QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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  void setDefaultPropertiesFromLayer( const QgsVectorLayer *layer ) override;
63 
65  Qgis::AltitudeClamping altitudeClamping() const { return mAltClamping; }
67  void setAltitudeClamping( Qgis::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
68 
70  QgsAbstractMaterialSettings *material() const;
71 
77  void setMaterial( QgsAbstractMaterialSettings *material SIP_TRANSFER );
78 
80  enum Shape
81  {
91  };
92 
94  static Shape shapeFromString( const QString &shape );
96  static QString shapeToString( Shape shape );
97 
99  Shape shape() const { return mShape; }
101  void setShape( Shape shape ) { mShape = shape; }
102 
104  QVariantMap shapeProperties() const { return mShapeProperties; }
106  void setShapeProperties( const QVariantMap &properties ) { mShapeProperties = properties; }
107 
109  QgsMarkerSymbol *billboardSymbol() const;
111  void setBillboardSymbol( QgsMarkerSymbol *symbol );
112 
114  QMatrix4x4 transform() const { return mTransform; }
116  void setTransform( const QMatrix4x4 &transform ) { mTransform = transform; }
117 
119  QMatrix4x4 billboardTransform() const;
120 
125  bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const override SIP_SKIP;
126  private:
129 
130  std::unique_ptr< QgsAbstractMaterialSettings> mMaterial;
131  Shape mShape = Cylinder;
132  QVariantMap mShapeProperties;
133  QMatrix4x4 mTransform;
134  std::unique_ptr<QgsMarkerSymbol> mBillboardSymbol;
135 #ifdef SIP_RUN
136  QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & );
137 #else
138  QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & ) = delete;
139 #endif
140 };
141 
142 
143 #endif // QGSPOINT3DSYMBOL_H
QgsPoint3DSymbol::Cube
@ Cube
Definition: qgspoint3dsymbol.h:85
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsPoint3DSymbol::Shape
Shape
3D shape types supported by the symbol
Definition: qgspoint3dsymbol.h:80
QgsPoint3DSymbol::Sphere
@ Sphere
Definition: qgspoint3dsymbol.h:83
Qgis::AltitudeClamping::Relative
@ Relative
Elevation is relative to terrain height (final elevation = terrain elevation + feature elevation)
qgsabstract3dsymbol.h
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsAbstract3DSymbol
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Definition: qgsabstract3dsymbol.h:46
Qgs3DSceneExporter
Entity that handles the exporting of 3D scene.
Definition: qgs3dsceneexporter.h:55
QgsPoint3DSymbol::Cone
@ Cone
Definition: qgspoint3dsymbol.h:84
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsAbstractMaterialSettings
Abstract base class for material settings.
Definition: qgsabstractmaterialsettings.h:114
QgsMarkerSymbol
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition: qgsmarkersymbol.h:30
QgsPoint3DSymbol::type
QString type() const override
Definition: qgspoint3dsymbol.h:56
QgsPoint3DSymbol::Model
@ Model
Definition: qgspoint3dsymbol.h:89
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
qgs3dtypes.h
QgsAbstract3DSymbol::clone
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
QgsPoint3DSymbol::setTransform
void setTransform(const QMatrix4x4 &transform)
Sets transform for individual objects represented by the symbol.
Definition: qgspoint3dsymbol.h:116
QgsPoint3DSymbol::Cylinder
@ Cylinder
Definition: qgspoint3dsymbol.h:82
QgsPoint3DSymbol::Torus
@ Torus
Definition: qgspoint3dsymbol.h:86
QgsAbstract3DSymbol::exportGeometries
virtual bool exportGeometries(Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix) const
Exports the geometries contained within the hierarchy of entity.
Definition: qgsabstract3dsymbol.cpp:53
SIP_NODEFAULTCTORS
#define SIP_NODEFAULTCTORS
Definition: qgis_sip.h:101
QgsPoint3DSymbol::shape
Shape shape() const
Returns 3D shape for points.
Definition: qgspoint3dsymbol.h:99
QgsPoint3DSymbol::Plane
@ Plane
Definition: qgspoint3dsymbol.h:87
QgsPoint3DSymbol::setShape
void setShape(Shape shape)
Sets 3D shape for points.
Definition: qgspoint3dsymbol.h:101
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsPoint3DSymbol::ExtrudedText
@ ExtrudedText
Supported in Qt 5.9+.
Definition: qgspoint3dsymbol.h:88
QgsPoint3DSymbol::shapeProperties
QVariantMap shapeProperties() const
Returns a key-value dictionary of point shape properties.
Definition: qgspoint3dsymbol.h:104
Qgis
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:71
QgsWkbTypes
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:41
QgsPoint3DSymbol::transform
QMatrix4x4 transform() const
Returns transform for individual objects represented by the symbol.
Definition: qgspoint3dsymbol.h:114
Qgis::AltitudeClamping
AltitudeClamping
Altitude clamping.
Definition: qgis.h:1757
QgsPoint3DSymbol::setAltitudeClamping
void setAltitudeClamping(Qgis::AltitudeClamping altClamping)
Sets method that determines altitude (whether to clamp to feature to terrain)
Definition: qgspoint3dsymbol.h:67
QgsPoint3DSymbol::Billboard
@ Billboard
Definition: qgspoint3dsymbol.h:90
QgsPoint3DSymbol::setShapeProperties
void setShapeProperties(const QVariantMap &properties)
Sets a key-value dictionary of point shape properties.
Definition: qgspoint3dsymbol.h:106
QgsPoint3DSymbol
3D symbol that draws point geometries as 3D objects using one of the predefined shapes.
Definition: qgspoint3dsymbol.h:38