QGIS API Documentation 3.41.0-Master (3440c17df1d)
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#include "moc_qgsmeshrenderervectorsettingswidget.cpp"
18
19#include "qgis.h"
20#include "qgsmeshlayer.h"
21
23 : QWidget( parent )
24{
25 setupUi( this );
26
27 QVector<QgsDoubleSpinBox *> widgets;
28 widgets << mMinMagSpinBox << mMaxMagSpinBox
29 << mHeadWidthSpinBox << mHeadLengthSpinBox
30 << mMinimumShaftSpinBox << mMaximumShaftSpinBox
31 << mScaleShaftByFactorOfSpinBox << mShaftLengthSpinBox
32 << mWindBarbLengthSpinBox << mWindBarbMagnitudeMultiplierSpinBox;
33
34 // Setup defaults and clear values for spin boxes
35 for ( const auto &widget : std::as_const( widgets ) )
36 {
37 widget->setClearValueMode( QgsDoubleSpinBox::ClearValueMode::MinimumValue );
38 widget->setSpecialValueText( QString( ) );
39 widget->setValue( widget->minimum() );
40 }
41
42 mShaftLengthComboBox->setCurrentIndex( -1 );
43
44 mColoringMethodComboBox->addItem( tr( "Single Color" ), QgsInterpolatedLineColor::SingleColor );
45 mColoringMethodComboBox->addItem( tr( "Color Ramp Shader" ), QgsInterpolatedLineColor::ColorRamp );
46
47 mXSpacingSpinBox->setClearValue( 10.0 );
48 mYSpacingSpinBox->setClearValue( 10.0 );
49 mStreamlinesDensitySpinBox->setClearValue( 15.0 );
50 mTracesParticlesCountSpinBox->setClearValue( 1000 );
51 mTracesMaxLengthSpinBox->setClearValue( 100.0 );
52
53 mWindBarbLengthSpinBox->setClearValue( 10.0 );
54 mWindBarbMagnitudeMultiplierSpinBox->setValue( 1.0 );
55 mWindBarbMagnitudeMultiplierSpinBox->setClearValue( 1.0 );
56
58 connect( mColoringMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
59 this, &QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged );
60 connect( mColorRampShaderWidget, &QgsColorRampShaderWidget::widgetChanged,
62 connect( mColorRampShaderMinimumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
63 this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
64 connect( mColorRampShaderMaximumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
65 this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
66
67 connect( mLineWidthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
69
70 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
72
73 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
74 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 ),
91 this, &QgsMeshRendererVectorSettingsWidget::onSymbologyChanged );
92 onSymbologyChanged( 0 );
93
94 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
96
97 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
98 this, &QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged );
99 onStreamLineSeedingMethodChanged( 0 );
100
101 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
103
104 connect( mStreamlinesDensitySpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
106
107 connect( mTracesMaxLengthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
109
110 connect( mTracesParticlesCountSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ),
112
113 mTracesTailLengthMapUnitWidget->setUnits(
114 {
119 } );
120
121 connect( mTracesTailLengthMapUnitWidget, &QgsUnitSelectionWidget::changed,
123
124 mWindBarbLengthMapUnitWidget->setUnits(
125 {
129 } );
130
131 connect( mWindBarbLengthMapUnitWidget, &QgsUnitSelectionWidget::changed,
133 connect( mWindBarbUnitsComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
134 this, &QgsMeshRendererVectorSettingsWidget::onWindBarbUnitsChanged );
135 onWindBarbUnitsChanged( 0 );
136}
137
139{
140 mMeshLayer = layer;
141}
142
144{
147 static_cast<QgsMeshRendererVectorSettings::Symbology>( mSymbologyVectorComboBox->currentIndex() ) );
148
149 //Arrow settings
151
152 // basic
153 settings.setColor( mColorWidget->color() );
154 settings.setLineWidth( mLineWidthSpinBox->value() );
156 ( mColoringMethodComboBox->currentData().toInt() ) );
157 settings.setColorRampShader( mColorRampShaderWidget->shader() );
158
159 // filter by magnitude
160 double val = filterValue( mMinMagSpinBox, -1 );
161 settings.setFilterMin( val );
162
163 val = filterValue( mMaxMagSpinBox, -1 );
164 settings.setFilterMax( val );
165
166 // arrow head
167 val = filterValue( mHeadWidthSpinBox, arrowSettings.arrowHeadWidthRatio() * 100.0 );
168 arrowSettings.setArrowHeadWidthRatio( val / 100.0 );
169
170 val = filterValue( mHeadLengthSpinBox, arrowSettings.arrowHeadLengthRatio() * 100.0 );
171 arrowSettings.setArrowHeadLengthRatio( val / 100.0 );
172
173 // user grid
174 bool enabled = mDisplayVectorsOnGridGroupBox->isChecked();
176 settings.setUserGridCellWidth( mXSpacingSpinBox->value() );
177 settings.setUserGridCellHeight( mYSpacingSpinBox->value() );
178
179 // shaft length
180 auto method = static_cast<QgsMeshRendererVectorArrowSettings::ArrowScalingMethod>( mShaftLengthComboBox->currentIndex() );
181 arrowSettings.setShaftLengthMethod( method );
182
183 val = filterValue( mMinimumShaftSpinBox, arrowSettings.minShaftLength() );
184 arrowSettings.setMinShaftLength( val );
185
186 val = filterValue( mMaximumShaftSpinBox, arrowSettings.maxShaftLength() );
187 arrowSettings.setMaxShaftLength( val );
188
189 val = filterValue( mScaleShaftByFactorOfSpinBox, arrowSettings.scaleFactor() );
190 arrowSettings.setScaleFactor( val );
191
192 val = filterValue( mShaftLengthSpinBox, arrowSettings.fixedShaftLength() );
193 arrowSettings.setFixedShaftLength( val );
194
195 settings.setArrowsSettings( arrowSettings );
196
197 //Streamline setting
199 streamlineSettings.setSeedingMethod(
200 static_cast<QgsMeshRendererVectorStreamlineSettings::SeedingStartPointsMethod>( mStreamlinesSeedingMethodComboBox->currentIndex() ) );
201
202 streamlineSettings.setSeedingDensity( mStreamlinesDensitySpinBox->value() / 100 );
203
204 settings.setStreamLinesSettings( streamlineSettings );
205
206 //Traces setting
208 tracesSettings.setMaximumTailLength( mTracesMaxLengthSpinBox->value() );
209 tracesSettings.setMaximumTailLengthUnit( mTracesTailLengthMapUnitWidget->unit() );
210 tracesSettings.setParticlesCount( mTracesParticlesCountSpinBox->value() );
211 settings.setTracesSettings( tracesSettings );
212
213 // Wind Barb settings
215 windBarbSettings.setShaftLength( mWindBarbLengthSpinBox->value() );
216 windBarbSettings.setShaftLengthUnits( mWindBarbLengthMapUnitWidget->unit() );
217 windBarbSettings.setMagnitudeUnits(
218 static_cast<QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit>( mWindBarbUnitsComboBox->currentIndex() ) );
219 windBarbSettings.setMagnitudeMultiplier( mWindBarbMagnitudeMultiplierSpinBox->value() );
220 settings.setWindBarbSettings( windBarbSettings );
221
222 return settings;
223}
224
226{
227 if ( !mMeshLayer || !mMeshLayer->dataProvider() )
228 return;
229
230 if ( mActiveDatasetGroup < 0 )
231 return;
232
233 bool hasFaces = ( mMeshLayer->dataProvider() &&
235
236 const QgsMeshRendererSettings rendererSettings = mMeshLayer->rendererSettings();
237 const QgsMeshRendererVectorSettings settings = rendererSettings.vectorSettings( mActiveDatasetGroup );
238
239 symbologyLabel->setVisible( hasFaces );
240 mSymbologyVectorComboBox->setVisible( hasFaces );
241 mSymbologyVectorComboBox->setCurrentIndex( hasFaces ? settings.symbology() : 0 );
242
243 // Arrow settings
245
246 // basic
247 mColorWidget->setColor( settings.color() );
248 mLineWidthSpinBox->setValue( settings.lineWidth() );
249 mColoringMethodComboBox->setCurrentIndex( mColoringMethodComboBox->findData( settings.coloringMethod() ) );
250 mColorRampShaderWidget->setFromShader( settings.colorRampShader() );
251 mColorRampShaderMinimumSpinBox->setValue( settings.colorRampShader().minimumValue() );
252 mColorRampShaderMaximumSpinBox->setValue( settings.colorRampShader().maximumValue() );
253
254 // filter by magnitude
255 if ( settings.filterMin() > 0 )
256 {
257 mMinMagSpinBox->setValue( settings.filterMin() );
258 }
259 if ( settings.filterMax() > 0 )
260 {
261 mMaxMagSpinBox->setValue( settings.filterMax() );
262 }
263
264 // arrow head
265 mHeadWidthSpinBox->setValue( arrowSettings.arrowHeadWidthRatio() * 100.0 );
266 mHeadLengthSpinBox->setValue( arrowSettings.arrowHeadLengthRatio() * 100.0 );
267
268 // user grid
269 mDisplayVectorsOnGridGroupBox->setVisible( hasFaces );
270 mDisplayVectorsOnGridGroupBox->setChecked( settings.isOnUserDefinedGrid() && hasFaces );
271 mXSpacingSpinBox->setValue( settings.userGridCellWidth() );
272 mYSpacingSpinBox->setValue( settings.userGridCellHeight() );
273
274 // shaft length
275 mShaftLengthComboBox->setCurrentIndex( arrowSettings.shaftLengthMethod() );
276
277 mMinimumShaftSpinBox->setValue( arrowSettings.minShaftLength() );
278 mMaximumShaftSpinBox->setValue( arrowSettings.maxShaftLength() );
279 mScaleShaftByFactorOfSpinBox->setValue( arrowSettings.scaleFactor() );
280 mShaftLengthSpinBox->setValue( arrowSettings.fixedShaftLength() );
281
282 //Streamlines settings
284
285 mStreamlinesSeedingMethodComboBox->setCurrentIndex( streamlinesSettings.seedingMethod() );
286 mStreamlinesDensitySpinBox->setValue( streamlinesSettings.seedingDensity() * 100 );
287
288 //Traces settings
290
291 mTracesMaxLengthSpinBox->setValue( tracesSettings.maximumTailLength() );
292 mTracesTailLengthMapUnitWidget->setUnit( tracesSettings.maximumTailLengthUnit() );
293 mTracesParticlesCountSpinBox->setValue( tracesSettings.particlesCount() );
294
295 // Wind Barb settings
297 mWindBarbLengthSpinBox->setValue( windBarbSettings.shaftLength() );
298 mWindBarbUnitsComboBox->setCurrentIndex( static_cast<int>( windBarbSettings.magnitudeUnits() ) );
300 mWindBarbMagnitudeMultiplierSpinBox->setValue( windBarbSettings.magnitudeMultiplier() );
301}
302
303void QgsMeshRendererVectorSettingsWidget::onSymbologyChanged( int currentIndex )
304{
305 mStreamlineWidget->setVisible( currentIndex == QgsMeshRendererVectorSettings::Streamlines );
306 mArrowLengthGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
307 mHeadOptionsGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
308 mTracesGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Traces );
309 mWindBarbGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::WindBarbs );
310
311 mDisplayVectorsOnGridGroupBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
312 filterByMagnitudeLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
313 minimumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
314 mMinMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
315 maximumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
316 mMaxMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
317
318 mDisplayVectorsOnGridGroupBox->setEnabled(
322 mStreamlinesSeedingMethodComboBox->currentIndex() == QgsMeshRendererVectorStreamlineSettings::MeshGridded ) ) ;
323}
324
325void QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged( int currentIndex )
326{
327 bool enabled = currentIndex == QgsMeshRendererVectorStreamlineSettings::Random;
328 mStreamlinesDensityLabel->setEnabled( enabled );
329 mStreamlinesDensitySpinBox->setEnabled( enabled );
330
331 mDisplayVectorsOnGridGroupBox->setEnabled( !enabled );
332}
333
334void QgsMeshRendererVectorSettingsWidget::onWindBarbUnitsChanged( int currentIndex )
335{
337 static_cast<QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit>( currentIndex );
338
339 mWindBarbMagnitudeMultiplierLabel->setVisible( units == QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit::OtherUnit );
340 mWindBarbMagnitudeMultiplierSpinBox->setVisible( units == QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit::OtherUnit );
341
342 emit widgetChanged();
343}
344
345void QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged()
346{
347 mColorRampShaderGroupBox->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::ColorRamp );
348 mColorWidget->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
349 mSingleColorLabel->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
350
351 if ( mColorRampShaderWidget->shader().colorRampItemList().isEmpty() )
352 loadColorRampShader();
353
354 emit widgetChanged();
355}
356
357void QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged()
358{
359 mColorRampShaderWidget->setMinimumMaximumAndClassify(
360 filterValue( mColorRampShaderMinimumSpinBox, 0 ),
361 filterValue( mColorRampShaderMaximumSpinBox, 0 ) );
362}
363
364void QgsMeshRendererVectorSettingsWidget::loadColorRampShader()
365{
366 if ( !mMeshLayer )
367 return;
368
369 int currentVectorDataSetGroupIndex = mMeshLayer->rendererSettings().activeVectorDatasetGroup();
370 if ( currentVectorDataSetGroupIndex < 0 ||
371 !mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex ).isVector() )
372 return;
373
374 const QgsMeshDatasetGroupMetadata meta = mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex );
375 double min = meta.minimum();
376 double max = meta.maximum();
377
378 mColorRampShaderWidget->setMinimumMaximumAndClassify( min, max );
379 whileBlocking( mColorRampShaderMinimumSpinBox )->setValue( min );
380 whileBlocking( mColorRampShaderMaximumSpinBox )->setValue( max );
381}
382
383double QgsMeshRendererVectorSettingsWidget::filterValue( const QgsDoubleSpinBox *spinBox, double errVal ) const
384{
385 if ( spinBox->value() == spinBox->clearValue() )
386 return errVal;
387
388 return spinBox->value();
389}
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
@ MetersInMapUnits
Meters value as Map units.
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.
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
QgsMeshDatasetGroupMetadata is a collection of dataset group metadata such as whether the data is vec...
bool isVector() const
Returns whether dataset group has vector data.
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.
QgsMeshRendererSettings rendererSettings() const
Returns renderer settings.
QgsMeshDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
QgsMeshDatasetGroupMetadata datasetGroupMetadata(const QgsMeshDatasetIndex &index) const
Returns the dataset groups metadata.
Represents all mesh renderer settings.
int activeVectorDatasetGroup() const
Returns the active vector dataset group.
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.
void setColorRampShader(const QgsColorRampShader &colorRampShader)
Returns the color ramp shader used to render vector datasets.
void setStreamLinesSettings(const QgsMeshRendererVectorStreamlineSettings &streamLinesSettings)
Sets settings for vector rendered with streamlines.
int userGridCellWidth() const
Returns width in pixels of user grid cell.
void setArrowsSettings(const QgsMeshRendererVectorArrowSettings &arrowSettings)
Sets settings for vector rendered with arrows.
void setUserGridCellWidth(int width)
Sets width of user grid cell (in pixels)
void setColor(const QColor &color)
Sets color used for drawing arrows.
QgsMeshRendererVectorTracesSettings tracesSettings() const
Returns settings for vector rendered with traces.
QColor color() const
Returns color used for drawing arrows.
int userGridCellHeight() const
Returns height in pixels of user grid cell.
void setOnUserDefinedGrid(bool enabled)
Toggles drawing of vectors on user defined grid.
double lineWidth() const
Returns line width of the arrow (in millimeters)
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.
void setUserGridCellHeight(int height)
Sets height of user grid cell (in pixels)
Symbology symbology() const
Returns the displaying method used to render vector datasets.
double filterMax() const
Returns filter value for vector magnitudes.
QgsColorRampShader colorRampShader() const
Sets the color ramp shader used to render vector datasets.
void setSymbology(const Symbology &symbology)
Sets the displaying method used to render vector datasets.
void setFilterMin(double filterMin)
Sets filter value for vector magnitudes.
QgsMeshRendererVectorArrowSettings arrowSettings() const
Returns settings for vector rendered with arrows.
void setFilterMax(double filterMax)
Sets filter value for vector magnitudes.
void setTracesSettings(const QgsMeshRendererVectorTracesSettings &tracesSettings)
Sets settings for vector rendered with traces.
void setColoringMethod(const QgsInterpolatedLineColor::ColoringMethod &coloringMethod)
Sets the coloring method used to render vector datasets.
QgsInterpolatedLineColor::ColoringMethod coloringMethod() const
Returns the coloring method used to render vector datasets.
QgsMeshRendererVectorWindBarbSettings windBarbSettings() const
Returns settings for vector rendered with wind barbs.
void setLineWidth(double lineWidth)
Sets line width of the arrow in pixels (in millimeters)
bool isOnUserDefinedGrid() const
Returns whether vectors are drawn on user-defined grid.
double filterMin() const
Returns filter value for vector magnitudes.
void setWindBarbSettings(const QgsMeshRendererVectorWindBarbSettings &windBarbSettings)
Sets settings for vector rendered with wind barbs.
QgsMeshRendererVectorStreamlineSettings streamLinesSettings() const
Returns settings for vector rendered 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...
double maximumValue() const
Returns the minimum value for the raster shader.
double minimumValue() const
Returns the maximum value for the raster shader.
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:5862