|
QGIS API Documentation 4.1.0-Master (31622b25bb0)
|
Abstract base class for 2d point cloud renderers. More...
#include <qgspointcloudrenderer.h>

Public Types | |
| enum class | Property : int { Color = 0 } |
| Data-defined properties that can be set on the renderer. More... | |
Public Member Functions | |
| QgsPointCloudRenderer () | |
| QgsPointCloudRenderer (const QgsPointCloudRenderer &other)=delete | |
| QgsPointCloudRenderer cannot be copied – use clone() instead. | |
| 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. | |
| virtual QgsPointCloudRenderer * | clone () const =0 |
| Create a deep copy of this renderer. | |
| virtual QList< QgsLayerTreeModelLegendNode * > | createLegendNodes (QgsLayerTreeLayer *nodeLayer) |
| Creates a set of legend nodes representing the renderer. | |
| const QgsPropertyCollection & | dataDefinedProperties () const |
| Returns the renderer's property collection, used for data defined overrides. | |
| Qgis::PointCloudDrawOrder | drawOrder2d () const |
| Returns the drawing order used by the renderer for drawing points. | |
| QgsElevationShadingRenderer | elevationShadingRenderer () const |
| Returns the shading renderer used to render shading on the layer. | |
| bool | horizontalTriangleFilter () const |
| Returns whether large triangles will get rendered. | |
| double | horizontalTriangleFilterThreshold () const |
| Returns threshold for filtering of triangles. | |
| Qgis::RenderUnit | horizontalTriangleFilterUnit () const |
| Returns units of the threshold for filtering of triangles. | |
| 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. | |
| QgsTextFormat | labelTextFormat () const |
| Returns the text format renderer is using for rendering labels. | |
| virtual bool | legendItemChecked (const QString &key) |
Returns true if the legend item with the specified key is checked. | |
| virtual QStringList | legendRuleKeys () const |
| Returns a list of all rule keys for legend nodes created by the renderer. | |
| double | maximumScreenError () const |
| Returns the maximum screen error allowed when rendering the point cloud. | |
| Qgis::RenderUnit | maximumScreenErrorUnit () const |
| Returns the unit for the maximum screen error allowed when rendering the point cloud. | |
| QgsPointCloudRenderer & | operator= (const QgsPointCloudRenderer &other)=delete |
| QgsPointCloudRenderer cannot be copied – use clone() instead. | |
| double | overviewSwitchingScale () const |
| Returns the overview switching scale. | |
| double | pointSize () const |
| Returns the point size. | |
| const QgsMapUnitScale & | pointSizeMapUnitScale () const |
| Returns the map unit scale used for the point size. | |
| Qgis::RenderUnit | pointSizeUnit () const |
| Returns the units used for the point size. | |
| Qgis::PointCloudSymbol | pointSymbol () const |
| Returns the symbol used by the renderer for drawing points. | |
| virtual std::unique_ptr< QgsPreparedPointCloudRendererData > | prepare () |
| Returns prepared data container for bulk point color retrieval. | |
| bool | renderAsTriangles () const |
| Returns whether points are triangulated to render solid surface. | |
| virtual void | renderBlock (const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context)=0 |
| Renders a block of point cloud data using the specified render context. | |
| virtual QDomElement | save (QDomDocument &doc, const QgsReadWriteContext &context) const =0 |
| Saves the renderer configuration to an XML element. | |
| void | setDataDefinedProperties (const QgsPropertyCollection &collection) |
| Sets the renderer's property collection, used for data defined overrides. | |
| void | setDrawOrder2d (Qgis::PointCloudDrawOrder order) |
| Sets the drawing order used by the renderer for drawing points. | |
| void | setElevationShadingRenderer (const QgsElevationShadingRenderer &renderer) |
| Sets the shading renderer used to render shading on the layer. | |
| void | setHorizontalTriangleFilter (bool enabled) |
| Sets whether large triangles will get rendered. | |
| void | setHorizontalTriangleFilterThreshold (double threshold) |
| Sets threshold for filtering of triangles. | |
| void | setHorizontalTriangleFilterUnit (Qgis::RenderUnit unit) |
| Sets units of the threshold for filtering of triangles. | |
| void | setLabelTextFormat (const QgsTextFormat &textFormat) |
| Sets the text format renderers should use for rendering labels. | |
| void | setMaximumScreenError (double error) |
| Sets the maximum screen error allowed when rendering the point cloud. | |
| void | setMaximumScreenErrorUnit (Qgis::RenderUnit unit) |
| Sets the unit for the maximum screen error allowed when rendering the point cloud. | |
| void | setOverviewSwitchingScale (const double value) |
| Sets the overview switching scale. | |
| void | setPointSize (double size) |
| Sets the point size. | |
| void | setPointSizeMapUnitScale (const QgsMapUnitScale &scale) |
| Sets the map unit scale used for the point size. | |
| void | setPointSizeUnit (const Qgis::RenderUnit units) |
| Sets the units used for the point size. | |
| void | setPointSymbol (Qgis::PointCloudSymbol symbol) |
| Sets the symbol used by the renderer for drawing points. | |
| void | setRenderAsTriangles (bool asTriangles) |
| Sets whether points are triangulated to render solid surface. | |
| void | setShowLabels (const bool show) |
| Set whether the renderer should also render file labels inside extent. | |
| void | setZoomOutBehavior (const Qgis::PointCloudZoomOutRenderBehavior behavior) |
| Sets the renderer behavior when zoomed out. | |
| bool | showLabels () const |
| Returns whether the renderer shows file labels inside the extent rectangle. | |
| virtual void | startRender (QgsPointCloudRenderContext &context) |
| Must be called when a new render cycle is started. | |
| virtual void | stopRender (QgsPointCloudRenderContext &context) |
| Must be called when a render cycle has finished, to allow the renderer to clean up. | |
| virtual QString | type () const =0 |
| Returns the identifier of the renderer type. | |
| virtual QSet< QString > | usedAttributes (const QgsPointCloudRenderContext &context) const |
| Returns a list of attributes required by this renderer. | |
| 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 ). | |
| Qgis::PointCloudZoomOutRenderBehavior | zoomOutBehavior () const |
| Returns the renderer behavior when zoomed out. | |
Static Public Member Functions | |
| static QgsPointCloudRenderer * | load (QDomElement &element, const QgsReadWriteContext &context) |
| Creates a renderer from an XML element. | |
| static const QgsPropertiesDefinition & | propertyDefinitions () |
| Returns the property definitions for data defined properties used by the renderer. | |
Protected Member Functions | |
| void | addPointToTriangulation (double x, double y, double z, const QColor &color, QgsPointCloudRenderContext &context) |
| Adds a point to the list of points to be triangulated (only used when renderAsTriangles() is enabled). | |
| QColor | colorFromExpression (const QgsPointCloudBlock *block, int pointIndex, const QColor &rendererColor, QgsPointCloudRenderContext &context) |
| Computes color from the expression set, uses expression referenced variables and renderer base color. | |
| void | copyCommonProperties (QgsPointCloudRenderer *destination) const |
| Copies common point cloud properties (such as point size and screen error) to the destination renderer. | |
| void | drawPoint (double x, double y, const QColor &color, int width, QgsPointCloudRenderContext &context) const |
| Draws a point using a color and painter width at the specified x and y (in map coordinates). | |
| 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). | |
| void | drawPointToElevationMap (double x, double y, double z, int width, QgsPointCloudRenderContext &context) const |
| Draws a point at the elevation z using at the specified x and y (in map coordinates) and painter width on the elevation map. | |
| void | drawPointToElevationMap (double x, double y, double z, QgsPointCloudRenderContext &context) const |
| Draws a point at the elevation z using at the specified x and y (in map coordinates) on the elevation map. | |
| void | restoreCommonProperties (const QDomElement &element, const QgsReadWriteContext &context) |
| Restores common renderer properties (such as point size and screen error) from the specified DOM element. | |
| void | saveCommonProperties (QDomElement &element, const QgsReadWriteContext &context) const |
| Saves common renderer properties (such as point size and screen error) to the specified DOM element. | |
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. | |
| static double | pointZ (QgsPointCloudRenderContext &context, const char *ptr, int i) |
| Retrieves the z value for the point at index i. | |
Abstract base class for 2d point cloud renderers.
Definition at line 322 of file qgspointcloudrenderer.h.
|
strong |
Data-defined properties that can be set on the renderer.
| Enumerator | |
|---|---|
| Color | Point color. |
Definition at line 348 of file qgspointcloudrenderer.h.
| QgsPointCloudRenderer::QgsPointCloudRenderer | ( | ) |
Definition at line 70 of file qgspointcloudrenderer.cpp.
|
virtualdefault |
|
delete |
QgsPointCloudRenderer cannot be copied – use clone() instead.
|
inlineprotected |
Adds a point to the list of points to be triangulated (only used when renderAsTriangles() is enabled).
Definition at line 855 of file qgspointcloudrenderer.h.
|
virtual |
Called when the check state of the legend item with the specified key is changed.
Reimplemented in QgsPointCloudClassifiedRenderer.
Definition at line 166 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 QgsPointCloudAttributeByRampRenderer, QgsPointCloudClassifiedRenderer, QgsPointCloudExtentRenderer, and QgsPointCloudRgbRenderer.
|
protected |
Computes color from the expression set, uses expression referenced variables and renderer base color.
Definition at line 458 of file qgspointcloudrenderer.cpp.
|
protected |
Copies common point cloud properties (such as point size and screen error) to the destination renderer.
Definition at line 230 of file qgspointcloudrenderer.cpp.
|
virtual |
Creates a set of legend nodes representing the renderer.
Reimplemented in QgsPointCloudAttributeByRampRenderer, QgsPointCloudClassifiedRenderer, and QgsPointCloudExtentRenderer.
Definition at line 194 of file qgspointcloudrenderer.cpp.
|
inline |
Returns the renderer's property collection, used for data defined overrides.
Definition at line 771 of file qgspointcloudrenderer.h.
| Qgis::PointCloudDrawOrder QgsPointCloudRenderer::drawOrder2d | ( | ) | const |
Returns the drawing order used by the renderer for drawing points.
Definition at line 340 of file qgspointcloudrenderer.cpp.
|
inlineprotected |
Draws a point using a color and painter width at the specified x and y (in map coordinates).
Definition at line 817 of file qgspointcloudrenderer.h.
|
inlineprotected |
Draws a point using a color at the specified x and y (in map coordinates).
Definition at line 810 of file qgspointcloudrenderer.h.
|
protected |
Draws a point at the elevation z using at the specified x and y (in map coordinates) and painter width on the elevation map.
Definition at line 209 of file qgspointcloudrenderer.cpp.
|
protected |
Draws a point at the elevation z using at the specified x and y (in map coordinates) on the elevation map.
Definition at line 204 of file qgspointcloudrenderer.cpp.
| QgsElevationShadingRenderer QgsPointCloudRenderer::elevationShadingRenderer | ( | ) | const |
Returns the shading renderer used to render shading on the layer.
Definition at line 453 of file qgspointcloudrenderer.cpp.
|
inline |
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 in horizontalTriangleFilterThreshold() do not get rendered.
Definition at line 616 of file qgspointcloudrenderer.h.
|
inline |
Returns threshold for filtering of triangles.
This only applies when renderAsTriangles() and horizontalTriangleFilter() 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 by horizontalTriangleFilterUnits().
Definition at line 641 of file qgspointcloudrenderer.h.
|
inline |
Returns units of the threshold for filtering of triangles.
This only applies when renderAsTriangles() and horizontalTriangleFilter() are both enabled.
Definition at line 665 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 366 of file qgspointcloudrenderer.cpp.
|
inline |
Returns the text format renderer is using for rendering labels.
Definition at line 711 of file qgspointcloudrenderer.h.
|
virtual |
Returns true if the legend item with the specified key is checked.
Reimplemented in QgsPointCloudClassifiedRenderer.
Definition at line 161 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 199 of file qgspointcloudrenderer.cpp.
|
static |
Creates a renderer from an XML element.
Caller takes ownership of the returned renderer.
Definition at line 82 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 169 of file qgspointcloudrenderer.cpp.
| Qgis::RenderUnit QgsPointCloudRenderer::maximumScreenErrorUnit | ( | ) | const |
Returns the unit for the maximum screen error allowed when rendering the point cloud.
Definition at line 184 of file qgspointcloudrenderer.cpp.
|
delete |
QgsPointCloudRenderer cannot be copied – use clone() instead.
|
inline |
Returns the overview switching scale.
Definition at line 740 of file qgspointcloudrenderer.h.
|
inline |
Returns the point size.
The point size units are retrieved by calling pointSizeUnit().
Definition at line 487 of file qgspointcloudrenderer.h.
|
inline |
Returns the map unit scale used for the point size.
Definition at line 520 of file qgspointcloudrenderer.h.
|
inline |
Returns the units used for the point size.
Definition at line 504 of file qgspointcloudrenderer.h.
| Qgis::PointCloudSymbol QgsPointCloudRenderer::pointSymbol | ( | ) | const |
Returns the symbol used by the renderer for drawing points.
Definition at line 330 of file qgspointcloudrenderer.cpp.
|
inlinestaticprotected |
Retrieves the x and y coordinate for the point at index i.
Definition at line 786 of file qgspointcloudrenderer.h.
|
inlinestaticprotected |
Retrieves the z value for the point at index i.
Definition at line 799 of file qgspointcloudrenderer.h.
|
virtual |
Returns prepared data container for bulk point color retrieval.
Reimplemented in QgsPointCloudAttributeByRampRenderer, QgsPointCloudClassifiedRenderer, and QgsPointCloudRgbRenderer.
Definition at line 108 of file qgspointcloudrenderer.cpp.
|
static |
Returns the property definitions for data defined properties used by the renderer.
Definition at line 360 of file qgspointcloudrenderer.cpp.
|
inline |
Returns whether points are triangulated to render solid surface.
Definition at line 597 of file qgspointcloudrenderer.h.
|
pure virtual |
Renders a block of point cloud data using the specified render context.
Implemented in QgsPointCloudAttributeByRampRenderer, QgsPointCloudClassifiedRenderer, QgsPointCloudExtentRenderer, and QgsPointCloudRgbRenderer.
|
protected |
Restores common renderer properties (such as point size and screen error) from the specified DOM element.
Definition at line 253 of file qgspointcloudrenderer.cpp.
|
pure virtual |
Saves the renderer configuration to an XML element.
Implemented in QgsPointCloudAttributeByRampRenderer, QgsPointCloudClassifiedRenderer, QgsPointCloudExtentRenderer, and QgsPointCloudRgbRenderer.
|
protected |
Saves common renderer properties (such as point size and screen error) to the specified DOM element.
Definition at line 288 of file qgspointcloudrenderer.cpp.
|
inline |
Sets the renderer's property collection, used for data defined overrides.
| collection | property collection. Existing properties will be replaced. |
Definition at line 780 of file qgspointcloudrenderer.h.
| void QgsPointCloudRenderer::setDrawOrder2d | ( | Qgis::PointCloudDrawOrder | order | ) |
Sets the drawing order used by the renderer for drawing points.
Definition at line 345 of file qgspointcloudrenderer.cpp.
|
inline |
Sets the shading renderer used to render shading on the layer.
Definition at line 756 of file qgspointcloudrenderer.h.
|
inline |
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 in horizontalTriangleFilterThreshold() do not get rendered.
Definition at line 628 of file qgspointcloudrenderer.h.
|
inline |
Sets threshold for filtering of triangles.
This only applies when renderAsTriangles() and horizontalTriangleFilter() 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 by horizontalTriangleFilterUnits().
Definition at line 654 of file qgspointcloudrenderer.h.
|
inline |
Sets units of the threshold for filtering of triangles.
This only applies when renderAsTriangles() and horizontalTriangleFilter() are both enabled.
Definition at line 676 of file qgspointcloudrenderer.h.
|
inline |
Sets the text format renderers should use for rendering labels.
Definition at line 705 of file qgspointcloudrenderer.h.
| 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 174 of file qgspointcloudrenderer.cpp.
| void QgsPointCloudRenderer::setMaximumScreenErrorUnit | ( | Qgis::RenderUnit | unit | ) |
Sets the unit for the maximum screen error allowed when rendering the point cloud.
Definition at line 189 of file qgspointcloudrenderer.cpp.
| void QgsPointCloudRenderer::setOverviewSwitchingScale | ( | const double | value | ) |
Sets the overview switching scale.
Point clouds whose extents intersect the map extent are considered visible. When zoomed out beyond the overview switching scale (render extent exceeds average point cloud dimensions by the scale factor), and overview zoom-out behavior is enabled, the overview is rendered instead of an individual point cloud.
Definition at line 179 of file qgspointcloudrenderer.cpp.
|
inline |
Sets the point size.
Point size units are specified via setPointSizeUnit().
Definition at line 476 of file qgspointcloudrenderer.h.
|
inline |
Sets the map unit scale used for the point size.
Definition at line 512 of file qgspointcloudrenderer.h.
|
inline |
Sets the units used for the point size.
Definition at line 496 of file qgspointcloudrenderer.h.
| void QgsPointCloudRenderer::setPointSymbol | ( | Qgis::PointCloudSymbol | symbol | ) |
Sets the symbol used by the renderer for drawing points.
Definition at line 335 of file qgspointcloudrenderer.cpp.
|
inline |
Sets whether points are triangulated to render solid surface.
Definition at line 604 of file qgspointcloudrenderer.h.
|
inline |
Set whether the renderer should also render file labels inside extent.
Definition at line 692 of file qgspointcloudrenderer.h.
|
inline |
Sets the renderer behavior when zoomed out.
Definition at line 717 of file qgspointcloudrenderer.h.
|
inline |
Returns whether the renderer shows file labels inside the extent rectangle.
Definition at line 699 of file qgspointcloudrenderer.h.
|
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 113 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 148 of file qgspointcloudrenderer.cpp.
|
pure virtual |
Returns the identifier of the renderer type.
Implemented in QgsPointCloudAttributeByRampRenderer, QgsPointCloudClassifiedRenderer, QgsPointCloudExtentRenderer, and QgsPointCloudRgbRenderer.
|
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 QgsPointCloudAttributeByRampRenderer, QgsPointCloudClassifiedRenderer, and QgsPointCloudRgbRenderer.
Definition at line 98 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 395 of file qgspointcloudrenderer.h.
|
inline |
Returns the renderer behavior when zoomed out.
Definition at line 723 of file qgspointcloudrenderer.h.