QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgsmesh3dsymbol.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmesh3dsymbol.h
3  -----------------
4  Date : January 2019
5  Copyright : (C) 2019 by Peter Petrik
6  Email : zilolv 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 QGSMESH3DSYMBOL_H
17 #define QGSMESH3DSYMBOL_H
18 
19 #include "qgis_3d.h"
20 
21 #include "qgsabstract3dsymbol.h"
23 #include "qgs3dtypes.h"
24 
25 #include <Qt3DRender/QCullFace>
26 
36 class _3D_EXPORT QgsMesh3DSymbol : public QgsAbstract3DSymbol
37 {
38  public:
40  QgsMesh3DSymbol() = default;
41 
42  QString type() const override { return "mesh"; }
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  float height() const { return mHeight; }
56  void setHeight( float height ) { mHeight = height; }
57 
59  QgsPhongMaterialSettings material() const { return mMaterial; }
61  void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; }
62 
66  bool addBackFaces() const { return mAddBackFaces; }
67 
71  void setAddBackFaces( bool add ) { mAddBackFaces = add; }
72 
73  private:
76  float mHeight = 0.0f;
77  QgsPhongMaterialSettings mMaterial;
78  bool mAddBackFaces = false;
79 };
80 
81 
82 #endif // QGSMESH3DSYMBOL_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)
3 3D symbol that draws mesh geometry as planar triangles.
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
float height() const
Returns height (altitude) of the symbol (in map units)
3 Basic shading material used for rendering based on the Phong shading model with three color compone...
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.
bool addBackFaces() const
Returns whether also triangles facing the other side will be created.
void setHeight(float height)
Sets height (altitude) of the symbol (in map units)
#define SIP_FACTORY
Definition: qgis_sip.h:69
QgsPhongMaterialSettings material() const
Returns material used for shading of the symbol.
void setAddBackFaces(bool add)
Sets whether also triangles facing the other side will be created.
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads symbol configuration from the given DOM element.
Qgs3DTypes::AltitudeClamping altitudeClamping() const
Returns method that determines altitude (whether to clamp to feature to terrain)
Z_final = z_terrain + z_geometry.
Definition: qgs3dtypes.h:37
void setMaterial(const QgsPhongMaterialSettings &material)
Sets material used for shading of the symbol.