QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Public Member Functions | Static Public Member Functions | List of all members
QgsPointCloudExtentRenderer Class Reference

A renderer for 2d visualisation of point clouds which shows the dataset's extents using a fill symbol. More...

#include <qgspointcloudextentrenderer.h>

Inheritance diagram for QgsPointCloudExtentRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsPointCloudExtentRenderer (QgsFillSymbol *symbol=nullptr)
 Constructor for QgsPointCloudExtentRenderer. More...
 
 ~QgsPointCloudExtentRenderer () override
 
QgsPointCloudRendererclone () const override
 Create a deep copy of this renderer. More...
 
QList< QgsLayerTreeModelLegendNode * > createLegendNodes (QgsLayerTreeLayer *nodeLayer) override
 Creates a set of legend nodes representing the renderer. More...
 
QgsFillSymbolfillSymbol () const
 Returns the symbol used to render the cloud's extent. More...
 
void renderBlock (const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context) override
 Renders a block of point cloud data using the specified render context. More...
 
void renderExtent (const QgsGeometry &extent, QgsPointCloudRenderContext &context)
 Renders a polygon extent geometry to the specified render context. More...
 
QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const override
 Saves the renderer configuration to an XML element. More...
 
void setFillSymbol (QgsFillSymbol *symbol)
 Sets the symbol used to render the cloud's extent. More...
 
void startRender (QgsPointCloudRenderContext &context) override
 Must be called when a new render cycle is started. More...
 
void stopRender (QgsPointCloudRenderContext &context) override
 Must be called when a render cycle has finished, to allow the renderer to clean up. More...
 
QString type () const override
 Returns the identifier of the renderer type. More...
 
- Public Member Functions inherited from QgsPointCloudRenderer
 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 QgsPointCloudRendererclone () 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...
 
Qgis::RenderUnit maximumScreenErrorUnit () const
 Returns the unit for the maximum screen error allowed when rendering the point cloud. More...
 
QgsPointCloudRendereroperator= (const QgsPointCloudRenderer &other)=delete
 QgsPointCloudRenderer cannot be copied – use clone() instead. More...
 
double pointSize () const
 Returns the point size. More...
 
const QgsMapUnitScalepointSizeMapUnitScale () const
 Returns the map unit scale used for the point size. More...
 
Qgis::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< QgsPreparedPointCloudRendererDataprepare ()
 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 (Qgis::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 Qgis::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 QgsPointCloudRenderercreate (QDomElement &element, const QgsReadWriteContext &context)
 Creates an extent renderer from an XML element. More...
 
static QgsFillSymboldefaultFillSymbol ()
 Returns a new instance of the default fill symbol to use for showing point cloud extents. More...
 
- Static Public Member Functions inherited from QgsPointCloudRenderer
static QgsPointCloudRendererload (QDomElement &element, const QgsReadWriteContext &context)
 Creates a renderer from an XML element. More...
 

Additional Inherited Members

- Protected Member Functions inherited from QgsPointCloudRenderer
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 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. 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 inherited from QgsPointCloudRenderer
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...
 

Detailed Description

A renderer for 2d visualisation of point clouds which shows the dataset's extents using a fill symbol.

Since
QGIS 3.18

Definition at line 33 of file qgspointcloudextentrenderer.h.

Constructor & Destructor Documentation

◆ QgsPointCloudExtentRenderer()

QgsPointCloudExtentRenderer::QgsPointCloudExtentRenderer ( QgsFillSymbol symbol = nullptr)

Constructor for QgsPointCloudExtentRenderer.

Optionally the symbol to use for showing the extent can be specified. If specified, ownership is transferred to the renderer. If no symbol is specified a default one will be created instead.

Definition at line 28 of file qgspointcloudextentrenderer.cpp.

◆ ~QgsPointCloudExtentRenderer()

QgsPointCloudExtentRenderer::~QgsPointCloudExtentRenderer ( )
overridedefault

Member Function Documentation

◆ clone()

QgsPointCloudRenderer * QgsPointCloudExtentRenderer::clone ( ) const
overridevirtual

Create a deep copy of this renderer.

Should be implemented by all subclasses and generate a proper subclass.

Implements QgsPointCloudRenderer.

Definition at line 41 of file qgspointcloudextentrenderer.cpp.

◆ create()

QgsPointCloudRenderer * QgsPointCloudExtentRenderer::create ( QDomElement &  element,
const QgsReadWriteContext context 
)
static

Creates an extent renderer from an XML element.

Definition at line 53 of file qgspointcloudextentrenderer.cpp.

◆ createLegendNodes()

QList< QgsLayerTreeModelLegendNode * > QgsPointCloudExtentRenderer::createLegendNodes ( QgsLayerTreeLayer nodeLayer)
overridevirtual

Creates a set of legend nodes representing the renderer.

Reimplemented from QgsPointCloudRenderer.

Definition at line 163 of file qgspointcloudextentrenderer.cpp.

◆ defaultFillSymbol()

QgsFillSymbol * QgsPointCloudExtentRenderer::defaultFillSymbol ( )
static

Returns a new instance of the default fill symbol to use for showing point cloud extents.

Definition at line 118 of file qgspointcloudextentrenderer.cpp.

◆ fillSymbol()

QgsFillSymbol * QgsPointCloudExtentRenderer::fillSymbol ( ) const

Returns the symbol used to render the cloud's extent.

See also
setFillSymbol()

Definition at line 128 of file qgspointcloudextentrenderer.cpp.

◆ renderBlock()

void QgsPointCloudExtentRenderer::renderBlock ( const QgsPointCloudBlock block,
QgsPointCloudRenderContext context 
)
overridevirtual

Renders a block of point cloud data using the specified render context.

Implements QgsPointCloudRenderer.

Definition at line 48 of file qgspointcloudextentrenderer.cpp.

◆ renderExtent()

void QgsPointCloudExtentRenderer::renderExtent ( const QgsGeometry extent,
QgsPointCloudRenderContext context 
)

Renders a polygon extent geometry to the specified render context.

Definition at line 67 of file qgspointcloudextentrenderer.cpp.

◆ save()

QDomElement QgsPointCloudExtentRenderer::save ( QDomDocument &  doc,
const QgsReadWriteContext context 
) const
overridevirtual

Saves the renderer configuration to an XML element.

See also
load()

Implements QgsPointCloudRenderer.

Definition at line 138 of file qgspointcloudextentrenderer.cpp.

◆ setFillSymbol()

void QgsPointCloudExtentRenderer::setFillSymbol ( QgsFillSymbol symbol)

Sets the symbol used to render the cloud's extent.

Ownership of symbol is transferred to the renderer.

See also
fillSymbol()

Definition at line 133 of file qgspointcloudextentrenderer.cpp.

◆ startRender()

void QgsPointCloudExtentRenderer::startRender ( QgsPointCloudRenderContext context)
overridevirtual

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.

See also
stopRender()
Warning
This method is not thread safe. Before calling startRender() in a non-main thread, the renderer should instead be cloned and startRender()/stopRender() called on the clone.

Reimplemented from QgsPointCloudRenderer.

Definition at line 151 of file qgspointcloudextentrenderer.cpp.

◆ stopRender()

void QgsPointCloudExtentRenderer::stopRender ( QgsPointCloudRenderContext context)
overridevirtual

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().

Warning
This method is not thread safe. Before calling startRender() in a non-main thread, the renderer should instead be cloned and startRender()/stopRender() called on the clone.
See also
startRender()

Reimplemented from QgsPointCloudRenderer.

Definition at line 157 of file qgspointcloudextentrenderer.cpp.

◆ type()

QString QgsPointCloudExtentRenderer::type ( ) const
overridevirtual

Returns the identifier of the renderer type.

Implements QgsPointCloudRenderer.

Definition at line 36 of file qgspointcloudextentrenderer.cpp.


The documentation for this class was generated from the following files: