QGIS API Documentation 3.41.0-Master (45a0abf3bec)
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
22#include "qgis_core.h"
23#include "qgis_sip.h"
24#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
46 int attributeOffset = 0;
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
102 QgsColorRampShader colorRampShader() const;
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.
An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes.
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.
Abstract base class for 2d point cloud renderers.
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.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_FACTORY
Definition qgis_sip.h:76