| 1 | // Copyright (C) 2015 Paul Lemire |
| 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_QSTENCILTESTARGUMENTS_H |
| 5 | #define QT3DRENDER_QSTENCILTESTARGUMENTS_H |
| 6 | |
| 7 | #include <QtCore/QObject> |
| 8 | #include <Qt3DRender/qt3drender_global.h> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | namespace Qt3DRender { |
| 13 | |
| 14 | class QStencilTestPrivate; |
| 15 | class QStencilTestArgumentsPrivate; |
| 16 | |
| 17 | class Q_3DRENDERSHARED_EXPORT QStencilTestArguments : public QObject |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | Q_PROPERTY(StencilFaceMode faceMode READ faceMode NOTIFY faceModeChanged) |
| 21 | Q_PROPERTY(uint comparisonMask READ comparisonMask WRITE setComparisonMask NOTIFY comparisonMaskChanged) |
| 22 | Q_PROPERTY(int referenceValue READ referenceValue WRITE setReferenceValue NOTIFY referenceValueChanged) |
| 23 | Q_PROPERTY(StencilFunction stencilFunction READ stencilFunction WRITE setStencilFunction NOTIFY stencilFunctionChanged) |
| 24 | |
| 25 | public: |
| 26 | enum StencilFaceMode |
| 27 | { |
| 28 | Front = 0x0404, |
| 29 | Back = 0x0405, |
| 30 | FrontAndBack = 0x0408 |
| 31 | }; |
| 32 | Q_ENUM(StencilFaceMode) // LCOV_EXCL_LINE |
| 33 | |
| 34 | enum StencilFunction |
| 35 | { |
| 36 | Never = 0x0200, |
| 37 | Always = 0x0207, |
| 38 | Less = 0x0201, |
| 39 | LessOrEqual = 0x0203, |
| 40 | Equal = 0x0202, |
| 41 | GreaterOrEqual = 0x0206, |
| 42 | Greater = 0x0204, |
| 43 | NotEqual = 0x0205 |
| 44 | }; |
| 45 | Q_ENUM(StencilFunction) // LCOV_EXCL_LINE |
| 46 | |
| 47 | ~QStencilTestArguments(); |
| 48 | |
| 49 | uint comparisonMask() const; |
| 50 | int referenceValue() const; |
| 51 | StencilFunction stencilFunction() const; |
| 52 | |
| 53 | StencilFaceMode faceMode() const; |
| 54 | |
| 55 | public Q_SLOTS: |
| 56 | void setComparisonMask(uint comparisonMask); |
| 57 | void setReferenceValue(int referenceValue); |
| 58 | void setStencilFunction(StencilFunction stencilFunction); |
| 59 | |
| 60 | Q_SIGNALS: |
| 61 | void comparisonMaskChanged(uint comparisonMask); |
| 62 | void stencilFunctionChanged(StencilFunction stencilFunction); |
| 63 | void referenceValueChanged(int referenceValue); |
| 64 | void faceModeChanged(StencilFaceMode faceMode); |
| 65 | |
| 66 | private: |
| 67 | explicit QStencilTestArguments(StencilFaceMode face, QObject *parent = nullptr); |
| 68 | |
| 69 | friend class QStencilTestPrivate; |
| 70 | |
| 71 | Q_DECLARE_PRIVATE(QStencilTestArguments) |
| 72 | }; |
| 73 | |
| 74 | } // namespace Qt3DRender |
| 75 | |
| 76 | QT_END_NAMESPACE |
| 77 | |
| 78 | #endif // QT3DRENDER_QSTENCILTESTARGUMENTS_H |
| 79 | |