QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgspointcloud3dsymbol.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgspointcloud3dsymbol.h
3  ------------------------------
4  Date : November 2020
5  Copyright : (C) 2020 by Nedjima Belgacem
6  Email : belgacem dot nedjima at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgspointcloud3dsymbol.h"
17 
18 #include "qgscolorramptexture.h"
19 #include "qgssymbollayerutils.h"
20 
21 #include <Qt3DRender/QMaterial>
22 #include <Qt3DRender/QParameter>
23 #include <Qt3DRender/QTexture>
24 
25 // QgsPointCloud3DSymbol
26 
27 
30 {
31 }
32 
34 
36 {
37  mPointSize = size;
38 }
39 
41 {
42  return mRenderAsTriangles;
43 }
44 
46 {
47  mRenderAsTriangles = asTriangles;
48 }
49 
51 {
53 }
54 
55 void QgsPointCloud3DSymbol::setHorizontalTriangleFilter( bool horizontalTriangleFilter )
56 {
58 }
59 
61 {
63 }
64 
65 void QgsPointCloud3DSymbol::setHorizontalFilterThreshold( float horizontalFilterThreshold )
66 {
68 }
69 
71 {
73 }
74 
75 void QgsPointCloud3DSymbol::setVerticalTriangleFilter( bool verticalTriangleFilter )
76 {
78 }
79 
81 {
83 }
84 
85 void QgsPointCloud3DSymbol::setVerticalFilterThreshold( float verticalFilterThreshold )
86 {
88 }
89 
90 void QgsPointCloud3DSymbol::writeBaseXml( QDomElement &elem, const QgsReadWriteContext &context ) const
91 {
92  Q_UNUSED( context )
93 
94  elem.setAttribute( QStringLiteral( "point-size" ), mPointSize );
95  elem.setAttribute( QStringLiteral( "render-as-triangles" ), mRenderAsTriangles ? 1 : 0 );
96  elem.setAttribute( QStringLiteral( "horizontal-triangle-filter" ), mHorizontalTriangleFilter ? 1 : 0 );
97  elem.setAttribute( QStringLiteral( "horizontal-filter-threshold" ), mHorizontalFilterThreshold );
98  elem.setAttribute( QStringLiteral( "vertical-triangle-filter" ), mVerticalTriangleFilter ? 1 : 0 );
99  elem.setAttribute( QStringLiteral( "vertical-filter-threshold" ), mVerticalFilterThreshold );
100 }
101 
102 void QgsPointCloud3DSymbol::readBaseXml( const QDomElement &elem, const QgsReadWriteContext &context )
103 {
104  Q_UNUSED( context )
105 
106  mPointSize = elem.attribute( QStringLiteral( "point-size" ), QStringLiteral( "3.0" ) ).toFloat();
107  mRenderAsTriangles = elem.attribute( QStringLiteral( "render-as-triangles" ), QStringLiteral( "0" ) ).toInt() == 1;
108  mHorizontalTriangleFilter = elem.attribute( QStringLiteral( "horizontal-triangle-filter" ), QStringLiteral( "0" ) ).toInt() == 1;
109  mHorizontalFilterThreshold = elem.attribute( QStringLiteral( "horizontal-filter-threshold" ), QStringLiteral( "10.0" ) ).toFloat();
110  mVerticalTriangleFilter = elem.attribute( QStringLiteral( "vertical-triangle-filter" ), QStringLiteral( "0" ) ).toInt() == 1;
111  mVerticalFilterThreshold = elem.attribute( QStringLiteral( "vertical-filter-threshold" ), QStringLiteral( "10.0" ) ).toFloat();
112 }
113 
115 {
117  QgsPointCloud3DSymbol *pcDestination = static_cast<QgsPointCloud3DSymbol *>( destination );
118  pcDestination->mPointSize = mPointSize;
119  pcDestination->mRenderAsTriangles = mRenderAsTriangles;
124 }
125 
126 // QgsSingleColorPointCloud3DSymbol
127 
130 {
131 
132 }
133 
135 {
136  return QStringLiteral( "single-color" );
137 }
138 
140 {
142  result->mSingleColor = mSingleColor;
143  copyBaseSettings( result );
144  return result;
145 }
146 
147 void QgsSingleColorPointCloud3DSymbol::writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const
148 {
149  Q_UNUSED( context )
150 
151  writeBaseXml( elem, context );
152  elem.setAttribute( QStringLiteral( "single-color" ), QgsSymbolLayerUtils::encodeColor( mSingleColor ) );
153 
154 }
155 
156 void QgsSingleColorPointCloud3DSymbol::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
157 {
158  Q_UNUSED( context )
159 
160  readBaseXml( elem, context );
161  mSingleColor = QgsSymbolLayerUtils::decodeColor( elem.attribute( QStringLiteral( "single-color" ), QStringLiteral( "0,0,255" ) ) );
162 }
163 
165 {
166  mSingleColor = color;
167 }
168 
169 void QgsSingleColorPointCloud3DSymbol::fillMaterial( Qt3DRender::QMaterial *mat )
170 {
171  Qt3DRender::QParameter *renderingStyle = new Qt3DRender::QParameter( "u_renderingStyle", QgsPointCloud3DSymbol::SingleColor );
172  mat->addParameter( renderingStyle );
173  Qt3DRender::QParameter *pointSizeParameter = new Qt3DRender::QParameter( "u_pointSize", QVariant::fromValue( mPointSize ) );
174  mat->addParameter( pointSizeParameter );
175  Qt3DRender::QParameter *singleColorParameter = new Qt3DRender::QParameter( "u_singleColor", QVector3D( mSingleColor.redF(), mSingleColor.greenF(), mSingleColor.blueF() ) );
176  mat->addParameter( singleColorParameter );
177 }
178 
179 // QgsColorRampPointCloud3DSymbol
180 
183 {
184 
185 }
186 
188 {
190  result->mRenderingParameter = mRenderingParameter;
191  result->mColorRampShader = mColorRampShader;
192  result->mColorRampShaderMin = mColorRampShaderMin;
193  result->mColorRampShaderMax = mColorRampShaderMax;
194  copyBaseSettings( result );
195  return result;
196 }
197 
199 {
200  return QStringLiteral( "color-ramp" );
201 }
202 
203 void QgsColorRampPointCloud3DSymbol::writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const
204 {
205  Q_UNUSED( context )
206 
207  writeBaseXml( elem, context );
208  elem.setAttribute( QStringLiteral( "rendering-parameter" ), mRenderingParameter );
209  elem.setAttribute( QStringLiteral( "color-ramp-shader-min" ), mColorRampShaderMin );
210  elem.setAttribute( QStringLiteral( "color-ramp-shader-max" ), mColorRampShaderMax );
211  QDomDocument doc = elem.ownerDocument();
212  const QDomElement elemColorRampShader = mColorRampShader.writeXml( doc );
213  elem.appendChild( elemColorRampShader );
214 }
215 
216 void QgsColorRampPointCloud3DSymbol::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
217 {
218  Q_UNUSED( context )
219 
220  readBaseXml( elem, context );
221  mRenderingParameter = elem.attribute( "rendering-parameter", QString() );
222  mColorRampShaderMin = elem.attribute( QStringLiteral( "color-ramp-shader-min" ), QStringLiteral( "0.0" ) ).toDouble();
223  mColorRampShaderMax = elem.attribute( QStringLiteral( "color-ramp-shader-max" ), QStringLiteral( "1.0" ) ).toDouble();
224  mColorRampShader.readXml( elem );
225 }
226 
228 {
229  return mRenderingParameter;
230 }
231 
232 void QgsColorRampPointCloud3DSymbol::setAttribute( const QString &parameter )
233 {
234  mRenderingParameter = parameter;
235 }
236 
238 {
239  return mColorRampShader;
240 }
241 
243 {
244  mColorRampShader = colorRampShader;
245 }
246 
248 {
249  mColorRampShaderMin = min;
250  mColorRampShaderMax = max;
251 }
252 
253 void QgsColorRampPointCloud3DSymbol::fillMaterial( Qt3DRender::QMaterial *mat )
254 {
255  Qt3DRender::QParameter *renderingStyle = new Qt3DRender::QParameter( "u_renderingStyle", QgsPointCloud3DSymbol::ColorRamp );
256  mat->addParameter( renderingStyle );
257  Qt3DRender::QParameter *pointSizeParameter = new Qt3DRender::QParameter( "u_pointSize", QVariant::fromValue( mPointSize ) );
258  mat->addParameter( pointSizeParameter );
259  // Create the texture to pass the color ramp
260  Qt3DRender::QTexture1D *colorRampTexture = nullptr;
261  if ( mColorRampShader.colorRampItemList().count() > 0 )
262  {
263  colorRampTexture = new Qt3DRender::QTexture1D( mat );
264  colorRampTexture->addTextureImage( new QgsColorRampTexture( mColorRampShader, 1 ) );
265  colorRampTexture->setMinificationFilter( Qt3DRender::QTexture1D::Linear );
266  colorRampTexture->setMagnificationFilter( Qt3DRender::QTexture1D::Linear );
267  }
268 
269  // Parameters
270  Qt3DRender::QParameter *colorRampTextureParameter = new Qt3DRender::QParameter( "u_colorRampTexture", colorRampTexture );
271  mat->addParameter( colorRampTextureParameter );
272  Qt3DRender::QParameter *colorRampCountParameter = new Qt3DRender::QParameter( "u_colorRampCount", mColorRampShader.colorRampItemList().count() );
273  mat->addParameter( colorRampCountParameter );
274  const int colorRampType = mColorRampShader.colorRampType();
275  Qt3DRender::QParameter *colorRampTypeParameter = new Qt3DRender::QParameter( "u_colorRampType", colorRampType );
276  mat->addParameter( colorRampTypeParameter );
277 }
278 
279 // QgsRgbPointCloud3DSymbol
280 
283 {
284 
285 }
286 
288 {
289  return QStringLiteral( "rgb" );
290 }
291 
293 {
295  result->mRedAttribute = mRedAttribute;
296  result->mGreenAttribute = mGreenAttribute;
297  result->mBlueAttribute = mBlueAttribute;
298 
299  if ( mRedContrastEnhancement )
300  {
301  result->setRedContrastEnhancement( new QgsContrastEnhancement( *mRedContrastEnhancement ) );
302  }
303  if ( mGreenContrastEnhancement )
304  {
305  result->setGreenContrastEnhancement( new QgsContrastEnhancement( *mGreenContrastEnhancement ) );
306  }
307  if ( mBlueContrastEnhancement )
308  {
309  result->setBlueContrastEnhancement( new QgsContrastEnhancement( *mBlueContrastEnhancement ) );
310  }
311  copyBaseSettings( result );
312  return result;
313 }
314 
315 void QgsRgbPointCloud3DSymbol::writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const
316 {
317  Q_UNUSED( context )
318 
319  writeBaseXml( elem, context );
320 
321  elem.setAttribute( QStringLiteral( "red" ), mRedAttribute );
322  elem.setAttribute( QStringLiteral( "green" ), mGreenAttribute );
323  elem.setAttribute( QStringLiteral( "blue" ), mBlueAttribute );
324 
325  QDomDocument doc = elem.ownerDocument();
326 
327  //contrast enhancement
328  if ( mRedContrastEnhancement )
329  {
330  QDomElement redContrastElem = doc.createElement( QStringLiteral( "redContrastEnhancement" ) );
331  mRedContrastEnhancement->writeXml( doc, redContrastElem );
332  elem.appendChild( redContrastElem );
333  }
334  if ( mGreenContrastEnhancement )
335  {
336  QDomElement greenContrastElem = doc.createElement( QStringLiteral( "greenContrastEnhancement" ) );
337  mGreenContrastEnhancement->writeXml( doc, greenContrastElem );
338  elem.appendChild( greenContrastElem );
339  }
340  if ( mBlueContrastEnhancement )
341  {
342  QDomElement blueContrastElem = doc.createElement( QStringLiteral( "blueContrastEnhancement" ) );
343  mBlueContrastEnhancement->writeXml( doc, blueContrastElem );
344  elem.appendChild( blueContrastElem );
345  }
346 }
347 
348 void QgsRgbPointCloud3DSymbol::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
349 {
350  Q_UNUSED( context )
351 
352  readBaseXml( elem, context );
353 
354  setRedAttribute( elem.attribute( QStringLiteral( "red" ), QStringLiteral( "Red" ) ) );
355  setGreenAttribute( elem.attribute( QStringLiteral( "green" ), QStringLiteral( "Green" ) ) );
356  setBlueAttribute( elem.attribute( QStringLiteral( "blue" ), QStringLiteral( "Blue" ) ) );
357 
358  //contrast enhancements
360  const QDomElement redContrastElem = elem.firstChildElement( QStringLiteral( "redContrastEnhancement" ) );
361  if ( !redContrastElem.isNull() )
362  {
364  redContrastEnhancement->readXml( redContrastElem );
366  }
367 
369  const QDomElement greenContrastElem = elem.firstChildElement( QStringLiteral( "greenContrastEnhancement" ) );
370  if ( !greenContrastElem.isNull() )
371  {
373  greenContrastEnhancement->readXml( greenContrastElem );
375  }
376 
378  const QDomElement blueContrastElem = elem.firstChildElement( QStringLiteral( "blueContrastEnhancement" ) );
379  if ( !blueContrastElem.isNull() )
380  {
382  blueContrastEnhancement->readXml( blueContrastElem );
384  }
385 }
386 
387 void QgsRgbPointCloud3DSymbol::fillMaterial( Qt3DRender::QMaterial *mat )
388 {
389  Qt3DRender::QParameter *renderingStyle = new Qt3DRender::QParameter( "u_renderingStyle", QgsPointCloud3DSymbol::RgbRendering );
390  mat->addParameter( renderingStyle );
391  Qt3DRender::QParameter *pointSizeParameter = new Qt3DRender::QParameter( "u_pointSize", QVariant::fromValue( mPointSize ) );
392  mat->addParameter( pointSizeParameter );
393 }
394 
395 
397 {
398  return mRedAttribute;
399 }
400 
401 void QgsRgbPointCloud3DSymbol::setRedAttribute( const QString &redAttribute )
402 {
403  mRedAttribute = redAttribute;
404 }
405 
407 {
408  return mGreenAttribute;
409 }
410 
411 void QgsRgbPointCloud3DSymbol::setGreenAttribute( const QString &greenAttribute )
412 {
413  mGreenAttribute = greenAttribute;
414 }
415 
417 {
418  return mBlueAttribute;
419 }
420 
421 void QgsRgbPointCloud3DSymbol::setBlueAttribute( const QString &blueAttribute )
422 {
423  mBlueAttribute = blueAttribute;
424 }
425 
427 {
428  return mRedContrastEnhancement.get();
429 }
430 
432 {
433  mRedContrastEnhancement.reset( enhancement );
434 }
435 
437 {
438  return mGreenContrastEnhancement.get();
439 }
440 
442 {
443  mGreenContrastEnhancement.reset( enhancement );
444 }
445 
447 {
448  return mBlueContrastEnhancement.get();
449 }
450 
452 {
453  mBlueContrastEnhancement.reset( enhancement );
454 }
455 
456 // QgsClassificationPointCloud3DSymbol
457 
458 
461 {
462 
463 }
464 
466 {
468  result->mRenderingParameter = mRenderingParameter;
469  result->mCategoriesList = mCategoriesList;
470  copyBaseSettings( result );
471  return result;
472 }
473 
475 {
476  return QStringLiteral( "classification" );
477 }
478 
479 void QgsClassificationPointCloud3DSymbol::writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const
480 {
481  Q_UNUSED( context )
482  QDomDocument doc = elem.ownerDocument();
483 
484  writeBaseXml( elem, context );
485 
486  elem.setAttribute( QStringLiteral( "rendering-parameter" ), mRenderingParameter );
487 
488  // categories
489  QDomElement catsElem = doc.createElement( QStringLiteral( "categories" ) );
490  for ( const QgsPointCloudCategory &category : mCategoriesList )
491  {
492  QDomElement catElem = doc.createElement( QStringLiteral( "category" ) );
493  catElem.setAttribute( QStringLiteral( "value" ), QString::number( category.value() ) );
494  catElem.setAttribute( QStringLiteral( "label" ), category.label() );
495  catElem.setAttribute( QStringLiteral( "color" ), QgsSymbolLayerUtils::encodeColor( category.color() ) );
496  catElem.setAttribute( QStringLiteral( "render" ), category.renderState() ? "true" : "false" );
497  catsElem.appendChild( catElem );
498  }
499  elem.appendChild( catsElem );
500 }
501 
502 void QgsClassificationPointCloud3DSymbol::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
503 {
504  Q_UNUSED( context )
505 
506  readBaseXml( elem, context );
507  mRenderingParameter = elem.attribute( "rendering-parameter", QString() );
508 
509  const QDomElement catsElem = elem.firstChildElement( QStringLiteral( "categories" ) );
510  if ( !catsElem.isNull() )
511  {
512  mCategoriesList.clear();
513  QDomElement catElem = catsElem.firstChildElement();
514  while ( !catElem.isNull() )
515  {
516  if ( catElem.tagName() == QLatin1String( "category" ) )
517  {
518  const int value = catElem.attribute( QStringLiteral( "value" ) ).toInt();
519  const QString label = catElem.attribute( QStringLiteral( "label" ) );
520  const bool render = catElem.attribute( QStringLiteral( "render" ) ) != QLatin1String( "false" );
521  const QColor color = QgsSymbolLayerUtils::decodeColor( catElem.attribute( QStringLiteral( "color" ) ) );
522  mCategoriesList.append( QgsPointCloudCategory( value, color, label, render ) );
523  }
524  catElem = catElem.nextSiblingElement();
525  }
526  }
527 }
528 
530 {
531  return mRenderingParameter;
532 }
533 
535 {
536  mRenderingParameter = attribute;
537 }
538 
540 {
541  mCategoriesList = categories;
542 }
543 
545 {
546  QgsPointCloudCategoryList filteredOut;
547  for ( const QgsPointCloudCategory &category : mCategoriesList )
548  {
549  if ( !category.renderState() )
550  filteredOut.push_back( category );
551  }
552  return filteredOut;
553 }
554 
555 QgsColorRampShader QgsClassificationPointCloud3DSymbol::colorRampShader() const
556 {
557  QgsColorRampShader colorRampShader;
558  colorRampShader.setColorRampType( QgsColorRampShader::Type::Exact );
559  colorRampShader.setClassificationMode( QgsColorRampShader::ClassificationMode::Continuous );
560  QList<QgsColorRampShader::ColorRampItem> colorRampItemList;
561  for ( const QgsPointCloudCategory &category : mCategoriesList )
562  {
563  const QColor color = category.color();
564  const QgsColorRampShader::ColorRampItem item( category.value(), color, category.label() );
565  colorRampItemList.push_back( item );
566  }
567  colorRampShader.setColorRampItemList( colorRampItemList );
568  return colorRampShader;
569 }
570 
571 
572 void QgsClassificationPointCloud3DSymbol::fillMaterial( Qt3DRender::QMaterial *mat )
573 {
574  const QgsColorRampShader mColorRampShader = colorRampShader();
575  Qt3DRender::QParameter *renderingStyle = new Qt3DRender::QParameter( "u_renderingStyle", QgsPointCloud3DSymbol::Classification );
576  mat->addParameter( renderingStyle );
577  Qt3DRender::QParameter *pointSizeParameter = new Qt3DRender::QParameter( "u_pointSize", QVariant::fromValue( mPointSize ) );
578  mat->addParameter( pointSizeParameter );
579  // Create the texture to pass the color ramp
580  Qt3DRender::QTexture1D *colorRampTexture = nullptr;
581  if ( mColorRampShader.colorRampItemList().count() > 0 )
582  {
583  colorRampTexture = new Qt3DRender::QTexture1D( mat );
584  colorRampTexture->addTextureImage( new QgsColorRampTexture( mColorRampShader, 1 ) );
585  colorRampTexture->setMinificationFilter( Qt3DRender::QTexture1D::Linear );
586  colorRampTexture->setMagnificationFilter( Qt3DRender::QTexture1D::Linear );
587  }
588 
589  // Parameters
590  Qt3DRender::QParameter *colorRampTextureParameter = new Qt3DRender::QParameter( "u_colorRampTexture", colorRampTexture );
591  mat->addParameter( colorRampTextureParameter );
592  Qt3DRender::QParameter *colorRampCountParameter = new Qt3DRender::QParameter( "u_colorRampCount", mColorRampShader.colorRampItemList().count() );
593  mat->addParameter( colorRampCountParameter );
594  const int colorRampType = mColorRampShader.colorRampType();
595  Qt3DRender::QParameter *colorRampTypeParameter = new Qt3DRender::QParameter( "u_colorRampType", colorRampType );
596  mat->addParameter( colorRampTypeParameter );
597 }
598 
QgsRgbPointCloud3DSymbol::blueContrastEnhancement
QgsContrastEnhancement * blueContrastEnhancement()
Returns the contrast enhancement to use for the blue channel.
Definition: qgspointcloud3dsymbol.cpp:446
QgsPointCloud3DSymbol::mHorizontalFilterThreshold
float mHorizontalFilterThreshold
Definition: qgspointcloud3dsymbol.h:185
QgsRgbPointCloud3DSymbol::redContrastEnhancement
QgsContrastEnhancement * redContrastEnhancement()
Returns the contrast enhancement to use for the red channel.
Definition: qgspointcloud3dsymbol.cpp:426
QgsColorRampPointCloud3DSymbol::QgsColorRampPointCloud3DSymbol
QgsColorRampPointCloud3DSymbol()
Constructor for QgsColorRampPointCloud3DSymbol.
Definition: qgspointcloud3dsymbol.cpp:181
QgsSymbolLayerUtils::encodeColor
static QString encodeColor(const QColor &color)
Definition: qgssymbollayerutils.cpp:64
QgsRgbPointCloud3DSymbol::writeXml
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Definition: qgspointcloud3dsymbol.cpp:315
QgsRgbPointCloud3DSymbol
3D symbol that draws point cloud geometries as 3D objects using RGB colors in the dataset
Definition: qgspointcloud3dsymbol.h:314
QgsRgbPointCloud3DSymbol::QgsRgbPointCloud3DSymbol
QgsRgbPointCloud3DSymbol()
Constructor for QgsRGBPointCloud3DSymbol.
Definition: qgspointcloud3dsymbol.cpp:281
QgsPointCloud3DSymbol::setVerticalTriangleFilter
void setVerticalTriangleFilter(bool verticalTriangleFilter)
Sets whether triangles are filtered by vertical height for rendering.
Definition: qgspointcloud3dsymbol.cpp:75
QgsColorRampShader::setClassificationMode
void setClassificationMode(ClassificationMode classificationMode)
Sets classification mode.
Definition: qgscolorrampshader.h:216
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsColorRampPointCloud3DSymbol::fillMaterial
void fillMaterial(Qt3DRender::QMaterial *material) override SIP_SKIP
Used to fill material object with necessary QParameters (and consequently opengl uniforms)
Definition: qgspointcloud3dsymbol.cpp:253
QgsPointCloud3DSymbol::horizontalFilterThreshold
float horizontalFilterThreshold() const
Returns the threshold horizontal size value for filtering triangles.
Definition: qgspointcloud3dsymbol.cpp:60
QgsPointCloud3DSymbol::~QgsPointCloud3DSymbol
~QgsPointCloud3DSymbol() override
Destructor for QgsPointCloud3DSymbol.
Definition: qgspointcloud3dsymbol.cpp:33
QgsPointCloud3DSymbol::verticalTriangleFilter
bool verticalTriangleFilter() const
Returns whether triangles are filtered by vertical height for rendering.
Definition: qgspointcloud3dsymbol.cpp:70
QgsClassificationPointCloud3DSymbol::fillMaterial
void fillMaterial(Qt3DRender::QMaterial *material) override SIP_SKIP
Used to fill material object with necessary QParameters (and consequently opengl uniforms)
Definition: qgspointcloud3dsymbol.cpp:572
QgsRgbPointCloud3DSymbol::readXml
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Definition: qgspointcloud3dsymbol.cpp:348
QgsClassificationPointCloud3DSymbol::attribute
QString attribute() const
Returns the attribute used to select the color of the point cloud.
Definition: qgspointcloud3dsymbol.cpp:529
QgsContrastEnhancement::readXml
void readXml(const QDomElement &elem)
Definition: qgscontrastenhancement.cpp:247
QgsPointCloud3DSymbol::mVerticalTriangleFilter
bool mVerticalTriangleFilter
Definition: qgspointcloud3dsymbol.h:186
qgssymbollayerutils.h
QgsPointCloud3DSymbol::mRenderAsTriangles
bool mRenderAsTriangles
Definition: qgspointcloud3dsymbol.h:183
QgsPointCloudCategoryList
QList< QgsPointCloudCategory > QgsPointCloudCategoryList
Definition: qgspointcloudclassifiedrenderer.h:116
QgsRgbPointCloud3DSymbol::blueAttribute
QString blueAttribute() const
Returns the attribute to use for the blue channel.
Definition: qgspointcloud3dsymbol.cpp:416
QgsPointCloud3DSymbol::readBaseXml
void readBaseXml(const QDomElement &elem, const QgsReadWriteContext &context)
Reads symbol configuration of this class from the given DOM element.
Definition: qgspointcloud3dsymbol.cpp:102
QgsRgbPointCloud3DSymbol::clone
QgsAbstract3DSymbol * clone() const override SIP_FACTORY
Definition: qgspointcloud3dsymbol.cpp:292
QgsPointCloud3DSymbol::setHorizontalTriangleFilter
void setHorizontalTriangleFilter(bool horizontalTriangleFilter)
Sets whether whether triangles are filtered by horizontal size for rendering.
Definition: qgspointcloud3dsymbol.cpp:55
QgsRgbPointCloud3DSymbol::fillMaterial
void fillMaterial(Qt3DRender::QMaterial *material) override SIP_SKIP
Used to fill material object with necessary QParameters (and consequently opengl uniforms)
Definition: qgspointcloud3dsymbol.cpp:387
QgsPointCloudCategory
Represents an individual category (class) from a QgsPointCloudClassifiedRenderer.
Definition: qgspointcloudclassifiedrenderer.h:32
QgsSingleColorPointCloud3DSymbol::QgsSingleColorPointCloud3DSymbol
QgsSingleColorPointCloud3DSymbol()
Constructor for QgsSingleColorPointCloud3DSymbol.
Definition: qgspointcloud3dsymbol.cpp:128
QgsAbstract3DSymbol::copyBaseSettings
virtual void copyBaseSettings(QgsAbstract3DSymbol *destination) const
Copies base class settings from this object to a destination object.
Definition: qgsabstract3dsymbol.cpp:33
QgsColorRampPointCloud3DSymbol::setColorRampShaderMinMax
void setColorRampShaderMinMax(double min, double max)
Sets the minimum and maximum values used when classifying colors in the color ramp shader.
Definition: qgspointcloud3dsymbol.cpp:247
QgsRgbPointCloud3DSymbol::greenContrastEnhancement
QgsContrastEnhancement * greenContrastEnhancement()
Returns the contrast enhancement to use for the green channel.
Definition: qgspointcloud3dsymbol.cpp:436
QgsPointCloud3DSymbol::SingleColor
@ SingleColor
Render the point cloud with a single color.
Definition: qgspointcloud3dsymbol.h:76
QgsPointCloud3DSymbol::setPointSize
void setPointSize(float size)
Sets the point size.
Definition: qgspointcloud3dsymbol.cpp:35
QgsPointCloud3DSymbol::mPointSize
float mPointSize
Definition: qgspointcloud3dsymbol.h:182
QgsPointCloud3DSymbol
3D symbol that draws point cloud geometries as 3D objects.
Definition: qgspointcloud3dsymbol.h:38
QgsSymbolLayerUtils::decodeColor
static QColor decodeColor(const QString &str)
Definition: qgssymbollayerutils.cpp:69
QgsColorRampShader
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
Definition: qgscolorrampshader.h:42
QgsClassificationPointCloud3DSymbol::clone
QgsAbstract3DSymbol * clone() const override SIP_FACTORY
Definition: qgspointcloud3dsymbol.cpp:465
QgsPointCloud3DSymbol::renderAsTriangles
bool renderAsTriangles() const
Returns whether points are triangulated to render solid surface.
Definition: qgspointcloud3dsymbol.cpp:40
QgsSingleColorPointCloud3DSymbol::writeXml
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Definition: qgspointcloud3dsymbol.cpp:147
QgsClassificationPointCloud3DSymbol::setAttribute
void setAttribute(const QString &attribute)
Sets the attribute used to select the color of the point cloud.
Definition: qgspointcloud3dsymbol.cpp:534
QgsAbstract3DSymbol
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Definition: qgsabstract3dsymbol.h:46
qgspointcloud3dsymbol.h
QgsRgbPointCloud3DSymbol::setBlueAttribute
void setBlueAttribute(const QString &attribute)
Sets the attribute to use for the blue channel.
Definition: qgspointcloud3dsymbol.cpp:421
QgsColorRampShader::setColorRampType
void setColorRampType(QgsColorRampShader::Type colorRampType)
Sets the color ramp type.
Definition: qgscolorrampshader.cpp:107
QgsRgbPointCloud3DSymbol::symbolType
QString symbolType() const override
Returns a unique string identifier of the symbol type.
Definition: qgspointcloud3dsymbol.cpp:287
QgsClassificationPointCloud3DSymbol::getFilteredOutCategories
QgsPointCloudCategoryList getFilteredOutCategories() const
Gets the list of categories of the classification that should not be rendered.
Definition: qgspointcloud3dsymbol.cpp:544
QgsColorRampShader::ColorRampItem
Definition: qgscolorrampshader.h:105
QgsPointCloud3DSymbol::ColorRamp
@ ColorRamp
Render the point cloud with a color ramp.
Definition: qgspointcloud3dsymbol.h:78
QgsPointCloud3DSymbol::RgbRendering
@ RgbRendering
Render the RGB colors of the point cloud.
Definition: qgspointcloud3dsymbol.h:80
QgsColorRampShader::writeXml
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Writes configuration to a new DOM element.
Definition: qgscolorrampshader.cpp:563
QgsSingleColorPointCloud3DSymbol::fillMaterial
void fillMaterial(Qt3DRender::QMaterial *material) override SIP_SKIP
Used to fill material object with necessary QParameters (and consequently opengl uniforms)
Definition: qgspointcloud3dsymbol.cpp:169
QgsPointCloud3DSymbol::horizontalTriangleFilter
bool horizontalTriangleFilter() const
Returns whether triangles are filtered by horizontal size for rendering.
Definition: qgspointcloud3dsymbol.cpp:50
Qgis::DataType::UnknownDataType
@ UnknownDataType
Unknown or unspecified type.
QgsSingleColorPointCloud3DSymbol::clone
QgsAbstract3DSymbol * clone() const override SIP_FACTORY
Definition: qgspointcloud3dsymbol.cpp:139
QgsPointCloud3DSymbol::setRenderAsTriangles
void setRenderAsTriangles(bool asTriangles)
Sets whether points are triangulated to render solid surface.
Definition: qgspointcloud3dsymbol.cpp:45
QgsRgbPointCloud3DSymbol::setBlueContrastEnhancement
void setBlueContrastEnhancement(QgsContrastEnhancement *enhancement SIP_TRANSFER)
Sets the contrast enhancement to use for the blue channel.
Definition: qgspointcloud3dsymbol.cpp:451
QgsPointCloud3DSymbol::copyBaseSettings
void copyBaseSettings(QgsAbstract3DSymbol *destination) const override
Definition: qgspointcloud3dsymbol.cpp:114
QgsPointCloud3DSymbol::QgsPointCloud3DSymbol
QgsPointCloud3DSymbol()
Constructor for QgsPointCloud3DSymbol.
Definition: qgspointcloud3dsymbol.cpp:28
QgsColorRampShader::setColorRampItemList
void setColorRampItemList(const QList< QgsColorRampShader::ColorRampItem > &list)
Sets a custom colormap.
Definition: qgscolorrampshader.cpp:99
QgsPointCloud3DSymbol::setHorizontalFilterThreshold
void setHorizontalFilterThreshold(float horizontalFilterThreshold)
Sets the threshold horizontal size value for filtering triangles.
Definition: qgspointcloud3dsymbol.cpp:65
QgsClassificationPointCloud3DSymbol::setCategoriesList
void setCategoriesList(const QgsPointCloudCategoryList &categories)
Sets the list of categories of the classification.
Definition: qgspointcloud3dsymbol.cpp:539
QgsColorRampPointCloud3DSymbol::readXml
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Definition: qgspointcloud3dsymbol.cpp:216
QgsRgbPointCloud3DSymbol::setRedContrastEnhancement
void setRedContrastEnhancement(QgsContrastEnhancement *enhancement SIP_TRANSFER)
Sets the contrast enhancement to use for the red channel.
Definition: qgspointcloud3dsymbol.cpp:431
QgsRgbPointCloud3DSymbol::setRedAttribute
void setRedAttribute(const QString &attribute)
Sets the attribute to use for the red channel.
Definition: qgspointcloud3dsymbol.cpp:401
QgsPointCloud3DSymbol::setVerticalFilterThreshold
void setVerticalFilterThreshold(float verticalFilterThreshold)
Sets the threshold vertical height value for filtering triangles.
Definition: qgspointcloud3dsymbol.cpp:85
QgsClassificationPointCloud3DSymbol::writeXml
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Definition: qgspointcloud3dsymbol.cpp:479
QgsContrastEnhancement
Manipulates raster or point cloud pixel values so that they enhanceContrast or clip into a specified ...
Definition: qgscontrastenhancement.h:42
QgsColorRampPointCloud3DSymbol::setColorRampShader
void setColorRampShader(const QgsColorRampShader &colorRampShader)
Sets the color ramp shader used to render the point cloud.
Definition: qgspointcloud3dsymbol.cpp:242
QgsColorRampShader::colorRampItemList
QList< QgsColorRampShader::ColorRampItem > colorRampItemList() const
Returns the custom colormap.
Definition: qgscolorrampshader.h:132
QgsColorRampPointCloud3DSymbol
3D symbol that draws point cloud geometries as 3D objects.using color ramp shader
Definition: qgspointcloud3dsymbol.h:241
QgsColorRampShader::colorRampType
Type colorRampType() const
Returns the color ramp type.
Definition: qgscolorrampshader.h:135
QgsRgbPointCloud3DSymbol::greenAttribute
QString greenAttribute() const
Returns the attribute to use for the green channel.
Definition: qgspointcloud3dsymbol.cpp:406
QgsColorRampPointCloud3DSymbol::colorRampShader
QgsColorRampShader colorRampShader() const
Returns the color ramp shader used to render the color.
Definition: qgspointcloud3dsymbol.cpp:237
QgsSingleColorPointCloud3DSymbol::readXml
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Definition: qgspointcloud3dsymbol.cpp:156
QgsClassificationPointCloud3DSymbol::symbolType
QString symbolType() const override
Returns a unique string identifier of the symbol type.
Definition: qgspointcloud3dsymbol.cpp:474
QgsSingleColorPointCloud3DSymbol::symbolType
QString symbolType() const override
Returns a unique string identifier of the symbol type.
Definition: qgspointcloud3dsymbol.cpp:134
QgsPointCloud3DSymbol::verticalFilterThreshold
float verticalFilterThreshold() const
Returns the threshold vertical height value for filtering triangles.
Definition: qgspointcloud3dsymbol.cpp:80
QgsColorRampShader::readXml
void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())
Reads configuration from the given DOM element.
Definition: qgscolorrampshader.cpp:599
QgsClassificationPointCloud3DSymbol::readXml
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Definition: qgspointcloud3dsymbol.cpp:502
QgsSingleColorPointCloud3DSymbol::setSingleColor
void setSingleColor(QColor color)
Sets the color used by the renderer when using SingleColor rendering mode.
Definition: qgspointcloud3dsymbol.cpp:164
QgsPointCloud3DSymbol::mVerticalFilterThreshold
float mVerticalFilterThreshold
Definition: qgspointcloud3dsymbol.h:187
qgscolorramptexture.h
QgsPointCloud3DSymbol::writeBaseXml
void writeBaseXml(QDomElement &elem, const QgsReadWriteContext &context) const
Writes symbol configuration of this class to the given DOM element.
Definition: qgspointcloud3dsymbol.cpp:90
QgsColorRampPointCloud3DSymbol::writeXml
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Definition: qgspointcloud3dsymbol.cpp:203
QgsSingleColorPointCloud3DSymbol
3D symbol that draws point cloud geometries as 3D objects.using one color
Definition: qgspointcloud3dsymbol.h:200
QgsPointCloud3DSymbol::Classification
@ Classification
Render the point cloud with classified colors.
Definition: qgspointcloud3dsymbol.h:82
QgsClassificationPointCloud3DSymbol::QgsClassificationPointCloud3DSymbol
QgsClassificationPointCloud3DSymbol()
Constructor for QgsClassificationPointCloud3DSymbol.
Definition: qgspointcloud3dsymbol.cpp:459
QgsRgbPointCloud3DSymbol::setGreenAttribute
void setGreenAttribute(const QString &attribute)
Sets the attribute to use for the green channel.
Definition: qgspointcloud3dsymbol.cpp:411
QgsColorRampPointCloud3DSymbol::setAttribute
void setAttribute(const QString &attribute)
Sets the attribute used to select the color of the point cloud.
Definition: qgspointcloud3dsymbol.cpp:232
QgsRgbPointCloud3DSymbol::redAttribute
QString redAttribute() const
Returns the attribute to use for the red channel.
Definition: qgspointcloud3dsymbol.cpp:396
QgsColorRampPointCloud3DSymbol::symbolType
QString symbolType() const override
Returns a unique string identifier of the symbol type.
Definition: qgspointcloud3dsymbol.cpp:198
QgsColorRampPointCloud3DSymbol::attribute
QString attribute() const
Returns the attribute used to select the color of the point cloud.
Definition: qgspointcloud3dsymbol.cpp:227
QgsClassificationPointCloud3DSymbol
3D symbol that draws point cloud geometries as 3D objects using classification of the dataset
Definition: qgspointcloud3dsymbol.h:474
QgsColorRampPointCloud3DSymbol::clone
QgsAbstract3DSymbol * clone() const override SIP_FACTORY
Definition: qgspointcloud3dsymbol.cpp:187
QgsPointCloud3DSymbol::mHorizontalTriangleFilter
bool mHorizontalTriangleFilter
Definition: qgspointcloud3dsymbol.h:184
QgsRgbPointCloud3DSymbol::setGreenContrastEnhancement
void setGreenContrastEnhancement(QgsContrastEnhancement *enhancement SIP_TRANSFER)
Sets the contrast enhancement to use for the green channel.
Definition: qgspointcloud3dsymbol.cpp:441