QGIS API Documentation 4.1.0-Master (60fea48833c)
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
30 << mMinMagSpinBox
31 << mMaxMagSpinBox
32 << mHeadWidthSpinBox
33 << mHeadLengthSpinBox
34 << mMinimumShaftSpinBox
35 << mMaximumShaftSpinBox
36 << mScaleShaftByFactorOfSpinBox
37 << mShaftLengthSpinBox
38 << mWindBarbLengthSpinBox
39 << mWindBarbMagnitudeMultiplierSpinBox;
40
41 // Setup defaults and clear values for spin boxes
42 for ( const auto &widget : std::as_const( widgets ) )
43 {
44 widget->setClearValueMode( QgsDoubleSpinBox::ClearValueMode::MinimumValue );
45 widget->setSpecialValueText( QString() );
46 widget->setValue( widget->minimum() );
47 }
48
49 mShaftLengthComboBox->setCurrentIndex( -1 );
50
51 mColoringMethodComboBox->addItem( tr( "Single Color" ), QgsInterpolatedLineColor::SingleColor );
52 mColoringMethodComboBox->addItem( tr( "Color Ramp Shader" ), QgsInterpolatedLineColor::ColorRamp );
53
54 mXSpacingSpinBox->setClearValue( 10.0 );
55 mYSpacingSpinBox->setClearValue( 10.0 );
56 mStreamlinesDensitySpinBox->setClearValue( 15.0 );
57 mTracesParticlesCountSpinBox->setClearValue( 1000 );
58 mTracesMaxLengthSpinBox->setClearValue( 100.0 );
59
60 mWindBarbLengthSpinBox->setClearValue( 10.0 );
61 mWindBarbMagnitudeMultiplierSpinBox->setValue( 1.0 );
62 mWindBarbMagnitudeMultiplierSpinBox->setClearValue( 1.0 );
63
65 connect( mColoringMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged );
67 connect( mColorRampShaderMinimumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
68 connect( mColorRampShaderMaximumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
69
70 connect( mLineWidthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
71
72 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
73
74 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), mShaftOptionsStackedWidget, &QStackedWidget::setCurrentIndex );
75
76 connect( mDisplayVectorsOnGridGroupBox, &QGroupBox::toggled, this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
77
78 connect( mColorRampShaderLoadButton, &QPushButton::clicked, this, &QgsMeshRendererVectorSettingsWidget::loadColorRampShader );
79
80 onColoringMethodChanged();
81
82 for ( const auto &widget : std::as_const( widgets ) )
83 {
84 connect( widget, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
85 }
86
87 connect( mXSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
88 connect( mYSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
89
90 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::onSymbologyChanged );
91 onSymbologyChanged( 0 );
92
93 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
94
95 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged );
96 onStreamLineSeedingMethodChanged( 0 );
97
98 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
99
100 connect( mStreamlinesDensitySpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
101
102 connect( mTracesMaxLengthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
103
104 connect( mTracesParticlesCountSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
105
107
108 connect( mTracesTailLengthMapUnitWidget, &QgsUnitSelectionWidget::changed, this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
109
110 mWindBarbLengthMapUnitWidget->setUnits( { Qgis::RenderUnit::Millimeters, Qgis::RenderUnit::Pixels, Qgis::RenderUnit::Points } );
111
112 connect( mWindBarbLengthMapUnitWidget, &QgsUnitSelectionWidget::changed, this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
113 connect( mWindBarbUnitsComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsMeshRendererVectorSettingsWidget::onWindBarbUnitsChanged );
114 onWindBarbUnitsChanged( 0 );
115}
116
118{
119 mMeshLayer = layer;
120}
121
123{
125 settings.setSymbology( static_cast<QgsMeshRendererVectorSettings::Symbology>( mSymbologyVectorComboBox->currentIndex() ) );
126
127 //Arrow settings
129
130 // basic
131 settings.setColor( mColorWidget->color() );
132 settings.setLineWidth( mLineWidthSpinBox->value() );
133 settings.setColoringMethod( static_cast<QgsInterpolatedLineColor::ColoringMethod>( mColoringMethodComboBox->currentData().toInt() ) );
134 settings.setColorRampShader( mColorRampShaderWidget->shader() );
135
136 // filter by magnitude
137 double val = filterValue( mMinMagSpinBox, -1 );
138 settings.setFilterMin( val );
139
140 val = filterValue( mMaxMagSpinBox, -1 );
141 settings.setFilterMax( val );
142
143 // arrow head
144 val = filterValue( mHeadWidthSpinBox, arrowSettings.arrowHeadWidthRatio() * 100.0 );
145 arrowSettings.setArrowHeadWidthRatio( val / 100.0 );
146
147 val = filterValue( mHeadLengthSpinBox, arrowSettings.arrowHeadLengthRatio() * 100.0 );
148 arrowSettings.setArrowHeadLengthRatio( val / 100.0 );
149
150 // user grid
151 bool enabled = mDisplayVectorsOnGridGroupBox->isChecked();
152 settings.setOnUserDefinedGrid( enabled );
153 settings.setUserGridCellWidth( mXSpacingSpinBox->value() );
154 settings.setUserGridCellHeight( mYSpacingSpinBox->value() );
155
156 // shaft length
157 auto method = static_cast<QgsMeshRendererVectorArrowSettings::ArrowScalingMethod>( mShaftLengthComboBox->currentIndex() );
158 arrowSettings.setShaftLengthMethod( method );
159
160 val = filterValue( mMinimumShaftSpinBox, arrowSettings.minShaftLength() );
161 arrowSettings.setMinShaftLength( val );
162
163 val = filterValue( mMaximumShaftSpinBox, arrowSettings.maxShaftLength() );
164 arrowSettings.setMaxShaftLength( val );
165
166 val = filterValue( mScaleShaftByFactorOfSpinBox, arrowSettings.scaleFactor() );
167 arrowSettings.setScaleFactor( val );
168
169 val = filterValue( mShaftLengthSpinBox, arrowSettings.fixedShaftLength() );
170 arrowSettings.setFixedShaftLength( val );
171
172 settings.setArrowsSettings( arrowSettings );
173
174 //Streamline setting
176 streamlineSettings.setSeedingMethod( static_cast<QgsMeshRendererVectorStreamlineSettings::SeedingStartPointsMethod>( mStreamlinesSeedingMethodComboBox->currentIndex() ) );
177
178 streamlineSettings.setSeedingDensity( mStreamlinesDensitySpinBox->value() / 100 );
179
180 settings.setStreamLinesSettings( streamlineSettings );
181
182 //Traces setting
184 tracesSettings.setMaximumTailLength( mTracesMaxLengthSpinBox->value() );
185 tracesSettings.setMaximumTailLengthUnit( mTracesTailLengthMapUnitWidget->unit() );
186 tracesSettings.setParticlesCount( mTracesParticlesCountSpinBox->value() );
187 settings.setTracesSettings( tracesSettings );
188
189 // Wind Barb settings
191 windBarbSettings.setShaftLength( mWindBarbLengthSpinBox->value() );
192 windBarbSettings.setShaftLengthUnits( mWindBarbLengthMapUnitWidget->unit() );
193 windBarbSettings.setMagnitudeUnits( static_cast<QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit>( mWindBarbUnitsComboBox->currentIndex() ) );
194 windBarbSettings.setMagnitudeMultiplier( mWindBarbMagnitudeMultiplierSpinBox->value() );
195 settings.setWindBarbSettings( windBarbSettings );
196
197 return settings;
198}
199
201{
202 if ( !mMeshLayer || !mMeshLayer->dataProvider() )
203 return;
204
205 if ( mActiveDatasetGroup < 0 )
206 return;
207
208 bool hasFaces = ( mMeshLayer->dataProvider() && mMeshLayer->dataProvider()->contains( QgsMesh::ElementType::Face ) );
209
210 const QgsMeshRendererSettings rendererSettings = mMeshLayer->rendererSettings();
211 const QgsMeshRendererVectorSettings settings = rendererSettings.vectorSettings( mActiveDatasetGroup );
212
213 symbologyLabel->setVisible( hasFaces );
214 mSymbologyVectorComboBox->setVisible( hasFaces );
215 mSymbologyVectorComboBox->setCurrentIndex( hasFaces ? settings.symbology() : 0 );
216
217 // Arrow settings
218 const QgsMeshRendererVectorArrowSettings arrowSettings = settings.arrowSettings();
219
220 // basic
221 mColorWidget->setColor( settings.color() );
222 mLineWidthSpinBox->setValue( settings.lineWidth() );
223 mColoringMethodComboBox->setCurrentIndex( mColoringMethodComboBox->findData( settings.coloringMethod() ) );
224 mColorRampShaderWidget->setFromShader( settings.colorRampShader() );
225 mColorRampShaderMinimumSpinBox->setValue( settings.colorRampShader().minimumValue() );
226 mColorRampShaderMaximumSpinBox->setValue( settings.colorRampShader().maximumValue() );
227
228 // filter by magnitude
229 if ( settings.filterMin() > 0 )
230 {
231 mMinMagSpinBox->setValue( settings.filterMin() );
232 }
233 if ( settings.filterMax() > 0 )
234 {
235 mMaxMagSpinBox->setValue( settings.filterMax() );
236 }
237
238 // arrow head
239 mHeadWidthSpinBox->setValue( arrowSettings.arrowHeadWidthRatio() * 100.0 );
240 mHeadLengthSpinBox->setValue( arrowSettings.arrowHeadLengthRatio() * 100.0 );
241
242 // user grid
243 mDisplayVectorsOnGridGroupBox->setVisible( hasFaces );
244 mDisplayVectorsOnGridGroupBox->setChecked( settings.isOnUserDefinedGrid() && hasFaces );
245 mXSpacingSpinBox->setValue( settings.userGridCellWidth() );
246 mYSpacingSpinBox->setValue( settings.userGridCellHeight() );
247
248 // shaft length
249 mShaftLengthComboBox->setCurrentIndex( arrowSettings.shaftLengthMethod() );
250
251 mMinimumShaftSpinBox->setValue( arrowSettings.minShaftLength() );
252 mMaximumShaftSpinBox->setValue( arrowSettings.maxShaftLength() );
253 mScaleShaftByFactorOfSpinBox->setValue( arrowSettings.scaleFactor() );
254 mShaftLengthSpinBox->setValue( arrowSettings.fixedShaftLength() );
255
256 //Streamlines settings
257 const QgsMeshRendererVectorStreamlineSettings streamlinesSettings = settings.streamLinesSettings();
258
259 mStreamlinesSeedingMethodComboBox->setCurrentIndex( streamlinesSettings.seedingMethod() );
260 mStreamlinesDensitySpinBox->setValue( streamlinesSettings.seedingDensity() * 100 );
261
262 //Traces settings
263 const QgsMeshRendererVectorTracesSettings tracesSettings = settings.tracesSettings();
264
265 mTracesMaxLengthSpinBox->setValue( tracesSettings.maximumTailLength() );
266 mTracesTailLengthMapUnitWidget->setUnit( tracesSettings.maximumTailLengthUnit() );
267 mTracesParticlesCountSpinBox->setValue( tracesSettings.particlesCount() );
268
269 // Wind Barb settings
270 const QgsMeshRendererVectorWindBarbSettings windBarbSettings = settings.windBarbSettings();
271 mWindBarbLengthSpinBox->setValue( windBarbSettings.shaftLength() );
272 mWindBarbUnitsComboBox->setCurrentIndex( static_cast<int>( windBarbSettings.magnitudeUnits() ) );
274 mWindBarbMagnitudeMultiplierSpinBox->setValue( windBarbSettings.magnitudeMultiplier() );
275}
276
277void QgsMeshRendererVectorSettingsWidget::onSymbologyChanged( int currentIndex )
278{
279 mStreamlineWidget->setVisible( currentIndex == QgsMeshRendererVectorSettings::Streamlines );
280 mArrowLengthGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
281 mHeadOptionsGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
282 mTracesGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Traces );
283 mWindBarbGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::WindBarbs );
284
285 mDisplayVectorsOnGridGroupBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
286 filterByMagnitudeLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
287 minimumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
288 mMinMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
289 maximumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
290 mMaxMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
291
292 mDisplayVectorsOnGridGroupBox->setEnabled(
295 || ( currentIndex == QgsMeshRendererVectorSettings::Streamlines && mStreamlinesSeedingMethodComboBox->currentIndex() == QgsMeshRendererVectorStreamlineSettings::MeshGridded )
296 );
297}
298
299void QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged( int currentIndex )
300{
301 bool enabled = currentIndex == QgsMeshRendererVectorStreamlineSettings::Random;
302 mStreamlinesDensityLabel->setEnabled( enabled );
303 mStreamlinesDensitySpinBox->setEnabled( enabled );
304
305 mDisplayVectorsOnGridGroupBox->setEnabled( !enabled );
306}
307
308void QgsMeshRendererVectorSettingsWidget::onWindBarbUnitsChanged( int currentIndex )
309{
311
312 mWindBarbMagnitudeMultiplierLabel->setVisible( units == QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit::OtherUnit );
313 mWindBarbMagnitudeMultiplierSpinBox->setVisible( units == QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit::OtherUnit );
314
315 emit widgetChanged();
316}
317
318void QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged()
319{
320 mColorRampShaderGroupBox->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::ColorRamp );
321 mColorWidget->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
322 mSingleColorLabel->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
323
324 if ( mColorRampShaderWidget->shader().colorRampItemList().isEmpty() )
325 loadColorRampShader();
326
327 emit widgetChanged();
328}
329
330void QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged()
331{
332 mColorRampShaderWidget->setMinimumMaximumAndClassify( filterValue( mColorRampShaderMinimumSpinBox, 0 ), filterValue( mColorRampShaderMaximumSpinBox, 0 ) );
333}
334
335void QgsMeshRendererVectorSettingsWidget::loadColorRampShader()
336{
337 if ( !mMeshLayer )
338 return;
339
340 int currentVectorDataSetGroupIndex = mMeshLayer->rendererSettings().activeVectorDatasetGroup();
341 if ( currentVectorDataSetGroupIndex < 0 || !mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex ).isVector() )
342 return;
343
344 const QgsMeshDatasetGroupMetadata meta = mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex );
345 double min = meta.minimum();
346 double max = meta.maximum();
347
348 mColorRampShaderWidget->setMinimumMaximumAndClassify( min, max );
349 whileBlocking( mColorRampShaderMinimumSpinBox )->setValue( min );
350 whileBlocking( mColorRampShaderMaximumSpinBox )->setValue( max );
351}
352
353double QgsMeshRendererVectorSettingsWidget::filterValue( const QgsDoubleSpinBox *spinBox, double errVal ) const
354{
355 if ( spinBox->value() == spinBox->clearValue() )
356 return errVal;
357
358 return spinBox->value();
359}
@ Millimeters
Millimeters.
Definition qgis.h:5341
@ Points
Points (e.g., for font sizes).
Definition qgis.h:5345
@ Pixels
Pixels.
Definition qgis.h:5343
@ MetersInMapUnits
Meters value as Map units.
Definition qgis.h:5348
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:6880