QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsline3dsymbol_p.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsline3dsymbol_p.cpp
3  --------------------------------------
4  Date : July 2017
5  Copyright : (C) 2017 by Martin Dobias
6  Email : wonder dot sk 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 "qgsline3dsymbol_p.h"
17 
18 #include "qgsline3dsymbol.h"
19 #include "qgslinematerial_p.h"
20 #include "qgslinevertexdata_p.h"
22 #include "qgstessellator.h"
23 #include "qgs3dmapsettings.h"
24 //#include "qgsterraingenerator.h"
25 #include "qgs3dutils.h"
26 
27 #include "qgsvectorlayer.h"
28 #include "qgsmultilinestring.h"
29 #include "qgsmultipolygon.h"
30 #include "qgsgeos.h"
32 
34 
35 #include <Qt3DExtras/QPhongMaterial>
36 #include <Qt3DRender/QAttribute>
37 #include <Qt3DRender/QBuffer>
38 #include <Qt3DRender/QGeometryRenderer>
39 
41 
42 // -----------
43 
44 
45 class QgsBufferedLine3DSymbolHandler : public QgsFeature3DHandler
46 {
47  public:
48  QgsBufferedLine3DSymbolHandler( const QgsLine3DSymbol *symbol, const QgsFeatureIds &selectedIds )
49  : mSymbol( static_cast< QgsLine3DSymbol *>( symbol->clone() ) )
50  , mSelectedIds( selectedIds ) {}
51 
52  bool prepare( const Qgs3DRenderContext &context, QSet<QString> &attributeNames ) override;
53  void processFeature( QgsFeature &feature, const Qgs3DRenderContext &context ) override;
54  void finalize( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context ) override;
55 
56  private:
57 
59  struct LineData
60  {
61  std::unique_ptr<QgsTessellator> tessellator;
62  QVector<QgsFeatureId> triangleIndexFids;
63  QVector<uint> triangleIndexStartingIndices;
64  };
65 
66  void processPolygon( QgsPolygon *polyBuffered, QgsFeatureId fid, float height, float extrusionHeight, const Qgs3DRenderContext &context, LineData &out );
67 
68  void makeEntity( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context, LineData &out, bool selected );
69 
70  // input specific for this class
71  std::unique_ptr< QgsLine3DSymbol > mSymbol;
72  // inputs - generic
73  QgsFeatureIds mSelectedIds;
74 
75  // outputs
76  LineData outNormal;
77  LineData outSelected;
78 };
79 
80 
81 
82 bool QgsBufferedLine3DSymbolHandler::prepare( const Qgs3DRenderContext &context, QSet<QString> &attributeNames )
83 {
84  Q_UNUSED( attributeNames )
85 
86  const QgsPhongTexturedMaterialSettings *texturedMaterialSettings = dynamic_cast< const QgsPhongTexturedMaterialSettings * >( mSymbol->material() );
87 
88  outNormal.tessellator.reset( new QgsTessellator( context.map().origin().x(), context.map().origin().y(), true,
89  false, false, false, texturedMaterialSettings ? texturedMaterialSettings->requiresTextureCoordinates() : false,
90  3,
91  texturedMaterialSettings ? texturedMaterialSettings->textureRotation() : 0 ) );
92  outSelected.tessellator.reset( new QgsTessellator( context.map().origin().x(), context.map().origin().y(), true,
93  false, false, false, texturedMaterialSettings ? texturedMaterialSettings->requiresTextureCoordinates() : false,
94  3,
95  texturedMaterialSettings ? texturedMaterialSettings->textureRotation() : 0 ) );
96 
97  return true;
98 }
99 
100 void QgsBufferedLine3DSymbolHandler::processFeature( QgsFeature &f, const Qgs3DRenderContext &context )
101 {
102  if ( f.geometry().isNull() )
103  return;
104 
105  LineData &out = mSelectedIds.contains( f.id() ) ? outSelected : outNormal;
106 
107  QgsGeometry geom = f.geometry();
108 
109  // segmentize curved geometries if necessary
110  if ( QgsWkbTypes::isCurvedType( geom.constGet()->wkbType() ) )
111  geom = QgsGeometry( geom.constGet()->segmentize() );
112 
113  const QgsAbstractGeometry *g = geom.constGet();
114 
115  // TODO: configurable
116  const int nSegments = 4;
119  const double mitreLimit = 0;
120 
121  QgsGeos engine( g );
122  QgsAbstractGeometry *buffered = engine.buffer( mSymbol->width() / 2., nSegments, endCapStyle, joinStyle, mitreLimit ); // factory
123  if ( !buffered )
124  return;
125 
126  if ( QgsWkbTypes::flatType( buffered->wkbType() ) == QgsWkbTypes::Polygon )
127  {
128  QgsPolygon *polyBuffered = static_cast<QgsPolygon *>( buffered );
129  processPolygon( polyBuffered, f.id(), mSymbol->height(), mSymbol->extrusionHeight(), context, out );
130  }
131  else if ( QgsWkbTypes::flatType( buffered->wkbType() ) == QgsWkbTypes::MultiPolygon )
132  {
133  QgsMultiPolygon *mpolyBuffered = static_cast<QgsMultiPolygon *>( buffered );
134  for ( int i = 0; i < mpolyBuffered->numGeometries(); ++i )
135  {
136  QgsPolygon *polyBuffered = static_cast<QgsPolygon *>( mpolyBuffered->polygonN( i ) )->clone(); // need to clone individual geometry parts
137  processPolygon( polyBuffered, f.id(), mSymbol->height(), mSymbol->extrusionHeight(), context, out );
138  }
139  delete buffered;
140  }
141 }
142 
143 void QgsBufferedLine3DSymbolHandler::processPolygon( QgsPolygon *polyBuffered, QgsFeatureId fid, float height, float extrusionHeight, const Qgs3DRenderContext &context, LineData &out )
144 {
145  Qgs3DUtils::clampAltitudes( polyBuffered, mSymbol->altitudeClamping(), mSymbol->altitudeBinding(), height, context.map() );
146 
147  Q_ASSERT( out.tessellator->dataVerticesCount() % 3 == 0 );
148  uint startingTriangleIndex = static_cast<uint>( out.tessellator->dataVerticesCount() / 3 );
149  out.triangleIndexStartingIndices.append( startingTriangleIndex );
150  out.triangleIndexFids.append( fid );
151  out.tessellator->addPolygon( *polyBuffered, extrusionHeight );
152  delete polyBuffered;
153 }
154 
155 void QgsBufferedLine3DSymbolHandler::finalize( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context )
156 {
157  // create entity for selected and not selected
158  makeEntity( parent, context, outNormal, false );
159  makeEntity( parent, context, outSelected, true );
160 
161  mZMin = std::min( outNormal.tessellator->zMinimum(), outSelected.tessellator->zMinimum() );
162  mZMax = std::max( outNormal.tessellator->zMaximum(), outSelected.tessellator->zMaximum() );
163 }
164 
165 
166 void QgsBufferedLine3DSymbolHandler::makeEntity( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context, LineData &out, bool selected )
167 {
168  if ( out.tessellator->dataVerticesCount() == 0 )
169  return; // nothing to show - no need to create the entity
170 
171  QgsMaterialContext materialContext;
172  materialContext.setIsSelected( selected );
173  materialContext.setSelectionColor( context.map().selectionColor() );
174  Qt3DRender::QMaterial *mat = mSymbol->material()->toMaterial( QgsMaterialSettingsRenderingTechnique::Triangles, materialContext );
175 
176  // extract vertex buffer data from tessellator
177  QByteArray data( ( const char * )out.tessellator->data().constData(), out.tessellator->data().count() * sizeof( float ) );
178  int nVerts = data.count() / out.tessellator->stride();
179 
180  const QgsPhongTexturedMaterialSettings *texturedMaterialSettings = dynamic_cast< const QgsPhongTexturedMaterialSettings * >( mSymbol->material() );
181 
182  QgsTessellatedPolygonGeometry *geometry = new QgsTessellatedPolygonGeometry( true, false, false,
183  texturedMaterialSettings ? texturedMaterialSettings->requiresTextureCoordinates() : false );
184  geometry->setData( data, nVerts, out.triangleIndexFids, out.triangleIndexStartingIndices );
185 
186  Qt3DRender::QGeometryRenderer *renderer = new Qt3DRender::QGeometryRenderer;
187  renderer->setGeometry( geometry );
188 
189  // make entity
190  Qt3DCore::QEntity *entity = new Qt3DCore::QEntity;
191  entity->addComponent( renderer );
192  entity->addComponent( mat );
193  entity->setParent( parent );
194 
195  if ( !selected )
196  entity->findChild<Qt3DRender::QGeometryRenderer *>()->setObjectName( QStringLiteral( "main" ) ); // temporary measure to distinguish between "selected" and "main"
197 
198  // cppcheck wrongly believes entity will leak
199  // cppcheck-suppress memleak
200 }
201 
202 
203 // --------------
204 
205 
206 class QgsSimpleLine3DSymbolHandler : public QgsFeature3DHandler
207 {
208  public:
209  QgsSimpleLine3DSymbolHandler( const QgsLine3DSymbol *symbol, const QgsFeatureIds &selectedIds )
210  : mSymbol( static_cast< QgsLine3DSymbol *>( symbol->clone() ) )
211  , mSelectedIds( selectedIds )
212  {
213  }
214 
215  bool prepare( const Qgs3DRenderContext &context, QSet<QString> &attributeNames ) override;
216  void processFeature( QgsFeature &feature, const Qgs3DRenderContext &context ) override;
217  void finalize( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context ) override;
218 
219  private:
220 
221  void makeEntity( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context, QgsLineVertexData &out, bool selected );
222  Qt3DExtras::QPhongMaterial *material( const QgsLine3DSymbol &symbol ) const;
223 
224  // input specific for this class
225  std::unique_ptr< QgsLine3DSymbol > mSymbol;
226  // inputs - generic
227  QgsFeatureIds mSelectedIds;
228 
229  // outputs
230  QgsLineVertexData outNormal;
231  QgsLineVertexData outSelected;
232 };
233 
234 
235 
236 bool QgsSimpleLine3DSymbolHandler::prepare( const Qgs3DRenderContext &context, QSet<QString> &attributeNames )
237 {
238  Q_UNUSED( attributeNames )
239 
240  outNormal.init( mSymbol->altitudeClamping(), mSymbol->altitudeBinding(), mSymbol->height(), &context.map() );
241  outSelected.init( mSymbol->altitudeClamping(), mSymbol->altitudeBinding(), mSymbol->height(), &context.map() );
242 
243  return true;
244 }
245 
246 void QgsSimpleLine3DSymbolHandler::processFeature( QgsFeature &f, const Qgs3DRenderContext &context )
247 {
248  Q_UNUSED( context )
249  if ( f.geometry().isNull() )
250  return;
251 
252  QgsLineVertexData &out = mSelectedIds.contains( f.id() ) ? outSelected : outNormal;
253 
254  QgsGeometry geom = f.geometry();
255  const QgsAbstractGeometry *g = geom.constGet();
256  if ( const QgsLineString *ls = qgsgeometry_cast<const QgsLineString *>( g ) )
257  {
258  out.addLineString( *ls );
259  }
260  else if ( const QgsMultiLineString *mls = qgsgeometry_cast<const QgsMultiLineString *>( g ) )
261  {
262  for ( int nGeom = 0; nGeom < mls->numGeometries(); ++nGeom )
263  {
264  const QgsLineString *ls = mls->lineStringN( nGeom );
265  out.addLineString( *ls );
266  }
267  }
268 }
269 
270 void QgsSimpleLine3DSymbolHandler::finalize( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context )
271 {
272  // create entity for selected and not selected
273  makeEntity( parent, context, outNormal, false );
274  makeEntity( parent, context, outSelected, true );
275 
276  updateZRangeFromPositions( outNormal.vertices );
277  updateZRangeFromPositions( outSelected.vertices );
278 }
279 
280 
281 void QgsSimpleLine3DSymbolHandler::makeEntity( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context, QgsLineVertexData &out, bool selected )
282 {
283  if ( out.indexes.isEmpty() )
284  return;
285 
286  // material (only ambient color is used for the color)
287 
288  QgsMaterialContext materialContext;
289  materialContext.setIsSelected( selected );
290  materialContext.setSelectionColor( context.map().selectionColor() );
291  Qt3DRender::QMaterial *mat = mSymbol->material()->toMaterial( QgsMaterialSettingsRenderingTechnique::Lines, materialContext );
292 
293  // geometry renderer
294 
295  Qt3DCore::QEntity *entity = new Qt3DCore::QEntity;
296 
297  Qt3DRender::QGeometry *geom = out.createGeometry( entity );
298 
299  Qt3DRender::QGeometryRenderer *renderer = new Qt3DRender::QGeometryRenderer;
300  renderer->setPrimitiveType( Qt3DRender::QGeometryRenderer::LineStrip );
301  renderer->setGeometry( geom );
302  renderer->setVertexCount( out.indexes.count() );
303  renderer->setPrimitiveRestartEnabled( true );
304  renderer->setRestartIndexValue( 0 );
305 
306  // make entity
307  entity->addComponent( renderer );
308  entity->addComponent( mat );
309  entity->setParent( parent );
310 }
311 
312 
313 
314 // --------------
315 
316 
317 class QgsThickLine3DSymbolHandler : public QgsFeature3DHandler
318 {
319  public:
320  QgsThickLine3DSymbolHandler( const QgsLine3DSymbol *symbol, const QgsFeatureIds &selectedIds )
321  : mSymbol( static_cast< QgsLine3DSymbol * >( symbol->clone() ) )
322  , mSelectedIds( selectedIds )
323  {
324  }
325 
326  bool prepare( const Qgs3DRenderContext &context, QSet<QString> &attributeNames ) override;
327  void processFeature( QgsFeature &feature, const Qgs3DRenderContext &context ) override;
328  void finalize( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context ) override;
329 
330  private:
331 
332 
333  void makeEntity( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context, QgsLineVertexData &out, bool selected );
334  Qt3DExtras::QPhongMaterial *material( const QgsLine3DSymbol &symbol ) const;
335 
336  // input specific for this class
337  std::unique_ptr< QgsLine3DSymbol > mSymbol;
338  // inputs - generic
339  QgsFeatureIds mSelectedIds;
340 
341  // outputs
342  QgsLineVertexData outNormal;
343  QgsLineVertexData outSelected;
344 };
345 
346 
347 
348 bool QgsThickLine3DSymbolHandler::prepare( const Qgs3DRenderContext &context, QSet<QString> &attributeNames )
349 {
350  Q_UNUSED( attributeNames )
351 
352  outNormal.withAdjacency = true;
353  outSelected.withAdjacency = true;
354  outNormal.init( mSymbol->altitudeClamping(), mSymbol->altitudeBinding(), mSymbol->height(), &context.map() );
355  outSelected.init( mSymbol->altitudeClamping(), mSymbol->altitudeBinding(), mSymbol->height(), &context.map() );
356 
357  return true;
358 }
359 
360 void QgsThickLine3DSymbolHandler::processFeature( QgsFeature &f, const Qgs3DRenderContext &context )
361 {
362  Q_UNUSED( context )
363  if ( f.geometry().isNull() )
364  return;
365 
366  QgsLineVertexData &out = mSelectedIds.contains( f.id() ) ? outSelected : outNormal;
367 
368  QgsGeometry geom = f.geometry();
369  const QgsAbstractGeometry *g = geom.constGet();
370  if ( const QgsLineString *ls = qgsgeometry_cast<const QgsLineString *>( g ) )
371  {
372  out.addLineString( *ls );
373  }
374  else if ( const QgsMultiLineString *mls = qgsgeometry_cast<const QgsMultiLineString *>( g ) )
375  {
376  for ( int nGeom = 0; nGeom < mls->numGeometries(); ++nGeom )
377  {
378  const QgsLineString *ls = mls->lineStringN( nGeom );
379  out.addLineString( *ls );
380  }
381  }
382 }
383 
384 void QgsThickLine3DSymbolHandler::finalize( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context )
385 {
386  // create entity for selected and not selected
387  makeEntity( parent, context, outNormal, false );
388  makeEntity( parent, context, outSelected, true );
389 
390  updateZRangeFromPositions( outNormal.vertices );
391  updateZRangeFromPositions( outSelected.vertices );
392 }
393 
394 
395 void QgsThickLine3DSymbolHandler::makeEntity( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context, QgsLineVertexData &out, bool selected )
396 {
397  if ( out.indexes.isEmpty() )
398  return;
399 
400  // material (only ambient color is used for the color)
401  QgsMaterialContext materialContext;
402  materialContext.setIsSelected( selected );
403  materialContext.setSelectionColor( context.map().selectionColor() );
404  Qt3DRender::QMaterial *mat = mSymbol->material()->toMaterial( QgsMaterialSettingsRenderingTechnique::Lines, materialContext );
405  if ( !mat )
406  {
407  QgsSimpleLineMaterialSettings defaultMaterial;
408  mat = defaultMaterial.toMaterial( QgsMaterialSettingsRenderingTechnique::Lines, materialContext );
409  }
410 
411  if ( QgsLineMaterial *lineMaterial = dynamic_cast< QgsLineMaterial * >( mat ) )
412  lineMaterial->setLineWidth( mSymbol->width() );
413 
414  Qt3DCore::QEntity *entity = new Qt3DCore::QEntity;
415 
416  // geometry renderer
417  Qt3DRender::QGeometryRenderer *renderer = new Qt3DRender::QGeometryRenderer;
418  renderer->setPrimitiveType( Qt3DRender::QGeometryRenderer::LineStripAdjacency );
419  renderer->setGeometry( out.createGeometry( entity ) );
420  renderer->setVertexCount( out.indexes.count() );
421  renderer->setPrimitiveRestartEnabled( true );
422  renderer->setRestartIndexValue( 0 );
423 
424  // make entity
425  entity->addComponent( renderer );
426  entity->addComponent( mat );
427  entity->setParent( parent );
428 }
429 
430 
431 // --------------
432 
433 
434 namespace Qgs3DSymbolImpl
435 {
436 
437  QgsFeature3DHandler *handlerForLine3DSymbol( QgsVectorLayer *layer, const QgsAbstract3DSymbol *symbol )
438  {
439  const QgsLine3DSymbol *lineSymbol = dynamic_cast< const QgsLine3DSymbol * >( symbol );
440  if ( !lineSymbol )
441  return nullptr;
442 
443  if ( lineSymbol->renderAsSimpleLines() )
444  return new QgsThickLine3DSymbolHandler( lineSymbol, layer->selectedFeatureIds() );
445  //return new QgsSimpleLine3DSymbolHandler( symbol, layer->selectedFeatureIds() );
446  else
447  return new QgsBufferedLine3DSymbolHandler( lineSymbol, layer->selectedFeatureIds() );
448  }
449 
450  Qt3DCore::QEntity *entityForLine3DSymbol( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol )
451  {
452  QgsFeature3DHandler *handler = handlerForLine3DSymbol( layer, &symbol );
453  Qt3DCore::QEntity *e = entityFromHandler( handler, map, layer );
454  delete handler;
455  return e;
456  }
457 }
458 
QgsFeature::id
Q_GADGET QgsFeatureId id
Definition: qgsfeature.h:64
QgsGeometry::CapRound
@ CapRound
Round cap.
Definition: qgsgeometry.h:1142
qgstessellatedpolygongeometry.h
QgsPhongTexturedMaterialSettings::textureRotation
float textureRotation() const
Returns the texture rotation, in degrees.
Definition: qgsphongtexturedmaterialsettings.cpp:61
QgsPolygon
Polygon geometry type.
Definition: qgspolygon.h:34
QgsWkbTypes::MultiPolygon
@ MultiPolygon
Definition: qgswkbtypes.h:78
qgsline3dsymbol.h
qgsphongtexturedmaterialsettings.h
QgsGeometry::isNull
Q_GADGET bool isNull
Definition: qgsgeometry.h:126
QgsWkbTypes::flatType
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
Definition: qgswkbtypes.h:702
QgsMultiLineString
Multi line string geometry collection.
Definition: qgsmultilinestring.h:32
QgsMaterialContext::setSelectionColor
void setSelectionColor(const QColor &color)
Sets the color for representing materials in a selected state.
Definition: qgsabstractmaterialsettings.h:84
QgsFeature::geometry
QgsGeometry geometry
Definition: qgsfeature.h:67
QgsGeometry::EndCapStyle
EndCapStyle
End cap styles for buffers.
Definition: qgsgeometry.h:1141
QgsLineString
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:44
Qgs3DUtils::clampAltitudes
static void clampAltitudes(QgsLineString *lineString, Qgs3DTypes::AltitudeClamping altClamp, Qgs3DTypes::AltitudeBinding altBind, const QgsPoint &centroid, float height, const Qgs3DMapSettings &map)
Clamps altitude of vertices of a linestring according to the settings.
Definition: qgs3dutils.cpp:267
QgsGeometryCollection::numGeometries
int numGeometries() const SIP_HOLDGIL
Returns the number of geometries within the collection.
Definition: qgsgeometrycollection.h:57
QgsLine3DSymbol::renderAsSimpleLines
bool renderAsSimpleLines() const
Returns whether the renderer will render data with simple lines (otherwise it uses buffer)
Definition: qgsline3dsymbol.h:82
QgsMaterialContext
3 Context settings for a material.
Definition: qgsabstractmaterialsettings.h:55
qgslinematerial_p.h
QgsAbstract3DSymbol
3 Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Definition: qgsabstract3dsymbol.h:46
QgsAbstractGeometry::wkbType
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns the WKB type of the geometry.
Definition: qgsabstractgeometry.h:193
qgssimplelinematerialsettings.h
qgsmultipolygon.h
qgs3dutils.h
QgsTessellatedPolygonGeometry::setData
void setData(const QByteArray &vertexBufferData, int vertexCount, const QVector< QgsFeatureId > &triangleIndexFids, const QVector< uint > &triangleIndexStartingIndices)
Initializes vertex buffer (and other members) from data that were already tessellated.
Definition: qgstessellatedpolygongeometry.cpp:112
QgsVectorLayer::selectedFeatureIds
Q_INVOKABLE const QgsFeatureIds & selectedFeatureIds() const
Returns a list of the selected features IDs in this layer.
Definition: qgsvectorlayer.cpp:3441
QgsGeos
Does vector analysis using the geos library and handles import, export, exception handling*.
Definition: qgsgeos.h:104
QgsLine3DSymbol
3 3D symbol that draws linestring geometries as planar polygons (created from lines using a buffer wi...
Definition: qgsline3dsymbol.h:36
qgstessellator.h
Qgs3DMapSettings
3 Definition of the world
Definition: qgs3dmapsettings.h:54
QgsMultiPolygon
Multi polygon geometry collection.
Definition: qgsmultipolygon.h:32
QgsGeometry::constGet
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
Definition: qgsgeometry.cpp:128
QgsFeatureIds
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:74
QgsAbstractGeometry::segmentize
virtual QgsAbstractGeometry * segmentize(double tolerance=M_PI/180., SegmentationToleranceType toleranceType=MaximumAngle) const
Returns a version of the geometry without curves.
Definition: qgsabstractgeometry.cpp:310
qgsvectorlayer.h
QgsPhongTexturedMaterialSettings
3 A phong shading model with diffuse texture map.
Definition: qgsphongtexturedmaterialsettings.h:36
qgs3dmapsettings.h
QgsWkbTypes::isCurvedType
static bool isCurvedType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a curved type or can contain curved geometries.
Definition: qgswkbtypes.h:881
QgsSimpleLineMaterialSettings
3 Basic shading material used for rendering simple lines as solid line components.
Definition: qgssimplelinematerialsettings.h:37
QgsMaterialContext::setIsSelected
void setIsSelected(bool isSelected)
Sets whether the material should represent a selected state.
Definition: qgsabstractmaterialsettings.h:70
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsTessellator
Class that takes care of tessellation of polygons into triangles.
Definition: qgstessellator.h:41
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
QgsGeometry::JoinStyleRound
@ JoinStyleRound
Use rounded joins.
Definition: qgsgeometry.h:1151
QgsWkbTypes::Polygon
@ Polygon
Definition: qgswkbtypes.h:74
QgsGeometry::JoinStyle
JoinStyle
Join styles for buffers.
Definition: qgsgeometry.h:1150
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:56
qgslinevertexdata_p.h
qgsline3dsymbol_p.h
QgsTessellatedPolygonGeometry
3 Class derived from Qt3DRender::QGeometry that represents polygons tessellated into 3D geometry.
Definition: qgstessellatedpolygongeometry.h:45
QgsMultiPolygon::polygonN
QgsPolygon * polygonN(int index)
Returns the polygon with the specified index.
Definition: qgsmultipolygon.cpp:33
QgsSimpleLineMaterialSettings::toMaterial
Qt3DRender::QMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const override
Creates a new QMaterial object representing the material settings.
Definition: qgssimplelinematerialsettings.cpp:66
qgsmultilinestring.h
QgsPhongTexturedMaterialSettings::requiresTextureCoordinates
bool requiresTextureCoordinates() const
Returns true if the material requires texture coordinates to be generated during triangulation....
Definition: qgsphongtexturedmaterialsettings.h:85
qgsgeos.h
QgsFeatureId
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Definition: qgsfeatureid.h:28