1// Copyright (C) 2017 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 QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_H
5#define QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_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 <Qt3DQuickExtras/private/qt3dquickextras_global_p.h>
19#include <Qt3DCore/qentity.h>
20#include <Qt3DRender/qlevelofdetail.h>
21
22QT_BEGIN_NAMESPACE
23
24namespace Qt3DExtras {
25namespace Extras {
26namespace Quick {
27
28class Quick3DLevelOfDetailLoaderPrivate;
29
30class Q_3DQUICKEXTRASSHARED_PRIVATE_EXPORT Quick3DLevelOfDetailLoader : public Qt3DCore::QEntity
31{
32 Q_OBJECT
33
34 QML_NAMED_ELEMENT(LevelOfDetailLoader)
35 QML_ADDED_IN_VERSION(2, 9)
36
37 Q_PROPERTY(QVariantList sources READ sources WRITE setSources NOTIFY sourcesChanged)
38
39 Q_PROPERTY(Qt3DRender::QCamera *camera READ camera WRITE setCamera NOTIFY cameraChanged)
40 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
41 Q_PROPERTY(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType READ thresholdType WRITE setThresholdType NOTIFY thresholdTypeChanged)
42 Q_PROPERTY(QList<qreal> thresholds READ thresholds WRITE setThresholds NOTIFY thresholdsChanged)
43 Q_PROPERTY(Qt3DRender::QLevelOfDetailBoundingSphere volumeOverride READ volumeOverride WRITE setVolumeOverride NOTIFY volumeOverrideChanged)
44
45 Q_PROPERTY(QObject *entity READ entity NOTIFY entityChanged)
46 Q_PROPERTY(QUrl source READ source NOTIFY sourceChanged)
47public:
48 explicit Quick3DLevelOfDetailLoader(QNode *parent = 0);
49
50 QVariantList sources() const;
51 void setSources(const QVariantList &sources);
52
53 Qt3DRender::QCamera *camera() const;
54 void setCamera(Qt3DRender::QCamera *camera);
55 int currentIndex() const;
56 void setCurrentIndex(int currentIndex);
57 Qt3DRender::QLevelOfDetail::ThresholdType thresholdType() const;
58 void setThresholdType(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType);
59 QList<qreal> thresholds() const;
60 void setThresholds(const QList<qreal> &thresholds);
61 Qt3DRender::QLevelOfDetailBoundingSphere volumeOverride() const;
62 void setVolumeOverride(const Qt3DRender::QLevelOfDetailBoundingSphere &volumeOverride);
63
64 Q_INVOKABLE Qt3DRender::QLevelOfDetailBoundingSphere createBoundingSphere(const QVector3D &center, float radius);
65
66 QObject *entity() const;
67 QUrl source() const;
68
69Q_SIGNALS:
70 void sourcesChanged();
71 void cameraChanged();
72 void currentIndexChanged();
73 void thresholdTypeChanged();
74 void thresholdsChanged();
75 void volumeOverrideChanged();
76 void entityChanged();
77 void sourceChanged();
78
79private:
80 Q_DECLARE_PRIVATE(Quick3DLevelOfDetailLoader)
81};
82
83} // namespace Quick
84} // namespace Extras
85} // namespace Qt3DExtras
86
87QT_END_NAMESPACE
88
89#endif // QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_H
90

source code of qt3d/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h