| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTDATAVIS3D_Q3DOBJECT_H |
| 5 | #define QTDATAVIS3D_Q3DOBJECT_H |
| 6 | |
| 7 | #include <QtDataVisualization/qdatavisualizationglobal.h> |
| 8 | #include <QtCore/QObject> |
| 9 | #include <QtGui/QVector3D> |
| 10 | |
| 11 | Q_MOC_INCLUDE(<QtDataVisualization/q3dscene.h>) |
| 12 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | class Q3DObjectPrivate; |
| 16 | class Q3DScene; |
| 17 | |
| 18 | class Q_DATAVISUALIZATION_EXPORT Q3DObject : public QObject |
| 19 | { |
| 20 | Q_OBJECT |
| 21 | Q_PROPERTY(Q3DScene* parentScene READ parentScene) |
| 22 | Q_PROPERTY(QVector3D position READ position WRITE setPosition NOTIFY positionChanged) |
| 23 | |
| 24 | public: |
| 25 | explicit Q3DObject(QObject *parent = nullptr); |
| 26 | virtual ~Q3DObject(); |
| 27 | |
| 28 | virtual void copyValuesFrom(const Q3DObject &source); |
| 29 | |
| 30 | Q3DScene *parentScene(); |
| 31 | |
| 32 | QVector3D position() const; |
| 33 | void setPosition(const QVector3D &position); |
| 34 | |
| 35 | Q_SIGNALS: |
| 36 | void positionChanged(const QVector3D &position); |
| 37 | |
| 38 | protected: |
| 39 | void setDirty(bool dirty); |
| 40 | bool isDirty() const; |
| 41 | |
| 42 | private: |
| 43 | QScopedPointer<Q3DObjectPrivate> d_ptr; |
| 44 | |
| 45 | Q_DISABLE_COPY(Q3DObject) |
| 46 | |
| 47 | friend class Q3DScenePrivate; |
| 48 | }; |
| 49 | |
| 50 | QT_END_NAMESPACE |
| 51 | |
| 52 | #endif |
| 53 | |