16#ifndef QGSTESSELLATEDPOLYGONGEOMETRY_H
17#define QGSTESSELLATEDPOLYGONGEOMETRY_H
21#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
22#include <Qt3DRender/QGeometry>
24#include <Qt3DCore/QGeometry>
31#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
55#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
103 QVector<QgsFeatureId>
featureIds()
const {
return mTriangleIndexFids; }
111#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
112 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
113 Qt3DRender::QAttribute *mNormalAttribute =
nullptr;
114 Qt3DRender::QAttribute *mTextureCoordsAttribute =
nullptr;
115 Qt3DRender::QBuffer *mVertexBuffer =
nullptr;
117 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
118 Qt3DCore::QAttribute *mNormalAttribute =
nullptr;
119 Qt3DCore::QAttribute *mTextureCoordsAttribute =
nullptr;
120 Qt3DCore::QBuffer *mVertexBuffer =
nullptr;
123 QVector<QgsFeatureId> mTriangleIndexFids;
124 QVector<uint> mTriangleIndexStartingIndices;
126 bool mWithNormals =
true;
127 bool mInvertNormals =
false;
128 bool mAddBackFaces =
false;
129 bool mAddTextureCoords =
false;
Entity that handles the exporting of 3D scenes.
Qt3DRender::QGeometry subclass that represents polygons tessellated into 3D geometry.
QVector< QgsFeatureId > featureIds() const
Returns included feature ids.
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).
QgsTessellatedPolygonGeometry(bool _withNormals=true, bool invertNormals=false, bool addBackFaces=false, bool addTextureCoords=false, QNode *parent=nullptr)
Constructor.
bool addBackFaces() const
Returns whether also triangles facing the other side will be created.
friend class Qgs3DSceneExporter
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.
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...
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features