Class: QgsPointCloudRenderer¶
Abstract base class for 2d point cloud renderers.
Added in version 3.18.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: clone()
, renderBlock()
, save()
, type()
Class Hierarchy¶
Subclasses¶
An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes. |
|
Renders point clouds by a classification attribute. |
|
A renderer for 2d visualisation of point clouds which shows the dataset’s extents using a fill symbol. |
|
An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes. |
Enums
alias of |
|
alias of |
Abstract Methods
Create a deep copy of this renderer. |
|
Renders a block of point cloud data using the specified render context. |
|
Saves the renderer configuration to an XML element. |
|
Returns the identifier of the renderer type. |
Methods
Adds a point to the list of points to be triangulated (only used when |
|
Copies common point cloud properties (such as point size and screen error) to the destination renderer. |
|
Returns the drawing order used by the renderer for drawing points. |
|
Draws a point using a color at the specified x and y (in map coordinates). |
|
Returns whether large triangles will get rendered. |
|
Returns threshold for filtering of triangles. |
|
Returns units of the threshold for filtering of triangles. |
|
Returns the text format renderer is using for rendering labels |
|
Returns the maximum screen error allowed when rendering the point cloud. |
|
Returns the unit for the maximum screen error allowed when rendering the point cloud. |
|
Returns the point size. |
|
Returns the map unit scale used for the point size. |
|
Returns the units used for the point size. |
|
Returns the symbol used by the renderer for drawing points. |
|
Returns whether points are triangulated to render solid surface |
|
Restores common renderer properties (such as point size and screen error) from the specified DOM element. |
|
Saves common renderer properties (such as point size and screen error) to the specified DOM element. |
|
Sets the drawing order used by the renderer for drawing points. |
|
Sets whether large triangles will get rendered. |
|
Sets threshold for filtering of triangles. |
|
Sets units of the threshold for filtering of triangles. |
|
Sets the text format renderers should use for rendering labels |
|
Sets the maximum screen error allowed when rendering the point cloud. |
|
Sets the unit for the maximum screen error allowed when rendering the point cloud. |
|
Sets the point size. |
|
Sets the map unit scale used for the point size. |
|
Sets the units used for the point size. |
|
Sets the symbol used by the renderer for drawing points. |
|
Sets whether points are triangulated to render solid surface |
|
Set whether the renderer should also render file labels inside extent |
|
Sets the renderer behavior when zoomed out |
|
Returns whether the renderer shows file labels inside the extent rectangle |
|
Returns the renderer behavior when zoomed out |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsPointCloudRenderer. See the FAQ for more details.
Called when the check state of the legend item with the specified key is changed. |
|
Creates a set of legend nodes representing the renderer. |
|
Returns |
|
Returns a list of all rule keys for legend nodes created by the renderer. |
|
Must be called when a new render cycle is started. |
|
Must be called when a render cycle has finished, to allow the renderer to clean up. |
|
Returns a list of attributes required by this renderer. |
|
Checks whether the point holding pointAttributes attributes will be rendered By default if not overridden in the subclass renderer will return true ( the renderer is responsible for the filtering behavior ) |
Static Methods
Creates a renderer from an XML element. |
|
Retrieves the x and y coordinate for the point at index i. |
|
Retrieves the z value for the point at index i. |
- class qgis.core.QgsPointCloudRenderer[source]¶
Bases:
object
- DrawOrder¶
alias of
PointCloudDrawOrder
- PointSymbol¶
alias of
PointCloudSymbol
- addPointToTriangulation(self, x: float, y: float, z: float, color: QColor | Qt.GlobalColor, context: QgsPointCloudRenderContext)[source]¶
Adds a point to the list of points to be triangulated (only used when
renderAsTriangles()
is enabled)Added in version 3.36.
- Parameters:
x (float)
y (float)
z (float)
color (Union[QColor, Qt.GlobalColor])
context (QgsPointCloudRenderContext)
- virtual checkLegendItem(self, key: str | None, state: bool = True)[source]¶
Called when the check state of the legend item with the specified
key
is changed.See also
- Parameters:
key (Optional[str])
state (bool = True)
- abstract clone(self) QgsPointCloudRenderer | None [source]¶
Create a deep copy of this renderer. Should be implemented by all subclasses and generate a proper subclass.
- Return type:
Optional[QgsPointCloudRenderer]
- copyCommonProperties(self, destination: QgsPointCloudRenderer | None)[source]¶
Copies common point cloud properties (such as point size and screen error) to the
destination
renderer.- Parameters:
destination (Optional[QgsPointCloudRenderer])
- virtual createLegendNodes(self, nodeLayer: QgsLayerTreeLayer | None) List[QgsLayerTreeModelLegendNode] ¶
Creates a set of legend nodes representing the renderer.
- Parameters:
nodeLayer (Optional[QgsLayerTreeLayer])
- Return type:
- drawOrder2d(self) Qgis.PointCloudDrawOrder [source]¶
Returns the drawing order used by the renderer for drawing points.
See also
Added in version 3.24.
- Return type:
- drawPoint(self, x: float, y: float, color: QColor | Qt.GlobalColor, context: QgsPointCloudRenderContext)[source]¶
Draws a point using a
color
at the specifiedx
andy
(in map coordinates).- Parameters:
x (float)
y (float)
color (Union[QColor, Qt.GlobalColor])
context (
QgsPointCloudRenderContext
)
- drawPoint(self, x: float, y: float, color: QColor | Qt.GlobalColor, width: int, context: QgsPointCloudRenderContext)[source]
Draws a point using a
color
and painterwidth
at the specifiedx
andy
(in map coordinates).Added in version 3.36.
- Parameters:
x (float)
y (float)
color (Union[QColor, Qt.GlobalColor])
width (int)
context (
QgsPointCloudRenderContext
)
- horizontalTriangleFilter(self) bool [source]¶
Returns whether large triangles will get rendered. This only applies when
renderAsTriangles()
is enabled. When the triangle filtering is enabled, triangles where at least one side is horizontally longer than the threshold inhorizontalTriangleFilterThreshold()
do not get rendered.See also
See also
See also
Added in version 3.36.
- Return type:
bool
- horizontalTriangleFilterThreshold(self) float [source]¶
Returns threshold for filtering of triangles. This only applies when
renderAsTriangles()
andhorizontalTriangleFilter()
are both enabled. If any edge of a triangle is horizontally longer than the threshold, such triangle will not get rendered. Units of the threshold value are given byhorizontalTriangleFilterUnits()
.See also
See also
Added in version 3.36.
- Return type:
float
- horizontalTriangleFilterUnit(self) Qgis.RenderUnit [source]¶
Returns units of the threshold for filtering of triangles. This only applies when
renderAsTriangles()
andhorizontalTriangleFilter()
are both enabled.See also
See also
See also
Added in version 3.36.
- Return type:
- labelTextFormat(self) QgsTextFormat [source]¶
Returns the text format renderer is using for rendering labels
Added in version 3.42.
- Return type:
- virtual legendItemChecked(self, key: str | None) bool [source]¶
Returns
True
if the legend item with the specifiedkey
is checked.See also
- Parameters:
key (Optional[str])
- Return type:
bool
- virtual legendRuleKeys(self) List[str] [source]¶
Returns a list of all rule keys for legend nodes created by the renderer.
- Return type:
List[str]
- static load(element: QDomElement, context: QgsReadWriteContext) QgsPointCloudRenderer | None [source]¶
Creates a renderer from an XML
element
.Caller takes ownership of the returned renderer.
See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- Return type:
Optional[QgsPointCloudRenderer]
- maximumScreenError(self) float [source]¶
Returns the maximum screen error allowed when rendering the point cloud.
Larger values result in a faster render with less points rendered.
Units are retrieved via
maximumScreenErrorUnit()
.See also
See also
- Return type:
float
- maximumScreenErrorUnit(self) Qgis.RenderUnit [source]¶
Returns the unit for the maximum screen error allowed when rendering the point cloud.
See also
See also
- Return type:
- pointSize(self) float [source]¶
Returns the point size.
The point size units are retrieved by calling
pointSizeUnit()
.See also
See also
See also
- Return type:
float
- pointSizeMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale used for the point size.
See also
See also
See also
- Return type:
- pointSizeUnit(self) Qgis.RenderUnit [source]¶
Returns the units used for the point size.
See also
See also
See also
- Return type:
- pointSymbol(self) Qgis.PointCloudSymbol [source]¶
Returns the symbol used by the renderer for drawing points.
See also
- Return type:
- static pointXY(context: QgsPointCloudRenderContext, ptr: str | None, i: int)[source]¶
Retrieves the x and y coordinate for the point at index
i
.- Parameters:
context (QgsPointCloudRenderContext)
ptr (Optional[str])
i (int) -> (float)
- static pointZ(context: QgsPointCloudRenderContext, ptr: str | None, i: int) float [source]¶
Retrieves the z value for the point at index
i
.- Parameters:
context (QgsPointCloudRenderContext)
ptr (Optional[str])
i (int)
- Return type:
float
- renderAsTriangles(self) bool [source]¶
Returns whether points are triangulated to render solid surface
Added in version 3.36.
- Return type:
bool
- abstract renderBlock(self, block: QgsPointCloudBlock | None, context: QgsPointCloudRenderContext)[source]¶
Renders a
block
of point cloud data using the specified rendercontext
.- Parameters:
block (Optional[QgsPointCloudBlock])
context (QgsPointCloudRenderContext)
- restoreCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)[source]¶
Restores common renderer properties (such as point size and screen error) from the specified DOM
element
.See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- abstract save(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement [source]¶
Saves the renderer configuration to an XML element.
See also
- Parameters:
doc (QDomDocument)
context (QgsReadWriteContext)
- Return type:
QDomElement
- saveCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)[source]¶
Saves common renderer properties (such as point size and screen error) to the specified DOM
element
.See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- setDrawOrder2d(self, order: Qgis.PointCloudDrawOrder)[source]¶
Sets the drawing
order
used by the renderer for drawing points.See also
Added in version 3.24.
- Parameters:
order (Qgis.PointCloudDrawOrder)
- setHorizontalTriangleFilter(self, enabled: bool)[source]¶
Sets whether large triangles will get rendered. This only applies when
renderAsTriangles()
is enabled. When the triangle filtering is enabled, triangles where at least one side is horizontally longer than the threshold inhorizontalTriangleFilterThreshold()
do not get rendered.See also
See also
Added in version 3.36.
- Parameters:
enabled (bool)
- setHorizontalTriangleFilterThreshold(self, threshold: float)[source]¶
Sets threshold for filtering of triangles. This only applies when
renderAsTriangles()
andhorizontalTriangleFilter()
are both enabled. If any edge of a triangle is horizontally longer than the threshold, such triangle will not get rendered. Units of the threshold value are given byhorizontalTriangleFilterUnits()
.See also
See also
See also
Added in version 3.36.
- Parameters:
threshold (float)
- setHorizontalTriangleFilterUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets units of the threshold for filtering of triangles. This only applies when
renderAsTriangles()
andhorizontalTriangleFilter()
are both enabled.See also
See also
See also
Added in version 3.36.
- Parameters:
unit (Qgis.RenderUnit)
- setLabelTextFormat(self, textFormat: QgsTextFormat)[source]¶
Sets the text format renderers should use for rendering labels
Added in version 3.42.
- Parameters:
textFormat (QgsTextFormat)
- setMaximumScreenError(self, error: float)[source]¶
Sets the maximum screen
error
allowed when rendering the point cloud.Larger values result in a faster render with less points rendered.
Units are set via
setMaximumScreenErrorUnit()
.See also
See also
- Parameters:
error (float)
- setMaximumScreenErrorUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the maximum screen error allowed when rendering the point cloud.See also
See also
- Parameters:
unit (Qgis.RenderUnit)
- setPointSize(self, size: float)[source]¶
Sets the point
size
. Point size units are specified viasetPointSizeUnit()
.See also
See also
See also
- Parameters:
size (float)
- setPointSizeMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
used for the point size.See also
See also
See also
- Parameters:
scale (QgsMapUnitScale)
- setPointSizeUnit(self, units: Qgis.RenderUnit)[source]¶
Sets the
units
used for the point size.See also
See also
See also
- Parameters:
units (Qgis.RenderUnit)
- setPointSymbol(self, symbol: Qgis.PointCloudSymbol)[source]¶
Sets the
symbol
used by the renderer for drawing points.See also
- Parameters:
symbol (Qgis.PointCloudSymbol)
- setRenderAsTriangles(self, asTriangles: bool)[source]¶
Sets whether points are triangulated to render solid surface
Added in version 3.36.
- Parameters:
asTriangles (bool)
- setShowLabels(self, show: bool)[source]¶
Set whether the renderer should also render file labels inside extent
Added in version 3.42.
- Parameters:
show (bool)
- setZoomOutBehavior(self, behavior: Qgis.PointCloudZoomOutRenderBehavior)[source]¶
Sets the renderer behavior when zoomed out
Added in version 3.42.
- Parameters:
behavior (Qgis.PointCloudZoomOutRenderBehavior)
- showLabels(self) bool [source]¶
Returns whether the renderer shows file labels inside the extent rectangle
Added in version 3.42.
- Return type:
bool
- virtual startRender(self, context: QgsPointCloudRenderContext)[source]¶
Must be called when a new render cycle is started. A call to
startRender()
must always be followed by a corresponding call tostopRender()
after all features have been rendered.See also
Warning
This method is not thread safe. Before calling
startRender()
in a non-main thread, the renderer should instead be cloned andstartRender()
/stopRender()
called on the clone.- Parameters:
context (QgsPointCloudRenderContext)
- virtual stopRender(self, context: QgsPointCloudRenderContext)[source]¶
Must be called when a render cycle has finished, to allow the renderer to clean up.
Calls to
stopRender()
must always be preceded by a call tostartRender()
.Warning
This method is not thread safe. Before calling
startRender()
in a non-main thread, the renderer should instead be cloned andstartRender()
/stopRender()
called on the clone.See also
- Parameters:
context (QgsPointCloudRenderContext)
- virtual usedAttributes(self, context: QgsPointCloudRenderContext) Set[str] ¶
Returns a list of attributes required by this renderer. Attributes not listed in here may not be requested from the provider at rendering time.
Note
the “X” and “Y” attributes will always be fetched and do not need to be explicitly returned here.
- Parameters:
context (QgsPointCloudRenderContext)
- Return type:
Set[str]
- virtual willRenderPoint(self, pointAttributes: Dict[str | None, Any]) bool [source]¶
Checks whether the point holding
pointAttributes
attributes will be rendered By default if not overridden in the subclass renderer will return true ( the renderer is responsible for the filtering behavior )- Parameters:
pointAttributes (Dict[Optional[str], Any])
- Return type:
bool
- zoomOutBehavior(self) Qgis.PointCloudZoomOutRenderBehavior [source]¶
Returns the renderer behavior when zoomed out
Added in version 3.42.
- Return type: