1 | // Copyright (C) 2016 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 <QtDataVisualization/qdatavisualizationglobal.h> |
8 | #include <QtGui/QQuaternion> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | class QScatterDataItemPrivate; |
13 | |
14 | class Q_DATAVISUALIZATION_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 | inline void setPosition(const QVector3D &pos) { m_position = pos; } |
26 | inline QVector3D position() const { return m_position; } |
27 | inline void setRotation(const QQuaternion &rot) { m_rotation = rot; } |
28 | inline QQuaternion rotation() const { return m_rotation; } |
29 | inline void setX(float value) { m_position.setX(value); } |
30 | inline void setY(float value) { m_position.setY(value); } |
31 | inline void setZ(float value) { m_position.setZ(value); } |
32 | inline float x() const { return m_position.x(); } |
33 | inline float y() const { return m_position.y(); } |
34 | inline float z() const { 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 |