Class: QgsMeshRendererVectorSettings

class qgis.core.QgsMeshRendererVectorSettings

Bases: sip.wrapper

Represents a mesh renderer settings for vector datasets

Note

The API is considered EXPERIMENTAL and can be changed without a notice

Methods

arrowHeadLengthRatio

Returns ratio of the head length of the arrow (range 0-1)

arrowHeadWidthRatio

Returns ratio of the head width of the arrow (range 0-1)

color

Returns color used for drawing arrows

filterMax

Returns filter value for vector magnitudes.

filterMin

Returns filter value for vector magnitudes.

fixedShaftLength

Returns fixed arrow length (in millimeters)

isOnUserDefinedGrid

Returns whether vectors are drawn on user-defined grid

lineWidth

Returns line width of the arrow (in millimeters)

maxShaftLength

Returns maximum shaft length (in millimeters)

minShaftLength

Returns mininimum shaft length (in millimeters)

readXml

Reads configuration from the given DOM element

scaleFactor

Returns scale factor

setArrowHeadLengthRatio

Sets ratio of the head length of the arrow (range 0-1)

setArrowHeadWidthRatio

Sets ratio of the head width of the arrow (range 0-1)

setColor

Sets color used for drawing arrows

setFilterMax

Sets filter value for vector magnitudes.

setFilterMin

Sets filter value for vector magnitudes.

setFixedShaftLength

Sets fixed length (in millimeters)

setLineWidth

Sets line width of the arrow in pixels (in millimeters)

setMaxShaftLength

Sets maximum shaft length (in millimeters)

setMinShaftLength

Sets mininimum shaft length (in millimeters)

setOnUserDefinedGrid

Toggles drawing of vectors on user defined grid

setScaleFactor

Sets scale factor

setShaftLengthMethod

Sets method used for drawing arrows

setUserGridCellHeight

Sets height of user grid cell (in pixels)

setUserGridCellWidth

Sets width of user grid cell (in pixels)

shaftLengthMethod

Returns method used for drawing arrows

userGridCellHeight

Returns height in pixels of user grid cell

userGridCellWidth

Returns width in pixels of user grid cell

writeXml

Writes configuration to a new DOM element

Attributes

Fixed

MinMax

Scaled

class ArrowScalingMethod

Bases: int

Fixed = 2
MinMax = 0
Scaled = 1
arrowHeadLengthRatio(self) → float

Returns ratio of the head length of the arrow (range 0-1)

Return type

float

arrowHeadWidthRatio(self) → float

Returns ratio of the head width of the arrow (range 0-1)

Return type

float

color(self) → QColor

Returns color used for drawing arrows

Return type

QColor

filterMax(self) → float

Returns filter value for vector magnitudes.

If magnitude of the vector is higher than this value, the vector is not drawn. -1 represents that filtering is not active.

Return type

float

filterMin(self) → float

Returns filter value for vector magnitudes.

If magnitude of the vector is lower than this value, the vector is not drawn. -1 represents that filtering is not active.

Return type

float

fixedShaftLength(self) → float

Returns fixed arrow length (in millimeters)

Only for QgsMeshRendererVectorSettings.ArrowScalingMethod.Fixed

Return type

float

isOnUserDefinedGrid(self) → bool

Returns whether vectors are drawn on user-defined grid

Return type

bool

lineWidth(self) → float

Returns line width of the arrow (in millimeters)

Return type

float

maxShaftLength(self) → float

Returns maximum shaft length (in millimeters)

Only for QgsMeshRendererVectorSettings.ArrowScalingMethod.MinMax

Return type

float

minShaftLength(self) → float

Returns mininimum shaft length (in millimeters)

Only for QgsMeshRendererVectorSettings.ArrowScalingMethod.MinMax

Return type

float

readXml(self, elem: QDomElement)

Reads configuration from the given DOM element

Parameters

elem (QDomElement) –

scaleFactor(self) → float

Returns scale factor

Only for QgsMeshRendererVectorSettings.ArrowScalingMethod.Scaled

Return type

float

setArrowHeadLengthRatio(self, arrowHeadLengthRatio: float)

Sets ratio of the head length of the arrow (range 0-1)

Parameters

arrowHeadLengthRatio (float) –

setArrowHeadWidthRatio(self, arrowHeadWidthRatio: float)

Sets ratio of the head width of the arrow (range 0-1)

Parameters

arrowHeadWidthRatio (float) –

setColor(self, color: Union[QColor, Qt.GlobalColor, QGradient])

Sets color used for drawing arrows

Parameters

color (Union[QColor) –

setFilterMax(self, filterMax: float)

Sets filter value for vector magnitudes.

See also

filterMax()

Parameters

filterMax (float) –

setFilterMin(self, filterMin: float)

Sets filter value for vector magnitudes.

See also

filterMin()

Parameters

filterMin (float) –

setFixedShaftLength(self, fixedShaftLength: float)

Sets fixed length (in millimeters)

Only for QgsMeshRendererVectorSettings.ArrowScalingMethod.Fixed

Parameters

fixedShaftLength (float) –

setLineWidth(self, lineWidth: float)

Sets line width of the arrow in pixels (in millimeters)

Parameters

lineWidth (float) –

setMaxShaftLength(self, maxShaftLength: float)

Sets maximum shaft length (in millimeters)

Only for QgsMeshRendererVectorSettings.ArrowScalingMethod.MinMax

Parameters

maxShaftLength (float) –

setMinShaftLength(self, minShaftLength: float)

Sets mininimum shaft length (in millimeters)

Only for QgsMeshRendererVectorSettings.ArrowScalingMethod.MinMax

Parameters

minShaftLength (float) –

setOnUserDefinedGrid(self, enabled: bool)

Toggles drawing of vectors on user defined grid

Parameters

enabled (bool) –

setScaleFactor(self, scaleFactor: float)

Sets scale factor

Only for QgsMeshRendererVectorSettings.ArrowScalingMethod.Scaled

Parameters

scaleFactor (float) –

setShaftLengthMethod(self, shaftLengthMethod: QgsMeshRendererVectorSettings.ArrowScalingMethod)

Sets method used for drawing arrows

Parameters

shaftLengthMethod (QgsMeshRendererVectorSettings.ArrowScalingMethod) –

setUserGridCellHeight(self, height: int)

Sets height of user grid cell (in pixels)

Parameters

height (int) –

setUserGridCellWidth(self, width: int)

Sets width of user grid cell (in pixels)

Parameters

width (int) –

shaftLengthMethod(self) → QgsMeshRendererVectorSettings.ArrowScalingMethod

Returns method used for drawing arrows

Return type

QgsMeshRendererVectorSettings.ArrowScalingMethod

userGridCellHeight(self) → int

Returns height in pixels of user grid cell

Return type

int

userGridCellWidth(self) → int

Returns width in pixels of user grid cell

Return type

int

writeXml(self, doc: QDomDocument) → QDomElement

Writes configuration to a new DOM element

Parameters

doc (QDomDocument) –

Return type

QDomElement