QGIS API Documentation 3.99.0-Master (d270888f95f)
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#include <QString>
27
28using namespace Qt::StringLiterals;
29
30#ifndef SIP_RUN
31
41{
42 public:
43
44 QSet< QString > usedAttributes() const override;
45 bool prepareBlock( const QgsPointCloudBlock *block ) override;
46 QColor pointColor( const QgsPointCloudBlock *block, int i, double z ) override SIP_SKIP;
47
51 bool attributeIsX = false;
52 bool attributeIsY = false;
53 bool attributeIsZ = false;
55};
56#endif
57
58
66{
67 public:
68
73
74 QString type() const override;
75 QgsPointCloudRenderer *clone() const override;
76 void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) override;
77 QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
78 QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const override;
79 QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) override SIP_FACTORY;
80 std::unique_ptr< QgsPreparedPointCloudRendererData > prepare() override SIP_SKIP;
81
85 static QgsPointCloudRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
86
92 QString attribute() const;
93
99 void setAttribute( const QString &attribute );
100
107
113 void setColorRampShader( const QgsColorRampShader &shader );
114
121 double minimum() const;
122
129 void setMinimum( double minimum );
130
137 double maximum() const;
138
145 void setMaximum( double maximum );
146
147 private:
148
149 double mMin = 0;
150 double mMax = 100;
151
152 QString mAttribute = u"Intensity"_s;
153 QgsColorRampShader mColorRampShader;
154
155};
156
157#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