QGIS API Documentation 3.39.0-Master (67e056379ed)
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
22 : QWidget( parent )
23{
24 setupUi( this );
25
26 QVector<QgsDoubleSpinBox *> widgets;
27 widgets << mMinMagSpinBox << mMaxMagSpinBox
28 << mHeadWidthSpinBox << mHeadLengthSpinBox
29 << mMinimumShaftSpinBox << mMaximumShaftSpinBox
30 << mScaleShaftByFactorOfSpinBox << mShaftLengthSpinBox
31 << mWindBarbLengthSpinBox << mWindBarbMagnitudeMultiplierSpinBox;
32
33 // Setup defaults and clear values for spin boxes
34 for ( const auto &widget : std::as_const( widgets ) )
35 {
36 widget->setClearValueMode( QgsDoubleSpinBox::ClearValueMode::MinimumValue );
37 widget->setSpecialValueText( QString( ) );
38 widget->setValue( widget->minimum() );
39 }
40
41 mShaftLengthComboBox->setCurrentIndex( -1 );
42
43 mColoringMethodComboBox->addItem( tr( "Single Color" ), QgsInterpolatedLineColor::SingleColor );
44 mColoringMethodComboBox->addItem( tr( "Color Ramp Shader" ), QgsInterpolatedLineColor::ColorRamp );
45
46 mXSpacingSpinBox->setClearValue( 10.0 );
47 mYSpacingSpinBox->setClearValue( 10.0 );
48 mStreamlinesDensitySpinBox->setClearValue( 15.0 );
49 mTracesParticlesCountSpinBox->setClearValue( 1000 );
50 mTracesMaxLengthSpinBox->setClearValue( 100.0 );
51
52 mWindBarbLengthSpinBox->setClearValue( 10.0 );
53 mWindBarbMagnitudeMultiplierSpinBox->setValue( 1.0 );
54 mWindBarbMagnitudeMultiplierSpinBox->setClearValue( 1.0 );
55
57 connect( mColoringMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
58 this, &QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged );
59 connect( mColorRampShaderWidget, &QgsColorRampShaderWidget::widgetChanged,
61 connect( mColorRampShaderMinimumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
62 this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
63 connect( mColorRampShaderMaximumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
64 this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
65
66 connect( mLineWidthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
68
69 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
71
72 connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
73 mShaftOptionsStackedWidget, &QStackedWidget::setCurrentIndex );
74
75 connect( mDisplayVectorsOnGridGroupBox, &QGroupBox::toggled, this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
76
77 connect( mColorRampShaderLoadButton, &QPushButton::clicked, this, &QgsMeshRendererVectorSettingsWidget::loadColorRampShader );
78
79 onColoringMethodChanged();
80
81 for ( const auto &widget : std::as_const( widgets ) )
82 {
83 connect( widget, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
84 }
85
86 connect( mXSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
87 connect( mYSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
88
89 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
90 this, &QgsMeshRendererVectorSettingsWidget::onSymbologyChanged );
91 onSymbologyChanged( 0 );
92
93 connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
95
96 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
97 this, &QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged );
98 onStreamLineSeedingMethodChanged( 0 );
99
100 connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
102
103 connect( mStreamlinesDensitySpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
105
106 connect( mTracesMaxLengthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
108
109 connect( mTracesParticlesCountSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ),
111
112 mTracesTailLengthMapUnitWidget->setUnits(
113 {
118 } );
119
120 connect( mTracesTailLengthMapUnitWidget, &QgsUnitSelectionWidget::changed,
122
123 mWindBarbLengthMapUnitWidget->setUnits(
124 {
128 } );
129
130 connect( mWindBarbLengthMapUnitWidget, &QgsUnitSelectionWidget::changed,
132 connect( mWindBarbUnitsComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
133 this, &QgsMeshRendererVectorSettingsWidget::onWindBarbUnitsChanged );
134 onWindBarbUnitsChanged( 0 );
135}
136
138{
139 mMeshLayer = layer;
140}
141
143{
146 static_cast<QgsMeshRendererVectorSettings::Symbology>( mSymbologyVectorComboBox->currentIndex() ) );
147
148 //Arrow settings
150
151 // basic
152 settings.setColor( mColorWidget->color() );
153 settings.setLineWidth( mLineWidthSpinBox->value() );
155 ( mColoringMethodComboBox->currentData().toInt() ) );
156 settings.setColorRampShader( mColorRampShaderWidget->shader() );
157
158 // filter by magnitude
159 double val = filterValue( mMinMagSpinBox, -1 );
160 settings.setFilterMin( val );
161
162 val = filterValue( mMaxMagSpinBox, -1 );
163 settings.setFilterMax( val );
164
165 // arrow head
166 val = filterValue( mHeadWidthSpinBox, arrowSettings.arrowHeadWidthRatio() * 100.0 );
167 arrowSettings.setArrowHeadWidthRatio( val / 100.0 );
168
169 val = filterValue( mHeadLengthSpinBox, arrowSettings.arrowHeadLengthRatio() * 100.0 );
170 arrowSettings.setArrowHeadLengthRatio( val / 100.0 );
171
172 // user grid
173 bool enabled = mDisplayVectorsOnGridGroupBox->isChecked();
175 settings.setUserGridCellWidth( mXSpacingSpinBox->value() );
176 settings.setUserGridCellHeight( mYSpacingSpinBox->value() );
177
178 // shaft length
179 auto method = static_cast<QgsMeshRendererVectorArrowSettings::ArrowScalingMethod>( mShaftLengthComboBox->currentIndex() );
180 arrowSettings.setShaftLengthMethod( method );
181
182 val = filterValue( mMinimumShaftSpinBox, arrowSettings.minShaftLength() );
183 arrowSettings.setMinShaftLength( val );
184
185 val = filterValue( mMaximumShaftSpinBox, arrowSettings.maxShaftLength() );
186 arrowSettings.setMaxShaftLength( val );
187
188 val = filterValue( mScaleShaftByFactorOfSpinBox, arrowSettings.scaleFactor() );
189 arrowSettings.setScaleFactor( val );
190
191 val = filterValue( mShaftLengthSpinBox, arrowSettings.fixedShaftLength() );
192 arrowSettings.setFixedShaftLength( val );
193
194 settings.setArrowsSettings( arrowSettings );
195
196 //Streamline setting
198 streamlineSettings.setSeedingMethod(
199 static_cast<QgsMeshRendererVectorStreamlineSettings::SeedingStartPointsMethod>( mStreamlinesSeedingMethodComboBox->currentIndex() ) );
200
201 streamlineSettings.setSeedingDensity( mStreamlinesDensitySpinBox->value() / 100 );
202
203 settings.setStreamLinesSettings( streamlineSettings );
204
205 //Traces setting
207 tracesSettings.setMaximumTailLength( mTracesMaxLengthSpinBox->value() );
208 tracesSettings.setMaximumTailLengthUnit( mTracesTailLengthMapUnitWidget->unit() );
209 tracesSettings.setParticlesCount( mTracesParticlesCountSpinBox->value() );
210 settings.setTracesSettings( tracesSettings );
211
212 // Wind Barb settings
214 windBarbSettings.setShaftLength( mWindBarbLengthSpinBox->value() );
215 windBarbSettings.setShaftLengthUnits( mWindBarbLengthMapUnitWidget->unit() );
216 windBarbSettings.setMagnitudeUnits(
217 static_cast<QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit>( mWindBarbUnitsComboBox->currentIndex() ) );
218 windBarbSettings.setMagnitudeMultiplier( mWindBarbMagnitudeMultiplierSpinBox->value() );
219 settings.setWindBarbSettings( windBarbSettings );
220
221 return settings;
222}
223
225{
226 if ( !mMeshLayer || !mMeshLayer->dataProvider() )
227 return;
228
229 if ( mActiveDatasetGroup < 0 )
230 return;
231
232 bool hasFaces = ( mMeshLayer->dataProvider() &&
234
235 const QgsMeshRendererSettings rendererSettings = mMeshLayer->rendererSettings();
236 const QgsMeshRendererVectorSettings settings = rendererSettings.vectorSettings( mActiveDatasetGroup );
237
238 symbologyLabel->setVisible( hasFaces );
239 mSymbologyVectorComboBox->setVisible( hasFaces );
240 mSymbologyVectorComboBox->setCurrentIndex( hasFaces ? settings.symbology() : 0 );
241
242 // Arrow settings
244
245 // basic
246 mColorWidget->setColor( settings.color() );
247 mLineWidthSpinBox->setValue( settings.lineWidth() );
248 mColoringMethodComboBox->setCurrentIndex( mColoringMethodComboBox->findData( settings.coloringMethod() ) );
249 mColorRampShaderWidget->setFromShader( settings.colorRampShader() );
250 mColorRampShaderMinimumSpinBox->setValue( settings.colorRampShader().minimumValue() );
251 mColorRampShaderMaximumSpinBox->setValue( settings.colorRampShader().maximumValue() );
252
253 // filter by magnitude
254 if ( settings.filterMin() > 0 )
255 {
256 mMinMagSpinBox->setValue( settings.filterMin() );
257 }
258 if ( settings.filterMax() > 0 )
259 {
260 mMaxMagSpinBox->setValue( settings.filterMax() );
261 }
262
263 // arrow head
264 mHeadWidthSpinBox->setValue( arrowSettings.arrowHeadWidthRatio() * 100.0 );
265 mHeadLengthSpinBox->setValue( arrowSettings.arrowHeadLengthRatio() * 100.0 );
266
267 // user grid
268 mDisplayVectorsOnGridGroupBox->setVisible( hasFaces );
269 mDisplayVectorsOnGridGroupBox->setChecked( settings.isOnUserDefinedGrid() && hasFaces );
270 mXSpacingSpinBox->setValue( settings.userGridCellWidth() );
271 mYSpacingSpinBox->setValue( settings.userGridCellHeight() );
272
273 // shaft length
274 mShaftLengthComboBox->setCurrentIndex( arrowSettings.shaftLengthMethod() );
275
276 mMinimumShaftSpinBox->setValue( arrowSettings.minShaftLength() );
277 mMaximumShaftSpinBox->setValue( arrowSettings.maxShaftLength() );
278 mScaleShaftByFactorOfSpinBox->setValue( arrowSettings.scaleFactor() );
279 mShaftLengthSpinBox->setValue( arrowSettings.fixedShaftLength() );
280
281 //Streamlines settings
283
284 mStreamlinesSeedingMethodComboBox->setCurrentIndex( streamlinesSettings.seedingMethod() );
285 mStreamlinesDensitySpinBox->setValue( streamlinesSettings.seedingDensity() * 100 );
286
287 //Traces settings
289
290 mTracesMaxLengthSpinBox->setValue( tracesSettings.maximumTailLength() );
291 mTracesTailLengthMapUnitWidget->setUnit( tracesSettings.maximumTailLengthUnit() );
292 mTracesParticlesCountSpinBox->setValue( tracesSettings.particlesCount() );
293
294 // Wind Barb settings
296 mWindBarbLengthSpinBox->setValue( windBarbSettings.shaftLength() );
297 mWindBarbUnitsComboBox->setCurrentIndex( static_cast<int>( windBarbSettings.magnitudeUnits() ) );
299 mWindBarbMagnitudeMultiplierSpinBox->setValue( windBarbSettings.magnitudeMultiplier() );
300}
301
302void QgsMeshRendererVectorSettingsWidget::onSymbologyChanged( int currentIndex )
303{
304 mStreamlineWidget->setVisible( currentIndex == QgsMeshRendererVectorSettings::Streamlines );
305 mArrowLengthGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
306 mHeadOptionsGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
307 mTracesGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Traces );
308 mWindBarbGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::WindBarbs );
309
310 mDisplayVectorsOnGridGroupBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
311 filterByMagnitudeLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
312 minimumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
313 mMinMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
314 maximumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
315 mMaxMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
316
317 mDisplayVectorsOnGridGroupBox->setEnabled(
321 mStreamlinesSeedingMethodComboBox->currentIndex() == QgsMeshRendererVectorStreamlineSettings::MeshGridded ) ) ;
322}
323
324void QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged( int currentIndex )
325{
326 bool enabled = currentIndex == QgsMeshRendererVectorStreamlineSettings::Random;
327 mStreamlinesDensityLabel->setEnabled( enabled );
328 mStreamlinesDensitySpinBox->setEnabled( enabled );
329
330 mDisplayVectorsOnGridGroupBox->setEnabled( !enabled );
331}
332
333void QgsMeshRendererVectorSettingsWidget::onWindBarbUnitsChanged( int currentIndex )
334{
336 static_cast<QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit>( currentIndex );
337
338 mWindBarbMagnitudeMultiplierLabel->setVisible( units == QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit::OtherUnit );
339 mWindBarbMagnitudeMultiplierSpinBox->setVisible( units == QgsMeshRendererVectorWindBarbSettings::WindSpeedUnit::OtherUnit );
340
341 emit widgetChanged();
342}
343
344void QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged()
345{
346 mColorRampShaderGroupBox->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::ColorRamp );
347 mColorWidget->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
348 mSingleColorLabel->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
349
350 if ( mColorRampShaderWidget->shader().colorRampItemList().isEmpty() )
351 loadColorRampShader();
352
353 emit widgetChanged();
354}
355
356void QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged()
357{
358 mColorRampShaderWidget->setMinimumMaximumAndClassify(
359 filterValue( mColorRampShaderMinimumSpinBox, 0 ),
360 filterValue( mColorRampShaderMaximumSpinBox, 0 ) );
361}
362
363void QgsMeshRendererVectorSettingsWidget::loadColorRampShader()
364{
365 if ( !mMeshLayer )
366 return;
367
368 int currentVectorDataSetGroupIndex = mMeshLayer->rendererSettings().activeVectorDatasetGroup();
369 if ( currentVectorDataSetGroupIndex < 0 ||
370 !mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex ).isVector() )
371 return;
372
373 const QgsMeshDatasetGroupMetadata meta = mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex );
374 double min = meta.minimum();
375 double max = meta.maximum();
376
377 mColorRampShaderWidget->setMinimumMaximumAndClassify( min, max );
378 whileBlocking( mColorRampShaderMinimumSpinBox )->setValue( min );
379 whileBlocking( mColorRampShaderMaximumSpinBox )->setValue( max );
380}
381
382double QgsMeshRendererVectorSettingsWidget::filterValue( const QgsDoubleSpinBox *spinBox, double errVal ) const
383{
384 if ( spinBox->value() == spinBox->clearValue() )
385 return errVal;
386
387 return spinBox->value();
388}
@ 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)
Returns 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.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition qgis.h:5369