Class: QgsInterpolatedLineRenderer¶
Represents a simple line renderer with width and color varying depending on values.
Added in version 3.14.
- class qgis.core.QgsInterpolatedLineRenderer[source]¶
Bases:
object- interpolatedColor(self) QgsInterpolatedLineColor[source]¶
Returns the stroke color used to render
Added in version 3.20.
- Return type:
- interpolatedLineWidth(self) QgsInterpolatedLineWidth[source]¶
Returns the stroke width used to render
Added in version 3.20.
- Return type:
- render(self, value1: float, value2: float, point1: QgsPointXY, point2: QgsPointXY, context: QgsRenderContext)[source]¶
Renders a line in the
contextbetweenpoint1andpoint2with color and width that vary depending onvalue1andvalue2This method assumes that
point1andpoint2are 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 thecontextbetweenpoint1andpoint2with color that varies depending onvalueColor1andvalueColor2and and width that varies betweenvalueWidth1andvalueWidth2This method assumes that
point1andpoint2are in map units. SeerenderInDeviceCoordinates()for an equivalent method which renders lines in painter coordinates.Added 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)[source]¶
Renders a line in the
contextbetweenpoint1andpoint2in device (painter) coordinates with color that varies depending onvalueColor1andvalueColor2and and width that varies betweenvalueWidth1andvalueWidth2.Added in version 3.22.
- Parameters:
valueColor1 (float)
valueColor2 (float)
valueWidth1 (float)
valueWidth2 (float)
point1 (Union[QPointF, QPoint])
point2 (Union[QPointF, QPoint])
context (QgsRenderContext)
- setInterpolatedColor(self, strokeColoring: QgsInterpolatedLineColor)[source]¶
Sets the stroke color used to render
- Parameters:
strokeColoring (QgsInterpolatedLineColor)
- setInterpolatedWidth(self, strokeWidth: QgsInterpolatedLineWidth)[source]¶
Sets the stroke width used to render
- Parameters:
strokeWidth (QgsInterpolatedLineWidth)
- setSelected(self, selected: bool)[source]¶
Sets if the rendering must be done as the element is selected
Added in version 3.20.
- Parameters:
selected (bool)
- setWidthUnit(self, strokeWidthUnit: Qgis.RenderUnit)[source]¶
Sets the unit of the stroke width
- Parameters:
strokeWidthUnit (Qgis.RenderUnit)
- widthUnit(self) Qgis.RenderUnit[source]¶
Returns the unit of the stroke width
Added in version 3.20.
- Return type: