1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include "qfrontface.h"
6#include "qfrontface_p.h"
7
8QT_BEGIN_NAMESPACE
9
10namespace Qt3DRender {
11
12/*!
13 \class Qt3DRender::QFrontFace
14 \brief The QFrontFace class defines front and back facing polygons.
15 \since 5.7
16 \ingroup renderstates
17 \inmodule Qt3DRender
18
19 A Qt3DRender::QFrontFace sets the winding direction of the front facing polygons.
20
21 \sa QCullFace
22 */
23
24/*!
25 \qmltype FrontFace
26 \brief The FrontFace type defines front and back facing polygons.
27 \since 5.7
28 \ingroup renderstates
29 \inqmlmodule Qt3D.Render
30 \inherits RenderState
31 \instantiates Qt3DRender::QFrontFace
32
33 A FrontFace sets the winding direction of the front facing polygons.
34
35 \sa CullFace
36 */
37
38/*!
39 \enum QFrontFace::WindingDirection
40
41 This enumeration specifies the winding direction values.
42 \value ClockWise Clockwise polygons are front facing.
43 \value CounterClockWise Counter clockwise polygons are front facing.
44*/
45
46/*!
47 \qmlproperty enumeration FrontFace::direction
48 Holds the winding direction of the front facing polygons. Default is FrontFace.Clockwise.
49*/
50
51/*!
52 \property QFrontFace::direction
53 Holds the winding direction of the front facing polygons. Default is Clockwise.
54*/
55
56/*!
57 The constructor creates a new QFrontFace::QFrontFace instance with the
58 specified \a parent
59 */
60QFrontFace::QFrontFace(QNode *parent)
61 : QRenderState(*new QFrontFacePrivate, parent)
62{
63}
64
65/*! \internal */
66QFrontFace::~QFrontFace()
67{
68}
69
70QFrontFace::WindingDirection QFrontFace::direction() const
71{
72 Q_D(const QFrontFace);
73 return d->m_direction;
74}
75
76void QFrontFace::setDirection(QFrontFace::WindingDirection direction)
77{
78 Q_D(QFrontFace);
79 if (d->m_direction != direction) {
80 d->m_direction = direction;
81 emit directionChanged(direction);
82 }
83}
84
85} // namespace Qt3DRender
86
87QT_END_NAMESPACE
88
89#include "moc_qfrontface.cpp"
90

source code of qt3d/src/render/renderstates/qfrontface.cpp