QGIS API Documentation  3.6.0-Noosa (5873452)
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 "qgs3dtypes.h"
24 
25 
35 class _3D_EXPORT QgsLine3DSymbol : public QgsAbstract3DSymbol
36 {
37  public:
39  QgsLine3DSymbol() = default;
40 
41  QString type() const override { return "line"; }
42  QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
43 
44  void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
45  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
46 
48  Qgs3DTypes::AltitudeClamping altitudeClamping() const { return mAltClamping; }
50  void setAltitudeClamping( Qgs3DTypes::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
51 
53  Qgs3DTypes::AltitudeBinding altitudeBinding() const { return mAltBinding; }
55  void setAltitudeBinding( Qgs3DTypes::AltitudeBinding altBinding ) { mAltBinding = altBinding; }
56 
58  float width() const { return mWidth; }
60  void setWidth( float width ) { mWidth = width; }
61 
63  float height() const { return mHeight; }
65  void setHeight( float height ) { mHeight = height; }
66 
68  float extrusionHeight() const { return mExtrusionHeight; }
70  void setExtrusionHeight( float extrusionHeight ) { mExtrusionHeight = extrusionHeight; }
71 
73  bool renderAsSimpleLines() const { return mRenderAsSimpleLines; }
75  void setRenderAsSimpleLines( bool enabled ) { mRenderAsSimpleLines = enabled; }
76 
78  QgsPhongMaterialSettings material() const { return mMaterial; }
80  void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; }
81 
82  private:
87 
88  float mWidth = 2.0f;
89  float mHeight = 0.0f;
90  float mExtrusionHeight = 0.0f;
91  bool mRenderAsSimpleLines = false;
92  QgsPhongMaterialSettings mMaterial;
93 };
94 
95 
96 #endif // QGSLINE3DSYMBOL_H
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 setRenderAsSimpleLines(bool enabled)
Sets whether the renderer will render data with simple lines (otherwise it uses buffer) ...
Qgs3DTypes::AltitudeBinding altitudeBinding() const
Returns method that determines how altitude is bound to individual vertices.
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
void setAltitudeBinding(Qgs3DTypes::AltitudeBinding altBinding)
Sets method that determines how altitude is bound to individual vertices.
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.
void setAltitudeClamping(Qgs3DTypes::AltitudeClamping altClamping)
Sets method that determines altitude (whether to clamp to feature to terrain)
float height() const
Returns height (altitude) of the symbol (in map units)
void setExtrusionHeight(float extrusionHeight)
Sets extrusion height (in map units)
float width() const
Returns width of the line symbol (in map units)
Qgs3DTypes::AltitudeClamping altitudeClamping() const
Returns method that determines altitude (whether to clamp to feature to terrain)
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...
AltitudeBinding
how to handle clamping of vertices of individual features
Definition: qgs3dtypes.h:42
bool renderAsSimpleLines() const
Returns whether the renderer will render data with simple lines (otherwise it uses buffer) ...
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.
QString type() const override
Returns identifier of symbol type. Each 3D symbol implementation should return a different type...
Z_final = z_terrain + z_geometry.
Definition: qgs3dtypes.h:37
Clamp just centroid of feature.
Definition: qgs3dtypes.h:45