QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Abstract base class for 2d point cloud renderers. More...
#include <qgspointcloudrenderer.h>
Public Member Functions | |
QgsPointCloudRenderer ()=default | |
Constructor for QgsPointCloudRenderer. More... | |
QgsPointCloudRenderer (const QgsPointCloudRenderer &other)=delete | |
QgsPointCloudRenderer cannot be copied – use clone() instead. More... | |
virtual | ~QgsPointCloudRenderer ()=default |
virtual void | checkLegendItem (const QString &key, bool state=true) |
Called when the check state of the legend item with the specified key is changed. More... | |
virtual QgsPointCloudRenderer * | clone () const =0 |
Create a deep copy of this renderer. More... | |
virtual QList< QgsLayerTreeModelLegendNode * > | createLegendNodes (QgsLayerTreeLayer *nodeLayer) |
Creates a set of legend nodes representing the renderer. More... | |
Qgis::PointCloudDrawOrder | drawOrder2d () const |
Returns the drawing order used by the renderer for drawing points. More... | |
QVector< QVariantMap > | identify (QgsPointCloudLayer *layer, const QgsRenderContext &context, const QgsGeometry &geometry, double toleranceForPointIdentification=0) |
Returns the list of visible points of the point cloud layer layer and an extent defined by a geometry in the 2D plane geometry. More... | |
virtual bool | legendItemChecked (const QString &key) |
Returns true if the legend item with the specified key is checked. More... | |
virtual QStringList | legendRuleKeys () const |
Returns a list of all rule keys for legend nodes created by the renderer. More... | |
double | maximumScreenError () const |
Returns the maximum screen error allowed when rendering the point cloud. More... | |
QgsUnitTypes::RenderUnit | maximumScreenErrorUnit () const |
Returns the unit for the maximum screen error allowed when rendering the point cloud. More... | |
QgsPointCloudRenderer & | operator= (const QgsPointCloudRenderer &other)=delete |
QgsPointCloudRenderer cannot be copied – use clone() instead. More... | |
double | pointSize () const |
Returns the point size. More... | |
const QgsMapUnitScale & | pointSizeMapUnitScale () const |
Returns the map unit scale used for the point size. More... | |
QgsUnitTypes::RenderUnit | pointSizeUnit () const |
Returns the units used for the point size. More... | |
Qgis::PointCloudSymbol | pointSymbol () const |
Returns the symbol used by the renderer for drawing points. More... | |
virtual std::unique_ptr< QgsPreparedPointCloudRendererData > | prepare () |
Returns prepared data container for bulk point color retrieval. More... | |
virtual void | renderBlock (const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context)=0 |
Renders a block of point cloud data using the specified render context. More... | |
virtual QDomElement | save (QDomDocument &doc, const QgsReadWriteContext &context) const =0 |
Saves the renderer configuration to an XML element. More... | |
void | setDrawOrder2d (Qgis::PointCloudDrawOrder order) |
Sets the drawing order used by the renderer for drawing points. More... | |
void | setMaximumScreenError (double error) |
Sets the maximum screen error allowed when rendering the point cloud. More... | |
void | setMaximumScreenErrorUnit (QgsUnitTypes::RenderUnit unit) |
Sets the unit for the maximum screen error allowed when rendering the point cloud. More... | |
void | setPointSize (double size) |
Sets the point size. More... | |
void | setPointSizeMapUnitScale (const QgsMapUnitScale &scale) |
Sets the map unit scale used for the point size. More... | |
void | setPointSizeUnit (const QgsUnitTypes::RenderUnit units) |
Sets the units used for the point size. More... | |
void | setPointSymbol (Qgis::PointCloudSymbol symbol) |
Sets the symbol used by the renderer for drawing points. More... | |
virtual void | startRender (QgsPointCloudRenderContext &context) |
Must be called when a new render cycle is started. More... | |
virtual void | stopRender (QgsPointCloudRenderContext &context) |
Must be called when a render cycle has finished, to allow the renderer to clean up. More... | |
virtual QString | type () const =0 |
Returns the identifier of the renderer type. More... | |
virtual QSet< QString > | usedAttributes (const QgsPointCloudRenderContext &context) const |
Returns a list of attributes required by this renderer. More... | |
virtual bool | willRenderPoint (const QMap< QString, QVariant > &pointAttributes) |
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 ) More... | |
Static Public Member Functions | |
static QgsPointCloudRenderer * | load (QDomElement &element, const QgsReadWriteContext &context) |
Creates a renderer from an XML element. More... | |
Protected Member Functions | |
void | copyCommonProperties (QgsPointCloudRenderer *destination) const |
Copies common point cloud properties (such as point size and screen error) to the destination renderer. More... | |
void | drawPoint (double x, double y, const QColor &color, QgsPointCloudRenderContext &context) const |
Draws a point using a color at the specified x and y (in map coordinates). More... | |
void | restoreCommonProperties (const QDomElement &element, const QgsReadWriteContext &context) |
Restores common renderer properties (such as point size and screen error) from the specified DOM element. More... | |
void | saveCommonProperties (QDomElement &element, const QgsReadWriteContext &context) const |
Saves common renderer properties (such as point size and screen error) to the specified DOM element. More... | |
Static Protected Member Functions | |
static void | pointXY (QgsPointCloudRenderContext &context, const char *ptr, int i, double &x, double &y) |
Retrieves the x and y coordinate for the point at index i. More... | |
static double | pointZ (QgsPointCloudRenderContext &context, const char *ptr, int i) |
Retrieves the z value for the point at index i. More... | |
Abstract base class for 2d point cloud renderers.
Definition at line 296 of file qgspointcloudrenderer.h.
|
default |
Constructor for QgsPointCloudRenderer.
|
virtualdefault |
|
delete |
QgsPointCloudRenderer cannot be copied – use clone() instead.
|
virtual |
Called when the check state of the legend item with the specified key is changed.
Reimplemented in QgsPointCloudClassifiedRenderer.
Definition at line 127 of file qgspointcloudrenderer.cpp.
|
pure virtual |
Create a deep copy of this renderer.
Should be implemented by all subclasses and generate a proper subclass.
Implemented in QgsPointCloudClassifiedRenderer, QgsPointCloudRgbRenderer, QgsPointCloudAttributeByRampRenderer, and QgsPointCloudExtentRenderer.
|
protected |
Copies common point cloud properties (such as point size and screen error) to the destination renderer.
Definition at line 162 of file qgspointcloudrenderer.cpp.
|
virtual |
Creates a set of legend nodes representing the renderer.
Reimplemented in QgsPointCloudClassifiedRenderer, QgsPointCloudAttributeByRampRenderer, and QgsPointCloudExtentRenderer.
Definition at line 152 of file qgspointcloudrenderer.cpp.
Qgis::PointCloudDrawOrder QgsPointCloudRenderer::drawOrder2d | ( | ) | const |
Returns the drawing order used by the renderer for drawing points.
Definition at line 207 of file qgspointcloudrenderer.cpp.
|
inlineprotected |
Draws a point using a color at the specified x and y (in map coordinates).
Definition at line 600 of file qgspointcloudrenderer.h.
QVector< QVariantMap > QgsPointCloudRenderer::identify | ( | QgsPointCloudLayer * | layer, |
const QgsRenderContext & | context, | ||
const QgsGeometry & | geometry, | ||
double | toleranceForPointIdentification = 0 |
||
) |
Returns the list of visible points of the point cloud layer layer and an extent defined by a geometry in the 2D plane geometry.
The toleranceForPointIdentification argument can be used to specify a minimum tolerance allowable when identify from a point geometry value. This must be specified in the map units associated with the render context.
Definition at line 217 of file qgspointcloudrenderer.cpp.
|
virtual |
Returns true
if the legend item with the specified key is checked.
Reimplemented in QgsPointCloudClassifiedRenderer.
Definition at line 122 of file qgspointcloudrenderer.cpp.
|
virtual |
Returns a list of all rule keys for legend nodes created by the renderer.
Reimplemented in QgsPointCloudClassifiedRenderer.
Definition at line 157 of file qgspointcloudrenderer.cpp.
|
static |
Creates a renderer from an XML element.
Caller takes ownership of the returned renderer.
Definition at line 62 of file qgspointcloudrenderer.cpp.
double QgsPointCloudRenderer::maximumScreenError | ( | ) | const |
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().
Definition at line 132 of file qgspointcloudrenderer.cpp.
QgsUnitTypes::RenderUnit QgsPointCloudRenderer::maximumScreenErrorUnit | ( | ) | const |
Returns the unit for the maximum screen error allowed when rendering the point cloud.
Definition at line 142 of file qgspointcloudrenderer.cpp.
|
delete |
QgsPointCloudRenderer cannot be copied – use clone() instead.
|
inline |
Returns the point size.
The point size units are retrieved by calling pointSizeUnit().
Definition at line 456 of file qgspointcloudrenderer.h.
|
inline |
Returns the map unit scale used for the point size.
Definition at line 489 of file qgspointcloudrenderer.h.
|
inline |
Returns the units used for the point size.
Definition at line 473 of file qgspointcloudrenderer.h.
Qgis::PointCloudSymbol QgsPointCloudRenderer::pointSymbol | ( | ) | const |
Returns the symbol used by the renderer for drawing points.
Definition at line 197 of file qgspointcloudrenderer.cpp.
|
inlinestaticprotected |
Retrieves the x and y coordinate for the point at index i.
Definition at line 576 of file qgspointcloudrenderer.h.
|
inlinestaticprotected |
Retrieves the z value for the point at index i.
Definition at line 589 of file qgspointcloudrenderer.h.
|
virtual |
Returns prepared data container for bulk point color retrieval.
Reimplemented in QgsPointCloudClassifiedRenderer, QgsPointCloudRgbRenderer, and QgsPointCloudAttributeByRampRenderer.
Definition at line 83 of file qgspointcloudrenderer.cpp.
|
pure virtual |
Renders a block of point cloud data using the specified render context.
Implemented in QgsPointCloudClassifiedRenderer, QgsPointCloudRgbRenderer, QgsPointCloudAttributeByRampRenderer, and QgsPointCloudExtentRenderer.
|
protected |
Restores common renderer properties (such as point size and screen error) from the specified DOM element.
Definition at line 173 of file qgspointcloudrenderer.cpp.
|
pure virtual |
Saves the renderer configuration to an XML element.
Implemented in QgsPointCloudClassifiedRenderer, QgsPointCloudRgbRenderer, QgsPointCloudAttributeByRampRenderer, and QgsPointCloudExtentRenderer.
|
protected |
Saves common renderer properties (such as point size and screen error) to the specified DOM element.
Definition at line 185 of file qgspointcloudrenderer.cpp.
void QgsPointCloudRenderer::setDrawOrder2d | ( | Qgis::PointCloudDrawOrder | order | ) |
Sets the drawing order used by the renderer for drawing points.
Definition at line 212 of file qgspointcloudrenderer.cpp.
void QgsPointCloudRenderer::setMaximumScreenError | ( | double | error | ) |
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().
Definition at line 137 of file qgspointcloudrenderer.cpp.
void QgsPointCloudRenderer::setMaximumScreenErrorUnit | ( | QgsUnitTypes::RenderUnit | unit | ) |
Sets the unit for the maximum screen error allowed when rendering the point cloud.
Definition at line 147 of file qgspointcloudrenderer.cpp.
|
inline |
Sets the point size.
Point size units are specified via setPointSizeUnit().
Definition at line 445 of file qgspointcloudrenderer.h.
|
inline |
Sets the map unit scale used for the point size.
Definition at line 481 of file qgspointcloudrenderer.h.
|
inline |
Sets the units used for the point size.
Definition at line 465 of file qgspointcloudrenderer.h.
void QgsPointCloudRenderer::setPointSymbol | ( | Qgis::PointCloudSymbol | symbol | ) |
Sets the symbol used by the renderer for drawing points.
Definition at line 202 of file qgspointcloudrenderer.cpp.
|
virtual |
Must be called when a new render cycle is started.
A call to startRender() must always be followed by a corresponding call to stopRender() after all features have been rendered.
Reimplemented in QgsPointCloudExtentRenderer.
Definition at line 88 of file qgspointcloudrenderer.cpp.
|
virtual |
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 to startRender().
Reimplemented in QgsPointCloudExtentRenderer.
Definition at line 115 of file qgspointcloudrenderer.cpp.
|
pure virtual |
Returns the identifier of the renderer type.
Implemented in QgsPointCloudClassifiedRenderer, QgsPointCloudRgbRenderer, QgsPointCloudAttributeByRampRenderer, and QgsPointCloudExtentRenderer.
|
virtual |
Returns a list of attributes required by this renderer.
Attributes not listed in here may not be requested from the provider at rendering time.
Reimplemented in QgsPointCloudClassifiedRenderer, QgsPointCloudRgbRenderer, and QgsPointCloudAttributeByRampRenderer.
Definition at line 78 of file qgspointcloudrenderer.cpp.
|
inlinevirtual |
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 )
Definition at line 364 of file qgspointcloudrenderer.h.