| 1 | // Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QT3DRENDER_RENDER_RENDERATTRIBUTE_H |
| 5 | #define QT3DRENDER_RENDER_RENDERATTRIBUTE_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 for the convenience |
| 12 | // of other Qt classes. 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 <Qt3DRender/private/backendnode_p.h> |
| 19 | #include <Qt3DCore/qattribute.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | namespace Qt3DRender { |
| 24 | |
| 25 | namespace Render { |
| 26 | |
| 27 | class Q_3DRENDERSHARED_PRIVATE_EXPORT Attribute : public BackendNode |
| 28 | { |
| 29 | public: |
| 30 | Attribute(); |
| 31 | ~Attribute(); |
| 32 | |
| 33 | void cleanup(); |
| 34 | |
| 35 | void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; |
| 36 | |
| 37 | inline Qt3DCore::QNodeId bufferId() const { return m_bufferId; } |
| 38 | inline QString name() const { return m_name; } |
| 39 | inline int nameId() const { return m_nameId; } |
| 40 | inline Qt3DCore::QAttribute::VertexBaseType vertexBaseType() const { return m_vertexBaseType; } |
| 41 | inline uint vertexSize() const { return m_vertexSize; } |
| 42 | inline uint count() const { return m_count; } |
| 43 | inline uint byteStride() const { return m_byteStride; } |
| 44 | inline uint byteOffset() const { return m_byteOffset; } |
| 45 | inline uint divisor() const { return m_divisor; } |
| 46 | inline Qt3DCore::QAttribute::AttributeType attributeType() const { return m_attributeType; } |
| 47 | inline bool isDirty() const { return m_attributeDirty; } |
| 48 | void unsetDirty(); |
| 49 | |
| 50 | private: |
| 51 | Qt3DCore::QNodeId m_bufferId; |
| 52 | QString m_name; |
| 53 | int m_nameId; |
| 54 | Qt3DCore::QAttribute::VertexBaseType m_vertexBaseType; |
| 55 | uint m_vertexSize; |
| 56 | uint m_count; |
| 57 | uint m_byteStride; |
| 58 | uint m_byteOffset; |
| 59 | uint m_divisor; |
| 60 | Qt3DCore::QAttribute::AttributeType m_attributeType; |
| 61 | bool m_attributeDirty; |
| 62 | }; |
| 63 | |
| 64 | } // namespace Render |
| 65 | |
| 66 | } // namespace Qt3DRender |
| 67 | |
| 68 | QT_END_NAMESPACE |
| 69 | |
| 70 | #endif // QT3DRENDER_RENDER_RENDERATTRIBUTE_H |
| 71 | |