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 Q_PROPERTY(QVariantList sources READ sources WRITE setSources NOTIFY sourcesChanged)
34
35 Q_PROPERTY(Qt3DRender::QCamera *camera READ camera WRITE setCamera NOTIFY cameraChanged)
36 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
37 Q_PROPERTY(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType READ thresholdType WRITE setThresholdType NOTIFY thresholdTypeChanged)
38 Q_PROPERTY(QList<qreal> thresholds READ thresholds WRITE setThresholds NOTIFY thresholdsChanged)
39 Q_PROPERTY(Qt3DRender::QLevelOfDetailBoundingSphere volumeOverride READ volumeOverride WRITE setVolumeOverride NOTIFY volumeOverrideChanged)
40
41 Q_PROPERTY(QObject *entity READ entity NOTIFY entityChanged)
42 Q_PROPERTY(QUrl source READ source NOTIFY sourceChanged)
43public:
44 explicit Quick3DLevelOfDetailLoader(QNode *parent = 0);
45
46 QVariantList sources() const;
47 void setSources(const QVariantList &sources);
48
49 Qt3DRender::QCamera *camera() const;
50 void setCamera(Qt3DRender::QCamera *camera);
51 int currentIndex() const;
52 void setCurrentIndex(int currentIndex);
53 Qt3DRender::QLevelOfDetail::ThresholdType thresholdType() const;
54 void setThresholdType(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType);
55 QList<qreal> thresholds() const;
56 void setThresholds(const QList<qreal> &thresholds);
57 Qt3DRender::QLevelOfDetailBoundingSphere volumeOverride() const;
58 void setVolumeOverride(const Qt3DRender::QLevelOfDetailBoundingSphere &volumeOverride);
59
60 Q_INVOKABLE Qt3DRender::QLevelOfDetailBoundingSphere createBoundingSphere(const QVector3D &center, float radius);
61
62 QObject *entity() const;
63 QUrl source() const;
64
65Q_SIGNALS:
66 void sourcesChanged();
67 void cameraChanged();
68 void currentIndexChanged();
69 void thresholdTypeChanged();
70 void thresholdsChanged();
71 void volumeOverrideChanged();
72 void entityChanged();
73 void sourceChanged();
74
75private:
76 Q_DECLARE_PRIVATE(Quick3DLevelOfDetailLoader)
77};
78
79} // namespace Quick
80} // namespace Extras
81} // namespace Qt3DExtras
82
83QT_END_NAMESPACE
84
85#endif // QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_H
86

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