QgsTessellatedPolygonGeometry class
3 Class derived from Qt3DRender::QGeometry that represents polygons tessellated into 3D geometry.
Contents
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.
Constructors, destructors, conversion operators
- QgsTessellatedPolygonGeometry(QNode* parent = nullptr)
- Constructor.
Public functions
- auto addBackFaces() const -> bool
- Returns whether also triangles facing the other side will be created.
- auto invertNormals() const -> bool
- Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
- void setAddBackFaces(bool add)
- Sets whether also triangles facing the other side will be created.
- void setInvertNormals(bool invert)
- Sets whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
- 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.
- auto triangleIndexToFeatureId(uint triangleIndex) const -> QgsFeatureId
- Returns ID of the feature to which given triangle index belongs (used for picking)
Function documentation
bool QgsTessellatedPolygonGeometry:: addBackFaces() const
Returns whether also triangles facing the other side will be created.
Useful if input data have inconsistent order of vertices
void QgsTessellatedPolygonGeometry:: setAddBackFaces(bool add)
Sets whether also triangles facing the other side will be created.
Useful if input data have inconsistent order of vertices