QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsPointCloudClassifiedRenderer Class Reference

Renders point clouds by a classification attribute. More...

#include <qgspointcloudclassifiedrenderer.h>

Inheritance diagram for QgsPointCloudClassifiedRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsPointCloudClassifiedRenderer (const QString &attributeName=QString(), const QgsPointCloudCategoryList &categories=QgsPointCloudCategoryList())
 Constructor for QgsPointCloudClassifiedRenderer.
 
void addCategory (const QgsPointCloudCategory &category)
 Adds a category to the renderer.
 
QString attribute () const
 Returns the attribute to use for the renderer.
 
QgsPointCloudCategoryList categories () const
 Returns the classification categories used for rendering.
 
void checkLegendItem (const QString &key, bool state=true) override
 Called when the check state of the legend item with the specified key is changed.
 
QgsPointCloudRendererclone () const override
 Create a deep copy of this renderer.
 
QList< QgsLayerTreeModelLegendNode * > createLegendNodes (QgsLayerTreeLayer *nodeLayer) override
 Creates a set of legend nodes representing the renderer.
 
bool legendItemChecked (const QString &key) override
 Returns true if the legend item with the specified key is checked.
 
QStringList legendRuleKeys () const override
 Returns a list of all rule keys for legend nodes created by the renderer.
 
std::unique_ptr< QgsPreparedPointCloudRendererDataprepare () override
 Returns prepared data container for bulk point color retrieval.
 
void renderBlock (const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context) override
 Renders a block of point cloud data using the specified render context.
 
QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const override
 Saves the renderer configuration to an XML element.
 
void setAttribute (const QString &attribute)
 Sets the attribute to use for the renderer.
 
void setCategories (const QgsPointCloudCategoryList &categories)
 Sets the classification categories used for rendering.
 
QString type () const override
 Returns the identifier of the renderer type.
 
QSet< QString > usedAttributes (const QgsPointCloudRenderContext &context) const override
 Returns a list of attributes required by this renderer.
 
bool willRenderPoint (const QVariantMap &pointAttributes) override
 
- Public Member Functions inherited from QgsPointCloudRenderer
 QgsPointCloudRenderer ()=default
 
 QgsPointCloudRenderer (const QgsPointCloudRenderer &other)=delete
 QgsPointCloudRenderer cannot be copied – use clone() instead.
 
virtual ~QgsPointCloudRenderer ()=default
 
Qgis::PointCloudDrawOrder drawOrder2d () const
 Returns the drawing order used by the renderer for drawing points.
 
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.
 
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.
 
QgsPointCloudRendereroperator= (const QgsPointCloudRenderer &other)=delete
 QgsPointCloudRenderer cannot be copied – use clone() instead.
 
double pointSize () const
 Returns the point size.
 
const QgsMapUnitScalepointSizeMapUnitScale () 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.
 
bool renderAsTriangles () const
 Returns whether points are triangulated to render solid surface.
 
void setDrawOrder2d (Qgis::PointCloudDrawOrder order)
 Sets the drawing order used by the renderer for drawing points.
 
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 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 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.
 
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 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 )
 

Static Public Member Functions

static QgsPointCloudRenderercreate (QDomElement &element, const QgsReadWriteContext &context)
 Creates an RGB renderer from an XML element.
 
static QgsPointCloudCategoryList defaultCategories ()
 Returns the default list of categories.
 
- Static Public Member Functions inherited from QgsPointCloudRenderer
static QgsPointCloudRendererload (QDomElement &element, const QgsReadWriteContext &context)
 Creates a renderer from an XML element.
 

Additional Inherited Members

- Protected Member Functions inherited from QgsPointCloudRenderer
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)
 
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 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.
 
static double pointZ (QgsPointCloudRenderContext &context, const char *ptr, int i)
 Retrieves the z value for the point at index i.
 

Detailed Description

Renders point clouds by a classification attribute.

Since
QGIS 3.18

Definition at line 164 of file qgspointcloudclassifiedrenderer.h.

Constructor & Destructor Documentation

◆ QgsPointCloudClassifiedRenderer()

QgsPointCloudClassifiedRenderer::QgsPointCloudClassifiedRenderer ( const QString &  attributeName = QString(),
const QgsPointCloudCategoryList categories = QgsPointCloudCategoryList() 
)

Constructor for QgsPointCloudClassifiedRenderer.

Definition at line 48 of file qgspointcloudclassifiedrenderer.cpp.

Member Function Documentation

◆ addCategory()

void QgsPointCloudClassifiedRenderer::addCategory ( const QgsPointCloudCategory category)

Adds a category to the renderer.

See also
categories()

Definition at line 349 of file qgspointcloudclassifiedrenderer.cpp.

◆ attribute()

QString QgsPointCloudClassifiedRenderer::attribute ( ) const

Returns the attribute to use for the renderer.

See also
setAttribute()

Definition at line 329 of file qgspointcloudclassifiedrenderer.cpp.

◆ categories()

QgsPointCloudCategoryList QgsPointCloudClassifiedRenderer::categories ( ) const

Returns the classification categories used for rendering.

See also
setCategories()

Definition at line 339 of file qgspointcloudclassifiedrenderer.cpp.

◆ checkLegendItem()

void QgsPointCloudClassifiedRenderer::checkLegendItem ( const QString &  key,
bool  state = true 
)
overridevirtual

Called when the check state of the legend item with the specified key is changed.

See also
legendItemChecked()

Reimplemented from QgsPointCloudRenderer.

Definition at line 312 of file qgspointcloudclassifiedrenderer.cpp.

◆ clone()

QgsPointCloudRenderer * QgsPointCloudClassifiedRenderer::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 59 of file qgspointcloudclassifiedrenderer.cpp.

◆ create()

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

Creates an RGB renderer from an XML element.

Definition at line 187 of file qgspointcloudclassifiedrenderer.cpp.

◆ createLegendNodes()

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

Creates a set of legend nodes representing the renderer.

Reimplemented from QgsPointCloudRenderer.

Definition at line 275 of file qgspointcloudclassifiedrenderer.cpp.

◆ defaultCategories()

QgsPointCloudCategoryList QgsPointCloudClassifiedRenderer::defaultCategories ( )
static

Returns the default list of categories.

Definition at line 219 of file qgspointcloudclassifiedrenderer.cpp.

◆ legendItemChecked()

bool QgsPointCloudClassifiedRenderer::legendItemChecked ( const QString &  key)
overridevirtual

Returns true if the legend item with the specified key is checked.

See also
checkLegendItem()

Reimplemented from QgsPointCloudRenderer.

Definition at line 297 of file qgspointcloudclassifiedrenderer.cpp.

◆ legendRuleKeys()

QStringList QgsPointCloudClassifiedRenderer::legendRuleKeys ( ) const
overridevirtual

Returns a list of all rule keys for legend nodes created by the renderer.

Reimplemented from QgsPointCloudRenderer.

Definition at line 287 of file qgspointcloudclassifiedrenderer.cpp.

◆ prepare()

std::unique_ptr< QgsPreparedPointCloudRendererData > QgsPointCloudClassifiedRenderer::prepare ( )
overridevirtual

Returns prepared data container for bulk point color retrieval.

Note
Not available in Python bindings.
Since
QGIS 3.26

Reimplemented from QgsPointCloudRenderer.

Definition at line 354 of file qgspointcloudclassifiedrenderer.cpp.

◆ renderBlock()

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

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

Implements QgsPointCloudRenderer.

Definition at line 70 of file qgspointcloudclassifiedrenderer.cpp.

◆ save()

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

Saves the renderer configuration to an XML element.

See also
load()

Implements QgsPointCloudRenderer.

Definition at line 242 of file qgspointcloudclassifiedrenderer.cpp.

◆ setAttribute()

void QgsPointCloudClassifiedRenderer::setAttribute ( const QString &  attribute)

Sets the attribute to use for the renderer.

See also
attribute()

Definition at line 334 of file qgspointcloudclassifiedrenderer.cpp.

◆ setCategories()

void QgsPointCloudClassifiedRenderer::setCategories ( const QgsPointCloudCategoryList categories)

Sets the classification categories used for rendering.

See also
categories()

Definition at line 344 of file qgspointcloudclassifiedrenderer.cpp.

◆ type()

QString QgsPointCloudClassifiedRenderer::type ( ) const
overridevirtual

Returns the identifier of the renderer type.

Implements QgsPointCloudRenderer.

Definition at line 54 of file qgspointcloudclassifiedrenderer.cpp.

◆ usedAttributes()

QSet< QString > QgsPointCloudClassifiedRenderer::usedAttributes ( const QgsPointCloudRenderContext context) const
overridevirtual

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.

Reimplemented from QgsPointCloudRenderer.

Definition at line 268 of file qgspointcloudclassifiedrenderer.cpp.

◆ willRenderPoint()

bool QgsPointCloudClassifiedRenderer::willRenderPoint ( const QVariantMap &  pointAttributes)
override

Definition at line 171 of file qgspointcloudclassifiedrenderer.cpp.


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