QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsline3dsymbol.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsline3dsymbol.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 QGSLINE3DSYMBOL_H
17 #define QGSLINE3DSYMBOL_H
18 
19 #include "qgis_3d.h"
20 
21 #include "qgsabstract3dsymbol.h"
23 #include "qgs3dutils.h"
24 
25 
31 class _3D_EXPORT QgsLine3DSymbol : public QgsAbstract3DSymbol
32 {
33  public:
35  QgsLine3DSymbol() = default;
36 
37  QString type() const override { return "line"; }
38  QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
39 
40  void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
41  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
42 
44  AltitudeClamping altitudeClamping() const { return mAltClamping; }
46  void setAltitudeClamping( AltitudeClamping altClamping ) { mAltClamping = altClamping; }
47 
49  AltitudeBinding altitudeBinding() const { return mAltBinding; }
51  void setAltitudeBinding( AltitudeBinding altBinding ) { mAltBinding = altBinding; }
52 
54  float width() const { return mWidth; }
56  void setWidth( float width ) { mWidth = width; }
57 
59  float height() const { return mHeight; }
61  void setHeight( float height ) { mHeight = height; }
62 
64  float extrusionHeight() const { return mExtrusionHeight; }
66  void setExtrusionHeight( float extrusionHeight ) { mExtrusionHeight = extrusionHeight; }
67 
69  QgsPhongMaterialSettings material() const { return mMaterial; }
71  void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; }
72 
73  private:
75  AltitudeClamping mAltClamping = AltClampRelative;
77  AltitudeBinding mAltBinding = AltBindCentroid;
78 
79  float mWidth = 2.0f;
80  float mHeight = 0.0f;
81  float mExtrusionHeight = 0.0f;
82  QgsPhongMaterialSettings mMaterial;
83 };
84 
85 
86 #endif // QGSLINE3DSYMBOL_H
AltitudeBinding altitudeBinding() const
Returns method that determines how altitude is bound to individual vertices.
The class is used as a container of context for various read/write operations on other objects...
Z_final = z_terrain + z_geometry.
Definition: qgs3dutils.h:31
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
void setAltitudeClamping(AltitudeClamping altClamping)
Sets method that determines altitude (whether to clamp to feature to terrain)
Clamp just centroid of feature.
Definition: qgs3dutils.h:40
void setHeight(float height)
Sets 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.
float height() const
Returns height (altitude) of the symbol (in map units)
void setExtrusionHeight(float extrusionHeight)
Sets extrusion height (in map units)
void setAltitudeBinding(AltitudeBinding altBinding)
Sets method that determines how altitude is bound to individual vertices.
float width() const
Returns width of the line symbol (in map units)
void setWidth(float width)
Sets width of the line symbol (in map units)
QgsPhongMaterialSettings material() const
Returns material used for shading of the symbol.
#define SIP_FACTORY
Definition: qgis_sip.h:69
3 3D symbol that draws linestring geometries as planar polygons (created from lines using a buffer wi...
AltitudeClamping
how to handle altitude of vector features
Definition: qgs3dutils.h:28
float extrusionHeight() const
Returns extrusion height (in map units)
void setMaterial(const QgsPhongMaterialSettings &material)
Sets material used for shading of the symbol.
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads symbol configuration from the given DOM element.
AltitudeClamping altitudeClamping() const
Returns method that determines altitude (whether to clamp to feature to terrain)
QString type() const override
Returns identifier of symbol type. Each 3D symbol implementation should return a different type...
AltitudeBinding
how to handle clamping of vertices of individual features
Definition: qgs3dutils.h:37