File size: 4,741 Bytes
3bb804c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// qquick3dgeometry.sip generated by MetaSIP
//
// This file is part of the QtQuick3D Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt6.
// 
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file.  Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
// 
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license.  For more information contact
// info@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


class QQuick3DGeometry : public QQuick3DObject
{
%TypeHeaderCode
#include <qquick3dgeometry.h>
%End

public:
    explicit QQuick3DGeometry(QQuick3DObject *parent /TransferThis/ = 0);
    virtual ~QQuick3DGeometry();

    enum class PrimitiveType
    {
        Points,
        LineStrip,
        Lines,
        TriangleStrip,
        TriangleFan,
        Triangles,
    };

    struct Attribute
    {
%TypeHeaderCode
#include <qquick3dgeometry.h>
%End

        enum Semantic
        {
            IndexSemantic,
            PositionSemantic,
            NormalSemantic,
            TexCoordSemantic,
            TangentSemantic,
            BinormalSemantic,
            JointSemantic,
            WeightSemantic,
            ColorSemantic,
%If (Qt_6_1_0 -)
            TargetPositionSemantic,
%End
%If (Qt_6_1_0 -)
            TargetNormalSemantic,
%End
%If (Qt_6_1_0 -)
            TargetTangentSemantic,
%End
%If (Qt_6_1_0 -)
            TargetBinormalSemantic,
%End
%If (Qt_6_1_0 -)
            TexCoord1Semantic,
%End
%If (Qt_6_1_0 -)
            TexCoord0Semantic,
%End
        };

        enum ComponentType
        {
            U16Type,
            U32Type,
            F32Type,
            I32Type,
        };

        QQuick3DGeometry::Attribute::Semantic semantic;
        int offset;
        QQuick3DGeometry::Attribute::ComponentType componentType;
    };

    int attributeCount() const;
    QQuick3DGeometry::Attribute attribute(int index) const;
    QQuick3DGeometry::PrimitiveType primitiveType() const;
    QVector3D boundsMin() const;
    QVector3D boundsMax() const;
    int stride() const;
    void setVertexData(const QByteArray &data);
    void setVertexData(int offset, const QByteArray &data);
    void setIndexData(const QByteArray &data);
    void setIndexData(int offset, const QByteArray &data);
    void setStride(int stride);
    void setBounds(const QVector3D &min, const QVector3D &max);
    void setPrimitiveType(QQuick3DGeometry::PrimitiveType type);
    void addAttribute(QQuick3DGeometry::Attribute::Semantic semantic, int offset, QQuick3DGeometry::Attribute::ComponentType componentType);
    void addAttribute(const QQuick3DGeometry::Attribute &att);
    void clear();
    QByteArray vertexData() const;
    QByteArray indexData() const;
%If (Qt_6_3_0 -)
    int subsetCount(int subset) const;
%End
%If (Qt_6_3_0 -)
    int subsetCount() const;
%End
%If (Qt_6_3_0 -)
    QVector3D subsetBoundsMin(int subset) const;
%End
%If (Qt_6_3_0 -)
    QVector3D subsetBoundsMax(int subset) const;
%End
%If (Qt_6_3_0 -)
    int subsetOffset(int subset) const;
%End
%If (Qt_6_3_0 -)
    QString subsetName(int subset) const;
%End
%If (Qt_6_3_0 -)
    void addSubset(int offset, int count, const QVector3D &boundsMin, const QVector3D &boundsMax, const QString &name = {});
%End
%If (Qt_6_6_0 -)

    struct TargetAttribute
    {
%TypeHeaderCode
#include <qquick3dgeometry.h>
%End

        quint32 targetId;
        QQuick3DGeometry::Attribute attr;
        int stride;
    };

%End
%If (Qt_6_6_0 -)
    QByteArray targetData() const;
%End
%If (Qt_6_6_0 -)
    void setTargetData(int offset, const QByteArray &data);
%End
%If (Qt_6_6_0 -)
    void setTargetData(const QByteArray &data);
%End
%If (Qt_6_6_0 -)
    QQuick3DGeometry::TargetAttribute targetAttribute(int index) const;
%End
%If (Qt_6_6_0 -)
    int targetAttributeCount() const;
%End
%If (Qt_6_6_0 -)
    void addTargetAttribute(const QQuick3DGeometry::TargetAttribute &att);
%End
%If (Qt_6_6_0 -)
    void addTargetAttribute(quint32 targetId, QQuick3DGeometry::Attribute::Semantic semantic, int offset, int stride = 0);
%End
};