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
qssgrendergeometry_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSG_RENDER_GEOMETRY_H
5#define QSSG_RENDER_GEOMETRY_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 <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
19#include <QtQuick3DRuntimeRender/private/qssgrendernode_p.h>
20#include <QtQuick3DRuntimeRender/private/qssgrendermesh_p.h>
21#include <QtQuick3DRuntimeRender/private/qssgrendererutil_p.h>
22#include <QtQuick3DUtils/private/qssgmesh_p.h>
23
24#include <QtCore/qbytearray.h>
25
27
28class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderGeometry : public QSSGRenderGraphObject
29{
30public:
37 quint32 targetId = 0;
39 int stride = 0;
40 };
41
42 explicit QSSGRenderGeometry();
43 virtual ~QSSGRenderGeometry();
44
45 const QByteArray &vertexBuffer() const;
46 QByteArray &vertexBuffer();
47 const QByteArray &indexBuffer() const;
48 QByteArray &indexBuffer();
49 int attributeCount() const;
50 Attribute attribute(int idx) const;
51 QSSGMesh::Mesh::DrawMode primitiveType() const;
52 QVector3D boundsMin() const;
53 QVector3D boundsMax() const;
54 int stride() const;
55 int targetStride() const;
56
57 void setVertexData(const QByteArray &data);
58 void setIndexData(const QByteArray &data);
59 void setStride(int stride);
60 void setBounds(const QVector3D &min, const QVector3D &max);
61 void setPrimitiveType(QSSGMesh::Mesh::DrawMode type);
62
63 void addAttribute(QSSGMesh::RuntimeMeshData::Attribute::Semantic semantic,
64 int offset,
65 QSSGMesh::Mesh::ComponentType componentType);
66 void addAttribute(const Attribute &att);
67 void addSubset(quint32 offset, quint32 count, const QVector3D &boundsMin, const QVector3D &boundsMax, const QString &name = {});
68
69 void clear();
70 void clearAttributes();
71
72 uint32_t generationId() const;
73 const QSSGMesh::RuntimeMeshData &meshData() const;
74
76
77 void clearVertexAndIndex();
78 void clearTarget();
79 void setTargetData(const QByteArray &data);
80 void addTargetAttribute(quint32 targetId,
82 int offset,
83 int stride = 0);
84 void addTargetAttribute(const TargetAttribute &att);
85
86protected:
87 Q_DISABLE_COPY(QSSGRenderGeometry)
88
89 void markDirty();
90
91 uint32_t m_generationId = 1;
94};
95
97
98#endif // QSSG_GEOMETRY_H
\inmodule QtCore
Definition qbytearray.h:57
Class representing 3D range or axis aligned bounding box.
int targetStride() const
QSSGMesh::RuntimeMeshData m_meshData
\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
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
QSSGRenderComponentType
unsigned int quint32
Definition qtypes.h:50