QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsvectorlayerelevationproperties.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayerelevationproperties.cpp
3  ---------------
4  begin : February 2022
5  copyright : (C) 2022 by Nyall Dawson
6  email : nyall dot dawson dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
19 #include "qgslinesymbol.h"
20 #include "qgsfillsymbol.h"
21 #include "qgsmarkersymbol.h"
22 #include "qgssymbollayerutils.h"
23 #include "qgslinesymbollayer.h"
24 #include "qgsfillsymbollayer.h"
25 #include "qgsmarkersymbollayer.h"
26 #include "qgsapplication.h"
27 #include "qgscolorschemeregistry.h"
28 #include "qgsvectorlayer.h"
29 
32 {
34  setDefaultProfileLineSymbol( color );
35  setDefaultProfileFillSymbol( color );
36  setDefaultProfileMarkerSymbol( color );
37 }
38 
40 
42 {
43  // layer is always considered as having elevation -- even if no z values are present or any
44  // offset/extrusion etc is set, then we are still considering the features as sitting on the terrain
45  // height
46  return true;
47 }
48 
49 QDomElement QgsVectorLayerElevationProperties::writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context )
50 {
51  QDomElement element = document.createElement( QStringLiteral( "elevation" ) );
52  writeCommonProperties( element, document, context );
53 
54  element.setAttribute( QStringLiteral( "extrusionEnabled" ), mEnableExtrusion ? QStringLiteral( "1" ) : QStringLiteral( "0" ) );
55  element.setAttribute( QStringLiteral( "extrusion" ), qgsDoubleToString( mExtrusionHeight ) );
56  element.setAttribute( QStringLiteral( "clamping" ), qgsEnumValueToKey( mClamping ) );
57  element.setAttribute( QStringLiteral( "binding" ), qgsEnumValueToKey( mBinding ) );
58  element.setAttribute( QStringLiteral( "type" ), qgsEnumValueToKey( mType ) );
59  element.setAttribute( QStringLiteral( "symbology" ), qgsEnumValueToKey( mSymbology ) );
60  element.setAttribute( QStringLiteral( "respectLayerSymbol" ), mRespectLayerSymbology ? QStringLiteral( "1" ) : QStringLiteral( "0" ) );
61  element.setAttribute( QStringLiteral( "showMarkerSymbolInSurfacePlots" ), mShowMarkerSymbolInSurfacePlots ? QStringLiteral( "1" ) : QStringLiteral( "0" ) );
62 
63  QDomElement profileLineSymbolElement = document.createElement( QStringLiteral( "profileLineSymbol" ) );
64  profileLineSymbolElement.appendChild( QgsSymbolLayerUtils::saveSymbol( QString(), mProfileLineSymbol.get(), document, context ) );
65  element.appendChild( profileLineSymbolElement );
66 
67  QDomElement profileFillSymbolElement = document.createElement( QStringLiteral( "profileFillSymbol" ) );
68  profileFillSymbolElement.appendChild( QgsSymbolLayerUtils::saveSymbol( QString(), mProfileFillSymbol.get(), document, context ) );
69  element.appendChild( profileFillSymbolElement );
70 
71  QDomElement profileMarkerSymbolElement = document.createElement( QStringLiteral( "profileMarkerSymbol" ) );
72  profileMarkerSymbolElement.appendChild( QgsSymbolLayerUtils::saveSymbol( QString(), mProfileMarkerSymbol.get(), document, context ) );
73  element.appendChild( profileMarkerSymbolElement );
74 
75  parentElement.appendChild( element );
76  return element;
77 }
78 
79 bool QgsVectorLayerElevationProperties::readXml( const QDomElement &element, const QgsReadWriteContext &context )
80 {
81  const QDomElement elevationElement = element.firstChildElement( QStringLiteral( "elevation" ) ).toElement();
82  if ( elevationElement.isNull() )
83  return false;
84 
85  readCommonProperties( elevationElement, context );
86 
87  mClamping = qgsEnumKeyToValue( elevationElement.attribute( QStringLiteral( "clamping" ) ), Qgis::AltitudeClamping::Terrain );
88  mBinding = qgsEnumKeyToValue( elevationElement.attribute( QStringLiteral( "binding" ) ), Qgis::AltitudeBinding::Centroid );
89  mType = qgsEnumKeyToValue( elevationElement.attribute( QStringLiteral( "type" ) ), Qgis::VectorProfileType::IndividualFeatures );
90  mEnableExtrusion = elevationElement.attribute( QStringLiteral( "extrusionEnabled" ), QStringLiteral( "0" ) ).toInt();
91  mExtrusionHeight = elevationElement.attribute( QStringLiteral( "extrusion" ), QStringLiteral( "0" ) ).toDouble();
92  mSymbology = qgsEnumKeyToValue( elevationElement.attribute( QStringLiteral( "symbology" ) ), Qgis::ProfileSurfaceSymbology::Line );
93  mShowMarkerSymbolInSurfacePlots = elevationElement.attribute( QStringLiteral( "showMarkerSymbolInSurfacePlots" ), QStringLiteral( "0" ) ).toInt();
94 
95  mRespectLayerSymbology = elevationElement.attribute( QStringLiteral( "respectLayerSymbol" ), QStringLiteral( "1" ) ).toInt();
96 
98 
99  const QDomElement profileLineSymbolElement = elevationElement.firstChildElement( QStringLiteral( "profileLineSymbol" ) ).firstChildElement( QStringLiteral( "symbol" ) );
100  mProfileLineSymbol.reset( QgsSymbolLayerUtils::loadSymbol< QgsLineSymbol >( profileLineSymbolElement, context ) );
101  if ( !mProfileLineSymbol )
102  setDefaultProfileLineSymbol( color );
103 
104  const QDomElement profileFillSymbolElement = elevationElement.firstChildElement( QStringLiteral( "profileFillSymbol" ) ).firstChildElement( QStringLiteral( "symbol" ) );
105  mProfileFillSymbol.reset( QgsSymbolLayerUtils::loadSymbol< QgsFillSymbol >( profileFillSymbolElement, context ) );
106  if ( !mProfileFillSymbol )
107  setDefaultProfileFillSymbol( color );
108 
109  const QDomElement profileMarkerSymbolElement = elevationElement.firstChildElement( QStringLiteral( "profileMarkerSymbol" ) ).firstChildElement( QStringLiteral( "symbol" ) );
110  mProfileMarkerSymbol.reset( QgsSymbolLayerUtils::loadSymbol< QgsMarkerSymbol >( profileMarkerSymbolElement, context ) );
111  if ( !mProfileMarkerSymbol )
112  setDefaultProfileMarkerSymbol( color );
113 
114  return true;
115 }
116 
118 {
119  QgsVectorLayer *vlayer = qobject_cast< QgsVectorLayer * >( layer );
120  if ( !vlayer )
121  return;
122 
123  mZOffset = 0;
124  mZScale = 1;
125 
126  mEnableExtrusion = false;
127  mExtrusionHeight = 0;
128 
130 
132 
133  if ( QgsWkbTypes::hasZ( vlayer->wkbType() ) )
134  {
136  }
137  else
138  {
140  }
141 }
142 
144 {
145  std::unique_ptr< QgsVectorLayerElevationProperties > res = std::make_unique< QgsVectorLayerElevationProperties >( nullptr );
146  res->setClamping( mClamping );
147  res->setBinding( mBinding );
148  res->setType( mType );
149  res->setExtrusionEnabled( mEnableExtrusion );
150  res->setExtrusionHeight( mExtrusionHeight );
151  res->setProfileLineSymbol( mProfileLineSymbol->clone() );
152  res->setProfileFillSymbol( mProfileFillSymbol->clone() );
153  res->setProfileMarkerSymbol( mProfileMarkerSymbol->clone() );
154  res->setRespectLayerSymbology( mRespectLayerSymbology );
155  res->setProfileSymbology( mSymbology );
156  res->setShowMarkerSymbolInSurfacePlots( mShowMarkerSymbolInSurfacePlots );
157  res->copyCommonProperties( this );
158  return res.release();
159 }
160 
162 {
163  QStringList properties;
164 
165  switch ( mClamping )
166  {
168  properties << tr( "Clamped to Terrain" );
169  break;
171  properties << tr( "Relative to Terrain" );
172  break;
174  properties << tr( "Absolute" );
175  break;
176  }
177 
178  if ( mDataDefinedProperties.isActive( Property::ZOffset ) )
179  {
180  switch ( mDataDefinedProperties.property( Property::ZOffset ).propertyType() )
181  {
184  break;
186  properties << tr( "Offset: %1" ).arg( mDataDefinedProperties.property( Property::ZOffset ).field() );
187  break;
189  properties << tr( "Offset: %1" ).arg( mDataDefinedProperties.property( Property::ZOffset ).expressionString() );
190  break;
191  }
192  }
193  else
194  {
195  properties << tr( "Offset: %1" ).arg( mZOffset );
196  }
197 
198  if ( mEnableExtrusion )
199  {
200  if ( mDataDefinedProperties.isActive( Property::ExtrusionHeight ) )
201  {
202  switch ( mDataDefinedProperties.property( Property::ExtrusionHeight ).propertyType() )
203  {
206  break;
208  properties << tr( "Extrusion: %1" ).arg( mDataDefinedProperties.property( Property::ExtrusionHeight ).field() );
209  break;
211  properties << tr( "Extrusion: %1" ).arg( mDataDefinedProperties.property( Property::ExtrusionHeight ).expressionString() );
212  break;
213  }
214  }
215  else
216  {
217  properties << tr( "Extrusion: %1" ).arg( mExtrusionHeight );
218  }
219  }
220 
221  properties << tr( "Scale: %1" ).arg( mZScale );
222 
223  return QStringLiteral( "<li>%1</li>" ).arg( properties.join( QLatin1String( "</li><li>" ) ) );
224 }
225 
227 {
228  // TODO -- test actual layer z range
229  return true;
230 }
231 
233 {
234  // TODO -- determine actual z range from layer statistics
235  return QgsDoubleRange();
236 }
237 
239 {
240  // show by default if the features aren't just directly clamped onto the terrain with
241  // no other changes
242  return !qgsDoubleNear( mZOffset, 0 )
243  || !qgsDoubleNear( mZScale, 1 )
244  || mEnableExtrusion
245  || mClamping != Qgis::AltitudeClamping::Terrain;
246 }
247 
249 {
250  if ( mClamping == clamping )
251  return;
252 
253  mClamping = clamping;
254  emit changed();
256 }
257 
259 {
260  if ( mBinding == binding )
261  return;
262 
263  mBinding = binding;
264  emit changed();
266 }
267 
269 {
270  if ( type == mType )
271  return;
272 
273  mType = type;
274  emit changed();
276 }
277 
279 {
280  if ( mEnableExtrusion == enabled )
281  return;
282 
283  mEnableExtrusion = enabled;
284  emit changed();
286 }
287 
289 {
290  if ( mExtrusionHeight == height )
291  return;
292 
293  mExtrusionHeight = height;
294  emit changed();
296 }
297 
299 {
300  if ( mRespectLayerSymbology == enabled )
301  return;
302 
303  mRespectLayerSymbology = enabled;
304  emit changed();
306 }
307 
309 {
310  return mProfileLineSymbol.get();
311 }
312 
314 {
315  mProfileLineSymbol.reset( symbol );
316  emit changed();
318 }
319 
321 {
322  return mProfileFillSymbol.get();
323 }
324 
326 {
327  mProfileFillSymbol.reset( symbol );
328  emit changed();
330 }
331 
333 {
334  return mProfileMarkerSymbol.get();
335 }
336 
338 {
339  mProfileMarkerSymbol.reset( symbol );
340  emit changed();
342 }
343 
345 {
346  if ( mSymbology == symbology )
347  return;
348 
349  mSymbology = symbology;
350  emit changed();
352 }
353 
355 {
356  if ( show == mShowMarkerSymbolInSurfacePlots )
357  return;
358 
359  mShowMarkerSymbolInSurfacePlots = show;
360  emit changed();
362 }
363 
364 void QgsVectorLayerElevationProperties::setDefaultProfileLineSymbol( const QColor &color )
365 {
366  std::unique_ptr< QgsSimpleLineSymbolLayer > profileLineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( color, 0.6 );
367  mProfileLineSymbol = std::make_unique< QgsLineSymbol>( QgsSymbolLayerList( { profileLineLayer.release() } ) );
368 }
369 
370 void QgsVectorLayerElevationProperties::setDefaultProfileMarkerSymbol( const QColor &color )
371 {
372  std::unique_ptr< QgsSimpleMarkerSymbolLayer > profileMarkerLayer = std::make_unique< QgsSimpleMarkerSymbolLayer >( Qgis::MarkerShape::Diamond, 3 );
373  profileMarkerLayer->setColor( color );
374  profileMarkerLayer->setStrokeWidth( 0.2 );
375  profileMarkerLayer->setStrokeColor( color.darker( 140 ) );
376  mProfileMarkerSymbol = std::make_unique< QgsMarkerSymbol>( QgsSymbolLayerList( { profileMarkerLayer.release() } ) );
377 }
378 
379 void QgsVectorLayerElevationProperties::setDefaultProfileFillSymbol( const QColor &color )
380 {
381  std::unique_ptr< QgsSimpleFillSymbolLayer > profileFillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( color );
382  profileFillLayer->setStrokeWidth( 0.2 );
383  profileFillLayer->setStrokeColor( color.darker( 140 ) );
384  mProfileFillSymbol = std::make_unique< QgsFillSymbol>( QgsSymbolLayerList( { profileFillLayer.release() } ) );
385 }
QgsVectorLayerElevationProperties::setProfileMarkerSymbol
void setProfileMarkerSymbol(QgsMarkerSymbol *symbol)
Sets the marker symbol used to render points for the layer in elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:337
QgsVectorLayerElevationProperties::setBinding
void setBinding(Qgis::AltitudeBinding binding)
Sets the altitude binding method, which determines how altitude is bound to individual vertices in fe...
Definition: qgsvectorlayerelevationproperties.cpp:258
Qgis::AltitudeClamping::Terrain
@ Terrain
Elevation is clamped to terrain (final elevation = terrain elevation)
QgsVectorLayerElevationProperties::~QgsVectorLayerElevationProperties
~QgsVectorLayerElevationProperties() override
qgsEnumValueToKey
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
Definition: qgis.h:2440
QgsVectorLayer::wkbType
Q_INVOKABLE QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
Definition: qgsvectorlayer.cpp:725
QgsColorSchemeRegistry::fetchRandomStyleColor
QColor fetchRandomStyleColor() const
Returns a random color for use with a new symbol style (e.g.
Definition: qgscolorschemeregistry.cpp:141
QgsVectorLayerElevationProperties::setProfileLineSymbol
void setProfileLineSymbol(QgsLineSymbol *symbol)
Sets the line symbol used to render lines for the layer in elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:313
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsVectorLayerElevationProperties::type
Qgis::VectorProfileType type() const
Returns the type of profile the layer represents.
Definition: qgsvectorlayerelevationproperties.h:100
Qgis::AltitudeBinding::Centroid
@ Centroid
Clamp just centroid of feature.
QgsMapLayerElevationProperties
Base class for storage of map layer elevation properties.
Definition: qgsmaplayerelevationproperties.h:41
Qgis::ProfileSurfaceSymbology
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition: qgis.h:1849
QgsProperty::FieldBasedProperty
@ FieldBasedProperty
Field based property (QgsFieldBasedProperty)
Definition: qgsproperty.h:239
QgsVectorLayerElevationProperties::setExtrusionEnabled
void setExtrusionEnabled(bool enabled)
Sets whether extrusion is enabled.
Definition: qgsvectorlayerelevationproperties.cpp:278
qgssymbollayerutils.h
qgsmarkersymbollayer.h
QgsApplication::colorSchemeRegistry
static QgsColorSchemeRegistry * colorSchemeRegistry()
Returns the application's color scheme registry, used for managing color schemes.
Definition: qgsapplication.cpp:2310
QgsVectorLayerElevationProperties::setRespectLayerSymbology
void setRespectLayerSymbology(bool enabled)
Sets whether layer symbology should be respected when rendering elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:298
Qgis::AltitudeClamping::Relative
@ Relative
Elevation is relative to terrain height (final elevation = terrain elevation + feature elevation)
QgsProperty::propertyType
Type propertyType() const
Returns the property type.
Definition: qgsproperty.cpp:286
QgsPropertyCollection::clear
void clear() override
Removes all properties from the collection.
Definition: qgspropertycollection.cpp:178
QgsVectorLayerElevationProperties::clamping
Qgis::AltitudeClamping clamping() const
Returns the altitude clamping method, which dictates how feature heights are interpreted with respect...
Definition: qgsvectorlayerelevationproperties.h:67
qgsDoubleToString
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Definition: qgis.h:2204
QgsVectorLayerElevationProperties::setProfileFillSymbol
void setProfileFillSymbol(QgsFillSymbol *symbol)
Sets the fill symbol used to render polygons for the layer in elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:325
QgsMapLayerElevationProperties::readCommonProperties
void readCommonProperties(const QDomElement &element, const QgsReadWriteContext &context)
Reads common class properties from a DOM element previously written by writeXml().
Definition: qgsmaplayerelevationproperties.cpp:54
QgsPropertyCollection::property
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
Definition: qgspropertycollection.cpp:214
QgsProperty::expressionString
QString expressionString() const
Returns the expression used for the property value.
Definition: qgsproperty.cpp:389
QgsVectorLayerElevationProperties::hasElevation
bool hasElevation() const override
Returns true if the layer has an elevation or z component.
Definition: qgsvectorlayerelevationproperties.cpp:41
QgsVectorLayerElevationProperties::setProfileSymbology
void setProfileSymbology(Qgis::ProfileSurfaceSymbology symbology)
Sets the symbology option used to render the vector profile in elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:344
Qgis::ProfileSurfaceSymbology::Line
@ Line
The elevation surface will be rendered using a line symbol.
qgsapplication.h
QgsVectorLayerElevationProperties::setClamping
void setClamping(Qgis::AltitudeClamping clamping)
Sets the altitude clamping method, which dictates how feature heights are interpreted with respect to...
Definition: qgsvectorlayerelevationproperties.cpp:248
QgsVectorLayerElevationProperties::showByDefaultInElevationProfilePlots
bool showByDefaultInElevationProfilePlots() const override
Returns true if the layer should be visible by default in newly created elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:238
QgsProperty::ExpressionBasedProperty
@ ExpressionBasedProperty
Expression based property (QgsExpressionBasedProperty)
Definition: qgsproperty.h:240
Qgis::AltitudeBinding
AltitudeBinding
Altitude binding.
Definition: qgis.h:1770
QgsVectorLayerElevationProperties::profileFillSymbol
QgsFillSymbol * profileFillSymbol() const
Returns the symbol used to render polygons for the layer in elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:320
QgsVectorLayerElevationProperties::isVisibleInZRange
bool isVisibleInZRange(const QgsDoubleRange &range) const override
Returns true if the layer should be visible and rendered for the specified z range.
Definition: qgsvectorlayerelevationproperties.cpp:226
Qgis::MarkerShape::Diamond
@ Diamond
Diamond.
QgsMarkerSymbol
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition: qgsmarkersymbol.h:30
qgsDoubleNear
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2265
Qgis::VectorProfileType::IndividualFeatures
@ IndividualFeatures
Treat each feature as an individual object (eg buildings)
QgsMapLayerElevationProperties::mDataDefinedProperties
QgsPropertyCollection mDataDefinedProperties
Property collection for data defined elevation settings.
Definition: qgsmaplayerelevationproperties.h:302
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgslinesymbol.h:29
Qgis::VectorProfileType
VectorProfileType
Types of elevation profiles to generate for vector sources.
Definition: qgis.h:1861
QgsVectorLayerElevationProperties
Vector layer specific subclass of QgsMapLayerElevationProperties.
Definition: qgsvectorlayerelevationproperties.h:38
QgsVectorLayerElevationProperties::setShowMarkerSymbolInSurfacePlots
void setShowMarkerSymbolInSurfacePlots(bool show)
Sets whehter the marker symbol should also be shown in continuous surface plots.
Definition: qgsvectorlayerelevationproperties.cpp:354
QgsMapLayerElevationProperties::mZOffset
double mZOffset
Z offset.
Definition: qgsmaplayerelevationproperties.h:299
QgsVectorLayerElevationProperties::writeXml
QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) override
Writes the properties to a DOM element, to be used later with readXml().
Definition: qgsvectorlayerelevationproperties.cpp:49
qgsfillsymbollayer.h
QgsMapLayerElevationProperties::profileGenerationPropertyChanged
void profileGenerationPropertyChanged()
Emitted when any of the elevation properties which relate solely to generation of elevation profiles ...
qgsvectorlayer.h
QgsMapLayerElevationProperties::profileRenderingPropertyChanged
void profileRenderingPropertyChanged()
Emitted when any of the elevation properties which relate solely to presentation of elevation results...
QgsVectorLayerElevationProperties::clone
QgsVectorLayerElevationProperties * clone() const override
Creates a clone of the properties.
Definition: qgsvectorlayerelevationproperties.cpp:143
QgsDoubleRange
QgsRange which stores a range of double values.
Definition: qgsrange.h:202
qgslinesymbollayer.h
qgsvectorlayerelevationproperties.h
QgsVectorLayerElevationProperties::setExtrusionHeight
void setExtrusionHeight(double height)
Sets the feature extrusion height.
Definition: qgsvectorlayerelevationproperties.cpp:288
QgsMapLayerElevationProperties::mZScale
double mZScale
Z scale.
Definition: qgsmaplayerelevationproperties.h:297
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsSymbolLayerList
QList< QgsSymbolLayer * > QgsSymbolLayerList
Definition: qgssymbol.h:27
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition: qgsmaplayer.h:72
qgsmarkersymbol.h
QgsProperty::field
QString field() const
Returns the current field name the property references.
Definition: qgsproperty.cpp:357
qgsEnumKeyToValue
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true, bool *returnOk=nullptr)
Returns the value corresponding to the given key of an enum.
Definition: qgis.h:2459
QgsVectorLayerElevationProperties::QgsVectorLayerElevationProperties
QgsVectorLayerElevationProperties(QObject *parent)
Constructor for QgsVectorLayerElevationProperties, with the specified parent object.
Definition: qgsvectorlayerelevationproperties.cpp:30
QgsFillSymbol
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgsfillsymbol.h:29
qgscolorschemeregistry.h
QgsVectorLayerElevationProperties::readXml
bool readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads the elevation properties from a DOM element previously written by writeXml().
Definition: qgsvectorlayerelevationproperties.cpp:79
QgsMapLayerElevationProperties::changed
void changed()
Emitted when any of the elevation properties have changed.
QgsWkbTypes::hasZ
static bool hasZ(Type type) SIP_HOLDGIL
Tests whether a WKB type contains the z-dimension.
Definition: qgswkbtypes.h:1080
QgsVectorLayerElevationProperties::binding
Qgis::AltitudeBinding binding() const
Returns the altitude binding method, which determines how altitude is bound to individual vertices in...
Definition: qgsvectorlayerelevationproperties.h:84
Qgis::AltitudeClamping::Absolute
@ Absolute
Elevation is taken directly from feature and is independent of terrain height (final elevation = feat...
QgsMapLayerElevationProperties::writeCommonProperties
void writeCommonProperties(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)
Writes common class properties to a DOM element, to be used later with readXml().
Definition: qgsmaplayerelevationproperties.cpp:44
QgsVectorLayerElevationProperties::setType
void setType(Qgis::VectorProfileType type)
Sets the type of profile the layer represents.
Definition: qgsvectorlayerelevationproperties.cpp:268
QgsProperty::StaticProperty
@ StaticProperty
Static property (QgsStaticProperty)
Definition: qgsproperty.h:238
QgsPropertyCollection::isActive
bool isActive(int key) const override
Returns true if the collection contains an active property with the specified key.
Definition: qgspropertycollection.cpp:268
Qgis::AltitudeClamping
AltitudeClamping
Altitude clamping.
Definition: qgis.h:1757
qgsfillsymbol.h
QgsVectorLayerElevationProperties::htmlSummary
QString htmlSummary() const override
Returns a HTML formatted summary of the properties.
Definition: qgsvectorlayerelevationproperties.cpp:161
QgsVectorLayerElevationProperties::profileMarkerSymbol
QgsMarkerSymbol * profileMarkerSymbol() const
Returns the symbol used to render points for the layer in elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:332
QgsSymbolLayerUtils::saveSymbol
static QDomElement saveSymbol(const QString &symbolName, const QgsSymbol *symbol, QDomDocument &doc, const QgsReadWriteContext &context)
Writes a symbol definition to XML.
Definition: qgssymbollayerutils.cpp:1397
QgsVectorLayerElevationProperties::setDefaultsFromLayer
void setDefaultsFromLayer(QgsMapLayer *layer) override
Sets default properties based on sensible choices for the given map layer.
Definition: qgsvectorlayerelevationproperties.cpp:117
QgsVectorLayerElevationProperties::profileLineSymbol
QgsLineSymbol * profileLineSymbol() const
Returns the symbol used to render lines for the layer in elevation profile plots.
Definition: qgsvectorlayerelevationproperties.cpp:308
QgsVectorLayerElevationProperties::calculateZRange
QgsDoubleRange calculateZRange(QgsMapLayer *layer) const override
Attempts to calculate the overall elevation or z range for the specified layer, using the settings de...
Definition: qgsvectorlayerelevationproperties.cpp:232
QgsProperty::InvalidProperty
@ InvalidProperty
Invalid (not set) property.
Definition: qgsproperty.h:237
qgslinesymbol.h