QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | Static Public Member Functions | List of all members
QgsPointCloudRgbRenderer Class Reference

An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes. More...

#include <qgspointcloudrgbrenderer.h>

Inheritance diagram for QgsPointCloudRgbRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsPointCloudRgbRenderer ()
 Constructor for QgsPointCloudRgbRenderer. More...
 
QString blueAttribute () const
 Returns the attribute to use for the blue channel. More...
 
const QgsContrastEnhancementblueContrastEnhancement () const
 Returns the contrast enhancement to use for the blue channel. More...
 
QgsPointCloudRendererclone () const override
 Create a deep copy of this renderer. More...
 
QString greenAttribute () const
 Returns the attribute to use for the green channel. More...
 
const QgsContrastEnhancementgreenContrastEnhancement () const
 Returns the contrast enhancement to use for the green channel. More...
 
std::unique_ptr< QgsPreparedPointCloudRendererDataprepare () override
 Returns prepared data container for bulk point color retrieval. More...
 
QString redAttribute () const
 Returns the attribute to use for the red channel. More...
 
const QgsContrastEnhancementredContrastEnhancement () const
 Returns the contrast enhancement to use for the red channel. More...
 
void renderBlock (const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context) override
 Renders a block of point cloud data using the specified render context. More...
 
QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const override
 Saves the renderer configuration to an XML element. More...
 
void setBlueAttribute (const QString &attribute)
 Sets the attribute to use for the blue channel. More...
 
void setBlueContrastEnhancement (QgsContrastEnhancement *enhancement)
 Sets the contrast enhancement to use for the blue channel. More...
 
void setGreenAttribute (const QString &attribute)
 Sets the attribute to use for the green channel. More...
 
void setGreenContrastEnhancement (QgsContrastEnhancement *enhancement)
 Sets the contrast enhancement to use for the green channel. More...
 
void setRedAttribute (const QString &attribute)
 Sets the attribute to use for the red channel. More...
 
void setRedContrastEnhancement (QgsContrastEnhancement *enhancement)
 Sets the contrast enhancement to use for the red channel. More...
 
QString type () const override
 Returns the identifier of the renderer type. More...
 
QSet< QString > usedAttributes (const QgsPointCloudRenderContext &context) const override
 Returns a list of attributes required by this renderer. 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...
 
bool horizontalTriangleFilter () const
 Returns whether large triangles will get rendered. More...
 
double horizontalTriangleFilterThreshold () const
 Returns threshold for filtering of triangles. More...
 
Qgis::RenderUnit horizontalTriangleFilterUnit () const
 Returns units of the threshold for filtering of triangles. 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...
 
bool renderAsTriangles () const
 Returns whether points are triangulated to render solid surface. 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 setHorizontalTriangleFilter (bool enabled)
 Sets whether large triangles will get rendered. More...
 
void setHorizontalTriangleFilterThreshold (double threshold)
 Sets threshold for filtering of triangles. More...
 
void setHorizontalTriangleFilterUnit (Qgis::RenderUnit unit)
 Sets units of the threshold for filtering of triangles. 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...
 
void setRenderAsTriangles (bool asTriangles)
 Sets whether points are triangulated to render solid surface. 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 RGB renderer from an XML element. 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 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) More...
 
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, int width, QgsPointCloudRenderContext &context) const
 Draws a point using a color and painter width at the specified x and y (in map coordinates). 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, 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. 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

An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes.

Since
QGIS 3.18

Definition at line 71 of file qgspointcloudrgbrenderer.h.

Constructor & Destructor Documentation

◆ QgsPointCloudRgbRenderer()

QgsPointCloudRgbRenderer::QgsPointCloudRgbRenderer ( )

Constructor for QgsPointCloudRgbRenderer.

Definition at line 22 of file qgspointcloudrgbrenderer.cpp.

Member Function Documentation

◆ blueAttribute()

QString QgsPointCloudRgbRenderer::blueAttribute ( ) const

Returns the attribute to use for the blue channel.

See also
greenAttribute()
redAttribute()
setBlueAttribute()

Definition at line 379 of file qgspointcloudrgbrenderer.cpp.

◆ blueContrastEnhancement()

const QgsContrastEnhancement * QgsPointCloudRgbRenderer::blueContrastEnhancement ( ) const

Returns the contrast enhancement to use for the blue channel.

See also
setBlueContrastEnhancement()
redContrastEnhancement()
greenContrastEnhancement()

Definition at line 409 of file qgspointcloudrgbrenderer.cpp.

◆ clone()

QgsPointCloudRenderer * QgsPointCloudRgbRenderer::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 32 of file qgspointcloudrgbrenderer.cpp.

◆ create()

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

Creates an RGB renderer from an XML element.

Definition at line 187 of file qgspointcloudrgbrenderer.cpp.

◆ greenAttribute()

QString QgsPointCloudRgbRenderer::greenAttribute ( ) const

Returns the attribute to use for the green channel.

See also
redAttribute()
blueAttribute()
setGreenAttribute()

Definition at line 369 of file qgspointcloudrgbrenderer.cpp.

◆ greenContrastEnhancement()

const QgsContrastEnhancement * QgsPointCloudRgbRenderer::greenContrastEnhancement ( ) const

Returns the contrast enhancement to use for the green channel.

See also
setGreenContrastEnhancement()
redContrastEnhancement()
blueContrastEnhancement()

Definition at line 399 of file qgspointcloudrgbrenderer.cpp.

◆ prepare()

std::unique_ptr< QgsPreparedPointCloudRendererData > QgsPointCloudRgbRenderer::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 270 of file qgspointcloudrgbrenderer.cpp.

◆ redAttribute()

QString QgsPointCloudRgbRenderer::redAttribute ( ) const

Returns the attribute to use for the red channel.

See also
greenAttribute()
blueAttribute()
setRedAttribute()

Definition at line 359 of file qgspointcloudrgbrenderer.cpp.

◆ redContrastEnhancement()

const QgsContrastEnhancement * QgsPointCloudRgbRenderer::redContrastEnhancement ( ) const

Returns the contrast enhancement to use for the red channel.

See also
setRedContrastEnhancement()
greenContrastEnhancement()
blueContrastEnhancement()

Definition at line 389 of file qgspointcloudrgbrenderer.cpp.

◆ renderBlock()

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

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

Implements QgsPointCloudRenderer.

Definition at line 57 of file qgspointcloudrgbrenderer.cpp.

◆ save()

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

Saves the renderer configuration to an XML element.

See also
load()

Implements QgsPointCloudRenderer.

Definition at line 228 of file qgspointcloudrgbrenderer.cpp.

◆ setBlueAttribute()

void QgsPointCloudRgbRenderer::setBlueAttribute ( const QString &  attribute)

Sets the attribute to use for the blue channel.

See also
setRedAttribute()
setGreenAttribute()
blueAttribute()

Definition at line 384 of file qgspointcloudrgbrenderer.cpp.

◆ setBlueContrastEnhancement()

void QgsPointCloudRgbRenderer::setBlueContrastEnhancement ( QgsContrastEnhancement enhancement)

Sets the contrast enhancement to use for the blue channel.

Ownership of enhancement is transferred.

See also
blueContrastEnhancement()
setRedContrastEnhancement()
setGreenContrastEnhancement()

Definition at line 414 of file qgspointcloudrgbrenderer.cpp.

◆ setGreenAttribute()

void QgsPointCloudRgbRenderer::setGreenAttribute ( const QString &  attribute)

Sets the attribute to use for the green channel.

See also
setRedAttribute()
setBlueAttribute()
greenAttribute()

Definition at line 374 of file qgspointcloudrgbrenderer.cpp.

◆ setGreenContrastEnhancement()

void QgsPointCloudRgbRenderer::setGreenContrastEnhancement ( QgsContrastEnhancement enhancement)

Sets the contrast enhancement to use for the green channel.

Ownership of enhancement is transferred.

See also
greenContrastEnhancement()
setRedContrastEnhancement()
setBlueContrastEnhancement()

Definition at line 404 of file qgspointcloudrgbrenderer.cpp.

◆ setRedAttribute()

void QgsPointCloudRgbRenderer::setRedAttribute ( const QString &  attribute)

Sets the attribute to use for the red channel.

See also
setGreenAttribute()
setBlueAttribute()
redAttribute()

Definition at line 364 of file qgspointcloudrgbrenderer.cpp.

◆ setRedContrastEnhancement()

void QgsPointCloudRgbRenderer::setRedContrastEnhancement ( QgsContrastEnhancement enhancement)

Sets the contrast enhancement to use for the red channel.

Ownership of enhancement is transferred.

See also
redContrastEnhancement()
setGreenContrastEnhancement()
setBlueContrastEnhancement()

Definition at line 394 of file qgspointcloudrgbrenderer.cpp.

◆ type()

QString QgsPointCloudRgbRenderer::type ( ) const
overridevirtual

Returns the identifier of the renderer type.

Implements QgsPointCloudRenderer.

Definition at line 27 of file qgspointcloudrgbrenderer.cpp.

◆ usedAttributes()

QSet< QString > QgsPointCloudRgbRenderer::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 263 of file qgspointcloudrgbrenderer.cpp.


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