1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | // |
5 | // W A R N I N G |
6 | // ------------- |
7 | // |
8 | // This file is not part of the QtDataVisualization API. It exists purely as an |
9 | // implementation detail. This header file may change from version to |
10 | // version without notice, or even be removed. |
11 | // |
12 | // We mean it. |
13 | |
14 | #ifndef OBJECTHELPER_P_H |
15 | #define OBJECTHELPER_P_H |
16 | |
17 | #include "datavisualizationglobal_p.h" |
18 | #include "abstractobjecthelper_p.h" |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class Abstract3DRenderer; |
23 | |
24 | class ObjectHelper : public AbstractObjectHelper |
25 | { |
26 | private: |
27 | ObjectHelper(const QString &objectFile); |
28 | public: |
29 | virtual ~ObjectHelper(); |
30 | |
31 | static void resetObjectHelper(const Abstract3DRenderer *cacheId, ObjectHelper *&obj, |
32 | const QString &meshFile); |
33 | static void releaseObjectHelper(const Abstract3DRenderer *cacheId, ObjectHelper *&obj); |
34 | inline const QString &objectFile() { return m_objectFile; } |
35 | |
36 | inline const QList<GLuint> &indices() const { return m_indices; } |
37 | inline const QList<QVector3D> &indexedvertices() const { return m_indexedVertices; } |
38 | inline const QList<QVector2D> &indexedUVs() const { return m_indexedUVs; } |
39 | inline const QList<QVector3D> &indexedNormals() const { return m_indexedNormals; } |
40 | |
41 | private: |
42 | static ObjectHelper *getObjectHelper(const Abstract3DRenderer *cacheId, |
43 | const QString &objectFile); |
44 | void load(); |
45 | |
46 | QString m_objectFile; |
47 | QList<GLuint> m_indices; |
48 | QList<QVector3D> m_indexedVertices; |
49 | QList<QVector2D> m_indexedUVs; |
50 | QList<QVector3D> m_indexedNormals; |
51 | }; |
52 | |
53 | QT_END_NAMESPACE |
54 | |
55 | #endif |
56 |