Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3dgeometry.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef Q_QUICK3D_GEOMETRY_H
5#define Q_QUICK3D_GEOMETRY_H
6
7#include <QtQuick3D/qquick3dobject.h>
8
10
12
13class Q_QUICK3D_EXPORT QQuick3DGeometry : public QQuick3DObject
14{
16 Q_DECLARE_PRIVATE(QQuick3DGeometry)
17
18 QML_NAMED_ELEMENT(Geometry)
19 QML_UNCREATABLE("Geometry is Abstract")
20public:
21 explicit QQuick3DGeometry(QQuick3DObject *parent = nullptr);
22 ~QQuick3DGeometry() override;
23
24 enum class PrimitiveType {
25 Points,
27 Lines,
31 };
32
33 struct Attribute {
34 enum Semantic {
36 PositionSemantic, // attr_pos
37 NormalSemantic, // attr_norm
38 TexCoordSemantic, // attr_uv0
39 TangentSemantic, // attr_textan
40 BinormalSemantic, // attr_binormal
41 JointSemantic, // attr_joints
42 WeightSemantic, // attr_weights
43 ColorSemantic, // attr_color
45 TargetNormalSemantic, // attr_tnorm0
46 TargetTangentSemantic, // attr_ttan0
47 TargetBinormalSemantic, // attr_tbinorm0
48 TexCoord1Semantic, // attr_uv1
49 TexCoord0Semantic = TexCoordSemantic // for compatibility
50 };
57 Semantic semantic = PositionSemantic;
58 int offset = -1;
59 ComponentType componentType = F32Type;
60 };
61
63 quint32 targetId = 0;
65 int stride = 0;
66 };
67
68 QByteArray vertexData() const;
69 QByteArray indexData() const;
70 int attributeCount() const;
71 Attribute attribute(int index) const;
72 PrimitiveType primitiveType() const;
75 int stride() const;
76
77 void setVertexData(const QByteArray &data);
78 void setVertexData(int offset, const QByteArray &data);
79 void setIndexData(const QByteArray &data);
80 void setIndexData(int offset, const QByteArray &data);
81 void setStride(int stride);
82 void setBounds(const QVector3D &min, const QVector3D &max);
83 void setPrimitiveType(PrimitiveType type);
84
85 void addAttribute(Attribute::Semantic semantic, int offset,
86 Attribute::ComponentType componentType);
87 void addAttribute(const Attribute &att);
88
89 Q_REVISION(6, 3) int subsetCount() const;
90 Q_REVISION(6, 3) QVector3D subsetBoundsMin(int subset) const;
91 Q_REVISION(6, 3) QVector3D subsetBoundsMax(int subset) const;
92 Q_REVISION(6, 3) int subsetOffset(int subset) const;
93 Q_REVISION(6, 3) int subsetCount(int subset) const;
94 Q_REVISION(6, 3) QString subsetName(int subset) const;
95 Q_REVISION(6, 3) void addSubset(int offset, int count, const QVector3D &boundsMin, const QVector3D &boundsMax, const QString &name = {});
96
97 Q_REVISION(6, 6) QByteArray targetData() const;
98 Q_REVISION(6, 6) void setTargetData(const QByteArray &data);
99 Q_REVISION(6, 6) void setTargetData(int offset, const QByteArray &data);
100 Q_REVISION(6, 6) TargetAttribute targetAttribute(int index) const;
101 Q_REVISION(6, 6) int targetAttributeCount() const;
102 Q_REVISION(6, 6) void addTargetAttribute(quint32 targetId,
103 Attribute::Semantic semantic, int offset,
104 int stride = 0);
105 Q_REVISION(6, 6) void addTargetAttribute(const TargetAttribute &att);
106
107 void clear();
108
110 void geometryNodeDirty();
111 Q_REVISION(6, 7) void geometryChanged();
112
113protected:
114 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
115 void markAllDirty() override;
116};
117
119
120#endif // Q_QUICK3D_GEOMETRY_H
\inmodule QtCore
Definition qbytearray.h:57
\qmltype Geometry \inherits Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DGeometry
QVector3D boundsMax() const
Q_REVISION(6, 6) QByteArray targetData() const
QVector3D boundsMin() const
int stride() const
Q_REVISION(6, 3) int subsetCount() const
\qmltype Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DObject \inherits QtObject
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
b clear()
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint attribute
GLuint index
[2]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
const void GLsizei GLsizei stride
GLenum type
GLenum GLuint GLintptr offset
GLuint name
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_SIGNALS
unsigned int quint32
Definition qtypes.h:50
float vertexData[]