|
QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
3 More...
#include <qgstessellatedpolygongeometry.h>

Public Member Functions | |
| QgsTessellatedPolygonGeometry (bool _withNormals=true, bool invertNormals=false, bool addBackFaces=false, bool addTextureCoords=false, QNode *parent=nullptr) | |
| Constructor. More... | |
| bool | addBackFaces () const |
| Returns whether also triangles facing the other side will be created. More... | |
| bool | invertNormals () const |
| Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders) More... | |
| bool | rayIntersection (const QgsRayCastingUtils::Ray3D &ray, const QMatrix4x4 &worldTransform, QVector3D &intersectionPoint, QgsFeatureId &fid) |
| Tests whether the geometry is intersected by ray. More... | |
| void | setAddBackFaces (bool add) |
| Sets whether also triangles facing the other side will be created. More... | |
| void | setAddTextureCoords (bool add) |
| Sets whether the texture coordinates will be generated. More... | |
| 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. More... | |
| void | setInvertNormals (bool invert) |
| Sets whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders) More... | |
| void | setPolygons (const QList< QgsPolygon * > &polygons, const QList< QgsFeatureId > &featureIds, const QgsPointXY &origin, float extrusionHeight, const QList< float > &extrusionHeightPerPolygon=QList< float >()) |
| Initializes vertex buffer from given polygons. Takes ownership of passed polygon geometries. More... | |
| QgsFeatureId | triangleIndexToFeatureId (uint triangleIndex) const |
| Returns ID of the feature to which given triangle index belongs (used for picking). More... | |
Friends | |
| class | Qgs3DSceneExporter |
3
Class derived from Qt3DRender::QGeometry that represents polygons tessellated into 3D geometry.
Takes a list of polygons as input, internally it does tessellation and writes output to the internal vertex buffer. Optionally it can add "walls" if the extrusion height is non-zero.
Definition at line 64 of file qgstessellatedpolygongeometry.h.
| QgsTessellatedPolygonGeometry::QgsTessellatedPolygonGeometry | ( | bool | _withNormals = true, |
| bool | invertNormals = false, |
||
| bool | addBackFaces = false, |
||
| bool | addTextureCoords = false, |
||
| QNode * | parent = nullptr |
||
| ) |
Constructor.
Definition at line 35 of file qgstessellatedpolygongeometry.cpp.
|
inline |
Returns whether also triangles facing the other side will be created.
Useful if input data have inconsistent order of vertices
Definition at line 81 of file qgstessellatedpolygongeometry.h.
|
inline |
Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
Definition at line 73 of file qgstessellatedpolygongeometry.h.
| bool QgsTessellatedPolygonGeometry::rayIntersection | ( | const QgsRayCastingUtils::Ray3D & | ray, |
| const QMatrix4x4 & | worldTransform, | ||
| QVector3D & | intersectionPoint, | ||
| QgsFeatureId & | fid | ||
| ) |
Tests whether the geometry is intersected by ray.
In case of success, the intersectionPoint and the corresponding fid are updated.
Definition at line 186 of file qgstessellatedpolygongeometry.cpp.
|
inline |
Sets whether also triangles facing the other side will be created.
Useful if input data have inconsistent order of vertices
Definition at line 87 of file qgstessellatedpolygongeometry.h.
|
inline |
Sets whether the texture coordinates will be generated.
Definition at line 93 of file qgstessellatedpolygongeometry.h.
| void QgsTessellatedPolygonGeometry::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.
This is an alternative to setPolygons() - this method does not do any expensive work in the body.
Definition at line 173 of file qgstessellatedpolygongeometry.cpp.
|
inline |
Sets whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
Definition at line 75 of file qgstessellatedpolygongeometry.h.
| void QgsTessellatedPolygonGeometry::setPolygons | ( | const QList< QgsPolygon * > & | polygons, |
| const QList< QgsFeatureId > & | featureIds, | ||
| const QgsPointXY & | origin, | ||
| float | extrusionHeight, | ||
| const QList< float > & | extrusionHeightPerPolygon = QList<float>() |
||
| ) |
Initializes vertex buffer from given polygons. Takes ownership of passed polygon geometries.
Definition at line 141 of file qgstessellatedpolygongeometry.cpp.
| QgsFeatureId QgsTessellatedPolygonGeometry::triangleIndexToFeatureId | ( | uint | triangleIndex | ) | const |
Returns ID of the feature to which given triangle index belongs (used for picking).
In case such triangle index does not match any feature, FID_NULL is returned.
Definition at line 227 of file qgstessellatedpolygongeometry.cpp.
|
friend |
Definition at line 117 of file qgstessellatedpolygongeometry.h.