QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 #include "qgsmessagelog.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 
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 
53  connect( mColoringMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
54  this, &QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged );
55  connect( mColorRampShaderWidget, &QgsColorRampShaderWidget::widgetChanged,
57  connect( mColorRampShaderMinimumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
58  this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
59  connect( mColorRampShaderMaximumSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
60  this, &QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged );
61 
62  connect( mLineWidthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
64 
65  connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
67 
68  connect( mShaftLengthComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
69  mShaftOptionsStackedWidget, &QStackedWidget::setCurrentIndex );
70 
71  connect( mDisplayVectorsOnGridGroupBox, &QGroupBox::toggled, this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
72 
73  connect( mColorRampShaderLoadButton, &QPushButton::clicked, this, &QgsMeshRendererVectorSettingsWidget::loadColorRampShader );
74 
75  onColoringMethodChanged();
76 
77  for ( const auto &widget : std::as_const( widgets ) )
78  {
79  connect( widget, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
80  }
81 
82  connect( mXSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
83  connect( mYSpacingSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, &QgsMeshRendererVectorSettingsWidget::widgetChanged );
84 
85  connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
86  this, &QgsMeshRendererVectorSettingsWidget::onSymbologyChanged );
87  onSymbologyChanged( 0 );
88 
89  connect( mSymbologyVectorComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
91 
92  connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
93  this, &QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged );
94  onStreamLineSeedingMethodChanged( 0 );
95 
96  connect( mStreamlinesSeedingMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
98 
99  connect( mStreamlinesDensitySpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
101 
102  connect( mTracesMaxLengthSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
104 
105  connect( mTracesParticlesCountSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ),
107 
108  mTracesTailLengthMapUnitWidget->setUnits( QgsUnitTypes::RenderUnitList()
113 
114  connect( mTracesTailLengthMapUnitWidget, &QgsUnitSelectionWidget::changed,
116 }
117 
119 {
120  mMeshLayer = layer;
121 }
122 
124 {
127  static_cast<QgsMeshRendererVectorSettings::Symbology>( mSymbologyVectorComboBox->currentIndex() ) );
128 
129  //Arrow settings
131 
132  // basic
133  settings.setColor( mColorWidget->color() );
134  settings.setLineWidth( mLineWidthSpinBox->value() );
136  ( mColoringMethodComboBox->currentData().toInt() ) );
137  settings.setColorRampShader( mColorRampShaderWidget->shader() );
138 
139  // filter by magnitude
140  double val = filterValue( mMinMagSpinBox, -1 );
141  settings.setFilterMin( val );
142 
143  val = filterValue( mMaxMagSpinBox, -1 );
144  settings.setFilterMax( val );
145 
146  // arrow head
147  val = filterValue( mHeadWidthSpinBox, arrowSettings.arrowHeadWidthRatio() * 100.0 );
148  arrowSettings.setArrowHeadWidthRatio( val / 100.0 );
149 
150  val = filterValue( mHeadLengthSpinBox, arrowSettings.arrowHeadLengthRatio() * 100.0 );
151  arrowSettings.setArrowHeadLengthRatio( val / 100.0 );
152 
153  // user grid
154  bool enabled = mDisplayVectorsOnGridGroupBox->isChecked();
155  settings.setOnUserDefinedGrid( enabled );
156  settings.setUserGridCellWidth( mXSpacingSpinBox->value() );
157  settings.setUserGridCellHeight( mYSpacingSpinBox->value() );
158 
159  // shaft length
160  auto method = static_cast<QgsMeshRendererVectorArrowSettings::ArrowScalingMethod>( mShaftLengthComboBox->currentIndex() );
161  arrowSettings.setShaftLengthMethod( method );
162 
163  val = filterValue( mMinimumShaftSpinBox, arrowSettings.minShaftLength() );
164  arrowSettings.setMinShaftLength( val );
165 
166  val = filterValue( mMaximumShaftSpinBox, arrowSettings.maxShaftLength() );
167  arrowSettings.setMaxShaftLength( val );
168 
169  val = filterValue( mScaleShaftByFactorOfSpinBox, arrowSettings.scaleFactor() );
170  arrowSettings.setScaleFactor( val );
171 
172  val = filterValue( mShaftLengthSpinBox, arrowSettings.fixedShaftLength() );
173  arrowSettings.setFixedShaftLength( val );
174 
175  settings.setArrowsSettings( arrowSettings );
176 
177  //Streamline setting
178  QgsMeshRendererVectorStreamlineSettings streamlineSettings;
179  streamlineSettings.setSeedingMethod(
180  static_cast<QgsMeshRendererVectorStreamlineSettings::SeedingStartPointsMethod>( mStreamlinesSeedingMethodComboBox->currentIndex() ) );
181 
182  streamlineSettings.setSeedingDensity( mStreamlinesDensitySpinBox->value() / 100 );
183 
184  settings.setStreamLinesSettings( streamlineSettings );
185 
186  //Traces setting
188  tracesSettings.setMaximumTailLength( mTracesMaxLengthSpinBox->value() );
189  tracesSettings.setMaximumTailLengthUnit( mTracesTailLengthMapUnitWidget->unit() );
190  tracesSettings.setParticlesCount( mTracesParticlesCountSpinBox->value() );
191  settings.setTracesSettings( tracesSettings );
192 
193  return settings;
194 }
195 
197 {
198  if ( !mMeshLayer || !mMeshLayer->dataProvider() )
199  return;
200 
201  if ( mActiveDatasetGroup < 0 )
202  return;
203 
204  bool hasFaces = ( mMeshLayer->dataProvider() &&
205  mMeshLayer->dataProvider()->contains( QgsMesh::ElementType::Face ) );
206 
207  const QgsMeshRendererSettings rendererSettings = mMeshLayer->rendererSettings();
208  const QgsMeshRendererVectorSettings settings = rendererSettings.vectorSettings( mActiveDatasetGroup );
209 
210  symbologyLabel->setVisible( hasFaces );
211  mSymbologyVectorComboBox->setVisible( hasFaces );
212  mSymbologyVectorComboBox->setCurrentIndex( hasFaces ? settings.symbology() : 0 );
213 
214  // Arrow settings
216 
217  // basic
218  mColorWidget->setColor( settings.color() );
219  mLineWidthSpinBox->setValue( settings.lineWidth() );
220  mColoringMethodComboBox->setCurrentIndex( mColoringMethodComboBox->findData( settings.coloringMethod() ) );
221  mColorRampShaderWidget->setFromShader( settings.colorRampShader() );
222  mColorRampShaderMinimumSpinBox->setValue( settings.colorRampShader().minimumValue() );
223  mColorRampShaderMaximumSpinBox->setValue( settings.colorRampShader().maximumValue() );
224 
225  // filter by magnitude
226  if ( settings.filterMin() > 0 )
227  {
228  mMinMagSpinBox->setValue( settings.filterMin() );
229  }
230  if ( settings.filterMax() > 0 )
231  {
232  mMaxMagSpinBox->setValue( settings.filterMax() );
233  }
234 
235  // arrow head
236  mHeadWidthSpinBox->setValue( arrowSettings.arrowHeadWidthRatio() * 100.0 );
237  mHeadLengthSpinBox->setValue( arrowSettings.arrowHeadLengthRatio() * 100.0 );
238 
239  // user grid
240  mDisplayVectorsOnGridGroupBox->setVisible( hasFaces );
241  mDisplayVectorsOnGridGroupBox->setChecked( settings.isOnUserDefinedGrid() && hasFaces );
242  mXSpacingSpinBox->setValue( settings.userGridCellWidth() );
243  mYSpacingSpinBox->setValue( settings.userGridCellHeight() );
244 
245  // shaft length
246  mShaftLengthComboBox->setCurrentIndex( arrowSettings.shaftLengthMethod() );
247 
248  mMinimumShaftSpinBox->setValue( arrowSettings.minShaftLength() );
249  mMaximumShaftSpinBox->setValue( arrowSettings.maxShaftLength() );
250  mScaleShaftByFactorOfSpinBox->setValue( arrowSettings.scaleFactor() );
251  mShaftLengthSpinBox->setValue( arrowSettings.fixedShaftLength() );
252 
253  //Streamlines settings
255 
256  mStreamlinesSeedingMethodComboBox->setCurrentIndex( streamlinesSettings.seedingMethod() );
257  mStreamlinesDensitySpinBox->setValue( streamlinesSettings.seedingDensity() * 100 );
258 
259  //Traces settings
261 
262  mTracesMaxLengthSpinBox->setValue( tracesSettings.maximumTailLength() );
263  mTracesTailLengthMapUnitWidget->setUnit( tracesSettings.maximumTailLengthUnit() );
264  mTracesParticlesCountSpinBox->setValue( tracesSettings.particlesCount() );
265 
266 }
267 
268 void QgsMeshRendererVectorSettingsWidget::onSymbologyChanged( int currentIndex )
269 {
270  mStreamlineWidget->setVisible( currentIndex == QgsMeshRendererVectorSettings::Streamlines );
271  mArrowLengthGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
272  mHeadOptionsGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Arrows );
273  mTracesGroupBox->setVisible( currentIndex == QgsMeshRendererVectorSettings::Traces );
274 
275  mDisplayVectorsOnGridGroupBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
276  filterByMagnitudeLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
277  minimumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
278  mMinMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
279  maximumMagLabel->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
280  mMaxMagSpinBox->setVisible( currentIndex != QgsMeshRendererVectorSettings::Traces );
281 
282  mDisplayVectorsOnGridGroupBox->setEnabled(
283  currentIndex == QgsMeshRendererVectorSettings::Arrows ||
284  ( currentIndex == QgsMeshRendererVectorSettings::Streamlines &&
285  mStreamlinesSeedingMethodComboBox->currentIndex() == QgsMeshRendererVectorStreamlineSettings::MeshGridded ) ) ;
286 }
287 
288 void QgsMeshRendererVectorSettingsWidget::onStreamLineSeedingMethodChanged( int currentIndex )
289 {
290  bool enabled = currentIndex == QgsMeshRendererVectorStreamlineSettings::Random;
291  mStreamlinesDensityLabel->setEnabled( enabled );
292  mStreamlinesDensitySpinBox->setEnabled( enabled );
293 
294  mDisplayVectorsOnGridGroupBox->setEnabled( !enabled );
295 }
296 
297 void QgsMeshRendererVectorSettingsWidget::onColoringMethodChanged()
298 {
299  mColorRampShaderGroupBox->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::ColorRamp );
300  mColorWidget->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
301  mSingleColorLabel->setVisible( mColoringMethodComboBox->currentData() == QgsInterpolatedLineColor::SingleColor );
302 
303  if ( mColorRampShaderWidget->shader().colorRampItemList().isEmpty() )
304  loadColorRampShader();
305 
306  emit widgetChanged();
307 }
308 
309 void QgsMeshRendererVectorSettingsWidget::onColorRampMinMaxChanged()
310 {
311  mColorRampShaderWidget->setMinimumMaximumAndClassify(
312  filterValue( mColorRampShaderMinimumSpinBox, 0 ),
313  filterValue( mColorRampShaderMaximumSpinBox, 0 ) );
314 }
315 
316 void QgsMeshRendererVectorSettingsWidget::loadColorRampShader()
317 {
318  if ( !mMeshLayer )
319  return;
320 
321  int currentVectorDataSetGroupIndex = mMeshLayer->rendererSettings().activeVectorDatasetGroup();
322  if ( currentVectorDataSetGroupIndex < 0 ||
323  !mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex ).isVector() )
324  return;
325 
326  const QgsMeshDatasetGroupMetadata meta = mMeshLayer->datasetGroupMetadata( currentVectorDataSetGroupIndex );
327  double min = meta.minimum();
328  double max = meta.maximum();
329 
330  mColorRampShaderWidget->setMinimumMaximumAndClassify( min, max );
331  whileBlocking( mColorRampShaderMinimumSpinBox )->setValue( min );
332  whileBlocking( mColorRampShaderMaximumSpinBox )->setValue( max );
333 }
334 
335 double QgsMeshRendererVectorSettingsWidget::filterValue( const QgsDoubleSpinBox *spinBox, double errVal ) const
336 {
337  if ( spinBox->value() == spinBox->clearValue() )
338  return errVal;
339 
340  return spinBox->value();
341 }
QgsMeshDatasetGroupMetadata::minimum
double minimum() const
Returns minimum scalar value/vector magnitude present for whole dataset group.
Definition: qgsmeshdataset.cpp:177
QgsMeshRendererVectorSettingsWidget::setLayer
void setLayer(QgsMeshLayer *layer)
Associates mesh layer with the widget.
Definition: qgsmeshrenderervectorsettingswidget.cpp:118
QgsMeshRendererVectorSettings
Represents a renderer settings for vector datasets.
Definition: qgsmeshrenderersettings.h:410
QgsMeshRendererVectorStreamlineSettings::SeedingStartPointsMethod
SeedingStartPointsMethod
Method used to define start points that are used to draw streamlines.
Definition: qgsmeshrenderersettings.h:328
QgsMeshRendererVectorSettings::Traces
@ Traces
Displaying vector dataset with particle traces.
Definition: qgsmeshrenderersettings.h:425
QgsMeshRendererVectorSettings::symbology
Symbology symbology() const
Returns the displaying method used to render vector datasets.
Definition: qgsmeshrenderersettings.cpp:565
QgsMeshRendererVectorArrowSettings::arrowHeadWidthRatio
double arrowHeadWidthRatio() const
Returns ratio of the head width of the arrow (range 0-1)
Definition: qgsmeshrenderersettings.cpp:311
QgsMeshRendererSettings
Represents all mesh renderer settings.
Definition: qgsmeshrenderersettings.h:590
QgsMeshRendererVectorSettings::arrowSettings
QgsMeshRendererVectorArrowSettings arrowSettings() const
Returns settings for vector rendered with arrows.
Definition: qgsmeshrenderersettings.cpp:575
QgsMeshRendererVectorSettings::setFilterMin
void setFilterMin(double filterMin)
Sets filter value for vector magnitudes.
Definition: qgsmeshrenderersettings.cpp:216
QgsMeshRendererVectorArrowSettings::setArrowHeadLengthRatio
void setArrowHeadLengthRatio(double arrowHeadLengthRatio)
Sets ratio of the head length of the arrow (range 0-1)
Definition: qgsmeshrenderersettings.cpp:326
QgsInterpolatedLineColor::SingleColor
@ SingleColor
Render with a single color.
Definition: qgsinterpolatedlinerenderer.h:48
QgsUnitTypes::RenderPoints
@ RenderPoints
Points (e.g., for font sizes)
Definition: qgsunittypes.h:173
QgsInterpolatedLineColor::ColoringMethod
ColoringMethod
Defines how the color is defined.
Definition: qgsinterpolatedlinerenderer.h:45
QgsMeshRendererVectorStreamlineSettings::setSeedingMethod
void setSeedingMethod(const SeedingStartPointsMethod &seedingMethod)
Sets the method used for seeding start points of strealines.
Definition: qgsmeshrenderersettings.cpp:532
QgsMeshRendererVectorArrowSettings::setShaftLengthMethod
void setShaftLengthMethod(ArrowScalingMethod shaftLengthMethod)
Sets method used for drawing arrows.
Definition: qgsmeshrenderersettings.cpp:266
QgsMeshRendererVectorSettings::setUserGridCellHeight
void setUserGridCellHeight(int height)
Sets height of user grid cell (in pixels)
Definition: qgsmeshrenderersettings.cpp:256
QgsRasterShaderFunction::maximumValue
double maximumValue() const
Returns the minimum value for the raster shader.
Definition: qgsrastershaderfunction.h:119
qgis.h
QgsDoubleSpinBox::clearValue
bool clearValue
Definition: qgsdoublespinbox.h:56
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:169
QgsMeshDataSourceInterface::contains
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
Definition: qgsmeshdataprovider.cpp:215
QgsMeshRendererVectorArrowSettings::ArrowScalingMethod
ArrowScalingMethod
Algorithm how to transform vector magnitude to length of arrow on the device in pixels.
Definition: qgsmeshrenderersettings.h:210
QgsMeshRendererVectorSettings::tracesSettings
QgsMeshRendererVectorTracesSettings tracesSettings() const
Returns settings for vector rendered with traces.
Definition: qgsmeshrenderersettings.cpp:685
QgsMeshRendererVectorArrowSettings::setFixedShaftLength
void setFixedShaftLength(double fixedShaftLength)
Sets fixed length (in millimeters)
Definition: qgsmeshrenderersettings.cpp:306
QgsMeshRendererVectorStreamlineSettings::MeshGridded
@ MeshGridded
Seeds start points on the vertices mesh or user regular grid.
Definition: qgsmeshrenderersettings.h:334
QgsMeshRendererVectorStreamlineSettings::setSeedingDensity
void setSeedingDensity(double seedingDensity)
Sets the density used for seeding start points.
Definition: qgsmeshrenderersettings.cpp:542
QgsMeshRendererVectorStreamlineSettings::Random
@ Random
Seeds start points randomly on the mesh.
Definition: qgsmeshrenderersettings.h:339
QgsColorButton::colorChanged
void colorChanged(const QColor &color)
Emitted whenever a new color is set for the button.
QgsMeshLayer::rendererSettings
QgsMeshRendererSettings rendererSettings() const
Returns renderer settings.
Definition: qgsmeshlayer.cpp:344
QgsMeshRendererVectorSettings::setColoringMethod
void setColoringMethod(const QgsInterpolatedLineColor::ColoringMethod &coloringMethod)
Sets the coloring method used to render vector datasets.
Definition: qgsmeshrenderersettings.cpp:654
QgsInterpolatedLineColor::ColorRamp
@ ColorRamp
Render with a color ramp.
Definition: qgsinterpolatedlinerenderer.h:50
qgsmeshrenderervectorsettingswidget.h
QgsMeshRendererVectorSettings::filterMin
double filterMin() const
Returns filter value for vector magnitudes.
Definition: qgsmeshrenderersettings.cpp:211
QgsMeshRendererVectorTracesSettings::particlesCount
int particlesCount() const
Returns particles count.
Definition: qgsmeshrenderersettings.cpp:733
QgsMeshRendererVectorSettings::setOnUserDefinedGrid
void setOnUserDefinedGrid(bool enabled)
Toggles drawing of vectors on user defined grid.
Definition: qgsmeshrenderersettings.cpp:236
QgsMeshRendererVectorSettings::setSymbology
void setSymbology(const Symbology &symbology)
Sets the displaying method used to render vector datasets.
Definition: qgsmeshrenderersettings.cpp:570
whileBlocking
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:2191
QgsMeshRendererSettings::activeVectorDatasetGroup
int activeVectorDatasetGroup() const
Returns the active vector dataset group.
Definition: qgsmeshrenderersettings.cpp:517
QgsMeshRendererVectorSettingsWidget::widgetChanged
void widgetChanged()
Mesh rendering settings changed.
QgsMeshLayer
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:98
QgsMeshRendererVectorSettings::setArrowsSettings
void setArrowsSettings(const QgsMeshRendererVectorArrowSettings &arrowSettings)
Sets settings for vector rendered with arrows.
Definition: qgsmeshrenderersettings.cpp:580
QgsMeshRendererVectorTracesSettings::setParticlesCount
void setParticlesCount(int value)
Sets particles count.
Definition: qgsmeshrenderersettings.cpp:738
QgsMeshRendererVectorTracesSettings::maximumTailLength
double maximumTailLength() const
Returns the maximum tail length.
Definition: qgsmeshrenderersettings.cpp:723
QgsMeshRendererVectorSettingsWidget::syncToLayer
void syncToLayer()
Synchronizes widgets state with associated mesh layer.
Definition: qgsmeshrenderervectorsettingswidget.cpp:196
QgsMeshRendererVectorSettings::setColor
void setColor(const QColor &color)
Sets color used for drawing arrows.
Definition: qgsmeshrenderersettings.cpp:206
QgsMeshRendererVectorSettings::setStreamLinesSettings
void setStreamLinesSettings(const QgsMeshRendererVectorStreamlineSettings &streamLinesSettings)
Sets settings for vector rendered with streamlines.
Definition: qgsmeshrenderersettings.cpp:590
QgsMeshRendererVectorSettings::setLineWidth
void setLineWidth(double lineWidth)
Sets line width of the arrow in pixels (in millimeters)
Definition: qgsmeshrenderersettings.cpp:196
QgsUnitSelectionWidget::changed
void changed()
QgsMeshRendererVectorStreamlineSettings::seedingDensity
double seedingDensity() const
Returns the density used for seeding start points.
Definition: qgsmeshrenderersettings.cpp:537
QgsMeshRendererVectorSettings::Streamlines
@ Streamlines
Displaying vector dataset with streamlines.
Definition: qgsmeshrenderersettings.h:423
QgsMeshRendererVectorArrowSettings::setMaxShaftLength
void setMaxShaftLength(double maxShaftLength)
Sets maximum shaft length (in millimeters)
Definition: qgsmeshrenderersettings.cpp:286
QgsMeshRendererVectorArrowSettings::fixedShaftLength
double fixedShaftLength() const
Returns fixed arrow length (in millimeters)
Definition: qgsmeshrenderersettings.cpp:301
QgsMeshRendererVectorSettings::color
QColor color() const
Returns color used for drawing arrows.
Definition: qgsmeshrenderersettings.cpp:201
QgsMeshRendererVectorArrowSettings::setMinShaftLength
void setMinShaftLength(double minShaftLength)
Sets mininimum shaft length (in millimeters)
Definition: qgsmeshrenderersettings.cpp:276
QgsRasterShaderFunction::minimumValue
double minimumValue() const
Returns the maximum value for the raster shader.
Definition: qgsrastershaderfunction.h:112
QgsUnitTypes::RenderPixels
@ RenderPixels
Pixels.
Definition: qgsunittypes.h:171
qgsmeshlayer.h
QgsMeshRendererVectorArrowSettings::shaftLengthMethod
QgsMeshRendererVectorArrowSettings::ArrowScalingMethod shaftLengthMethod() const
Returns method used for drawing arrows.
Definition: qgsmeshrenderersettings.cpp:261
QgsMeshRendererVectorSettings::setTracesSettings
void setTracesSettings(const QgsMeshRendererVectorTracesSettings &tracesSettings)
Sets settings for vector rendered with traces.
Definition: qgsmeshrenderersettings.cpp:690
QgsMeshRendererVectorSettings::filterMax
double filterMax() const
Returns filter value for vector magnitudes.
Definition: qgsmeshrenderersettings.cpp:221
QgsMeshRendererVectorSettings::userGridCellHeight
int userGridCellHeight() const
Returns height in pixels of user grid cell.
Definition: qgsmeshrenderersettings.cpp:251
QgsMeshRendererVectorTracesSettings::maximumTailLengthUnit
QgsUnitTypes::RenderUnit maximumTailLengthUnit() const
Returns the maximum tail length unit.
Definition: qgsmeshrenderersettings.cpp:713
QgsMeshRendererSettings::vectorSettings
QgsMeshRendererVectorSettings vectorSettings(int groupIndex) const
Returns renderer settings.
Definition: qgsmeshrenderersettings.h:629
QgsMeshRendererVectorSettings::setColorRampShader
void setColorRampShader(const QgsColorRampShader &colorRampShader)
Returns the color ramp shader used to render vector datasets.
Definition: qgsmeshrenderersettings.cpp:664
QgsMeshRendererVectorSettings::coloringMethod
QgsInterpolatedLineColor::ColoringMethod coloringMethod() const
Returns the coloring method used to render vector datasets.
Definition: qgsmeshrenderersettings.cpp:649
QgsMeshDatasetGroupMetadata
QgsMeshDatasetGroupMetadata is a collection of dataset group metadata such as whether the data is vec...
Definition: qgsmeshdataset.h:351
QgsMeshRendererVectorSettings::Arrows
@ Arrows
Displaying vector dataset with arrows.
Definition: qgsmeshrenderersettings.h:421
QgsMeshRendererVectorSettings::Symbology
Symbology
Defines the symbology of vector rendering.
Definition: qgsmeshrenderersettings.h:418
QgsMeshRendererVectorArrowSettings
Represents a mesh renderer settings for vector datasets displayed with arrows.
Definition: qgsmeshrenderersettings.h:205
QgsColorRampShaderWidget::widgetChanged
void widgetChanged()
Widget changed.
QgsMeshRendererVectorArrowSettings::maxShaftLength
double maxShaftLength() const
Returns maximum shaft length (in millimeters)
Definition: qgsmeshrenderersettings.cpp:281
QgsMeshDatasetGroupMetadata::maximum
double maximum() const
Returns maximum scalar value/vector magnitude present for whole dataset group.
Definition: qgsmeshdataset.cpp:182
QgsMeshRendererVectorStreamlineSettings
Represents a streamline renderer settings for vector datasets displayed by streamlines.
Definition: qgsmeshrenderersettings.h:324
QgsMeshRendererVectorSettingsWidget::QgsMeshRendererVectorSettingsWidget
QgsMeshRendererVectorSettingsWidget(QWidget *parent=nullptr)
A widget to hold the renderer Vector settings for a mesh layer.
Definition: qgsmeshrenderervectorsettingswidget.cpp:22
QgsUnitTypes::RenderMetersInMapUnits
@ RenderMetersInMapUnits
Meters value as Map units.
Definition: qgsunittypes.h:176
QgsMeshRendererVectorArrowSettings::setScaleFactor
void setScaleFactor(double scaleFactor)
Sets scale factor.
Definition: qgsmeshrenderersettings.cpp:296
QgsDoubleSpinBox
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value....
Definition: qgsdoublespinbox.h:42
QgsMeshRendererVectorArrowSettings::scaleFactor
double scaleFactor() const
Returns scale factor.
Definition: qgsmeshrenderersettings.cpp:291
QgsMeshRendererVectorSettings::colorRampShader
QgsColorRampShader colorRampShader() const
Sets the color ramp shader used to render vector datasets.
Definition: qgsmeshrenderersettings.cpp:659
QgsMeshRendererVectorTracesSettings::setMaximumTailLengthUnit
void setMaximumTailLengthUnit(const QgsUnitTypes::RenderUnit &maximumTailLengthUnit)
Sets the maximum tail length unit.
Definition: qgsmeshrenderersettings.cpp:718
QgsMeshLayer::datasetGroupMetadata
QgsMeshDatasetGroupMetadata datasetGroupMetadata(const QgsMeshDatasetIndex &index) const
Returns the dataset groups metadata.
Definition: qgsmeshlayer.cpp:404
QgsMeshRendererVectorTracesSettings::setMaximumTailLength
void setMaximumTailLength(double maximumTailLength)
Sets the maximums tail length.
Definition: qgsmeshrenderersettings.cpp:728
QgsMeshRendererVectorSettings::userGridCellWidth
int userGridCellWidth() const
Returns width in pixels of user grid cell.
Definition: qgsmeshrenderersettings.cpp:241
QgsMeshRendererVectorSettings::isOnUserDefinedGrid
bool isOnUserDefinedGrid() const
Returns whether vectors are drawn on user-defined grid.
Definition: qgsmeshrenderersettings.cpp:231
QgsMeshRendererVectorArrowSettings::arrowHeadLengthRatio
double arrowHeadLengthRatio() const
Returns ratio of the head length of the arrow (range 0-1)
Definition: qgsmeshrenderersettings.cpp:321
QgsMeshRendererVectorStreamlineSettings::seedingMethod
SeedingStartPointsMethod seedingMethod() const
Returns the method used for seeding start points of strealines.
Definition: qgsmeshrenderersettings.cpp:527
QgsMeshRendererVectorArrowSettings::minShaftLength
double minShaftLength() const
Returns mininimum shaft length (in millimeters)
Definition: qgsmeshrenderersettings.cpp:271
QgsUnitTypes::RenderUnitList
QList< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
Definition: qgsunittypes.h:240
QgsMeshRendererVectorSettings::streamLinesSettings
QgsMeshRendererVectorStreamlineSettings streamLinesSettings() const
Returns settings for vector rendered with streamlines.
Definition: qgsmeshrenderersettings.cpp:585
QgsMeshDatasetGroupMetadata::isVector
bool isVector() const
Returns whether dataset group has vector data.
Definition: qgsmeshdataset.cpp:152
QgsMeshRendererVectorArrowSettings::setArrowHeadWidthRatio
void setArrowHeadWidthRatio(double arrowHeadWidthRatio)
Sets ratio of the head width of the arrow (range 0-1)
Definition: qgsmeshrenderersettings.cpp:316
QgsMeshRendererVectorSettings::lineWidth
double lineWidth() const
Returns line width of the arrow (in millimeters)
Definition: qgsmeshrenderersettings.cpp:191
QgsMeshRendererVectorSettings::setFilterMax
void setFilterMax(double filterMax)
Sets filter value for vector magnitudes.
Definition: qgsmeshrenderersettings.cpp:226
QgsMeshRendererVectorTracesSettings
Represents a trace renderer settings for vector datasets displayed by particle traces.
Definition: qgsmeshrenderersettings.h:370
QgsMeshRendererVectorSettings::setUserGridCellWidth
void setUserGridCellWidth(int width)
Sets width of user grid cell (in pixels)
Definition: qgsmeshrenderersettings.cpp:246
QgsMeshLayer::dataProvider
QgsMeshDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
Definition: qgsmeshlayer.cpp:110
QgsMeshRendererVectorSettingsWidget::settings
QgsMeshRendererVectorSettings settings() const
Returns vector settings.
Definition: qgsmeshrenderervectorsettingswidget.cpp:123
qgsmessagelog.h