Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwavefrontmesh_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAVEFRONTMESH_P_H
6#define QWAVEFRONTMESH_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20
21#include <QtQuick/private/qquickshadereffectmesh_p.h>
22
23#include <QtCore/qurl.h>
24#include <QtGui/qvector3d.h>
25
26QT_BEGIN_NAMESPACE
27
28class QWavefrontMeshPrivate;
29class Q_LABSWAVEFRONTMESH_EXPORT QWavefrontMesh : public QQuickShaderEffectMesh
30{
31 Q_OBJECT
32 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged FINAL)
33 Q_PROPERTY(Error lastError READ lastError NOTIFY lastErrorChanged FINAL)
34 Q_PROPERTY(QVector3D projectionPlaneV READ projectionPlaneV WRITE setProjectionPlaneV NOTIFY projectionPlaneVChanged FINAL)
35 Q_PROPERTY(QVector3D projectionPlaneW READ projectionPlaneW WRITE setProjectionPlaneW NOTIFY projectionPlaneWChanged FINAL)
36 QML_NAMED_ELEMENT(WavefrontMesh)
37 QML_ADDED_IN_VERSION(1, 0)
38
39public:
40 enum Error {
41 NoError,
42 InvalidSourceError,
43 UnsupportedFaceShapeError,
44 UnsupportedIndexSizeError,
45 FileNotFoundError,
46 NoAttributesError,
47 MissingPositionAttributeError,
48 MissingTextureCoordinateAttributeError,
49 MissingPositionAndTextureCoordinateAttributesError,
50 TooManyAttributesError,
51 InvalidPlaneDefinitionError
52 };
53 Q_ENUM(Error)
54
55 QWavefrontMesh(QObject *parent = nullptr);
56 ~QWavefrontMesh() override;
57
58 QUrl source() const;
59 void setSource(const QUrl &url);
60
61 Error lastError() const;
62 void setLastError(Error lastError);
63
64 bool validateAttributes(const QList<QByteArray> &attributes, int *posIndex) override;
65 QSGGeometry *updateGeometry(QSGGeometry *geometry, int attrCount, int posIndex,
66 const QRectF &srcRect, const QRectF &rect) override;
67 QString log() const override;
68
69 QVector3D projectionPlaneV() const;
70 void setProjectionPlaneV(const QVector3D &projectionPlaneV);
71
72 QVector3D projectionPlaneW() const;
73 void setProjectionPlaneW(const QVector3D &projectionPlaneW);
74
75Q_SIGNALS:
76 void sourceChanged();
77 void lastErrorChanged();
78 void projectionPlaneVChanged();
79 void projectionPlaneWChanged();
80
81protected Q_SLOTS:
82 void readData();
83
84private:
85 Q_DISABLE_COPY(QWavefrontMesh)
86 Q_DECLARE_PRIVATE(QWavefrontMesh)
87};
88
89QT_END_NAMESPACE
90
91#endif // QWAVEFRONTMESH_P_H
QVector< QVector3D > vertexes
QVector< QVector2D > textureCoordinates