diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-08-07 16:25:35 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-08-14 15:18:48 +0200 |
commit | cb62de969e4fa469f3c3b293f76c894a11e7cb82 (patch) | |
tree | ed92456039edffa375bdd3c60aef66eb836ec877 /src/render/frontend/qstenciltest.h | |
parent | 97796e5f548a3f69ca7ce43ba50c6fadf7fff66a (diff) |
Added QStencilTest
Change-Id: Ib93c2aba1f25204c06c40463699ad7f4140f604b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qstenciltest.h')
-rw-r--r-- | src/render/frontend/qstenciltest.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/src/render/frontend/qstenciltest.h b/src/render/frontend/qstenciltest.h new file mode 100644 index 000000000..c52f700ba --- /dev/null +++ b/src/render/frontend/qstenciltest.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3D_QSTENCILTEST_H +#define QT3D_QSTENCILTEST_H + +#include <Qt3DRenderer/qdrawstate.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +class QStencilTestPrivate; + +class QT3DRENDERERSHARED_EXPORT QStencilTest : public QDrawState +{ + Q_OBJECT + Q_ENUMS(StencilFaceMode) + Q_ENUMS(StencilFunc) + Q_PROPERTY(uint mask READ mask WRITE setMask NOTIFY maskChanged) + Q_PROPERTY(StencilFaceMode faceMode READ faceMode WRITE setFaceMode NOTIFY faceModeChanged) + Q_PROPERTY(StencilFunc func READ func WRITE setFunc NOTIFY funcChanged) +public: + + enum StencilFaceMode + { + Front = 0, + Back, + FrontAndBack + }; + + enum StencilFunc + { + Never = 0, + Always, + Less, + LessOrEqual, + Equal, + GreaterOrEqual, + Greater, + NotEqual + }; + + explicit QStencilTest(QNode *parent = 0); + + void copy(const QNode *ref) Q_DECL_OVERRIDE; + + uint mask() const; + void setMask(uint mask); + + StencilFaceMode faceMode() const; + void setFaceMode(StencilFaceMode mode); + + StencilFunc func() const; + void setFunc(StencilFunc func); + +Q_SIGNALS: + void maskChanged(); + void faceModeChanged(); + void funcChanged(); + +private: + Q_DECLARE_PRIVATE(QStencilTest) + QNode *doClone(QNode *clonedParent) const Q_DECL_OVERRIDE; +}; + +} // Qt3D + +QT_END_NAMESPACE + + +#endif // QT3D_QSTENCILTEST_H |