1 | // Copyright (C) 2023 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QSCATTERDATAITEM_H |
5 | #define QSCATTERDATAITEM_H |
6 | |
7 | #include <QtGraphs/qgraphsglobal.h> |
8 | #include <QtGui/QQuaternion> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | class QScatterDataItemPrivate; |
13 | |
14 | class Q_GRAPHS_EXPORT QScatterDataItem |
15 | { |
16 | public: |
17 | QScatterDataItem(); |
18 | QScatterDataItem(const QVector3D &position); |
19 | QScatterDataItem(const QVector3D &position, const QQuaternion &rotation); |
20 | QScatterDataItem(const QScatterDataItem &other); |
21 | ~QScatterDataItem(); |
22 | |
23 | QScatterDataItem &operator=(const QScatterDataItem &other); |
24 | |
25 | constexpr inline void setPosition(const QVector3D &pos) noexcept { m_position = pos; } |
26 | constexpr inline QVector3D position() const noexcept { return m_position; } |
27 | constexpr inline void setRotation(const QQuaternion &rot) noexcept { m_rotation = rot; } |
28 | inline QQuaternion rotation() const { return m_rotation; } |
29 | constexpr inline void setX(float value) noexcept { m_position.setX(value); } |
30 | constexpr inline void setY(float value) noexcept { m_position.setY(value); } |
31 | constexpr inline void setZ(float value) noexcept { m_position.setZ(value); } |
32 | constexpr inline float x() const noexcept { return m_position.x(); } |
33 | constexpr inline float y() const noexcept { return m_position.y(); } |
34 | constexpr inline float z() const noexcept { return m_position.z(); } |
35 | |
36 | protected: |
37 | void createExtraData(); |
38 | |
39 | QScatterDataItemPrivate *d_ptr; |
40 | |
41 | private: |
42 | QVector3D m_position; |
43 | QQuaternion m_rotation; |
44 | }; |
45 | |
46 | QT_END_NAMESPACE |
47 | |
48 | #endif |
49 |