1// Copyright (C) 2014 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_QSORTPOLICY_H
5#define QT3DRENDER_QSORTPOLICY_H
6
7#include <Qt3DRender/qframegraphnode.h>
8
9QT_BEGIN_NAMESPACE
10
11namespace Qt3DRender {
12
13class QSortPolicyPrivate;
14
15class Q_3DRENDERSHARED_EXPORT QSortPolicy : public QFrameGraphNode
16{
17 Q_OBJECT
18 Q_PROPERTY(QList<int> sortTypes READ sortTypesInt WRITE setSortTypes NOTIFY sortTypesChanged)
19public:
20 explicit QSortPolicy(Qt3DCore::QNode *parent = nullptr);
21 ~QSortPolicy();
22
23 enum SortType {
24 StateChangeCost = (1 << 0),
25 BackToFront = (1 << 1),
26 Material = (1 << 2),
27 FrontToBack = (1 << 3),
28 Texture = (1 << 4),
29 Uniform = (1 << 5)
30 };
31 Q_ENUM(SortType) // LCOV_EXCL_LINE
32
33 QList<SortType> sortTypes() const;
34 QList<int> sortTypesInt() const;
35
36public Q_SLOTS:
37 void setSortTypes(const QList<SortType> &sortTypes);
38 void setSortTypes(const QList<int> &sortTypesInt);
39
40Q_SIGNALS:
41 void sortTypesChanged(const QList<SortType> &sortTypes);
42 void sortTypesChanged(const QList<int> &sortTypes);
43
44protected:
45 explicit QSortPolicy(QSortPolicyPrivate &dd, Qt3DCore::QNode *parent = nullptr);
46
47private:
48 Q_DECLARE_PRIVATE(QSortPolicy)
49};
50
51} // namespace Qt3DRender
52
53QT_END_NAMESPACE
54
55#endif // QT3DRENDER_QSORTPOLICY_H
56

source code of qt3d/src/render/framegraph/qsortpolicy.h