QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgspointcloudattributebyramprenderer.cpp
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 
19 #include "qgspointcloudblock.h"
20 #include "qgsstyle.h"
21 #include "qgscolorramp.h"
22 #include "qgssymbollayerutils.h"
24 #include "qgscolorramplegendnode.h"
25 
27 {
28  mColorRampShader.setSourceColorRamp( QgsStyle::defaultStyle()->colorRamp( QStringLiteral( "Viridis" ) ) );
29  mColorRampShader.classifyColorRamp( 5, -1, QgsRectangle(), nullptr );
30 }
31 
33 {
34  return QStringLiteral( "ramp" );
35 }
36 
38 {
39  std::unique_ptr< QgsPointCloudAttributeByRampRenderer > res = std::make_unique< QgsPointCloudAttributeByRampRenderer >();
40  res->mAttribute = mAttribute;
41  res->mColorRampShader = mColorRampShader;
42  res->mMin = mMin;
43  res->mMax = mMax;
44 
45  copyCommonProperties( res.get() );
46 
47  return res.release();
48 }
49 
51 {
52  const QgsRectangle visibleExtent = context.renderContext().extent();
53 
54  const char *ptr = block->data();
55  int count = block->pointCount();
56  const QgsPointCloudAttributeCollection request = block->attributes();
57 
58  const std::size_t recordSize = request.pointRecordSize();
59  int attributeOffset = 0;
60  const QgsPointCloudAttribute *attribute = request.find( mAttribute, attributeOffset );
61  if ( !attribute )
62  return;
63  const QgsPointCloudAttribute::DataType attributeType = attribute->type();
64 
65  const QgsDoubleRange zRange = context.renderContext().zRange();
66  const bool considerZ = !zRange.isInfinite();
67 
68  const bool applyZOffset = attribute->name() == QLatin1String( "Z" );
69  const bool applyXOffset = attribute->name() == QLatin1String( "X" );
70  const bool applyYOffset = attribute->name() == QLatin1String( "Y" );
71 
72  int rendered = 0;
73  double x = 0;
74  double y = 0;
75  double z = 0;
77  const bool reproject = ct.isValid();
78 
79  int red = 0;
80  int green = 0;
81  int blue = 0;
82  int alpha = 0;
83  for ( int i = 0; i < count; ++i )
84  {
85  if ( context.renderContext().renderingStopped() )
86  {
87  break;
88  }
89 
90  if ( considerZ )
91  {
92  // z value filtering is cheapest, if we're doing it...
93  z = pointZ( context, ptr, i );
94  if ( !zRange.contains( z ) )
95  continue;
96  }
97 
98  pointXY( context, ptr, i, x, y );
99  if ( visibleExtent.contains( x, y ) )
100  {
101  if ( reproject )
102  {
103  try
104  {
105  ct.transformInPlace( x, y, z );
106  }
107  catch ( QgsCsException & )
108  {
109  continue;
110  }
111  }
112 
113  double attributeValue = 0;
114  context.getAttribute( ptr, i * recordSize + attributeOffset, attributeType, attributeValue );
115 
116  if ( applyXOffset )
117  attributeValue = context.offset().x() + context.scale().x() * attributeValue;
118  if ( applyYOffset )
119  attributeValue = context.offset().y() + context.scale().y() * attributeValue;
120  if ( applyZOffset )
121  attributeValue = ( context.offset().z() + context.scale().z() * attributeValue ) * context.zValueScale() + context.zValueFixedOffset();
122 
123  mColorRampShader.shade( attributeValue, &red, &green, &blue, &alpha );
124  drawPoint( x, y, QColor( red, green, blue, alpha ), context );
125 
126  rendered++;
127  }
128  }
129  context.incrementPointsRendered( rendered );
130 }
131 
132 
134 {
135  std::unique_ptr< QgsPointCloudAttributeByRampRenderer > r = std::make_unique< QgsPointCloudAttributeByRampRenderer >();
136 
137  r->setAttribute( element.attribute( QStringLiteral( "attribute" ), QStringLiteral( "Intensity" ) ) );
138 
139  QDomElement elemShader = element.firstChildElement( QStringLiteral( "colorrampshader" ) );
140  r->mColorRampShader.readXml( elemShader, context );
141 
142  r->setMinimum( element.attribute( QStringLiteral( "min" ), QStringLiteral( "0" ) ).toDouble() );
143  r->setMaximum( element.attribute( QStringLiteral( "max" ), QStringLiteral( "100" ) ).toDouble() );
144 
145  r->restoreCommonProperties( element, context );
146 
147  return r.release();
148 }
149 
150 QDomElement QgsPointCloudAttributeByRampRenderer::save( QDomDocument &doc, const QgsReadWriteContext &context ) const
151 {
152  QDomElement rendererElem = doc.createElement( QStringLiteral( "renderer" ) );
153 
154  rendererElem.setAttribute( QStringLiteral( "type" ), QStringLiteral( "ramp" ) );
155  rendererElem.setAttribute( QStringLiteral( "min" ), mMin );
156  rendererElem.setAttribute( QStringLiteral( "max" ), mMax );
157 
158  rendererElem.setAttribute( QStringLiteral( "attribute" ), mAttribute );
159 
160  QDomElement elemShader = mColorRampShader.writeXml( doc, context );
161  rendererElem.appendChild( elemShader );
162 
163  saveCommonProperties( rendererElem, context );
164 
165  return rendererElem;
166 }
167 
169 {
170  QSet<QString> res;
171  res << mAttribute;
172  return res;
173 }
174 
175 QList<QgsLayerTreeModelLegendNode *> QgsPointCloudAttributeByRampRenderer::createLegendNodes( QgsLayerTreeLayer *nodeLayer )
176 {
177  QList<QgsLayerTreeModelLegendNode *> res;
178  res << new QgsSimpleLegendNode( nodeLayer, mAttribute );
179 
180  switch ( mColorRampShader.colorRampType() )
181  {
183  // for interpolated shaders we use a ramp legend node unless the settings flag
184  // to use the continuous legend is not set, in that case we fall through
185  if ( mColorRampShader.sourceColorRamp() && ( ! mColorRampShader.legendSettings() || mColorRampShader.legendSettings()->useContinuousLegend() ) )
186  {
187  res << new QgsColorRampLegendNode( nodeLayer, mColorRampShader.sourceColorRamp()->clone(),
188  mColorRampShader.legendSettings() ? *mColorRampShader.legendSettings() : QgsColorRampLegendNodeSettings(),
189  mColorRampShader.minimumValue(),
190  mColorRampShader.maximumValue() );
191  break;
192  }
193  Q_FALLTHROUGH();
196  {
197  // for all others we use itemised lists
198  QList< QPair< QString, QColor > > items;
199  mColorRampShader.legendSymbologyItems( items );
200  res.reserve( items.size() );
201  for ( const QPair< QString, QColor > &item : std::as_const( items ) )
202  {
203  res << new QgsRasterSymbolLegendNode( nodeLayer, item.second, item.first );
204  }
205  break;
206  }
207  }
208  return res;
209 }
210 
212 {
213  return mAttribute;
214 }
215 
217 {
218  mAttribute = attribute;
219 }
220 
222 {
223  return mColorRampShader;
224 }
225 
227 {
228  mColorRampShader = shader;
229 }
230 
232 {
233  return mMin;
234 }
235 
237 {
238  mMin = minimum;
239 }
240 
242 {
243  return mMax;
244 }
245 
247 {
248  mMax = value;
249 }
250 
251 std::unique_ptr<QgsPreparedPointCloudRendererData> QgsPointCloudAttributeByRampRenderer::prepare()
252 {
253  std::unique_ptr< QgsPointCloudAttributeByRampRendererPreparedData> data = std::make_unique< QgsPointCloudAttributeByRampRendererPreparedData >();
254  data->attributeName = mAttribute;
255  data->colorRampShader = mColorRampShader;
256 
257  data->attributeIsX = mAttribute == QLatin1String( "X" );
258  data->attributeIsY = mAttribute == QLatin1String( "Y" );
259  data->attributeIsZ = mAttribute == QLatin1String( "Z" );
260  return data;
261 }
262 
264 {
265  double attributeValue = 0;
266  if ( attributeIsZ )
267  attributeValue = z;
268  else
270 
271  if ( attributeIsX )
272  attributeValue = block->offset().x() + block->scale().x() * attributeValue;
273  else if ( attributeIsY )
274  attributeValue = block->offset().y() + block->scale().y() * attributeValue;
275 
276  int red = 0;
277  int green = 0;
278  int blue = 0;
279  int alpha = 0;
280  colorRampShader.shade( attributeValue, &red, &green, &blue, &alpha );
281  return QColor( red, green, blue, alpha );
282 }
283 
285 {
286  return { attributeName };
287 }
288 
290 {
291  const QgsPointCloudAttributeCollection attributes = block->attributes();
292  const QgsPointCloudAttribute *attribute = attributes.find( attributeName, attributeOffset );
293  if ( !attribute )
294  return false;
295 
296  attributeType = attribute->type();
297  return true;
298 }
QgsPointCloudAttributeByRampRenderer::type
QString type() const override
Returns the identifier of the renderer type.
Definition: qgspointcloudattributebyramprenderer.cpp:32
QgsPointCloudAttributeByRampRendererPreparedData::usedAttributes
QSet< QString > usedAttributes() const override
Returns the set of attributes used by the prepared point cloud renderer.
Definition: qgspointcloudattributebyramprenderer.cpp:284
QgsPointCloudAttributeByRampRenderer::createLegendNodes
QList< QgsLayerTreeModelLegendNode * > createLegendNodes(QgsLayerTreeLayer *nodeLayer) override
Creates a set of legend nodes representing the renderer.
Definition: qgspointcloudattributebyramprenderer.cpp:175
QgsCoordinateTransform::transformInPlace
void transformInPlace(double &x, double &y, double &z, Qgis::TransformDirection direction=Qgis::TransformDirection::Forward) const SIP_THROW(QgsCsException)
Transforms an array of x, y and z double coordinates in place, from the source CRS to the destination...
Definition: qgscoordinatetransform.cpp:364
QgsPointCloudAttributeByRampRenderer::renderBlock
void renderBlock(const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context) override
Renders a block of point cloud data using the specified render context.
Definition: qgspointcloudattributebyramprenderer.cpp:50
QgsColorRampShader::setSourceColorRamp
void setSourceColorRamp(QgsColorRamp *colorramp)
Set the source color ramp.
Definition: qgscolorrampshader.cpp:182
qgslayertreemodellegendnode.h
QgsPointCloudAttribute::DataType
DataType
Systems of unit measurement.
Definition: qgspointcloudattribute.h:44
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsPointCloudAttributeCollection::find
const QgsPointCloudAttribute * find(const QString &attributeName, int &offset) const
Finds the attribute with the name.
Definition: qgspointcloudattribute.cpp:168
QgsPointCloudAttributeByRampRendererPreparedData::attributeType
QgsPointCloudAttribute::DataType attributeType
Definition: qgspointcloudattributebyramprenderer.h:63
QgsVector3D::y
double y() const
Returns Y coordinate.
Definition: qgsvector3d.h:64
QgsPointCloudBlock::data
const char * data() const
Returns raw pointer to data.
Definition: qgspointcloudblock.cpp:37
QgsPointCloudBlock::attributes
QgsPointCloudAttributeCollection attributes() const
Returns the attributes that are stored in the data block, along with their size.
Definition: qgspointcloudblock.cpp:47
QgsPointCloudAttributeByRampRenderer::prepare
std::unique_ptr< QgsPreparedPointCloudRendererData > prepare() override
Returns prepared data container for bulk point color retrieval.
Definition: qgspointcloudattributebyramprenderer.cpp:251
QgsSimpleLegendNode
Implementation of legend node interface for displaying arbitrary label with icon.
Definition: qgslayertreemodellegendnode.h:544
qgssymbollayerutils.h
QgsColorRampLegendNode
A legend node which renders a color ramp.
Definition: qgscolorramplegendnode.h:34
QgsPointCloudAttributeByRampRenderer::QgsPointCloudAttributeByRampRenderer
QgsPointCloudAttributeByRampRenderer()
Constructor for QgsPointCloudAttributeByRampRenderer.
Definition: qgspointcloudattributebyramprenderer.cpp:26
QgsColorRampShader::classifyColorRamp
void classifyColorRamp(int classes=0, int band=-1, const QgsRectangle &extent=QgsRectangle(), QgsRasterInterface *input=nullptr)
Classify color ramp shader.
Definition: qgscolorrampshader.cpp:187
QgsRasterShaderFunction::maximumValue
double maximumValue() const
Returns the minimum value for the raster shader.
Definition: qgsrastershaderfunction.h:119
qgscolorramplegendnode.h
QgsPointCloudRenderer::copyCommonProperties
void copyCommonProperties(QgsPointCloudRenderer *destination) const
Copies common point cloud properties (such as point size and screen error) to the destination rendere...
Definition: qgspointcloudrenderer.cpp:162
QgsPointCloudBlock
Base class for storing raw data from point cloud nodes.
Definition: qgspointcloudblock.h:38
QgsCoordinateTransform::isValid
bool isValid() const
Returns true if the coordinate transform is valid, ie both the source and destination CRS have been s...
Definition: qgscoordinatetransform.cpp:900
QgsRenderContext::extent
const QgsRectangle & extent() const
When rendering a map layer, calling this method returns the "clipping" extent for the layer (in the l...
Definition: qgsrendercontext.h:239
QgsColorRampShader
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
Definition: qgscolorrampshader.h:42
QgsPointCloudAttributeByRampRenderer::usedAttributes
QSet< QString > usedAttributes(const QgsPointCloudRenderContext &context) const override
Returns a list of attributes required by this renderer.
Definition: qgspointcloudattributebyramprenderer.cpp:168
QgsPointCloudAttributeByRampRendererPreparedData::colorRampShader
QgsColorRampShader colorRampShader
Definition: qgspointcloudattributebyramprenderer.h:58
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
QgsPointCloudAttributeByRampRenderer::setMinimum
void setMinimum(double minimum)
Sets the minimum value for attributes which will be used by the color ramp shader.
Definition: qgspointcloudattributebyramprenderer.cpp:236
QgsPointCloudAttributeByRampRenderer::colorRampShader
QgsColorRampShader colorRampShader() const
Returns the color ramp shader function used to visualize the attribute.
Definition: qgspointcloudattributebyramprenderer.cpp:221
QgsPointCloudBlock::pointCount
int pointCount() const
Returns number of points that are stored in the block.
Definition: qgspointcloudblock.cpp:42
QgsStyle::defaultStyle
static QgsStyle * defaultStyle()
Returns default application-wide style.
Definition: qgsstyle.cpp:145
QgsPointCloudRenderContext::getAttribute
static void getAttribute(const char *data, std::size_t offset, QgsPointCloudAttribute::DataType type, T &value)
Retrieves the attribute value from data at the specified offset, where type indicates the original da...
Definition: qgspointcloudrenderer.h:183
QgsRenderContext::renderingStopped
bool renderingStopped() const
Returns true if the rendering operation has been stopped and any ongoing rendering should be canceled...
Definition: qgsrendercontext.h:285
QgsColorRampShader::Discrete
@ Discrete
Assigns the color of the higher class for every pixel between two class breaks.
Definition: qgscolorrampshader.h:51
QgsRenderContext::coordinateTransform
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
Definition: qgsrendercontext.h:178
QgsCsException
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:65
QgsPointCloudRenderer::drawPoint
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).
Definition: qgspointcloudrenderer.h:600
QgsColorRampShader::sourceColorRamp
QgsColorRamp * sourceColorRamp() const
Returns the source color ramp.
Definition: qgscolorrampshader.cpp:133
QgsPointCloudRenderContext
Encapsulates the render context for a 2D point cloud rendering operation.
Definition: qgspointcloudrenderer.h:41
QgsPointCloudAttributeByRampRenderer::setMaximum
void setMaximum(double maximum)
Sets the maximum value for attributes which will be used by the color ramp shader.
Definition: qgspointcloudattributebyramprenderer.cpp:246
QgsPointCloudAttributeByRampRendererPreparedData::attributeName
QString attributeName
Definition: qgspointcloudattributebyramprenderer.h:57
QgsPointCloudAttributeCollection::pointRecordSize
int pointRecordSize() const
Returns total size of record.
Definition: qgspointcloudattribute.h:187
QgsPointCloudAttributeByRampRendererPreparedData::pointColor
QColor pointColor(const QgsPointCloudBlock *block, int i, double z) override
An optimised method of retrieving the color of a point from a point cloud block.
Definition: qgspointcloudattributebyramprenderer.cpp:263
QgsPointCloudAttributeByRampRenderer::setAttribute
void setAttribute(const QString &attribute)
Sets the attribute to use for the renderer.
Definition: qgspointcloudattributebyramprenderer.cpp:216
QgsColorRampShader::legendSymbologyItems
void legendSymbologyItems(QList< QPair< QString, QColor > > &symbolItems) const override
Returns legend symbology items if provided by renderer.
Definition: qgscolorrampshader.cpp:554
QgsPointCloudRenderContext::incrementPointsRendered
void incrementPointsRendered(long count)
Increments the count of points rendered by the specified amount.
Definition: qgspointcloudrenderer.cpp:46
QgsVector3D::z
double z() const
Returns Z coordinate.
Definition: qgsvector3d.h:66
QgsColorRampShader::Exact
@ Exact
Assigns the color of the exact matching value in the color ramp item list.
Definition: qgscolorrampshader.h:52
QgsColorRampShader::writeXml
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Writes configuration to a new DOM element.
Definition: qgscolorrampshader.cpp:563
qgscolorramp.h
QgsPointCloudAttributeByRampRenderer::minimum
double minimum() const
Returns the minimum value for attributes which will be used by the color ramp shader.
Definition: qgspointcloudattributebyramprenderer.cpp:231
QgsPointCloudAttributeByRampRenderer::maximum
double maximum() const
Returns the maximum value for attributes which will be used by the color ramp shader.
Definition: qgspointcloudattributebyramprenderer.cpp:241
QgsPointCloudRenderContext::zValueFixedOffset
double zValueFixedOffset() const
Returns any constant offset which must be applied to z values taken from the point cloud index.
Definition: qgspointcloudrenderer.h:167
QgsLayerTreeLayer
Layer tree node points to a map layer.
Definition: qgslayertreelayer.h:43
QgsPointCloudAttributeCollection
Collection of point cloud attributes.
Definition: qgspointcloudattribute.h:141
QgsRectangle::contains
bool contains(const QgsRectangle &rect) const SIP_HOLDGIL
Returns true when rectangle contains other rectangle.
Definition: qgsrectangle.h:363
QgsPointCloudAttributeByRampRenderer::create
static QgsPointCloudRenderer * create(QDomElement &element, const QgsReadWriteContext &context)
Creates an RGB renderer from an XML element.
Definition: qgspointcloudattributebyramprenderer.cpp:133
QgsPointCloudRenderContext::offset
QgsVector3D offset() const
Returns the offset of the layer's int32 coordinates compared to CRS coords.
Definition: qgspointcloudrenderer.h:91
QgsPointCloudAttributeByRampRendererPreparedData::attributeIsX
bool attributeIsX
Definition: qgspointcloudattributebyramprenderer.h:60
QgsPointCloudAttribute
Attribute for point cloud data pair of name and size in bytes.
Definition: qgspointcloudattribute.h:40
qgspointcloudattributebyramprenderer.h
QgsPointCloudAttributeByRampRenderer::setColorRampShader
void setColorRampShader(const QgsColorRampShader &shader)
Sets the color ramp shader function used to visualize the attribute.
Definition: qgspointcloudattributebyramprenderer.cpp:226
QgsPointCloudRenderer::pointXY
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.
Definition: qgspointcloudrenderer.h:576
QgsColorRampLegendNodeSettings::useContinuousLegend
bool useContinuousLegend() const
Returns true if a continuous gradient legend will be used.
Definition: qgscolorramplegendnodesettings.cpp:193
QgsColorRamp::clone
virtual QgsColorRamp * clone() const =0
Creates a clone of the color ramp.
QgsRasterShaderFunction::minimumValue
double minimumValue() const
Returns the maximum value for the raster shader.
Definition: qgsrastershaderfunction.h:112
qgsstyle.h
QgsDoubleRange::isInfinite
bool isInfinite() const
Returns true if the range consists of all possible values.
Definition: qgsrange.h:247
QgsRenderContext::zRange
QgsDoubleRange zRange() const
Returns the range of z-values which should be rendered.
Definition: qgsrendercontext.cpp:650
QgsColorRampShader::colorRampType
Type colorRampType() const
Returns the color ramp type.
Definition: qgscolorrampshader.h:135
QgsPointCloudRenderContext::zValueScale
double zValueScale() const
Returns any constant scaling factor which must be applied to z values taken from the point cloud inde...
Definition: qgspointcloudrenderer.h:160
QgsPointCloudBlock::pointRecordSize
int pointRecordSize() const
Returns the total size of each individual point record.
Definition: qgspointcloudblock.h:72
QgsDoubleRange
QgsRange which stores a range of double values.
Definition: qgsrange.h:202
QgsPointCloudAttributeByRampRendererPreparedData::attributeIsZ
bool attributeIsZ
Definition: qgspointcloudattributebyramprenderer.h:62
QgsColorRampShader::shade
bool shade(double value, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlphaValue) const override
Generates and new RGB value based on one input value.
Definition: qgscolorrampshader.cpp:381
QgsPointCloudAttributeByRampRendererPreparedData::attributeOffset
int attributeOffset
Definition: qgspointcloudattributebyramprenderer.h:59
QgsPointCloudRenderContext::scale
QgsVector3D scale() const
Returns the scale of the layer's int32 coordinates compared to CRS coords.
Definition: qgspointcloudrenderer.h:80
QgsPointCloudAttributeByRampRenderer::attribute
QString attribute() const
Returns the attribute to use for the renderer.
Definition: qgspointcloudattributebyramprenderer.cpp:211
QgsPointCloudBlock::offset
QgsVector3D offset() const
Returns the custom offset of the block.
Definition: qgspointcloudblock.cpp:57
QgsPointCloudAttributeByRampRenderer::clone
QgsPointCloudRenderer * clone() const override
Create a deep copy of this renderer.
Definition: qgspointcloudattributebyramprenderer.cpp:37
QgsPointCloudRenderer
Abstract base class for 2d point cloud renderers.
Definition: qgspointcloudrenderer.h:296
qgspointcloudblock.h
QgsRange::contains
bool contains(const QgsRange< T > &other) const
Returns true if this range contains another range.
Definition: qgsrange.h:108
QgsPointCloudAttributeByRampRenderer::save
QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) const override
Saves the renderer configuration to an XML element.
Definition: qgspointcloudattributebyramprenderer.cpp:150
QgsRasterSymbolLegendNode
Implementation of legend node interface for displaying raster legend entries.
Definition: qgslayertreemodellegendnode.h:606
QgsPointCloudRenderer::saveCommonProperties
void saveCommonProperties(QDomElement &element, const QgsReadWriteContext &context) const
Saves common renderer properties (such as point size and screen error) to the specified DOM element.
Definition: qgspointcloudrenderer.cpp:185
QgsPointCloudRenderContext::renderContext
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Definition: qgspointcloudrenderer.h:69
QgsPointCloudRenderer::pointZ
static double pointZ(QgsPointCloudRenderContext &context, const char *ptr, int i)
Retrieves the z value for the point at index i.
Definition: qgspointcloudrenderer.h:589
QgsCoordinateTransform
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:57
QgsPointCloudAttributeByRampRendererPreparedData::attributeIsY
bool attributeIsY
Definition: qgspointcloudattributebyramprenderer.h:61
QgsColorRampShader::Interpolated
@ Interpolated
Interpolates the color between two class breaks linearly.
Definition: qgscolorrampshader.h:50
QgsVector3D::x
double x() const
Returns X coordinate.
Definition: qgsvector3d.h:62
QgsColorRampLegendNodeSettings
Settings for a color ramp legend node.
Definition: qgscolorramplegendnodesettings.h:37
QgsPointCloudBlock::scale
QgsVector3D scale() const
Returns the custom scale of the block.
Definition: qgspointcloudblock.cpp:52
QgsPointCloudAttribute::type
DataType type() const
Returns the data type.
Definition: qgspointcloudattribute.h:74
QgsPointCloudAttributeByRampRendererPreparedData::prepareBlock
bool prepareBlock(const QgsPointCloudBlock *block) override
Prepares the renderer for using the specified block.
Definition: qgspointcloudattributebyramprenderer.cpp:289
QgsColorRampShader::legendSettings
const QgsColorRampLegendNodeSettings * legendSettings() const
Returns the color ramp shader legend settings.
Definition: qgscolorrampshader.cpp:641