QGIS API Documentation 4.3.0-Master (c8cdfe19d7b)
Loading...
Searching...
No Matches
qgsvectorfieldsettingswidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorfieldsettingswidget.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
20#include "moc_qgsvectorfieldsettingswidget.cpp"
21
23 : QWidget( parent )
24{
25 setupUi( this );
26
27 QVector<QgsDoubleSpinBox *> widgets;
28 widgets
29 << mMinMagSpinBox
30 << mMaxMagSpinBox
31 << mHeadWidthSpinBox
32 << mHeadLengthSpinBox
33 << mMinimumShaftSpinBox
34 << mMaximumShaftSpinBox
35 << mScaleShaftByFactorOfSpinBox
36 << mShaftLengthSpinBox
37 << mWindBarbLengthSpinBox
38 << mWindBarbMagnitudeMultiplierSpinBox;
39
40 // Setup defaults and clear values for spin boxes
41 for ( const auto &widget : std::as_const( widgets ) )
42 {
43 widget->setClearValueMode( QgsDoubleSpinBox::ClearValueMode::MinimumValue );
44 widget->setSpecialValueText( QString() );
45 widget->setValue( widget->minimum() );
46 }
47
48 mShaftLengthComboBox->setCurrentIndex( -1 );
49
50 mColoringMethodComboBox->addItem( tr( "Single Color" ), QgsInterpolatedLineColor::SingleColor );
51 mColoringMethodComboBox->addItem( tr( "Color Ramp Shader" ), QgsInterpolatedLineColor::ColorRamp );
52
53 mXSpacingSpinBox->setClearValue( 10.0 );
54 mYSpacingSpinBox->setClearValue( 10.0 );
55 mStreamlinesDensitySpinBox->setClearValue( 15.0 );
56 mTracesParticlesCountSpinBox->setClearValue( 1000 );
57 mTracesMaxLengthSpinBox->setClearValue( 100.0 );
58
59 mWindBarbLengthSpinBox->setClearValue( 10.0 );
60 mWindBarbMagnitudeMultiplierSpinBox->setValue( 1.0 );
61 mWindBarbMagnitudeMultiplierSpinBox->setClearValue( 1.0 );
62
64 connect( mColoringMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsVectorFieldSettingsWidget::onColoringMethodChanged );
66 connect( mColorRampShaderMinimumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::onColorRampMinMaxChanged );
67 connect( mColorRampShaderMaximumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::onColorRampMinMaxChanged );
68
69 connect( mLineWidthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
70
71 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
72
73 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), mShaftOptionsStackedWidget, &QStackedWidget::setCurrentIndex );
74
75 connect( mDisplayVectorsOnGridGroupBox, &QGroupBox::toggled, this, &QgsVectorFieldSettingsWidget::widgetChanged );
76
77 connect( mColorRampShaderLoadButton, &QPushButton::clicked, this, &QgsVectorFieldSettingsWidget::loadColorRampShader );
78
79 onColoringMethodChanged();
80
81 for ( const auto &widget : std::as_const( widgets ) )
82 {
83 connect( widget, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
84 }
85
86 connect( mXSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
87 connect( mYSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
88
89 populateSymbologies();
90
91 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsVectorFieldSettingsWidget::onSymbologyChanged );
92 onSymbologyChanged();
93
94 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
95
96 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsVectorFieldSettingsWidget::onStreamLineSeedingMethodChanged );
97 onStreamLineSeedingMethodChanged( 0 );
98
99 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
100
101 connect( mStreamlinesDensitySpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
102
103 connect( mTracesMaxLengthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
104
105 connect( mTracesParticlesCountSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsVectorFieldSettingsWidget::widgetChanged );
106
108
109 connect( mTracesTailLengthMapUnitWidget, &QgsUnitSelectionWidget::changed, this, &QgsVectorFieldSettingsWidget::widgetChanged );
110
111 mWindBarbLengthMapUnitWidget->setUnits( { Qgis::RenderUnit::Millimeters, Qgis::RenderUnit::Pixels, Qgis::RenderUnit::Points } );
112
113 connect( mWindBarbLengthMapUnitWidget, &QgsUnitSelectionWidget::changed, this, &QgsVectorFieldSettingsWidget::widgetChanged );
114 connect( mWindBarbUnitsComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, &QgsVectorFieldSettingsWidget::onWindBarbUnitsChanged );
115 onWindBarbUnitsChanged( 0 );
116}
117
119{
121 settings.setSymbology( currentSymbology() );
122
123 //Arrow settings
124 QgsVectorFieldArrowSettings arrowSettings;
125
126 // basic
127 settings.setColor( mColorWidget->color() );
128 settings.setLineWidth( mLineWidthSpinBox->value() );
129 settings.setColoringMethod( static_cast<QgsInterpolatedLineColor::ColoringMethod>( mColoringMethodComboBox->currentData().toInt() ) );
130 settings.setColorRampShader( mColorRampShaderWidget->shader() );
131
132 // filter by magnitude
133 double val = filterValue( mMinMagSpinBox, -1 );
134 settings.setFilterMin( val );
135
136 val = filterValue( mMaxMagSpinBox, -1 );
137 settings.setFilterMax( val );
138
139 // arrow head
140 val = filterValue( mHeadWidthSpinBox, arrowSettings.arrowHeadWidthRatio() * 100.0 );
141 arrowSettings.setArrowHeadWidthRatio( val / 100.0 );
142
143 val = filterValue( mHeadLengthSpinBox, arrowSettings.arrowHeadLengthRatio() * 100.0 );
144 arrowSettings.setArrowHeadLengthRatio( val / 100.0 );
145
146 // user grid
147 bool enabled = mDisplayVectorsOnGridGroupBox->isChecked();
148 settings.setOnUserDefinedGrid( enabled );
149 settings.setUserGridCellWidth( mXSpacingSpinBox->value() );
150 settings.setUserGridCellHeight( mYSpacingSpinBox->value() );
151
152 // shaft length
153 auto method = static_cast<Qgis::VectorFieldArrowScalingMethod>( mShaftLengthComboBox->currentIndex() );
154 arrowSettings.setShaftLengthMethod( method );
155
156 val = filterValue( mMinimumShaftSpinBox, arrowSettings.minShaftLength() );
157 arrowSettings.setMinShaftLength( val );
158
159 val = filterValue( mMaximumShaftSpinBox, arrowSettings.maxShaftLength() );
160 arrowSettings.setMaxShaftLength( val );
161
162 val = filterValue( mScaleShaftByFactorOfSpinBox, arrowSettings.scaleFactor() );
163 arrowSettings.setScaleFactor( val );
164
165 val = filterValue( mShaftLengthSpinBox, arrowSettings.fixedShaftLength() );
166 arrowSettings.setFixedShaftLength( val );
167
168 settings.setArrowsSettings( arrowSettings );
169
170 //Streamline setting
171 QgsVectorFieldStreamlineSettings streamlineSettings;
172 streamlineSettings.setSeedingMethod( static_cast<Qgis::VectorFieldSeedingMethod>( mStreamlinesSeedingMethodComboBox->currentIndex() ) );
173
174 streamlineSettings.setSeedingDensity( mStreamlinesDensitySpinBox->value() / 100 );
175
176 settings.setStreamLinesSettings( streamlineSettings );
177
178 //Traces setting
179 QgsVectorFieldTracesSettings tracesSettings;
180 tracesSettings.setMaximumTailLength( mTracesMaxLengthSpinBox->value() );
181 tracesSettings.setMaximumTailLengthUnit( mTracesTailLengthMapUnitWidget->unit() );
182 tracesSettings.setParticlesCount( mTracesParticlesCountSpinBox->value() );
183 settings.setTracesSettings( tracesSettings );
184
185 // Wind Barb settings
186 QgsVectorFieldWindBarbSettings windBarbSettings;
187 windBarbSettings.setShaftLength( mWindBarbLengthSpinBox->value() );
188 windBarbSettings.setShaftLengthUnits( mWindBarbLengthMapUnitWidget->unit() );
189 windBarbSettings.setMagnitudeUnits( static_cast<Qgis::WindSpeedUnit>( mWindBarbUnitsComboBox->currentIndex() ) );
190 windBarbSettings.setMagnitudeMultiplier( mWindBarbMagnitudeMultiplierSpinBox->value() );
191 settings.setWindBarbSettings( windBarbSettings );
192
193 return settings;
194}
195
197{
198 mSupportsInterpolation = supported;
199 populateSymbologies();
200}
201
203{
204 mHasMagnitude = hasMagnitude;
205}
206
207void QgsVectorFieldSettingsWidget::setMagnitudeRange( double minimum, double maximum )
208{
209 mMagnitudeMinimum = minimum;
210 mMagnitudeMaximum = maximum;
211 mHasMagnitudeRange = true;
212}
213
215{
216 const int symbologyIndex = mSymbologyVectorComboBox->findData( static_cast< int >( settings.symbology() ) );
217 // a symbology the data cannot be drawn with is not offered, fall back to arrows
218 mSymbologyVectorComboBox->setCurrentIndex( symbologyIndex >= 0 ? symbologyIndex : mSymbologyVectorComboBox->findData( static_cast< int >( Qgis::VectorFieldSymbology::Arrows ) ) );
219
220 // Arrow settings
221 const QgsVectorFieldArrowSettings arrowSettings = settings.arrowSettings();
222
223 // basic
224 mColorWidget->setColor( settings.color() );
225 mLineWidthSpinBox->setValue( settings.lineWidth() );
226 mColoringMethodComboBox->setCurrentIndex( mColoringMethodComboBox->findData( settings.coloringMethod() ) );
227 mColorRampShaderWidget->setFromShader( settings.colorRampShader() );
228 mColorRampShaderMinimumSpinBox->setValue( settings.colorRampShader().minimumValue() );
229 mColorRampShaderMaximumSpinBox->setValue( settings.colorRampShader().maximumValue() );
230
231 // filter by magnitude
232 if ( settings.filterMin() > 0 )
233 {
234 mMinMagSpinBox->setValue( settings.filterMin() );
235 }
236 if ( settings.filterMax() > 0 )
237 {
238 mMaxMagSpinBox->setValue( settings.filterMax() );
239 }
240
241 // arrow head
242 mHeadWidthSpinBox->setValue( arrowSettings.arrowHeadWidthRatio() * 100.0 );
243 mHeadLengthSpinBox->setValue( arrowSettings.arrowHeadLengthRatio() * 100.0 );
244
245 // user grid
246 mDisplayVectorsOnGridGroupBox->setVisible( mSupportsInterpolation );
247 mDisplayVectorsOnGridGroupBox->setChecked( settings.isOnUserDefinedGrid() && mSupportsInterpolation );
248 mXSpacingSpinBox->setValue( settings.userGridCellWidth() );
249 mYSpacingSpinBox->setValue( settings.userGridCellHeight() );
250
251 // shaft length
252 mShaftLengthComboBox->setCurrentIndex( static_cast< int >( arrowSettings.shaftLengthMethod() ) );
253
254 mMinimumShaftSpinBox->setValue( arrowSettings.minShaftLength() );
255 mMaximumShaftSpinBox->setValue( arrowSettings.maxShaftLength() );
256 mScaleShaftByFactorOfSpinBox->setValue( arrowSettings.scaleFactor() );
257 mShaftLengthSpinBox->setValue( arrowSettings.fixedShaftLength() );
258
259 //Streamlines settings
260 const QgsVectorFieldStreamlineSettings streamlinesSettings = settings.streamLinesSettings();
261
262 mStreamlinesSeedingMethodComboBox->setCurrentIndex( static_cast< int >( streamlinesSettings.seedingMethod() ) );
263 mStreamlinesDensitySpinBox->setValue( streamlinesSettings.seedingDensity() * 100 );
264
265 //Traces settings
266 const QgsVectorFieldTracesSettings tracesSettings = settings.tracesSettings();
267
268 mTracesMaxLengthSpinBox->setValue( tracesSettings.maximumTailLength() );
269 mTracesTailLengthMapUnitWidget->setUnit( tracesSettings.maximumTailLengthUnit() );
270 mTracesParticlesCountSpinBox->setValue( tracesSettings.particlesCount() );
271
272 // Wind Barb settings
273 const QgsVectorFieldWindBarbSettings windBarbSettings = settings.windBarbSettings();
274 mWindBarbLengthSpinBox->setValue( windBarbSettings.shaftLength() );
275 mWindBarbUnitsComboBox->setCurrentIndex( static_cast<int>( windBarbSettings.magnitudeUnits() ) );
276 if ( windBarbSettings.magnitudeUnits() == Qgis::WindSpeedUnit::OtherUnit )
277 mWindBarbMagnitudeMultiplierSpinBox->setValue( windBarbSettings.magnitudeMultiplier() );
278
279 applyMagnitudeSupport();
280}
281
282void QgsVectorFieldSettingsWidget::applyMagnitudeSupport()
283{
284 // a filter on the magnitude of vectors which all have a magnitude of one either passes everything
285 // or rejects everything, so it is hidden and cleared rather than left to confuse
286 const bool isTraces = currentSymbology() == Qgis::VectorFieldSymbology::Traces;
287 const bool showMagnitudeFilter = mHasMagnitude && !isTraces;
288 mMagnitudeFilterGroupBox->setVisible( showMagnitudeFilter );
289
290 // the color ramp classifies the magnitude, and only a fixed shaft length can draw vectors which
291 // all have the same one
292 mColoringMethodLabel->setVisible( mHasMagnitude );
293 mColoringMethodComboBox->setVisible( mHasMagnitude );
294 mShaftLengthComboBox->setEnabled( mHasMagnitude );
295
296 if ( !mHasMagnitude )
297 {
298 mMinMagSpinBox->clear();
299 mMaxMagSpinBox->clear();
300 mColoringMethodComboBox->setCurrentIndex( mColoringMethodComboBox->findData( QgsInterpolatedLineColor::SingleColor ) );
301 mShaftLengthComboBox->setCurrentIndex( static_cast< int >( Qgis::VectorFieldArrowScalingMethod::Fixed ) );
302 }
303}
304
305void QgsVectorFieldSettingsWidget::onSymbologyChanged()
306{
307 const Qgis::VectorFieldSymbology symbology = currentSymbology();
308
309 mStreamlineWidget->setVisible( symbology == Qgis::VectorFieldSymbology::Streamlines );
310 mArrowLengthGroupBox->setVisible( symbology == Qgis::VectorFieldSymbology::Arrows );
311 mHeadOptionsGroupBox->setVisible( symbology == Qgis::VectorFieldSymbology::Arrows );
312 mTracesGroupBox->setVisible( symbology == Qgis::VectorFieldSymbology::Traces );
313 mWindBarbGroupBox->setVisible( symbology == Qgis::VectorFieldSymbology::WindBarbs );
314
315 // the grid places vectors between the data points, which needs a field which can be interpolated
316 mDisplayVectorsOnGridGroupBox->setVisible( mSupportsInterpolation && symbology != Qgis::VectorFieldSymbology::Traces );
317 applyMagnitudeSupport();
318
319 mDisplayVectorsOnGridGroupBox->setEnabled(
322 || ( symbology == Qgis::VectorFieldSymbology::Streamlines && mStreamlinesSeedingMethodComboBox->currentIndex() == static_cast< int >( Qgis::VectorFieldSeedingMethod::Gridded ) )
323 );
324}
325
326void QgsVectorFieldSettingsWidget::populateSymbologies()
327{
328 const QVariant previous = mSymbologyVectorComboBox->currentData();
329
330 const QSignalBlocker blocker( mSymbologyVectorComboBox );
331 mSymbologyVectorComboBox->clear();
332
333 // one glyph per data point, which any vector field can place
334 mSymbologyVectorComboBox->addItem( tr( "Arrows" ), static_cast< int >( Qgis::VectorFieldSymbology::Arrows ) );
335 if ( mSupportsInterpolation )
336 {
337 // both walk the field between its data points
338 mSymbologyVectorComboBox->addItem( tr( "Streamlines" ), static_cast< int >( Qgis::VectorFieldSymbology::Streamlines ) );
339 mSymbologyVectorComboBox->addItem( tr( "Traces" ), static_cast< int >( Qgis::VectorFieldSymbology::Traces ) );
340 }
341 mSymbologyVectorComboBox->addItem( tr( "Wind Barbs" ), static_cast< int >( Qgis::VectorFieldSymbology::WindBarbs ) );
342
343 const int previousIndex = previous.isValid() ? mSymbologyVectorComboBox->findData( previous ) : -1;
344 mSymbologyVectorComboBox->setCurrentIndex( previousIndex >= 0 ? previousIndex : 0 );
345}
346
347Qgis::VectorFieldSymbology QgsVectorFieldSettingsWidget::currentSymbology() const
348{
349 return static_cast< Qgis::VectorFieldSymbology >( mSymbologyVectorComboBox->currentData().toInt() );
350}
351
352void QgsVectorFieldSettingsWidget::onStreamLineSeedingMethodChanged( int currentIndex )
353{
354 bool enabled = currentIndex == static_cast< int >( Qgis::VectorFieldSeedingMethod::Random );
355 mStreamlinesDensityLabel->setEnabled( enabled );
356 mStreamlinesDensitySpinBox->setEnabled( enabled );
357
358 mDisplayVectorsOnGridGroupBox->setEnabled( !enabled );
359}
360
361void QgsVectorFieldSettingsWidget::onWindBarbUnitsChanged( int currentIndex )
362{
363 const Qgis::WindSpeedUnit units = static_cast<Qgis::WindSpeedUnit>( currentIndex );
364
365 mWindBarbMagnitudeMultiplierLabel->setVisible( units == Qgis::WindSpeedUnit::OtherUnit );
366 mWindBarbMagnitudeMultiplierSpinBox->setVisible( units == Qgis::WindSpeedUnit::OtherUnit );
367
368 emit widgetChanged();
369}
370
371void QgsVectorFieldSettingsWidget::onColoringMethodChanged()
372{
373 mColorRampShaderGroupBox->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::ColorRamp );
374 mColorWidget->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
375 mSingleColorLabel->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
376
377 if ( mColorRampShaderWidget->shader().colorRampItemList().isEmpty() )
378 loadColorRampShader();
379
380 emit widgetChanged();
381}
382
383void QgsVectorFieldSettingsWidget::onColorRampMinMaxChanged()
384{
385 mColorRampShaderWidget->setMinimumMaximumAndClassify( filterValue( mColorRampShaderMinimumSpinBox, 0 ), filterValue( mColorRampShaderMaximumSpinBox, 0 ) );
386}
387
388void QgsVectorFieldSettingsWidget::loadColorRampShader()
389{
390 if ( !mHasMagnitudeRange )
391 return;
392
393 mColorRampShaderWidget->setMinimumMaximumAndClassify( mMagnitudeMinimum, mMagnitudeMaximum );
394 whileBlocking( mColorRampShaderMinimumSpinBox )->setValue( mMagnitudeMinimum );
395 whileBlocking( mColorRampShaderMaximumSpinBox )->setValue( mMagnitudeMaximum );
396}
397
398double QgsVectorFieldSettingsWidget::filterValue( const QgsDoubleSpinBox *spinBox, double errVal ) const
399{
400 if ( spinBox->value() == spinBox->clearValue() )
401 return errVal;
402
403 return spinBox->value();
404}
VectorFieldSeedingMethod
Method used to define start points that are used to draw streamlines.
Definition qgis.h:7262
@ Gridded
Seeds start points on data grid or user regular grid.
Definition qgis.h:7263
@ Random
Seeds start points randomly.
Definition qgis.h:7264
VectorFieldSymbology
Defines the symbology of vector field rendering.
Definition qgis.h:7246
@ WindBarbs
Displaying vector dataset with wind barbs.
Definition qgis.h:7250
@ Arrows
Displaying vector dataset with arrows.
Definition qgis.h:7247
@ Traces
Displaying vector dataset with particle traces.
Definition qgis.h:7249
@ Streamlines
Displaying vector dataset with streamlines.
Definition qgis.h:7248
WindSpeedUnit
Wind speed units.
Definition qgis.h:5728
@ OtherUnit
Other unit.
Definition qgis.h:5734
@ Millimeters
Millimeters.
Definition qgis.h:5771
@ Points
Points (e.g., for font sizes).
Definition qgis.h:5775
@ Pixels
Pixels.
Definition qgis.h:5773
@ MetersInMapUnits
Meters value as Map units.
Definition qgis.h:5778
VectorFieldArrowScalingMethod
Algorithm to transform vector magnitude to length of arrow on the device in pixels.
Definition qgis.h:7231
@ Fixed
Use fixed length fixedShaftLength() regardless of vector's magnitude.
Definition qgis.h:7234
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.
void changed()
Emitted when the selected unit is changed, or the definition of the map unit scale is changed.
Represents a mesh renderer settings for vector datasets displayed with arrows.
void setFixedShaftLength(double fixedShaftLength)
Sets fixed length (in millimeters).
double minShaftLength() const
Returns mininimum shaft length (in millimeters).
Qgis::VectorFieldArrowScalingMethod shaftLengthMethod() const
Returns method used for drawing arrows.
void setMinShaftLength(double minShaftLength)
Sets mininimum shaft length (in millimeters).
double arrowHeadLengthRatio() const
Returns ratio of the head length of the arrow (range 0-1).
void setShaftLengthMethod(Qgis::VectorFieldArrowScalingMethod shaftLengthMethod)
Sets method used for drawing arrows.
void setScaleFactor(double scaleFactor)
Sets scale factor.
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).
void setMaxShaftLength(double maxShaftLength)
Sets maximum shaft length (in millimeters).
double arrowHeadWidthRatio() const
Returns ratio of the head width of the arrow (range 0-1).
double maxShaftLength() const
Returns maximum shaft length (in millimeters).
double scaleFactor() const
Returns scale factor.
void setArrowHeadLengthRatio(double arrowHeadLengthRatio)
Sets ratio of the head length of the arrow (range 0-1).
QgsVectorFieldSettings settings() const
Returns vector settings.
QgsVectorFieldSettingsWidget(QWidget *parent=nullptr)
A widget to hold the vector field symbology settings.
void setSupportsInterpolation(bool supported)
Sets whether the vector field behind the widget can be sampled between its data points.
void widgetChanged()
Vector field symbology settings changed.
void setSettings(const QgsVectorFieldSettings &settings)
Synchronizes the widgets state with settings.
void setHasMagnitude(bool hasMagnitude)
Sets whether the data behind the widget carries a magnitude.
void setMagnitudeRange(double minimum, double maximum)
Sets the minimum and maximum magnitude of the data, which the color ramp shader is classified against...
Represents a renderer settings for vector datasets.
Represents a streamline renderer settings for vector datasets displayed by streamlines.
void setSeedingMethod(const Qgis::VectorFieldSeedingMethod &seedingMethod)
Sets the method used for seeding start points of strealines.
Qgis::VectorFieldSeedingMethod seedingMethod() const
Returns the method used for seeding start points of strealines.
double seedingDensity() const
Returns the density used for seeding start points.
void setSeedingDensity(double seedingDensity)
Sets 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.
int particlesCount() const
Returns particles count.
void setMaximumTailLengthUnit(Qgis::RenderUnit maximumTailLengthUnit)
Sets the maximum tail length unit.
double maximumTailLength() const
Returns the maximum tail length.
void setParticlesCount(int value)
Sets particles count.
void setMaximumTailLength(double maximumTailLength)
Sets the maximums tail length.
Represents a mesh renderer settings for vector datasets displayed with wind barbs.
Qgis::WindSpeedUnit magnitudeUnits() const
Returns the units that the data are in.
double shaftLength() const
Returns the shaft length (in millimeters).
void setMagnitudeMultiplier(double magnitudeMultiplier)
Sets a multiplier for the magnitude to convert it to knots.
void setMagnitudeUnits(Qgis::WindSpeedUnit units)
Sets the units that the data are in.
double magnitudeMultiplier() const
Returns the multiplier for the magnitude to convert it to knots, according to the units set with setM...
void setShaftLength(double shaftLength)
Sets the shaft length (in millimeters).
void setShaftLengthUnits(Qgis::RenderUnit shaftLengthUnit)
Sets the units for the shaft length.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition qgis.h:7689