QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
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 "qgspointcloudrenderer.h"
22 #include "qgis_core.h"
23 #include "qgis_sip.h"
24 #include "qgscolorrampshader.h"
25 
33 {
34  public:
35 
40 
41  QString type() const override;
42  QgsPointCloudRenderer *clone() const override;
43  void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) override;
44  QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
45  QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const override;
46  QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) override SIP_FACTORY;
47 
51  static QgsPointCloudRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
52 
58  QString attribute() const;
59 
65  void setAttribute( const QString &attribute );
66 
72  QgsColorRampShader colorRampShader() const;
73 
79  void setColorRampShader( const QgsColorRampShader &shader );
80 
87  double minimum() const;
88 
95  void setMinimum( double minimum );
96 
103  double maximum() const;
104 
111  void setMaximum( double maximum );
112 
113  private:
114 
115  double mMin = 0;
116  double mMax = 100;
117 
118  QString mAttribute = QStringLiteral( "Intensity" );
119  QgsColorRampShader mColorRampShader;
120 
121 };
122 
123 #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.
An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes.
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.
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) const =0
Saves the renderer configuration to an XML element.
virtual void renderBlock(const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context)=0
Renders a block of point cloud data using the specified render context.
virtual QgsPointCloudRenderer * clone() const =0
Create a deep copy of this renderer.
virtual QSet< QString > usedAttributes(const QgsPointCloudRenderContext &context) const
Returns a list of attributes required by this renderer.
virtual QString type() const =0
Returns the identifier of the renderer type.
virtual QList< QgsLayerTreeModelLegendNode * > createLegendNodes(QgsLayerTreeLayer *nodeLayer)
Creates a set of legend nodes representing the renderer.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_FACTORY
Definition: qgis_sip.h:76