Class: QgsPointCloudRenderer¶
- class qgis.core.QgsPointCloudRenderer¶
Bases:
sip.wrapper
Abstract base class for 2d point cloud renderers.
New in version 3.18.
QgsPointCloudRenderer() Constructor for QgsPointCloudRenderer.
Enums
alias of
PointCloudDrawOrder
alias of
PointCloudSymbol
Methods
Adds a point to the list of points to be triangulated (only used when
renderAsTriangles()
is enabled)Called when the check state of the legend item with the specified
key
is changed.Create a deep copy of this renderer.
Copies common point cloud properties (such as point size and screen error) to the
destination
renderer.Creates a set of legend nodes representing the renderer.
Returns the drawing order used by the renderer for drawing points.
Draws a point using a
color
at the specifiedx
andy
(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
True
if the legend item with the specifiedkey
is checked.Returns a list of all rule keys for legend nodes created by the renderer.
Creates a renderer from an XML
element
.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.
Retrieves the x and y coordinate for the point at index
i
.Retrieves the z value for the point at index
i
.Returns whether points are triangulated to render solid surface
Renders a
block
of point cloud data using the specified rendercontext
.Restores common renderer properties (such as point size and screen error) from the specified DOM
element
.Saves the renderer configuration to an XML 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 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
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 the identifier of the renderer type.
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 )- DrawOrder¶
alias of
PointCloudDrawOrder
- PointSymbol¶
alias of
PointCloudSymbol
- addPointToTriangulation(self, x: float, y: float, z: float, color: QColor | Qt.GlobalColor | QGradient, context: QgsPointCloudRenderContext)¶
Adds a point to the list of points to be triangulated (only used when
renderAsTriangles()
is enabled)New in version 3.36.
- Parameters:
x (float) –
y (float) –
z (float) –
color (Union[QColor) –
context (QgsPointCloudRenderContext) –
- checkLegendItem(self, key: str, state: bool = True)¶
Called when the check state of the legend item with the specified
key
is changed.See also
- Parameters:
key (str) –
state (bool = True) –
- clone(self) QgsPointCloudRenderer ¶
Create a deep copy of this renderer. Should be implemented by all subclasses and generate a proper subclass.
- Return type:
- copyCommonProperties(self, destination: QgsPointCloudRenderer)¶
Copies common point cloud properties (such as point size and screen error) to the
destination
renderer.- Parameters:
destination (QgsPointCloudRenderer) –
- createLegendNodes(self, nodeLayer: QgsLayerTreeLayer) List[QgsLayerTreeModelLegendNode] ¶
Creates a set of legend nodes representing the renderer.
- Parameters:
nodeLayer (QgsLayerTreeLayer) –
- Return type:
- drawOrder2d(self) Qgis.PointCloudDrawOrder ¶
Returns the drawing order used by the renderer for drawing points.
See also
New in version 3.24.
- Return type:
- drawPoint(self, x: float, y: float, color: QColor | Qt.GlobalColor | QGradient, context: QgsPointCloudRenderContext)¶
Draws a point using a
color
at the specifiedx
andy
(in map coordinates).- Parameters:
x (float) –
y (float) –
color (Union[QColor) –
context (QgsPointCloudRenderContext) –
- horizontalTriangleFilter(self) bool ¶
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
New in version 3.36.
- Return type:
bool
- horizontalTriangleFilterThreshold(self) float ¶
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
New in version 3.36.
- Return type:
float
- horizontalTriangleFilterUnit(self) Qgis.RenderUnit ¶
Returns units of the threshold for filtering of triangles. This only applies when
renderAsTriangles()
andhorizontalTriangleFilter()
are both enabled.See also
See also
See also
New in version 3.36.
- Return type:
- legendItemChecked(self, key: str) bool ¶
Returns
True
if the legend item with the specifiedkey
is checked.See also
- Parameters:
key (str) –
- Return type:
bool
- legendRuleKeys(self) List[str] ¶
Returns a list of all rule keys for legend nodes created by the renderer.
- Return type:
List[str]
- load(element: QDomElement, context: QgsReadWriteContext) QgsPointCloudRenderer ¶
Creates a renderer from an XML
element
.Caller takes ownership of the returned renderer.
See also
- Parameters:
element (QDomElement) –
context (QgsReadWriteContext) –
- Return type:
- maximumScreenError(self) float ¶
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 ¶
Returns the unit for the maximum screen error allowed when rendering the point cloud.
See also
See also
- Return type:
- pointSize(self) float ¶
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 ¶
Returns the units used for the point size.
See also
See also
See also
- Return type:
- pointSymbol(self) Qgis.PointCloudSymbol ¶
Returns the symbol used by the renderer for drawing points.
See also
- Return type:
- pointXY(context: QgsPointCloudRenderContext, ptr: str, i: int) Tuple[float, float] ¶
Retrieves the x and y coordinate for the point at index
i
.- Parameters:
context (QgsPointCloudRenderContext) –
ptr (str) –
i (int) –
- Return type:
Tuple[float, float]
- pointZ(context: QgsPointCloudRenderContext, ptr: str, i: int) float ¶
Retrieves the z value for the point at index
i
.- Parameters:
context (QgsPointCloudRenderContext) –
ptr (str) –
i (int) –
- Return type:
float
- renderAsTriangles(self) bool ¶
Returns whether points are triangulated to render solid surface
New in version 3.36.
- Return type:
bool
- renderBlock(self, block: QgsPointCloudBlock, context: QgsPointCloudRenderContext)¶
Renders a
block
of point cloud data using the specified rendercontext
.- Parameters:
block (QgsPointCloudBlock) –
context (QgsPointCloudRenderContext) –
- restoreCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)¶
Restores common renderer properties (such as point size and screen error) from the specified DOM
element
.See also
- Parameters:
element (QDomElement) –
context (QgsReadWriteContext) –
- save(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement ¶
Saves the renderer configuration to an XML element.
See also
- Parameters:
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
QDomElement
- saveCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)¶
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)¶
Sets the drawing
order
used by the renderer for drawing points.See also
New in version 3.24.
- Parameters:
order (Qgis.PointCloudDrawOrder) –
- setHorizontalTriangleFilter(self, enabled: bool)¶
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
New in version 3.36.
- Parameters:
enabled (bool) –
- setHorizontalTriangleFilterThreshold(self, threshold: float)¶
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
New in version 3.36.
- Parameters:
threshold (float) –
- setHorizontalTriangleFilterUnit(self, unit: Qgis.RenderUnit)¶
Sets units of the threshold for filtering of triangles. This only applies when
renderAsTriangles()
andhorizontalTriangleFilter()
are both enabled.See also
See also
See also
New in version 3.36.
- Parameters:
unit (Qgis.RenderUnit) –
- setMaximumScreenError(self, error: float)¶
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)¶
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)¶
Sets the point
size
. Point size units are specified viasetPointSizeUnit()
.See also
See also
See also
- Parameters:
size (float) –
- setPointSizeMapUnitScale(self, scale: QgsMapUnitScale)¶
Sets the map unit
scale
used for the point size.See also
See also
See also
- Parameters:
scale (QgsMapUnitScale) –
- setPointSizeUnit(self, units: Qgis.RenderUnit)¶
Sets the
units
used for the point size.See also
See also
See also
- Parameters:
units (Qgis.RenderUnit) –
- setPointSymbol(self, symbol: Qgis.PointCloudSymbol)¶
Sets the
symbol
used by the renderer for drawing points.See also
- Parameters:
symbol (Qgis.PointCloudSymbol) –
- setRenderAsTriangles(self, asTriangles: bool)¶
Sets whether points are triangulated to render solid surface
New in version 3.36.
- Parameters:
asTriangles (bool) –
- startRender(self, context: QgsPointCloudRenderContext)¶
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) –
- stopRender(self, context: QgsPointCloudRenderContext)¶
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) –
- type(self) str ¶
Returns the identifier of the renderer type.
- Return type:
str
- 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]
- willRenderPoint(self, pointAttributes: Dict[str, Any]) bool ¶
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[str) –
- Return type:
bool