1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef Q_QUICK3D_GEOMETRY_P_H
5#define Q_QUICK3D_GEOMETRY_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3D/qquick3dgeometry.h>
19#include <QtQuick3D/private/qquick3dobject_p.h>
20#include <QtQuick3DRuntimeRender/private/qssgrendergeometry_p.h>
21
22#include <QtGui/qvector3d.h>
23
24QT_BEGIN_NAMESPACE
25
26class Q_QUICK3D_PRIVATE_EXPORT QQuick3DGeometryPrivate : public QQuick3DObjectPrivate
27{
28public:
29 QQuick3DGeometryPrivate();
30
31 struct Subset {
32 QString name;
33 QVector3D boundsMin;
34 QVector3D boundsMax;
35 quint32 offset;
36 quint32 count;
37 };
38
39 static const int MAX_ATTRIBUTE_COUNT = 16;
40 static const int MAX_TARGET_ATTRIBUTE_COUNT = 32;
41 QByteArray m_vertexBuffer;
42 QByteArray m_targetBuffer;
43 QByteArray m_indexBuffer;
44 QQuick3DGeometry::Attribute m_attributes[MAX_ATTRIBUTE_COUNT];
45 QVector<Subset> m_subsets;
46 int m_attributeCount = 0;
47 QQuick3DGeometry::TargetAttribute m_targetAttributes[MAX_TARGET_ATTRIBUTE_COUNT];
48 int m_targetAttributeCount = 0;
49 QQuick3DGeometry::PrimitiveType m_primitiveType = QQuick3DGeometry::PrimitiveType::Triangles;
50 QVector3D m_min;
51 QVector3D m_max;
52 int m_stride = 0;
53 bool m_geometryChanged = true;
54 bool m_geometryBoundsChanged = true;
55 bool m_targetChanged = true;
56 bool m_usesOldTargetSemantics = false;
57
58 static QQuick3DGeometry::Attribute::Semantic semanticFromName(const QByteArray &name);
59 static QQuick3DGeometry::Attribute::ComponentType toComponentType(QSSGMesh::Mesh::ComponentType componentType);
60};
61
62QT_END_NAMESPACE
63
64#endif
65

source code of qtquick3d/src/quick3d/qquick3dgeometry_p.h