Class: QgsInterpolatedLineRenderer¶
- class qgis.core.QgsInterpolatedLineRenderer¶
Bases:
sip.wrapper
Represents a simple line renderer with width and color varying depending on values.
New in version 3.14:
Methods
Returns the stroke color used to render
Returns the stroke width used to render
Renders a line in the
context
betweenpoint1
andpoint2
with color and width that vary depending onvalue1
andvalue2
Renders a line in the
context
betweenpoint1
andpoint2
in device (painter) coordinates with color that varies depending onvalueColor1
andvalueColor2
and and width that varies betweenvalueWidth1
andvalueWidth2
.Sets the stroke color used to render
Sets the stroke width used to render
Sets if the rendering must be done as the element is selected
Sets the unit of the stroke width
Returns the unit of the stroke width
- interpolatedColor(self) QgsInterpolatedLineColor ¶
Returns the stroke color used to render
New in version 3.20.
- Return type:
- interpolatedLineWidth(self) QgsInterpolatedLineWidth ¶
Returns the stroke width used to render
New in version 3.20.
- Return type:
- render(self, value1: float, value2: float, point1: QgsPointXY, point2: QgsPointXY, context: QgsRenderContext)¶
Renders a line in the
context
betweenpoint1
andpoint2
with color and width that vary depending onvalue1
andvalue2
This method assumes that
point1
andpoint2
are in map units. SeerenderInDeviceCoordinates()
for an equivalent method which renders lines in painter coordinates.render(self, valueColor1: float, valueColor2: float, valueWidth1: float, valueWidth2: float, point1:
QgsPointXY
, point2:QgsPointXY
, context:QgsRenderContext
) Renders a line in thecontext
betweenpoint1
andpoint2
with color that varies depending onvalueColor1
andvalueColor2
and and width that varies betweenvalueWidth1
andvalueWidth2
This method assumes that
point1
andpoint2
are in map units. SeerenderInDeviceCoordinates()
for an equivalent method which renders lines in painter coordinates.New in version 3.20.
- Parameters:
value1 (float) –
value2 (float) –
point1 (QgsPointXY) –
point2 (QgsPointXY) –
context (QgsRenderContext) –
- renderInDeviceCoordinates(self, valueColor1: float, valueColor2: float, valueWidth1: float, valueWidth2: float, point1: QPointF | QPoint, point2: QPointF | QPoint, context: QgsRenderContext)¶
Renders a line in the
context
betweenpoint1
andpoint2
in device (painter) coordinates with color that varies depending onvalueColor1
andvalueColor2
and and width that varies betweenvalueWidth1
andvalueWidth2
.New in version 3.22.
- Parameters:
valueColor1 (float) –
valueColor2 (float) –
valueWidth1 (float) –
valueWidth2 (float) –
point1 (Union[QPointF) –
point2 (Union[QPointF) –
context (QgsRenderContext) –
- setInterpolatedColor(self, strokeColoring: QgsInterpolatedLineColor)¶
Sets the stroke color used to render
- Parameters:
strokeColoring (QgsInterpolatedLineColor) –
- setInterpolatedWidth(self, strokeWidth: QgsInterpolatedLineWidth)¶
Sets the stroke width used to render
- Parameters:
strokeWidth (QgsInterpolatedLineWidth) –
- setSelected(self, selected: bool)¶
Sets if the rendering must be done as the element is selected
New in version 3.20.
- Parameters:
selected (bool) –
- setWidthUnit(self, strokeWidthUnit: Qgis.RenderUnit)¶
Sets the unit of the stroke width
- Parameters:
strokeWidthUnit (Qgis.RenderUnit) –
- widthUnit(self) Qgis.RenderUnit ¶
Returns the unit of the stroke width
New in version 3.20.
- Return type: