16#ifndef QGSTESSELLATEDPOLYGONGEOMETRY_H
17#define QGSTESSELLATEDPOLYGONGEOMETRY_H
21#include <Qt3DCore/QGeometry>
95 QVector<QgsFeatureId>
featureIds()
const {
return mTriangleIndexFids; }
103 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
104 Qt3DCore::QAttribute *mNormalAttribute =
nullptr;
105 Qt3DCore::QAttribute *mTangentAttribute =
nullptr;
106 Qt3DCore::QAttribute *mTextureCoordsAttribute =
nullptr;
107 Qt3DCore::QBuffer *mVertexBuffer =
nullptr;
108 Qt3DCore::QBuffer *mIndexBuffer =
nullptr;
109 Qt3DCore::QAttribute *mIndexAttribute =
nullptr;
111 QVector<QgsFeatureId> mTriangleIndexFids;
112 QVector<uint> mTriangleIndexStartingIndices;
114 bool mWithNormals =
true;
115 bool mInvertNormals =
false;
116 bool mAddBackFaces =
false;
117 bool mAddTextureCoords =
false;
118 bool mWithTangents =
false;
Entity that handles the exporting of 3D scenes.
QVector< QgsFeatureId > featureIds() const
Returns included feature ids.
void setVertexBufferData(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.
void setInvertNormals(bool invert)
Sets whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwi...
QgsTessellatedPolygonGeometry(bool _withNormals=true, bool invertNormals=false, bool addBackFaces=false, bool addTextureCoords=false, bool withTangents=false, QNode *parent=nullptr)
Constructor.
QgsFeatureId triangleIndexToFeatureId(uint triangleIndex) const
Returns ID of the feature to which given triangle index belongs (used for picking).
bool addBackFaces() const
Returns whether also triangles facing the other side will be created.
friend class Qgs3DSceneExporter
void setAddBackFaces(bool add)
Sets whether also triangles facing the other side will be created.
void setAddTextureCoords(bool add)
Sets whether the texture coordinates will be generated.
bool invertNormals() const
Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-cloc...
QVector< uint > triangleIndexStartingIndices() const
Returns triangle index for features. For a feature featureIds()[i], matching triangles start at trian...
void setIndexBufferData(const QByteArray &indexBufferData, size_t indexCount)
Sets index buffer data.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features