QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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"
22 #include "qgs3dtypes.h"
23 
25 
36 {
37  public:
40  ~QgsLine3DSymbol() override;
41 
47  static QgsAbstract3DSymbol *create() SIP_FACTORY;
48 
49  QString type() const override { return "line"; }
50  QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
51 
52  void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
53  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
54  QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const override;
55  void setDefaultPropertiesFromLayer( const QgsVectorLayer *layer ) override;
56 
58  Qgis::AltitudeClamping altitudeClamping() const { return mAltClamping; }
60  void setAltitudeClamping( Qgis::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
61 
63  Qgis::AltitudeBinding altitudeBinding() const { return mAltBinding; }
65  void setAltitudeBinding( Qgis::AltitudeBinding altBinding ) { mAltBinding = altBinding; }
66 
68  float width() const { return mWidth; }
70  void setWidth( float width ) { mWidth = width; }
71 
73  float height() const { return mHeight; }
75  void setHeight( float height ) { mHeight = height; }
76 
78  float extrusionHeight() const { return mExtrusionHeight; }
80  void setExtrusionHeight( float extrusionHeight ) { mExtrusionHeight = extrusionHeight; }
81 
83  bool renderAsSimpleLines() const { return mRenderAsSimpleLines; }
85  void setRenderAsSimpleLines( bool enabled ) { mRenderAsSimpleLines = enabled; }
86 
88  QgsAbstractMaterialSettings *material() const;
89 
95  void setMaterial( QgsAbstractMaterialSettings *material SIP_TRANSFER );
96 
101  bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const override SIP_SKIP;
102 
103  private:
108 
109  float mWidth = 2.0f;
110  float mHeight = 0.0f;
111  float mExtrusionHeight = 0.0f;
112  bool mRenderAsSimpleLines = false;
113  std::unique_ptr< QgsAbstractMaterialSettings > mMaterial;
114 };
115 
116 
117 #endif // QGSLINE3DSYMBOL_H
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
Qgis::AltitudeBinding::Centroid
@ Centroid
Clamp just centroid of feature.
QgsLine3DSymbol::setAltitudeBinding
void setAltitudeBinding(Qgis::AltitudeBinding altBinding)
Sets method that determines how altitude is bound to individual vertices.
Definition: qgsline3dsymbol.h:65
QgsLine3DSymbol::setWidth
void setWidth(float width)
Sets width of the line symbol (in map units)
Definition: qgsline3dsymbol.h:70
QgsLine3DSymbol::height
float height() const
Returns height (altitude) of the symbol (in map units)
Definition: qgsline3dsymbol.h:73
Qgis::AltitudeClamping::Relative
@ Relative
Elevation is relative to terrain height (final elevation = terrain elevation + feature elevation)
qgsabstract3dsymbol.h
QgsLine3DSymbol::renderAsSimpleLines
bool renderAsSimpleLines() const
Returns whether the renderer will render data with simple lines (otherwise it uses buffer)
Definition: qgsline3dsymbol.h:83
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsLine3DSymbol::setRenderAsSimpleLines
void setRenderAsSimpleLines(bool enabled)
Sets whether the renderer will render data with simple lines (otherwise it uses buffer)
Definition: qgsline3dsymbol.h:85
QgsAbstract3DSymbol
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Definition: qgsabstract3dsymbol.h:46
Qgis::AltitudeBinding
AltitudeBinding
Altitude binding.
Definition: qgis.h:1770
Qgs3DSceneExporter
Entity that handles the exporting of 3D scene.
Definition: qgs3dsceneexporter.h:55
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsAbstractMaterialSettings
Abstract base class for material settings.
Definition: qgsabstractmaterialsettings.h:114
QgsLine3DSymbol
3D symbol that draws linestring geometries as planar polygons (created from lines using a buffer with...
Definition: qgsline3dsymbol.h:35
QgsLine3DSymbol::setAltitudeClamping
void setAltitudeClamping(Qgis::AltitudeClamping altClamping)
Sets method that determines altitude (whether to clamp to feature to terrain)
Definition: qgsline3dsymbol.h:60
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsLine3DSymbol::setExtrusionHeight
void setExtrusionHeight(float extrusionHeight)
Sets extrusion height (in map units)
Definition: qgsline3dsymbol.h:80
qgs3dtypes.h
QgsAbstract3DSymbol::clone
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
QgsLine3DSymbol::type
QString type() const override
Definition: qgsline3dsymbol.h:49
QgsLine3DSymbol::extrusionHeight
float extrusionHeight() const
Returns extrusion height (in map units)
Definition: qgsline3dsymbol.h:78
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
QgsLine3DSymbol::altitudeBinding
Qgis::AltitudeBinding altitudeBinding() const
Returns method that determines how altitude is bound to individual vertices.
Definition: qgsline3dsymbol.h:63
QgsLine3DSymbol::width
float width() const
Returns width of the line symbol (in map units)
Definition: qgsline3dsymbol.h:68
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
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
Qgis::AltitudeClamping
AltitudeClamping
Altitude clamping.
Definition: qgis.h:1757
QgsLine3DSymbol::setHeight
void setHeight(float height)
Sets height (altitude) of the symbol (in map units)
Definition: qgsline3dsymbol.h:75