QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGSTESSELLATEDPOLYGONGEOMETRY_H
17 #define QGSTESSELLATEDPOLYGONGEOMETRY_H
22 #include <Qt3DRender/QGeometry>
75 void setPolygons(
const QList<QgsPolygon *> &polygons,
const QList<QgsFeatureId> &featureIds,
const QgsPointXY &origin,
float extrusionHeight,
const QList<float> &extrusionHeightPerPolygon = QList<float>() );
82 void setData(
const QByteArray &vertexBufferData,
int vertexCount,
const QVector<QgsFeatureId> &triangleIndexFids,
const QVector<uint> &triangleIndexStartingIndices );
93 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
94 Qt3DRender::QAttribute *mNormalAttribute =
nullptr;
95 Qt3DRender::QAttribute *mTextureCoordsAttribute =
nullptr;
96 Qt3DRender::QBuffer *mVertexBuffer =
nullptr;
98 QVector<QgsFeatureId> mTriangleIndexFids;
99 QVector<uint> mTriangleIndexStartingIndices;
101 bool mWithNormals =
true;
102 bool mInvertNormals =
false;
103 bool mAddBackFaces =
false;
104 bool mAddTextureCoords =
false;
107 #endif // QGSTESSELLATEDPOLYGONGEOMETRY_H
void setInvertNormals(bool invert)
Sets whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwi...
QgsFeatureId triangleIndexToFeatureId(uint triangleIndex) const
Returns ID of the feature to which given triangle index belongs (used for picking).
bool invertNormals() const
Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-cloc...
bool addBackFaces() const
Returns whether also triangles facing the other side will be created.
Entity that handles the exporting of 3D scene.
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.
A class to represent a 2D point.
void setAddTextureCoords(bool add)
Sets whether the texture coordinates will be generated.
void setAddBackFaces(bool add)
Sets whether also triangles facing the other side will be created.
QgsTessellatedPolygonGeometry(bool _withNormals=true, bool invertNormals=false, bool addBackFaces=false, bool addTextureCoords=false, QNode *parent=nullptr)
Constructor.
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.
Class derived from Qt3DRender::QGeometry that represents polygons tessellated into 3D geometry.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features