1 | // Copyright (C) 2015 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_QSTENCILOPERATIONARGUMENTS_H |
5 | #define QT3DRENDER_QSTENCILOPERATIONARGUMENTS_H |
6 | |
7 | #include <QtCore/QObject> |
8 | #include <Qt3DRender/qt3drender_global.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | namespace Qt3DRender { |
13 | |
14 | class QStencilOperationPrivate; |
15 | class QStencilOperationArgumentsPrivate; |
16 | |
17 | class Q_3DRENDERSHARED_EXPORT QStencilOperationArguments : public QObject |
18 | { |
19 | Q_OBJECT |
20 | Q_PROPERTY(FaceMode faceMode READ faceMode NOTIFY faceModeChanged) |
21 | Q_PROPERTY(Operation stencilTestFailureOperation READ stencilTestFailureOperation WRITE setStencilTestFailureOperation NOTIFY stencilTestFailureOperationChanged) |
22 | Q_PROPERTY(Operation depthTestFailureOperation READ depthTestFailureOperation WRITE setDepthTestFailureOperation NOTIFY depthTestFailureOperationChanged) |
23 | Q_PROPERTY(Operation allTestsPassOperation READ allTestsPassOperation WRITE setAllTestsPassOperation NOTIFY allTestsPassOperationChanged) |
24 | |
25 | public: |
26 | enum FaceMode |
27 | { |
28 | Front = 0x0404, |
29 | Back = 0x0405, |
30 | FrontAndBack = 0x0408 |
31 | }; |
32 | Q_ENUM(FaceMode) // LCOV_EXCL_LINE |
33 | |
34 | enum Operation |
35 | { |
36 | Zero = 0, |
37 | Keep = 0x1E00, |
38 | Replace = 0x1E01, |
39 | Increment = 0x1E02, |
40 | Decrement = 0x1E03, |
41 | IncrementWrap = 0x8507, |
42 | DecrementWrap = 0x8508, |
43 | Invert = 0x150A |
44 | }; |
45 | Q_ENUM(Operation) // LCOV_EXCL_LINE |
46 | |
47 | ~QStencilOperationArguments(); |
48 | |
49 | FaceMode faceMode() const; |
50 | |
51 | Operation stencilTestFailureOperation() const; |
52 | Operation depthTestFailureOperation() const; |
53 | Operation allTestsPassOperation() const; |
54 | |
55 | public Q_SLOTS: |
56 | void setStencilTestFailureOperation(Operation operation); |
57 | void setDepthTestFailureOperation(Operation operation); |
58 | void setAllTestsPassOperation(Operation operation); |
59 | |
60 | Q_SIGNALS: |
61 | void stencilTestFailureOperationChanged(Operation stencilFail); |
62 | void depthTestFailureOperationChanged(Operation depthFail); |
63 | void allTestsPassOperationChanged(Operation stencilDepthPass); |
64 | void faceModeChanged(FaceMode faceMode); |
65 | |
66 | private: |
67 | explicit QStencilOperationArguments(FaceMode mode, QObject *parent = nullptr); |
68 | Q_DECLARE_PRIVATE(QStencilOperationArguments) |
69 | |
70 | friend class QStencilOperationPrivate; |
71 | }; |
72 | |
73 | } // namespace Qt3DRender |
74 | |
75 | QT_END_NAMESPACE |
76 | |
77 | #endif // QT3DRENDER_QSTENCILOPERATIONARGUMENTS_H |
78 | |