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