QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsinterpolatedlinesymbollayerwidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsinterpolatedlinesymbollayerwidget.cpp - QgsInterpolatedLineSymbolLayerWidget
3 
4  ---------------------
5  begin : 23.3.2021
6  copyright : (C) 2021 by Vincent Cloarec
7  email : vcloarec at gmail dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
17 
18 #include "qgsvectorlayer.h"
20 #include "qgsproject.h"
21 #include "qgstemporalcontroller.h"
22 #include "qgsmapcanvas.h"
23 #include "qgsdoublevalidator.h"
24 
25 
27  : QgsSymbolLayerWidget( parent, layer )
28 {
29  setupUi( this );
30 
31  mWidthMethodComboBox->addItem( tr( "Fixed Width" ), false );
32  mWidthMethodComboBox->addItem( tr( "Varying Width" ), true );
33  mColorMethodComboBox->addItem( tr( "Single Color" ), QgsInterpolatedLineColor::SingleColor );
34  mColorMethodComboBox->addItem( tr( "Varying Color" ), QgsInterpolatedLineColor::ColorRamp );
35 
36  mWidthStartFieldExpression->setFilters( QgsFieldProxyModel::Numeric );
37  mWidthEndFieldExpression->setFilters( QgsFieldProxyModel::Numeric );
38  mColorStartFieldExpression->setFilters( QgsFieldProxyModel::Numeric );
39  mColorEndFieldExpression->setFilters( QgsFieldProxyModel::Numeric );
40 
41  mWidthStartFieldExpression->setLayer( layer );
42  mWidthEndFieldExpression->setLayer( layer );
43  mColorStartFieldExpression->setLayer( layer );
44  mColorEndFieldExpression->setLayer( layer );
45 
46  mWidthUnitSelectionFixed->setUnits( QgsUnitTypes::RenderUnitList()
47  << QgsUnitTypes::RenderUnit::RenderInches
48  << QgsUnitTypes::RenderUnit::RenderMapUnits
49  << QgsUnitTypes::RenderUnit::RenderMetersInMapUnits
50  << QgsUnitTypes::RenderUnit::RenderMillimeters
51  << QgsUnitTypes::RenderUnit::RenderPixels
52  << QgsUnitTypes::RenderUnit::RenderPoints );
53 
54  mWidthUnitSelectionVarying->setUnits( QgsUnitTypes::RenderUnitList()
55  << QgsUnitTypes::RenderUnit::RenderInches
56  << QgsUnitTypes::RenderUnit::RenderMapUnits
57  << QgsUnitTypes::RenderUnit::RenderMetersInMapUnits
58  << QgsUnitTypes::RenderUnit::RenderMillimeters
59  << QgsUnitTypes::RenderUnit::RenderPixels
60  << QgsUnitTypes::RenderUnit::RenderPoints );
61 
62  connect( mWidthMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
63  this, &QgsInterpolatedLineSymbolLayerWidget::updateVisibleWidget );
64  connect( mColorMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
65  this, &QgsInterpolatedLineSymbolLayerWidget::updateVisibleWidget );
66 
67  // Width parameter
68  connect( mWidthMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
69  this, &QgsInterpolatedLineSymbolLayerWidget::apply );
70  connect( mDoubleSpinBoxWidth, qOverload<double>( &QDoubleSpinBox::valueChanged ),
71  this, &QgsInterpolatedLineSymbolLayerWidget::apply );
72  connect( mWidthStartFieldExpression, static_cast < void ( QgsFieldExpressionWidget::* )( const QString & ) >( &QgsFieldExpressionWidget::fieldChanged )
73  , this, &QgsInterpolatedLineSymbolLayerWidget::reloadMinMaxWidthFromLayer );
74  connect( mWidthEndFieldExpression, static_cast < void ( QgsFieldExpressionWidget::* )( const QString & ) >( &QgsFieldExpressionWidget::fieldChanged )
75  , this, &QgsInterpolatedLineSymbolLayerWidget::reloadMinMaxWidthFromLayer );
76  connect( mButtonLoadMinMaxValueWidth, &QPushButton::clicked, this, &QgsInterpolatedLineSymbolLayerWidget::onReloadMinMaxValueWidth );
77  connect( mLineEditWidthMinValue, &QLineEdit::textChanged, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
78  connect( mLineEditWidthMaxValue, &QLineEdit::textChanged, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
79  connect( mDoubleSpinBoxMinWidth, qOverload<double>( &QDoubleSpinBox::valueChanged ),
80  this, &QgsInterpolatedLineSymbolLayerWidget::apply );
81  connect( mDoubleSpinBoxMaxWidth, qOverload<double>( &QDoubleSpinBox::valueChanged ),
82  this, &QgsInterpolatedLineSymbolLayerWidget::apply );
83  connect( mWidthUnitSelectionFixed, &QgsUnitSelectionWidget::changed, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
84  connect( mWidthUnitSelectionVarying, &QgsUnitSelectionWidget::changed, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
85 
86  connect( mWidthUnitSelectionVarying, &QgsUnitSelectionWidget::changed, this, [this]
87  {
88  whileBlocking( mWidthUnitSelectionFixed )->setUnit( mWidthUnitSelectionVarying->unit() );
89  } );
90 
91  connect( mWidthUnitSelectionFixed, &QgsUnitSelectionWidget::changed, this, [this]
92  {
93  whileBlocking( mWidthUnitSelectionVarying )->setUnit( mWidthUnitSelectionFixed->unit() );
94  } );
95 
96  connect( mCheckBoxAbsoluteValue, &QCheckBox::clicked, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
97  connect( mCheckBoxOutOfrange, &QCheckBox::clicked, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
98 
99  // Color parameter
100  connect( mColorMethodComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
101  this, &QgsInterpolatedLineSymbolLayerWidget::apply );
102  connect( mColorRampShaderWidget, &QgsColorRampShaderWidget::widgetChanged, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
103  connect( mColorButton, &QgsColorButton::colorChanged, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
104 
105  connect( mColorStartFieldExpression, static_cast < void ( QgsFieldExpressionWidget::* )( const QString & ) >( &QgsFieldExpressionWidget::fieldChanged )
106  , this, &QgsInterpolatedLineSymbolLayerWidget::reloadMinMaxColorFromLayer );
107  connect( mColorEndFieldExpression, static_cast < void ( QgsFieldExpressionWidget::* )( const QString & ) >( &QgsFieldExpressionWidget::fieldChanged )
108  , this, &QgsInterpolatedLineSymbolLayerWidget::reloadMinMaxColorFromLayer );
109 
110  connect( mLineEditColorMinValue, &QLineEdit::textChanged, this, &QgsInterpolatedLineSymbolLayerWidget::onColorMinMaxLineTextChanged );
111  connect( mLineEditColorMinValue, &QLineEdit::textEdited, this, &QgsInterpolatedLineSymbolLayerWidget::onColorMinMaxLineTextEdited );
112  connect( mLineEditColorMaxValue, &QLineEdit::textChanged, this, &QgsInterpolatedLineSymbolLayerWidget::onColorMinMaxLineTextChanged );
113  connect( mLineEditColorMaxValue, &QLineEdit::textEdited, this, &QgsInterpolatedLineSymbolLayerWidget::onColorMinMaxLineTextEdited );
114  connect( mButtonLoadMinMaxValueColor, &QPushButton::clicked, this, &QgsInterpolatedLineSymbolLayerWidget::onReloadMinMaxValueColor );
115  connect( mColorRampShaderWidget, &QgsColorRampShaderWidget::widgetChanged, this, &QgsInterpolatedLineSymbolLayerWidget::apply );
116 
117 }
118 
120 {
121  if ( !layer || layer->layerType() != QLatin1String( "InterpolatedLine" ) )
122  return;
123 
124  mLayer = static_cast<QgsInterpolatedLineSymbolLayer *>( layer );
125 
126  const QgsInterpolatedLineWidth interpolatedWidth = mLayer->interpolatedWidth();
127  whileBlocking( mWidthMethodComboBox )->setCurrentIndex( mWidthMethodComboBox->findData( interpolatedWidth.isVariableWidth() ) );
128 
129  whileBlocking( mDoubleSpinBoxWidth )->setValue( interpolatedWidth.fixedStrokeWidth() );
130  whileBlocking( mWidthStartFieldExpression )->setExpression( mLayer->dataDefinedProperties().property( QgsSymbolLayer::PropertyLineStartWidthValue ).asExpression() );
131  whileBlocking( mWidthEndFieldExpression )->setExpression( mLayer->dataDefinedProperties().property( QgsSymbolLayer::PropertyLineEndWidthValue ).asExpression() );
132  setLineEditValue( mLineEditWidthMinValue, interpolatedWidth.minimumValue() );
133  setLineEditValue( mLineEditWidthMaxValue, interpolatedWidth.maximumValue() );
134  whileBlocking( mDoubleSpinBoxMinWidth )->setValue( interpolatedWidth.minimumWidth() );
135  whileBlocking( mDoubleSpinBoxMaxWidth )->setValue( interpolatedWidth.maximumWidth() );
136  whileBlocking( mWidthUnitSelectionFixed )->setUnit( mLayer->widthUnit() );
137  whileBlocking( mWidthUnitSelectionVarying )->setUnit( mLayer->widthUnit() );
138  whileBlocking( mCheckBoxAbsoluteValue )->setChecked( interpolatedWidth.useAbsoluteValue() );
139  whileBlocking( mCheckBoxOutOfrange )->setChecked( interpolatedWidth.ignoreOutOfRange() );
140 
141  const QgsInterpolatedLineColor interpolatedColor = mLayer->interpolatedColor();
142  whileBlocking( mColorMethodComboBox )->setCurrentIndex( mColorMethodComboBox->findData( interpolatedColor.coloringMethod() ) );
143 
144  whileBlocking( mColorStartFieldExpression )->setExpression( mLayer->dataDefinedProperties().property( QgsSymbolLayer::PropertyLineStartColorValue ).asExpression() );
145  whileBlocking( mColorEndFieldExpression )->setExpression( mLayer->dataDefinedProperties().property( QgsSymbolLayer::PropertyLineEndColorValue ).asExpression() );
146  whileBlocking( mColorRampShaderWidget )->setFromShader( interpolatedColor.colorRampShader() );
147  setLineEditValue( mLineEditColorMinValue, interpolatedColor.colorRampShader().minimumValue() );
148  setLineEditValue( mLineEditColorMaxValue, interpolatedColor.colorRampShader().maximumValue() );
149  whileBlocking( mColorButton )->setColor( interpolatedColor.singleColor() );
150 
151 
152  updateVisibleWidget();
153 }
154 
156 {
157  if ( !mLayer )
158  return nullptr;
159 
160  return mLayer;
161 }
162 
163 void QgsInterpolatedLineSymbolLayerWidget::apply()
164 {
165  if ( !mLayer )
166  return;
167 
168  bool isExpression = false;
169  QString fieldOrExpression = mWidthStartFieldExpression->currentField( &isExpression );
170  mLayer->setDataDefinedProperty( QgsSymbolLayer::PropertyLineStartWidthValue, isExpression ? QgsProperty::fromExpression( fieldOrExpression ) : QgsProperty::fromField( fieldOrExpression ) );
171  fieldOrExpression = mWidthEndFieldExpression->currentField( &isExpression );
172  mLayer->setDataDefinedProperty( QgsSymbolLayer::PropertyLineEndWidthValue, isExpression ? QgsProperty::fromExpression( fieldOrExpression ) : QgsProperty::fromField( fieldOrExpression ) );
173 
174  mLayer->setInterpolatedWidth( interpolatedLineWidth() );
175  if ( mWidthMethodComboBox->currentData().toBool() )
176  mLayer->setWidthUnit( mWidthUnitSelectionVarying->unit() );
177  else
178  mLayer->setWidthUnit( mWidthUnitSelectionFixed->unit() );
179 
180  fieldOrExpression = mColorStartFieldExpression->currentField( &isExpression );
181  mLayer->setDataDefinedProperty( QgsSymbolLayer::PropertyLineStartColorValue, isExpression ? QgsProperty::fromExpression( fieldOrExpression ) : QgsProperty::fromField( fieldOrExpression ) );
182  fieldOrExpression = mColorEndFieldExpression->currentField( &isExpression );
183  mLayer->setDataDefinedProperty( QgsSymbolLayer::PropertyLineEndColorValue, isExpression ? QgsProperty::fromExpression( fieldOrExpression ) : QgsProperty::fromField( fieldOrExpression ) );
184 
185  mLayer->setInterpolatedColor( interpolatedLineColor() );
186 
187  emit changed();
188 }
189 
190 void QgsInterpolatedLineSymbolLayerWidget::updateVisibleWidget()
191 {
192  mFixedWidthWidget->setVisible( !mWidthMethodComboBox->currentData().toBool() );
193  mVaryingWidthWidget->setVisible( mWidthMethodComboBox->currentData().toBool() );
194 
195  mFixedColorWidget->setVisible(
196  static_cast<QgsInterpolatedLineColor::ColoringMethod>( mColorMethodComboBox->currentData().toInt() ) == QgsInterpolatedLineColor::SingleColor );
197  mVaryingColorWidget->setVisible(
198  static_cast<QgsInterpolatedLineColor::ColoringMethod>( mColorMethodComboBox->currentData().toInt() ) == QgsInterpolatedLineColor::ColorRamp );
199 }
200 
201 void QgsInterpolatedLineSymbolLayerWidget::onReloadMinMaxValueWidth()
202 {
203  reloadMinMaxWidthFromLayer();
204  setLineEditValue( mLineEditWidthMinValue, mMinimumForWidthFromLayer );
205  setLineEditValue( mLineEditWidthMaxValue, mMaximumForWidthFromLayer );
206  apply();
207 }
208 
209 void QgsInterpolatedLineSymbolLayerWidget::onReloadMinMaxValueColor()
210 {
211  reloadMinMaxColorFromLayer();
212  setLineEditValue( mLineEditColorMinValue, mMinimumForColorFromLayer );
213  setLineEditValue( mLineEditColorMaxValue, mMaximumForColorFromLayer );
214  onColorMinMaxLineTextEdited();
215 }
216 
217 void QgsInterpolatedLineSymbolLayerWidget::reloadMinMaxWidthFromLayer()
218 {
219  QgsExpressionContext expressionContext = createExpressionContext();
220 
221  QgsExpression expressionStart( mWidthStartFieldExpression->expression() );
222  if ( !expressionStart.prepare( &expressionContext ) )
223  {
224  apply();
225  return;
226  }
227 
228  QgsExpression expressionEnd( mWidthEndFieldExpression->expression() );
229  if ( !expressionEnd.prepare( &expressionContext ) )
230  {
231  apply();
232  return;
233  }
234 
235  if ( !mLayer || !vectorLayer() )
236  {
237  apply();
238  return;
239  }
240 
242  QgsFeature feat;
243  mMinimumForWidthFromLayer = std::numeric_limits<double>::max();
244  mMaximumForWidthFromLayer = -std::numeric_limits<double>::max();
245  while ( it.nextFeature( feat ) )
246  {
247  expressionContext.setFeature( feat );
248  double startValue = expressionStart.evaluate( &expressionContext ).toDouble();
249  double endValue = expressionEnd.evaluate( &expressionContext ).toDouble();
250 
251  if ( mCheckBoxAbsoluteValue->isChecked() )
252  {
253  startValue = fabs( startValue );
254  endValue = fabs( endValue );
255  }
256 
257  if ( startValue < mMinimumForWidthFromLayer )
258  mMinimumForWidthFromLayer = startValue;
259  if ( startValue > mMaximumForWidthFromLayer )
260  mMaximumForWidthFromLayer = startValue;
261 
262  if ( endValue < mMinimumForWidthFromLayer )
263  mMinimumForWidthFromLayer = endValue;
264  if ( endValue > mMaximumForWidthFromLayer )
265  mMaximumForWidthFromLayer = endValue;
266  }
267 
268  if ( mLineEditWidthMinValue->text().isEmpty() && !std::isnan( mMinimumForWidthFromLayer ) )
269  {
270  setLineEditValue( mLineEditWidthMinValue, mMinimumForWidthFromLayer );
271  }
272 
273  if ( mLineEditWidthMaxValue->text().isEmpty() && !std::isnan( mMaximumForWidthFromLayer ) )
274  {
275  setLineEditValue( mLineEditWidthMaxValue, mMaximumForWidthFromLayer );
276  }
277 
278  apply();
279 }
280 
281 void QgsInterpolatedLineSymbolLayerWidget::reloadMinMaxColorFromLayer()
282 {
283  QgsExpressionContext expressionContext = createExpressionContext();
284 
285  QgsExpression expressionStart( mColorStartFieldExpression->expression() );
286  if ( !expressionStart.prepare( &expressionContext ) )
287  {
288  apply();
289  return;
290  }
291 
292  QgsExpression expressionEnd( mColorEndFieldExpression->expression() );
293  if ( !expressionEnd.prepare( &expressionContext ) )
294  {
295  apply();
296  return;
297  }
298 
299  if ( !mLayer || !vectorLayer() )
300  {
301  apply();
302  return;
303  }
304 
306  QgsFeature feat;
307  mMinimumForColorFromLayer = std::numeric_limits<double>::max();
308  mMaximumForColorFromLayer = -std::numeric_limits<double>::max();
309  while ( it.nextFeature( feat ) )
310  {
311  expressionContext.setFeature( feat );
312  const double startValue = expressionStart.evaluate( &expressionContext ).toDouble();
313  const double endValue = expressionEnd.evaluate( &expressionContext ).toDouble();
314 
315  if ( startValue < mMinimumForColorFromLayer )
316  mMinimumForColorFromLayer = startValue;
317  if ( startValue > mMaximumForColorFromLayer )
318  mMaximumForColorFromLayer = startValue;
319 
320  if ( endValue < mMinimumForColorFromLayer )
321  mMinimumForColorFromLayer = endValue;
322  if ( endValue > mMaximumForColorFromLayer )
323  mMaximumForColorFromLayer = endValue;
324  }
325 
326  bool minMaxColorChanged = false;
327  if ( mLineEditColorMinValue->text().isEmpty() && !std::isnan( mMinimumForColorFromLayer ) )
328  {
329  setLineEditValue( mLineEditColorMinValue, mMinimumForColorFromLayer );
330  minMaxColorChanged = true;
331  }
332 
333  if ( mLineEditColorMaxValue->text().isEmpty() && !std::isnan( mMaximumForColorFromLayer ) )
334  {
335  setLineEditValue( mLineEditColorMaxValue, mMaximumForColorFromLayer );
336  minMaxColorChanged = true;
337  }
338 
339  if ( minMaxColorChanged )
340  onColorMinMaxLineTextEdited();
341 
342  apply();
343 }
344 
345 void QgsInterpolatedLineSymbolLayerWidget::onColorMinMaxLineTextChanged()
346 {
347  const double min = lineEditValue( mLineEditColorMinValue );
348  const double max = lineEditValue( mLineEditColorMaxValue );
349  whileBlocking( mColorRampShaderWidget )->setMinimumMaximum( min, max );
350  apply();
351 }
352 
353 void QgsInterpolatedLineSymbolLayerWidget::onColorMinMaxLineTextEdited()
354 {
355  const double min = lineEditValue( mLineEditColorMinValue );
356  const double max = lineEditValue( mLineEditColorMaxValue );
357  whileBlocking( mColorRampShaderWidget )->setMinimumMaximumAndClassify( min, max );
358  apply();
359 }
360 
361 QgsInterpolatedLineWidth QgsInterpolatedLineSymbolLayerWidget::interpolatedLineWidth()
362 {
363  QgsInterpolatedLineWidth interWidth;
364  interWidth.setIsVariableWidth( mWidthMethodComboBox->currentData().toBool() );
365  interWidth.setMinimumValue( lineEditValue( mLineEditWidthMinValue ) );
366  interWidth.setMaximumValue( lineEditValue( mLineEditWidthMaxValue ) );
367  interWidth.setMinimumWidth( mDoubleSpinBoxMinWidth->value() );
368  interWidth.setMaximumWidth( mDoubleSpinBoxMaxWidth->value() );
369  interWidth.setFixedStrokeWidth( mDoubleSpinBoxWidth->value() );
370  interWidth.setIgnoreOutOfRange( mCheckBoxOutOfrange->isChecked() );
371  interWidth.setUseAbsoluteValue( mCheckBoxAbsoluteValue->isChecked() );
372 
373  return interWidth;
374 }
375 
376 QgsInterpolatedLineColor QgsInterpolatedLineSymbolLayerWidget::interpolatedLineColor()
377 {
378  QgsInterpolatedLineColor interColor;
379  interColor.setColor( mColorButton->color() );
380  const QgsColorRampShader colorRampShader = mColorRampShaderWidget->shader();
381  interColor.setColor( colorRampShader );
382  interColor.setColoringMethod( static_cast<QgsInterpolatedLineColor::ColoringMethod>( mColorMethodComboBox->currentData().toInt() ) );
383 
384  return interColor;
385 }
386 
387 double QgsInterpolatedLineSymbolLayerWidget::lineEditValue( QLineEdit *lineEdit )
388 {
389  if ( lineEdit->text().isEmpty() )
390  {
391  return std::numeric_limits<double>::quiet_NaN();
392  }
393 
394  return QgsDoubleValidator::toDouble( lineEdit->text() );
395 }
396 
397 void QgsInterpolatedLineSymbolLayerWidget::setLineEditValue( QLineEdit *lineEdit, double value )
398 {
399  QString strValue;
400  if ( !std::isnan( value ) )
401  strValue = QLocale().toString( value );
402  whileBlocking( lineEdit )->setText( strValue );
403 }
QgsFieldProxyModel::Numeric
@ Numeric
All numeric fields.
Definition: qgsfieldproxymodel.h:45
QgsVectorLayer::getFeatures
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const FINAL
Queries the layer for features specified in request.
Definition: qgsvectorlayer.cpp:1052
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:406
qgsexpressioncontextutils.h
qgsinterpolatedlinesymbollayerwidget.h
QgsProperty::fromField
static QgsProperty fromField(const QString &fieldName, bool isActive=true)
Returns a new FieldBasedProperty created from the specified field name.
Definition: qgsproperty.cpp:245
QgsSymbolLayerWidget::vectorLayer
const QgsVectorLayer * vectorLayer() const
Returns the vector layer associated with the widget.
Definition: qgssymbollayerwidget.h:75
QgsSymbolLayer::dataDefinedProperties
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Definition: qgssymbollayer.h:595
QgsSymbolLayerWidget::changed
void changed()
Should be emitted whenever configuration changes happened on this symbol layer configuration.
QgsInterpolatedLineColor::setColor
void setColor(const QgsColorRampShader &colorRampShader)
Sets the color ramp to define the coloring.
Definition: qgsinterpolatedlinerenderer.cpp:456
qgsmapcanvas.h
QgsInterpolatedLineColor::SingleColor
@ SingleColor
Render with a single color.
Definition: qgsinterpolatedlinerenderer.h:48
QgsInterpolatedLineColor::ColoringMethod
ColoringMethod
Defines how the color is defined.
Definition: qgsinterpolatedlinerenderer.h:45
QgsSymbolLayerWidget
Definition: qgssymbollayerwidget.h:37
QgsSymbolLayer::PropertyLineEndColorValue
@ PropertyLineEndColorValue
End line color for interpolated line renderer (since QGIS 3.22)
Definition: qgssymbollayer.h:209
QgsInterpolatedLineSymbolLayer::setWidthUnit
void setWidthUnit(QgsUnitTypes::RenderUnit strokeWidthUnit)
Sets the width unit.
Definition: qgsinterpolatedlinerenderer.cpp:964
QgsInterpolatedLineSymbolLayer::interpolatedColor
QgsInterpolatedLineColor interpolatedColor() const
Returns the interpolated color used to render the colors of lines, see QgsInterpolatedLineColor.
Definition: qgsinterpolatedlinerenderer.cpp:1006
QgsProperty::asExpression
QString asExpression() const
Returns an expression string representing the state of the property, or an empty string if the proper...
Definition: qgsproperty.cpp:398
QgsRasterShaderFunction::maximumValue
double maximumValue() const
Returns the minimum value for the raster shader.
Definition: qgsrastershaderfunction.h:119
QgsInterpolatedLineWidth::setIgnoreOutOfRange
void setIgnoreOutOfRange(bool ignoreOutOfRange)
Sets whether the variable width ignores out of range value.
Definition: qgsinterpolatedlinerenderer.cpp:408
QgsInterpolatedLineSymbolLayer::setInterpolatedWidth
void setInterpolatedWidth(const QgsInterpolatedLineWidth &interpolatedLineWidth)
Sets the interpolated width used to render the width of lines, see QgsInterpolatedLineWidth.
Definition: qgsinterpolatedlinerenderer.cpp:971
QgsInterpolatedLineColor::coloringMethod
QgsInterpolatedLineColor::ColoringMethod coloringMethod() const
Returns the coloring method used.
Definition: qgsinterpolatedlinerenderer.cpp:490
QgsProperty::fromExpression
static QgsProperty fromExpression(const QString &expression, bool isActive=true)
Returns a new ExpressionBasedProperty created from the specified expression.
Definition: qgsproperty.cpp:237
QgsInterpolatedLineWidth::fixedStrokeWidth
double fixedStrokeWidth() const
Returns the fixed width.
Definition: qgsinterpolatedlinerenderer.cpp:398
QgsInterpolatedLineSymbolLayer::setInterpolatedColor
void setInterpolatedColor(const QgsInterpolatedLineColor &interpolatedLineColor)
Sets the interpolated color used to render the colors of lines, see QgsInterpolatedLineColor.
Definition: qgsinterpolatedlinerenderer.cpp:1001
QgsInterpolatedLineWidth::setIsVariableWidth
void setIsVariableWidth(bool isVariableWidth)
Returns whether the width is variable.
Definition: qgsinterpolatedlinerenderer.cpp:418
QgsInterpolatedLineWidth::setUseAbsoluteValue
void setUseAbsoluteValue(bool useAbsoluteValue)
Sets whether absolute value are used as input.
Definition: qgsinterpolatedlinerenderer.cpp:393
QgsInterpolatedLineSymbolLayerWidget::setSymbolLayer
void setSymbolLayer(QgsSymbolLayer *layer) override
Definition: qgsinterpolatedlinesymbollayerwidget.cpp:119
QgsColorRampShader
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
Definition: qgscolorrampshader.h:42
QgsPropertyCollection::property
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
Definition: qgspropertycollection.cpp:214
QgsColorButton::colorChanged
void colorChanged(const QColor &color)
Emitted whenever a new color is set for the button.
QgsInterpolatedLineWidth::minimumValue
double minimumValue() const
Returns the minimum value used to defined the variable width.
Definition: qgsinterpolatedlinerenderer.cpp:284
QgsInterpolatedLineColor::setColoringMethod
void setColoringMethod(ColoringMethod coloringMethod)
Sets the coloring method used.
Definition: qgsinterpolatedlinerenderer.cpp:552
QgsInterpolatedLineColor::ColorRamp
@ ColorRamp
Render with a color ramp.
Definition: qgsinterpolatedlinerenderer.h:50
QgsInterpolatedLineWidth::setMinimumValue
void setMinimumValue(double minimumValue)
Sets the minimum value used to defined the variable width.
Definition: qgsinterpolatedlinerenderer.cpp:289
qgstemporalcontroller.h
QgsInterpolatedLineWidth::setMinimumWidth
void setMinimumWidth(double minimumWidth)
Sets the minimum width used to defined the variable width.
Definition: qgsinterpolatedlinerenderer.cpp:311
QgsSymbolLayer::PropertyLineStartWidthValue
@ PropertyLineStartWidthValue
Start line width for interpolated line renderer (since QGIS 3.22)
Definition: qgssymbollayer.h:206
QgsInterpolatedLineColor::singleColor
QColor singleColor() const
Returns the single color that is used if SingleColor coloring mode is set.
Definition: qgsinterpolatedlinerenderer.cpp:500
QgsSymbolLayer
Definition: qgssymbollayer.h:54
whileBlocking
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:2191
QgsSymbolLayerWidget::createExpressionContext
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Definition: qgssymbollayerwidget.cpp:69
QgsInterpolatedLineWidth
Represents a width than can vary depending on values.
Definition: qgsinterpolatedlinerenderer.h:126
QgsFieldExpressionWidget::fieldChanged
void fieldChanged(const QString &fieldName)
Emitted when the currently selected field changes.
QgsInterpolatedLineColor
Class defining color to render mesh datasets. The color can vary depending on the dataset value.
Definition: qgsinterpolatedlinerenderer.h:38
QgsUnitSelectionWidget::changed
void changed()
QgsInterpolatedLineWidth::ignoreOutOfRange
bool ignoreOutOfRange() const
Returns whether the variable width ignores out of range value.
Definition: qgsinterpolatedlinerenderer.cpp:403
QgsInterpolatedLineSymbolLayerWidget::QgsInterpolatedLineSymbolLayerWidget
QgsInterpolatedLineSymbolLayerWidget(QgsVectorLayer *layer, QWidget *parent=nullptr)
Constructor.
Definition: qgsinterpolatedlinesymbollayerwidget.cpp:26
QgsInterpolatedLineColor::colorRampShader
QgsColorRampShader colorRampShader() const
Returns the color ramp shader.
Definition: qgsinterpolatedlinerenderer.cpp:495
QgsRasterShaderFunction::minimumValue
double minimumValue() const
Returns the maximum value for the raster shader.
Definition: qgsrastershaderfunction.h:112
QgsInterpolatedLineSymbolLayer::interpolatedWidth
QgsInterpolatedLineWidth interpolatedWidth() const
Returns the interpolated width used to render the width of lines, see QgsInterpolatedLineWidth.
Definition: qgsinterpolatedlinerenderer.cpp:976
qgsvectorlayer.h
QgsInterpolatedLineWidth::useAbsoluteValue
bool useAbsoluteValue() const
Returns whether absolute value are used as input.
Definition: qgsinterpolatedlinerenderer.cpp:388
QgsInterpolatedLineWidth::setMaximumValue
void setMaximumValue(double maximumValue)
Sets the maximum value used to defined the variable width.
Definition: qgsinterpolatedlinerenderer.cpp:300
QgsInterpolatedLineSymbolLayer
A symbol layer that represents vector layer line feature as interpolated line The interpolation is do...
Definition: qgsinterpolatedlinerenderer.h:285
QgsInterpolatedLineSymbolLayer::widthUnit
QgsUnitTypes::RenderUnit widthUnit() const
Returns the width unit.
Definition: qgsinterpolatedlinerenderer.cpp:969
QgsColorRampShaderWidget::widgetChanged
void widgetChanged()
Widget changed.
QgsFeatureIterator::nextFeature
bool nextFeature(QgsFeature &f)
Definition: qgsfeatureiterator.h:399
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsDoubleValidator::toDouble
static double toDouble(const QString &input, bool *ok)
Converts input string to double value.
Definition: qgsdoublevalidator.cpp:134
QgsSymbolLayer::layerType
virtual QString layerType() const =0
Returns a string that represents this layer type.
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:55
QgsInterpolatedLineWidth::setMaximumWidth
void setMaximumWidth(double maximumWidth)
Sets the maximum width used to defined the variable width.
Definition: qgsinterpolatedlinerenderer.cpp:322
qgsdoublevalidator.h
QgsUnitTypes::RenderUnitList
QList< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
Definition: qgsunittypes.h:240
QgsExpression
Class for parsing and evaluation of expressions (formerly called "search strings")....
Definition: qgsexpression.h:102
QgsSymbolLayer::PropertyLineEndWidthValue
@ PropertyLineEndWidthValue
End line width for interpolated line renderer (since QGIS 3.22)
Definition: qgssymbollayer.h:207
QgsFeatureIterator
Wrapper for iterator of features from vector data provider or vector layer.
Definition: qgsfeatureiterator.h:289
QgsSymbolLayer::PropertyLineStartColorValue
@ PropertyLineStartColorValue
Start line color for interpolated line renderer (since QGIS 3.22)
Definition: qgssymbollayer.h:208
QgsFieldExpressionWidget
The QgsFieldExpressionWidget class reates a widget to choose fields and edit expressions It contains ...
Definition: qgsfieldexpressionwidget.h:46
QgsInterpolatedLineWidth::minimumWidth
double minimumWidth() const
Returns the minimum width used to defined the variable width.
Definition: qgsinterpolatedlinerenderer.cpp:306
QgsInterpolatedLineSymbolLayerWidget::symbolLayer
QgsSymbolLayer * symbolLayer() override
Definition: qgsinterpolatedlinesymbollayerwidget.cpp:155
QgsInterpolatedLineWidth::maximumWidth
double maximumWidth() const
Returns the maximum width used to defined the variable width.
Definition: qgsinterpolatedlinerenderer.cpp:317
QgsInterpolatedLineWidth::maximumValue
double maximumValue() const
Returns the maximum value used to defined the variable width.
Definition: qgsinterpolatedlinerenderer.cpp:295
qgsproject.h
QgsSymbolLayer::setDataDefinedProperty
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
Definition: qgssymbollayer.cpp:126
QgsInterpolatedLineWidth::setFixedStrokeWidth
void setFixedStrokeWidth(double fixedWidth)
Sets the fixed width.
Definition: qgsinterpolatedlinerenderer.cpp:423
QgsExpressionContext::setFeature
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
Definition: qgsexpressioncontext.cpp:525
QgsInterpolatedLineWidth::isVariableWidth
bool isVariableWidth() const
Returns whether the width is variable.
Definition: qgsinterpolatedlinerenderer.cpp:413