QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
Public Member Functions | Static Public Member Functions | List of all members
QgsPointCloudAttributeByRampRenderer Class Reference

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

#include <qgspointcloudattributebyramprenderer.h>

Inheritance diagram for QgsPointCloudAttributeByRampRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsPointCloudAttributeByRampRenderer ()
 Constructor for QgsPointCloudAttributeByRampRenderer. More...
 
QString attribute () const
 Returns the attribute to use for the renderer. More...
 
QgsPointCloudRendererclone () const override
 Create a deep copy of this renderer. More...
 
QgsColorRampShader colorRampShader () const
 Returns the color ramp shader function used to visualize the attribute. More...
 
QList< QgsLayerTreeModelLegendNode * > createLegendNodes (QgsLayerTreeLayer *nodeLayer) override
 Creates a set of legend nodes representing the renderer. More...
 
double maximum () const
 Returns the maximum value for attributes which will be used by the color ramp shader. More...
 
double minimum () const
 Returns the minimum value for attributes which will be used by the color ramp shader. 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 setAttribute (const QString &attribute)
 Sets the attribute to use for the renderer. More...
 
void setColorRampShader (const QgsColorRampShader &shader)
 Sets the color ramp shader function used to visualize the attribute. More...
 
void setMaximum (double maximum)
 Sets the maximum value for attributes which will be used by the color ramp shader. More...
 
void setMinimum (double minimum)
 Sets the minimum value for attributes which will be used by the color ramp shader. 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...
 
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...
 
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...
 
QgsUnitTypes::RenderUnit pointSizeUnit () const
 Returns the units used for the point size. More...
 
PointSymbol pointSymbol () const
 Returns the symbol 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 (PointSymbol 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 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

- Public Types inherited from QgsPointCloudRenderer
enum  PointSymbol { Square , Circle }
 Rendering symbols for points. More...
 
- 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 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 32 of file qgspointcloudattributebyramprenderer.h.

Constructor & Destructor Documentation

◆ QgsPointCloudAttributeByRampRenderer()

QgsPointCloudAttributeByRampRenderer::QgsPointCloudAttributeByRampRenderer ( )

Member Function Documentation

◆ attribute()

QString QgsPointCloudAttributeByRampRenderer::attribute ( ) const

Returns the attribute to use for the renderer.

See also
setAttribute()

Definition at line 210 of file qgspointcloudattributebyramprenderer.cpp.

◆ clone()

QgsPointCloudRenderer * QgsPointCloudAttributeByRampRenderer::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 36 of file qgspointcloudattributebyramprenderer.cpp.

◆ colorRampShader()

QgsColorRampShader QgsPointCloudAttributeByRampRenderer::colorRampShader ( ) const

Returns the color ramp shader function used to visualize the attribute.

See also
setColorRampShader()

Definition at line 220 of file qgspointcloudattributebyramprenderer.cpp.

◆ create()

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

Creates an RGB renderer from an XML element.

Definition at line 132 of file qgspointcloudattributebyramprenderer.cpp.

◆ createLegendNodes()

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

Creates a set of legend nodes representing the renderer.

Reimplemented from QgsPointCloudRenderer.

Definition at line 174 of file qgspointcloudattributebyramprenderer.cpp.

◆ maximum()

double QgsPointCloudAttributeByRampRenderer::maximum ( ) const

Returns the maximum value for attributes which will be used by the color ramp shader.

See also
setMaximum()
minimum()

Definition at line 240 of file qgspointcloudattributebyramprenderer.cpp.

◆ minimum()

double QgsPointCloudAttributeByRampRenderer::minimum ( ) const

Returns the minimum value for attributes which will be used by the color ramp shader.

See also
setMinimum()
maximum()

Definition at line 230 of file qgspointcloudattributebyramprenderer.cpp.

◆ renderBlock()

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

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

Implements QgsPointCloudRenderer.

Definition at line 49 of file qgspointcloudattributebyramprenderer.cpp.

◆ save()

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

Saves the renderer configuration to an XML element.

See also
load()

Implements QgsPointCloudRenderer.

Definition at line 149 of file qgspointcloudattributebyramprenderer.cpp.

◆ setAttribute()

void QgsPointCloudAttributeByRampRenderer::setAttribute ( const QString &  attribute)

Sets the attribute to use for the renderer.

See also
attribute()

Definition at line 215 of file qgspointcloudattributebyramprenderer.cpp.

◆ setColorRampShader()

void QgsPointCloudAttributeByRampRenderer::setColorRampShader ( const QgsColorRampShader shader)

Sets the color ramp shader function used to visualize the attribute.

See also
colorRampShader()

Definition at line 225 of file qgspointcloudattributebyramprenderer.cpp.

◆ setMaximum()

void QgsPointCloudAttributeByRampRenderer::setMaximum ( double  maximum)

Sets the maximum value for attributes which will be used by the color ramp shader.

See also
maximum()
setMinimum()

Definition at line 245 of file qgspointcloudattributebyramprenderer.cpp.

◆ setMinimum()

void QgsPointCloudAttributeByRampRenderer::setMinimum ( double  minimum)

Sets the minimum value for attributes which will be used by the color ramp shader.

See also
minimum()
setMaximum()

Definition at line 235 of file qgspointcloudattributebyramprenderer.cpp.

◆ type()

QString QgsPointCloudAttributeByRampRenderer::type ( ) const
overridevirtual

Returns the identifier of the renderer type.

Implements QgsPointCloudRenderer.

Definition at line 31 of file qgspointcloudattributebyramprenderer.cpp.

◆ usedAttributes()

QSet< QString > QgsPointCloudAttributeByRampRenderer::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 167 of file qgspointcloudattributebyramprenderer.cpp.


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