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 QT3DRENDER_RENDER_LEVELOFDETAIL_H
5#define QT3DRENDER_RENDER_LEVELOFDETAIL_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 <Qt3DRender/private/backendnode_p.h>
19#include <Qt3DRender/qt3drender_global.h>
20#include <Qt3DRender/qlevelofdetail.h>
21#include <QStringList>
22#include <QVector3D>
23
24QT_BEGIN_NAMESPACE
25
26namespace Qt3DRender {
27
28class QLevelOfDetail;
29
30namespace Render {
31
32class LevelOfDetailManager;
33
34class Q_3DRENDERSHARED_PRIVATE_EXPORT LevelOfDetail : public BackendNode
35{
36public:
37 LevelOfDetail();
38 ~LevelOfDetail();
39 void cleanup();
40 void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override;
41
42 Qt3DCore::QNodeId camera() const { return m_camera; }
43 int currentIndex() const { return m_currentIndex; }
44 QLevelOfDetail::ThresholdType thresholdType() const { return m_thresholdType; }
45 QList<qreal> thresholds() const { return m_thresholds; }
46 float radius() const { return m_volumeOverride.radius(); }
47 QVector3D center() const { return m_volumeOverride.center(); }
48 bool hasBoundingVolumeOverride() const { return !m_volumeOverride.isEmpty(); }
49
50 void setCurrentIndex(int currentIndex);
51
52private:
53 Qt3DCore::QNodeId m_camera;
54 int m_currentIndex;
55 QLevelOfDetail::ThresholdType m_thresholdType;
56 QList<qreal> m_thresholds;
57 QLevelOfDetailBoundingSphere m_volumeOverride;
58};
59
60} // namespace Render
61
62} // namespace Qt3DRender
63
64QT_END_NAMESPACE
65
66#endif // QT3DRENDER_RENDER_LEVELOFDETAIL_H
67

source code of qt3d/src/render/backend/levelofdetail_p.h