QGIS API Documentation 3.99.0-Master (a8f284845db)
Loading...
Searching...
No Matches
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#include "qgsabstract3dsymbol.h"
21
23
33{
34 public:
36 ~QgsLine3DSymbol() override;
37
44
45 QString type() const override { return "line"; }
46 QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
47
48 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
49 void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
50 QList<Qgis::GeometryType> compatibleGeometryTypes() const override;
51 void setDefaultPropertiesFromLayer( const QgsVectorLayer *layer ) override;
52
54 Qgis::AltitudeClamping altitudeClamping() const { return mAltClamping; }
56 void setAltitudeClamping( Qgis::AltitudeClamping altClamping ) { mAltClamping = altClamping; }
57
59 Qgis::AltitudeBinding altitudeBinding() const { return mAltBinding; }
61 void setAltitudeBinding( Qgis::AltitudeBinding altBinding ) { mAltBinding = altBinding; }
62
64 float width() const { return mWidth; }
66 void setWidth( float width ) { mWidth = width; }
67
73 Q_DECL_DEPRECATED float height() const SIP_DEPRECATED { return mOffset; }
74
80 Q_DECL_DEPRECATED void setHeight( float height ) SIP_DEPRECATED { mOffset = height; }
81
87 float offset() const { return mOffset; }
88
94 void setOffset( float offset ) { mOffset = offset; }
95
97 float extrusionHeight() const { return mExtrusionHeight; }
99 void setExtrusionHeight( float extrusionHeight ) { mExtrusionHeight = extrusionHeight; }
100
102 bool renderAsSimpleLines() const { return mRenderAsSimpleLines; }
104 void setRenderAsSimpleLines( bool enabled ) { mRenderAsSimpleLines = enabled; }
105
107 QgsAbstractMaterialSettings *materialSettings() const;
108
114 void setMaterialSettings( QgsAbstractMaterialSettings *materialSettings SIP_TRANSFER );
115
120 bool exportGeometries( Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix ) const override SIP_SKIP;
121
122 private:
127
128 float mWidth = 2.0f;
129 float mOffset = 0.0f;
130 float mExtrusionHeight = 0.0f;
131 bool mRenderAsSimpleLines = false;
132 std::unique_ptr<QgsAbstractMaterialSettings> mMaterialSettings;
133};
134
135
136#endif // QGSLINE3DSYMBOL_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:59
AltitudeClamping
Altitude clamping.
Definition qgis.h:4068
@ Absolute
Elevation is taken directly from feature and is independent of terrain height (final elevation = feat...
Definition qgis.h:4069
AltitudeBinding
Altitude binding.
Definition qgis.h:4081
@ Centroid
Clamp just centroid of feature.
Definition qgis.h:4083
Entity that handles the exporting of 3D scenes.
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
virtual bool exportGeometries(Qgs3DSceneExporter *exporter, Qt3DCore::QEntity *entity, const QString &objectNamePrefix) const
Exports the geometries contained within the hierarchy of entity.
virtual QgsAbstract3DSymbol * clone() const =0
Returns a new instance of the symbol with the same settings.
Abstract base class for material settings.
bool renderAsSimpleLines() const
Returns whether the renderer will render data with simple lines (otherwise it uses buffer).
void setAltitudeBinding(Qgis::AltitudeBinding altBinding)
Sets method that determines how altitude is bound to individual vertices.
void setOffset(float offset)
Sets vertical offset of the symbol (in map units).
Q_DECL_DEPRECATED float height() const SIP_DEPRECATED
Returns height (altitude) of the symbol (in map units).
QString type() const override
float width() const
Returns width of the line symbol (in map units).
Qgis::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).
Qgis::AltitudeBinding altitudeBinding() const
Returns method that determines how altitude is bound to individual vertices.
void setExtrusionHeight(float extrusionHeight)
Sets extrusion height (in map units).
Q_DECL_DEPRECATED void setHeight(float height) SIP_DEPRECATED
Sets height (altitude) of the symbol (in map units).
~QgsLine3DSymbol() override
void setRenderAsSimpleLines(bool enabled)
Sets whether the renderer will render data with simple lines (otherwise it uses buffer).
float extrusionHeight() const
Returns extrusion height (in map units).
static QgsAbstract3DSymbol * create() SIP_FACTORY
Creates a new QgsLine3DSymbol.
float offset() const
Returns vertical offset of the symbol (in map units).
void setAltitudeClamping(Qgis::AltitudeClamping altClamping)
Sets method that determines altitude (whether to clamp to feature to terrain).
A container for the context for various read/write operations on objects.
Represents a vector layer which manages a vector based dataset.
#define SIP_DEPRECATED
Definition qgis_sip.h:113
#define SIP_SKIP
Definition qgis_sip.h:133
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_FACTORY
Definition qgis_sip.h:83
#define SIP_NODEFAULTCTORS
Definition qgis_sip.h:108