16 #ifndef QGSINTERPOLATEDLINERENDERER_H
17 #define QGSINTERPOLATEDLINERENDERER_H
64 void setColor(
const QColor &color );
67 QColor color(
double magnitude )
const;
85 QColor singleColor()
const;
101 void graduatedColors(
double value1,
double value2, QList<double> &breakValues, QList<QColor> &breakColors, QList<QLinearGradient> &gradients )
const;
105 QColor mSingleColor = Qt::black;
109 QLinearGradient makeSimpleLinearGradient(
const QColor &color1,
const QColor &color2 )
const;
112 int itemColorIndexInf(
double value )
const;
114 void graduatedColorsExact(
double value1,
double value2, QList<double> &breakValues, QList<QColor> &breakColors, QList<QLinearGradient> &gradients )
const;
115 void graduatedColorsInterpolated(
double value1,
double value2, QList<double> &breakValues, QList<QColor> &breakColors, QList<QLinearGradient> &gradients )
const;
116 void graduatedColorsDiscrete(
double value1,
double value2, QList<double> &breakValues, QList<QColor> &breakColors, QList<QLinearGradient> &gradients )
const;
130 double minimumValue()
const;
132 void setMinimumValue(
double minimumValue );
135 double maximumValue()
const;
137 void setMaximumValue(
double maximumValue );
140 double minimumWidth()
const;
142 void setMinimumWidth(
double minimumWidth );
145 double maximumWidth()
const;
147 void setMaximumWidth(
double maximumWidth );
150 bool ignoreOutOfRange()
const;
152 void setIgnoreOutOfRange(
bool ignoreOutOfRange );
155 bool useAbsoluteValue()
const;
157 void setUseAbsoluteValue(
bool useAbsoluteValue );
160 bool isVariableWidth()
const;
162 void setIsVariableWidth(
bool isVariableWidth );
165 double fixedStrokeWidth()
const;
167 void setFixedStrokeWidth(
double fixedWidth );
170 double strokeWidth(
double value )
const;
178 bool mIsWidthVariable =
false;
182 double mMinimumValue = 0;
183 double mMaximumValue = 10;
185 double mMaximumWidth = 3;
186 bool mIgnoreOutOfRange =
false;
187 bool mUseAbsoluteValue =
false;
189 mutable double mLinearCoef = 1;
190 mutable bool mNeedUpdateFormula =
true;
191 void updateLinearFormula()
const;
243 void render(
double valueColor1,
double valueColor2,
double valueWidth1,
double valueWidth2,
const QgsPointXY &point1,
const QgsPointXY &point2,
QgsRenderContext &context )
const;
250 void setSelected(
bool selected );
257 void adjustLine(
const double &value,
const double &value1,
const double &value2,
double &width,
double &adjusting )
const;
258 bool mSelected =
false;
264 void renderInDeviceCoordinate(
double valueColor1,
double valueColor2,
double valueWidth1,
double valueWidth2,
const QPointF &p1,
const QPointF &p2,
QgsRenderContext &context )
const;
286 QString layerType()
const override;
290 QVariantMap properties()
const override;
296 bool isCompatibleWithSymbol(
QgsSymbol *symbol )
const override;
297 QSet<QString> usedAttributes(
const QgsRenderContext &context )
const override;
298 bool canCauseArtifactsBetweenAdjacentTiles()
const override;
301 void setExpressionsStringForWidth( QString start, QString end );
304 QString startValueExpressionForWidth()
const;
307 QString endValueExpressionForWidth()
const;
322 void setExpressionsStringForColor( QString start, QString end );
325 QString startValueExpressionForColor()
const;
328 QString endValueExpressionForColor()
const;
342 QString mStartWidthExpressionString;
343 QString mEndWidthExpressionString;
344 QString mStartColorExpressionString;
345 QString mEndColorExpressionString;
347 int mStartWidthAttributeIndex = -1;
348 int mEndWidthAttributeIndex = -1;
349 int mStartColorAttributeIndex = -1;
350 int mEndColorAttributeIndex = -1;
352 std::unique_ptr<QgsExpression> mStartWidthExpression;
353 std::unique_ptr<QgsExpression> mEndWithExpression;
354 std::unique_ptr<QgsExpression> mStartColorExpression;
355 std::unique_ptr<QgsExpression> mEndColorExpression;
358 QVariant colorRampShaderProperties()
const;
359 static QgsColorRampShader createColorRampShaderFromProperties(
const QVariant &properties );
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Class defining color to render mesh datasets.
ColoringMethod
Defines how the color is defined.
Represents a simple line renderer with width and color varying depending on values.
A symbol layer that represents vector layer line feature as interpolated line The interpolation is do...
Represents a width than can vary depending on values.
Layer tree node points to a map layer.
A class to represent a 2D point.
The class is used as a container of context for various read/write operations on other objects.
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
RenderUnit
Rendering size units.
@ RenderMillimeters
Millimeters.
const double DEFAULT_LINE_WIDTH