summaryrefslogtreecommitdiffstats
path: root/src/render/renderstates/qfrontface.cpp
blob: 22165ea0901b50f052940a3676d2c73c71f609d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "qfrontface.h"
#include "qfrontface_p.h"

QT_BEGIN_NAMESPACE

namespace Qt3DRender {

/*!
    \class Qt3DRender::QFrontFace
    \brief The QFrontFace class defines front and back facing polygons.
    \since 5.7
    \ingroup renderstates
    \inmodule Qt3DRender

    A Qt3DRender::QFrontFace sets the winding direction of the front facing polygons.

    \sa QCullFace
 */

/*!
    \qmltype FrontFace
    \brief The FrontFace type defines front and back facing polygons.
    \since 5.7
    \ingroup renderstates
    \inqmlmodule Qt3D.Render
    \inherits RenderState
    \instantiates Qt3DRender::QFrontFace

    A FrontFace sets the winding direction of the front facing polygons.

    \sa CullFace
 */

/*!
    \enum QFrontFace::WindingDirection

    This enumeration specifies the winding direction values.
    \value ClockWise Clockwise polygons are front facing.
    \value CounterClockWise Counter clockwise polygons are front facing.
*/

/*!
    \qmlproperty enumeration FrontFace::direction
    Holds the winding direction of the front facing polygons. Default is FrontFace.Clockwise.
*/

/*!
    \property QFrontFace::direction
    Holds the winding direction of the front facing polygons. Default is Clockwise.
*/

/*!
    The constructor creates a new QFrontFace::QFrontFace instance with the
    specified \a parent
 */
QFrontFace::QFrontFace(QNode *parent)
    : QRenderState(*new QFrontFacePrivate, parent)
{
}

/*! \internal */
QFrontFace::~QFrontFace()
{
}

QFrontFace::WindingDirection QFrontFace::direction() const
{
    Q_D(const QFrontFace);
    return d->m_direction;
}

void QFrontFace::setDirection(QFrontFace::WindingDirection direction)
{
    Q_D(QFrontFace);
    if (d->m_direction != direction) {
        d->m_direction = direction;
        emit directionChanged(direction);
    }
}

} // namespace Qt3DRender

QT_END_NAMESPACE

#include "moc_qfrontface.cpp"