QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgsmeshrenderervectorsettingswidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshrenderervectorsettingswidget.cpp
3 ---------------------------------------
4 begin : June 2018
5 copyright : (C) 2018 by Peter Petrik
6 email : zilolv 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
17
18#include "qgis.h"
19#include "qgsmeshlayer.h"
20
21#include "moc_qgsmeshrenderervectorsettingswidget.cpp"
22
24 : QWidget( parent )
25{
26 setupUi( this );
27
28 QVector<QgsDoubleSpinBox *> widgets;
29 widgets << mMinMagSpinBox << mMaxMagSpinBox
30 << mHeadWidthSpinBox << mHeadLengthSpinBox
31 << mMinimumShaftSpinBox << mMaximumShaftSpinBox
32 << mScaleShaftByFactorOfSpinBox << mShaftLengthSpinBox
33 << mWindBarbLengthSpinBox << mWindBarbMagnitudeMultiplierSpinBox;
34
35 // Setup defaults and clear values for spin boxes
36 for ( const auto &widget : std::as_const( widgets ) )
37 {
38 widget->setClearValueMode( QgsDoubleSpinBox::ClearValueMode::MinimumValue );
39 widget->setSpecialValueText( QString() );
40 widget->setValue( widget->minimum() );
41 }
42
43 mShaftLengthComboBox->setCurrentIndex( -1 );
44
45 mColoringMethodComboBox->addItem( tr( "Single Color" ), QgsInterpolatedLineColor::SingleColor );
46 mColoringMethodComboBox->addItem( tr( "Color Ramp Shader" ), QgsInterpolatedLineColor::ColorRamp );
47
48 mXSpacingSpinBox->setClearValue( 10.0 );
49 mYSpacingSpinBox->setClearValue( 10.0 );
50 mStreamlinesDensitySpinBox->setClearValue( 15.0 );
51 mTracesParticlesCountSpinBox->setClearValue( 1000 );
52 mTracesMaxLengthSpinBox->setClearValue( 100.0 );
53
54 mWindBarbLengthSpinBox->setClearValue( 10.0 );
55 mWindBarbMagnitudeMultiplierSpinBox->setValue( 1.0 );
56 mWindBarbMagnitudeMultiplierSpinBox->setClearValue( 1.0 );
57
59 connect( mColoringMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged );
61 connect( mColorRampShaderMinimumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
62 connect( mColorRampShaderMaximumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
63
64 connect( mLineWidthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
65
66 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
67
68 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), mShaftOptionsStackedWidget, &QStackedWidget::setCurrentIndex );
69
70 connect( mDisplayVectorsOnGridGroupBox, &QGroupBox::toggled, this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
71
72 connect( mColorRampShaderLoadButton, &QPushButton::clicked, this, &QgsMeshRendererVectorSettingsWidget::loadColorRampShader );
73
74 onColoringMethodChanged();
75
76 for ( const auto &widget : std::as_const( widgets ) )
77 {
78 connect( widget, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
79 }
80
81 connect( mXSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
82 connect( mYSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
83
84 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::onSymbologyChanged );
85 onSymbologyChanged( 0 );
86
87 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
88
89 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged );
90 onStreamLineSeedingMethodChanged( 0 );
91
92 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
93
94 connect( mStreamlinesDensitySpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
95
96 connect( mTracesMaxLengthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
97
98 connect( mTracesParticlesCountSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
99
100 mTracesTailLengthMapUnitWidget->setUnits(
105 }
106 );
107
108 connect( mTracesTailLengthMapUnitWidget, &QgsUnitSelectionWidget::changed, this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
109
110 mWindBarbLengthMapUnitWidget->setUnits(
114 }
115 );
116
117 connect( mWindBarbLengthMapUnitWidget, &QgsUnitSelectionWidget::changed, this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
118 connect( mWindBarbUnitsComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::onWindBarbUnitsChanged );
119 onWindBarbUnitsChanged( 0 );
120}
121
123{
124 mMeshLayer = layer;
125}
126
128{
130 settings.setSymbology(
131 static_cast<QgsMeshRendererVectorSettings::Symbology>( mSymbologyVectorComboBox->currentIndex() )
132 );
133
134 //Arrow settings
136
137 // basic
138 settings.setColor( mColorWidget->color() );
139 settings.setLineWidth( mLineWidthSpinBox->value() );
140 settings.setColoringMethod( static_cast<QgsInterpolatedLineColor::ColoringMethod>( mColoringMethodComboBox->currentData().toInt() ) );
141 settings.setColorRampShader( mColorRampShaderWidget->shader() );
142
143 // filter by magnitude
144 double val = filterValue( mMinMagSpinBox, -1 );
145 settings.setFilterMin( val );
146
147 val = filterValue( mMaxMagSpinBox, -1 );
148 settings.setFilterMax( val );
149
150 // arrow head
151 val = filterValue( mHeadWidthSpinBox, arrowSettings.arrowHeadWidthRatio() * 100.0 );
152 arrowSettings.setArrowHeadWidthRatio( val / 100.0 );
153
154 val = filterValue( mHeadLengthSpinBox, arrowSettings.arrowHeadLengthRatio() * 100.0 );
155 arrowSettings.setArrowHeadLengthRatio( val / 100.0 );
156
157 // user grid
158 bool enabled = mDisplayVectorsOnGridGroupBox->isChecked();
159 settings.setOnUserDefinedGrid( enabled );
160 settings.setUserGridCellWidth( mXSpacingSpinBox->value() );
161 settings.setUserGridCellHeight( mYSpacingSpinBox->value() );
162
163 // shaft length
164 auto method = static_cast<QgsMeshRendererVectorArrowSettings::ArrowScalingMethod>( mShaftLengthComboBox->currentIndex() );
165 arrowSettings.setShaftLengthMethod( method );
166
167 val = filterValue( mMinimumShaftSpinBox, arrowSettings.minShaftLength() );
168 arrowSettings.setMinShaftLength( val );
169
170 val = filterValue( mMaximumShaftSpinBox, arrowSettings.maxShaftLength() );
171 arrowSettings.setMaxShaftLength( val );
172
173 val = filterValue( mScaleShaftByFactorOfSpinBox, arrowSettings.scaleFactor() );
174 arrowSettings.setScaleFactor( val );
175
176 val = filterValue( mShaftLengthSpinBox, arrowSettings.fixedShaftLength() );
177 arrowSettings.setFixedShaftLength( val );
178
179 settings.setArrowsSettings( arrowSettings );
180
181 //Streamline setting
183 streamlineSettings.setSeedingMethod(
184 static_cast<QgsMeshRendererVectorStreamlineSettings::SeedingStartPointsMethod>( mStreamlinesSeedingMethodComboBox->currentIndex() )
185 );
186
187 streamlineSettings.setSeedingDensity( mStreamlinesDensitySpinBox->value() / 100 );
188
189 settings.setStreamLinesSettings( streamlineSettings );
190
191 //Traces setting
193 tracesSettings.setMaximumTailLength( mTracesMaxLengthSpinBox->value() );
194 tracesSettings.setMaximumTailLengthUnit( mTracesTailLengthMapUnitWidget->unit() );
195 tracesSettings.setParticlesCount( mTracesParticlesCountSpinBox->value() );
196 settings.setTracesSettings( tracesSettings );
197
198 // Wind Barb settings
200 windBarbSettings.setShaftLength( mWindBarbLengthSpinBox->value() );
201 windBarbSettings.setShaftLengthUnits( mWindBarbLengthMapUnitWidget->unit() );
202 windBarbSettings.setMagnitudeUnits(
203 static_cast<QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit>( mWindBarbUnitsComboBox->currentIndex() )
204 );
205 windBarbSettings.setMagnitudeMultiplier( mWindBarbMagnitudeMultiplierSpinBox->value() );
206 settings.setWindBarbSettings( windBarbSettings );
207
208 return settings;
209}
210
212{
213 if ( !mMeshLayer || !mMeshLayer->dataProvider() )
214 return;
215
216 if ( mActiveDatasetGroup < 0 )
217 return;
218
219 bool hasFaces = ( mMeshLayer->dataProvider() && mMeshLayer->dataProvider()->contains( QgsMesh::ElementType::Face ) );
220
221 const QgsMeshRendererSettings rendererSettings = mMeshLayer->rendererSettings();
222 const QgsMeshRendererVectorSettings settings = rendererSettings.vectorSettings( mActiveDatasetGroup );
223
224 symbologyLabel->setVisible( hasFaces );
225 mSymbologyVectorComboBox->setVisible( hasFaces );
226 mSymbologyVectorComboBox->setCurrentIndex( hasFaces ? settings.symbology() : 0 );
227
228 // Arrow settings
229 const QgsMeshRendererVectorArrowSettings arrowSettings = settings.arrowSettings();
230
231 // basic
232 mColorWidget->setColor( settings.color() );
233 mLineWidthSpinBox->setValue( settings.lineWidth() );
234 mColoringMethodComboBox->setCurrentIndex( mColoringMethodComboBox->findData( settings.coloringMethod() ) );
235 mColorRampShaderWidget->setFromShader( settings.colorRampShader() );
236 mColorRampShaderMinimumSpinBox->setValue( settings.colorRampShader().minimumValue() );
237 mColorRampShaderMaximumSpinBox->setValue( settings.colorRampShader().maximumValue() );
238
239 // filter by magnitude
240 if ( settings.filterMin() > 0 )
241 {
242 mMinMagSpinBox->setValue( settings.filterMin() );
243 }
244 if ( settings.filterMax() > 0 )
245 {
246 mMaxMagSpinBox->setValue( settings.filterMax() );
247 }
248
249 // arrow head
250 mHeadWidthSpinBox->setValue( arrowSettings.arrowHeadWidthRatio() * 100.0 );
251 mHeadLengthSpinBox->setValue( arrowSettings.arrowHeadLengthRatio() * 100.0 );
252
253 // user grid
254 mDisplayVectorsOnGridGroupBox->setVisible( hasFaces );
255 mDisplayVectorsOnGridGroupBox->setChecked( settings.isOnUserDefinedGrid() && hasFaces );
256 mXSpacingSpinBox->setValue( settings.userGridCellWidth() );
257 mYSpacingSpinBox->setValue( settings.userGridCellHeight() );
258
259 // shaft length
260 mShaftLengthComboBox->setCurrentIndex( arrowSettings.shaftLengthMethod() );
261
262 mMinimumShaftSpinBox->setValue( arrowSettings.minShaftLength() );
263 mMaximumShaftSpinBox->setValue( arrowSettings.maxShaftLength() );
264 mScaleShaftByFactorOfSpinBox->setValue( arrowSettings.scaleFactor() );
265 mShaftLengthSpinBox->setValue( arrowSettings.fixedShaftLength() );
266
267 //Streamlines settings
268 const QgsMeshRendererVectorStreamlineSettings streamlinesSettings = settings.streamLinesSettings();
269
270 mStreamlinesSeedingMethodComboBox->setCurrentIndex( streamlinesSettings.seedingMethod() );
271 mStreamlinesDensitySpinBox->setValue( streamlinesSettings.seedingDensity() * 100 );
272
273 //Traces settings
274 const QgsMeshRendererVectorTracesSettings tracesSettings = settings.tracesSettings();
275
276 mTracesMaxLengthSpinBox->setValue( tracesSettings.maximumTailLength() );
277 mTracesTailLengthMapUnitWidget->setUnit( tracesSettings.maximumTailLengthUnit() );
278 mTracesParticlesCountSpinBox->setValue( tracesSettings.particlesCount() );
279
280 // Wind Barb settings
281 const QgsMeshRendererVectorWindBarbSettings windBarbSettings = settings.windBarbSettings();
282 mWindBarbLengthSpinBox->setValue( windBarbSettings.shaftLength() );
283 mWindBarbUnitsComboBox->setCurrentIndex( static_cast<int>( windBarbSettings.magnitudeUnits() ) );
285 mWindBarbMagnitudeMultiplierSpinBox->setValue( windBarbSettings.magnitudeMultiplier() );
286}
287
288void QgsMeshRendererVectorSettingsWidget::onSymbologyChanged( int currentIndex )
289{
290 mStreamlineWidget->setVisible( currentIndex == QgsMeshRendererVectorSettings::Streamlines );
291 mArrowLengthGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
292 mHeadOptionsGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
293 mTracesGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Traces );
294 mWindBarbGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::WindBarbs );
295
296 mDisplayVectorsOnGridGroupBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
297 filterByMagnitudeLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
298 minimumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
299 mMinMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
300 maximumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
301 mMaxMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
302
303 mDisplayVectorsOnGridGroupBox->setEnabled(
304 currentIndex == QgsMeshRendererVectorSettings::Arrows || currentIndex == QgsMeshRendererVectorSettings::WindBarbs || ( currentIndex == QgsMeshRendererVectorSettings::Streamlines && mStreamlinesSeedingMethodComboBox->currentIndex() == QgsMeshRendererVectorStreamlineSettings::MeshGridded )
305 );
306}
307
308void QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged( int currentIndex )
309{
310 bool enabled = currentIndex == QgsMeshRendererVectorStreamlineSettings::Random;
311 mStreamlinesDensityLabel->setEnabled( enabled );
312 mStreamlinesDensitySpinBox->setEnabled( enabled );
313
314 mDisplayVectorsOnGridGroupBox->setEnabled( !enabled );
315}
316
317void QgsMeshRendererVectorSettingsWidget::onWindBarbUnitsChanged( int currentIndex )
318{
320
321 mWindBarbMagnitudeMultiplierLabel->setVisible( units == QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit::OtherUnit );
322 mWindBarbMagnitudeMultiplierSpinBox->setVisible( units == QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit::OtherUnit );
323
324 emit widgetChanged();
325}
326
327void QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged()
328{
329 mColorRampShaderGroupBox->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::ColorRamp );
330 mColorWidget->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
331 mSingleColorLabel->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
332
333 if ( mColorRampShaderWidget->shader().colorRampItemList().isEmpty() )
334 loadColorRampShader();
335
336 emit widgetChanged();
337}
338
339void QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged()
340{
341 mColorRampShaderWidget->setMinimumMaximumAndClassify(
342 filterValue( mColorRampShaderMinimumSpinBox, 0 ),
343 filterValue( mColorRampShaderMaximumSpinBox, 0 )
344 );
345}
346
347void QgsMeshRendererVectorSettingsWidget::loadColorRampShader()
348{
349 if ( !mMeshLayer )
350 return;
351
352 int currentVectorDataSetGroupIndex = mMeshLayer->rendererSettings().activeVectorDatasetGroup();
353 if ( currentVectorDataSetGroupIndex < 0 || !mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex ).isVector() )
354 return;
355
356 const QgsMeshDatasetGroupMetadata meta = mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex );
357 double min = meta.minimum();
358 double max = meta.maximum();
359
360 mColorRampShaderWidget->setMinimumMaximumAndClassify( min, max );
361 whileBlocking( mColorRampShaderMinimumSpinBox )->setValue( min );
362 whileBlocking( mColorRampShaderMaximumSpinBox )->setValue( max );
363}
364
365double QgsMeshRendererVectorSettingsWidget::filterValue( const QgsDoubleSpinBox *spinBox, double errVal ) const
366{
367 if ( spinBox->value() == spinBox->clearValue() )
368 return errVal;
369
370 return spinBox->value();
371}
@ Millimeters
Millimeters.
Definition qgis.h:5184
@ Points
Points (e.g., for font sizes).
Definition qgis.h:5188
@ Pixels
Pixels.
Definition qgis.h:5186
@ MetersInMapUnits
Meters value as Map units.
Definition qgis.h:5191
void colorChanged(const QColor &color)
Emitted whenever a new color is set for the button.
void widgetChanged()
Widget changed.
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
@ MinimumValue
Reset value to minimum().
ColoringMethod
Defines how the color is defined.
@ ColorRamp
Render with a color ramp.
@ SingleColor
Render with a single color.
double minimum() const
Returns minimum scalar value/vector magnitude present for whole dataset group.
double maximum() const
Returns maximum scalar value/vector magnitude present for whole dataset group.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Represents all mesh renderer settings.
QgsMeshRendererVectorSettings vectorSettings(int groupIndex) const
Returns renderer settings.
Represents a mesh renderer settings for vector datasets displayed with arrows.
void setFixedShaftLength(double fixedShaftLength)
Sets fixed length (in millimeters).
void setMaxShaftLength(double maxShaftLength)
Sets maximum shaft length (in millimeters).
QgsMeshRendererVectorArrowSettings::ArrowScalingMethod shaftLengthMethod() const
Returns method used for drawing arrows.
void setMinShaftLength(double minShaftLength)
Sets mininimum shaft length (in millimeters).
double fixedShaftLength() const
Returns fixed arrow length (in millimeters).
void setArrowHeadWidthRatio(double arrowHeadWidthRatio)
Sets ratio of the head width of the arrow (range 0-1).
double scaleFactor() const
Returns scale factor.
double maxShaftLength() const
Returns maximum shaft length (in millimeters).
double arrowHeadWidthRatio() const
Returns ratio of the head width of the arrow (range 0-1).
void setArrowHeadLengthRatio(double arrowHeadLengthRatio)
Sets ratio of the head length of the arrow (range 0-1).
void setScaleFactor(double scaleFactor)
Sets scale factor.
void setShaftLengthMethod(ArrowScalingMethod shaftLengthMethod)
Sets method used for drawing arrows.
ArrowScalingMethod
Algorithm how to transform vector magnitude to length of arrow on the device in pixels.
double minShaftLength() const
Returns mininimum shaft length (in millimeters).
double arrowHeadLengthRatio() const
Returns ratio of the head length of the arrow (range 0-1).
QgsMeshRendererVectorSettingsWidget(QWidget *parent=nullptr)
A widget to hold the renderer Vector settings for a mesh layer.
QgsMeshRendererVectorSettings settings() const
Returns vector settings.
void syncToLayer()
Synchronizes widgets state with associated mesh layer.
void setLayer(QgsMeshLayer *layer)
Associates mesh layer with the widget.
void widgetChanged()
Mesh rendering settings changed.
Represents a renderer settings for vector datasets.
Symbology
Defines the symbology of vector rendering.
@ Traces
Displaying vector dataset with particle traces.
@ Arrows
Displaying vector dataset with arrows.
@ WindBarbs
Displaying vector dataset with wind barbs.
@ Streamlines
Displaying vector dataset with streamlines.
Represents a streamline renderer settings for vector datasets displayed by streamlines.
void setSeedingDensity(double seedingDensity)
Sets the density used for seeding start points.
SeedingStartPointsMethod seedingMethod() const
Returns the method used for seeding start points of strealines.
void setSeedingMethod(const SeedingStartPointsMethod &seedingMethod)
Sets the method used for seeding start points of strealines.
SeedingStartPointsMethod
Method used to define start points that are used to draw streamlines.
@ Random
Seeds start points randomly on the mesh.
@ MeshGridded
Seeds start points on the vertices mesh or user regular grid.
double seedingDensity() const
Returns the density used for seeding start points.
Represents a trace renderer settings for vector datasets displayed by particle traces.
Qgis::RenderUnit maximumTailLengthUnit() const
Returns the maximum tail length unit.
void setMaximumTailLength(double maximumTailLength)
Sets the maximums tail length.
void setMaximumTailLengthUnit(Qgis::RenderUnit maximumTailLengthUnit)
Sets the maximum tail length unit.
double maximumTailLength() const
Returns the maximum tail length.
int particlesCount() const
Returns particles count.
void setParticlesCount(int value)
Sets particles count.
Represents a mesh renderer settings for vector datasets displayed with wind barbs.
void setShaftLengthUnits(Qgis::RenderUnit shaftLengthUnit)
Sets the units for the shaft length.
WindSpeedUnit magnitudeUnits() const
Returns the units that the data are in.
void setMagnitudeUnits(WindSpeedUnit units)
Sets the units that the data are in.
void setMagnitudeMultiplier(double magnitudeMultiplier)
Sets a multiplier for the magnitude to convert it to knots.
double shaftLength() const
Returns the shaft length (in millimeters).
void setShaftLength(double shaftLength)
Sets the shaft length (in millimeters).
WindSpeedUnit
Wind speed units. Wind barbs use knots so we use this enum for preset conversion values.
double magnitudeMultiplier() const
Returns the multiplier for the magnitude to convert it to knots, according to the units set with setM...
void changed()
Emitted when the selected unit is changed, or the definition of the map unit scale is changed.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition qgis.h:6511