QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgspointcloudattributebyramprenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudattributebyramprenderer.h
3 --------------------
4 begin : October 2020
5 copyright : (C) 2020 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPOINTCLOUDATTRIBUTEBYRAMPRENDERER_H
19#define QGSPOINTCLOUDATTRIBUTEBYRAMPRENDERER_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgscolorrampshader.h"
25
26#ifndef SIP_RUN
27
37{
38 public:
39
40 QSet< QString > usedAttributes() const override;
41 bool prepareBlock( const QgsPointCloudBlock *block ) override;
42 QColor pointColor( const QgsPointCloudBlock *block, int i, double z ) override SIP_SKIP;
43
47 bool attributeIsX = false;
48 bool attributeIsY = false;
49 bool attributeIsZ = false;
51};
52#endif
53
54
62{
63 public:
64
69
70 QString type() const override;
71 QgsPointCloudRenderer *clone() const override;
72 void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) override;
73 QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
74 QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const override;
75 QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) override SIP_FACTORY;
76 std::unique_ptr< QgsPreparedPointCloudRendererData > prepare() override SIP_SKIP;
77
81 static QgsPointCloudRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
82
88 QString attribute() const;
89
95 void setAttribute( const QString &attribute );
96
103
109 void setColorRampShader( const QgsColorRampShader &shader );
110
117 double minimum() const;
118
125 void setMinimum( double minimum );
126
133 double maximum() const;
134
141 void setMaximum( double maximum );
142
143 private:
144
145 double mMin = 0;
146 double mMax = 100;
147
148 QString mAttribute = QStringLiteral( "Intensity" );
149 QgsColorRampShader mColorRampShader;
150
151};
152
153#endif // QGSPOINTCLOUDATTRIBUTEBYRAMPRENDERER_H
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
Layer tree node points to a map layer.
Prepared data container for QgsPointCloudAttributeByRampRenderer.
QString type() const override
Returns the identifier of the renderer type.
void setMaximum(double maximum)
Sets the maximum value for attributes which will be used by the color ramp shader.
QgsPointCloudRenderer * clone() const override
Create a deep copy of this renderer.
static QgsPointCloudRenderer * create(QDomElement &element, const QgsReadWriteContext &context)
Creates an RGB renderer from an XML element.
void renderBlock(const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context) override
Renders a block of point cloud data using the specified render context.
void setMinimum(double minimum)
Sets the minimum value for attributes which will be used by the color ramp shader.
QgsPointCloudAttributeByRampRenderer()
Constructor for QgsPointCloudAttributeByRampRenderer.
QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) const override
Saves the renderer configuration to an XML element.
double maximum() const
Returns the maximum value for attributes which will be used by the color ramp shader.
QList< QgsLayerTreeModelLegendNode * > createLegendNodes(QgsLayerTreeLayer *nodeLayer) override
Creates a set of legend nodes representing the renderer.
void setColorRampShader(const QgsColorRampShader &shader)
Sets the color ramp shader function used to visualize the attribute.
std::unique_ptr< QgsPreparedPointCloudRendererData > prepare() override
Returns prepared data container for bulk point color retrieval.
QgsColorRampShader colorRampShader() const
Returns the color ramp shader function used to visualize the attribute.
double minimum() const
Returns the minimum value for attributes which will be used by the color ramp shader.
QString attribute() const
Returns the attribute to use for the renderer.
void setAttribute(const QString &attribute)
Sets the attribute to use for the renderer.
DataType
Systems of unit measurement.
Base class for storing raw data from point cloud nodes.
Encapsulates the render context for a 2D point cloud rendering operation.
Base class for 2d point cloud renderer prepared data containers.
virtual QColor pointColor(const QgsPointCloudBlock *block, int i, double z)=0
An optimised method of retrieving the color of a point from a point cloud block.
virtual bool prepareBlock(const QgsPointCloudBlock *block)=0
Prepares the renderer for using the specified block.
virtual QSet< QString > usedAttributes() const =0
Returns the set of attributes used by the prepared point cloud renderer.
A container for the context for various read/write operations on objects.
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_FACTORY
Definition qgis_sip.h:84