QCullFace Class

class Qt3DRender::QCullFace

The QCullFace class specifies whether front or back face culling is enabled. More...

Header: #include <QCullFace>
qmake: QT += 3drender
Since: Qt 5.7
Instantiated By: CullFace
Inherits: Qt3DRender::QRenderState

This class was introduced in Qt 5.7.

Public Types

enum CullingMode { NoCulling, Front, Back, FrontAndBack }

Properties

  • mode : CullingMode

Public Functions

QCullFace(Qt3DCore::QNode *parent = nullptr)
Qt3DRender::QCullFace::CullingMode mode() const

Public Slots

void setMode(Qt3DRender::QCullFace::CullingMode mode)

Signals

void modeChanged(Qt3DRender::QCullFace::CullingMode mode)

Detailed Description

QCullFace sets whether the front or back facets are culled. Facets include triangles, quadrilaterals, polygons and rectangles.

It can be added by calling the addRenderState() method on a QRenderPass:

 // using namespace Qt3DRender;

 QRenderPass *renderPass = new QRenderPass();

 // Create a front face culling render state
 QCullFace *cullFront = new QCullFace();
 cullFront->setMode(QCullFace::Front);

 // Add the render state to the render pass
 renderPass->addRenderState(cullFront);

Or by calling the addRenderState() method on a QRenderStateSet:

 // using namespace Qt3DRender;

 QRenderStateSet *renderStateSet = new QRenderStateSet();

 // Create a front face culling render state
 QCullFace *cullFront = new QCullFace();
 cullFront->setMode(QCullFace::Front);

 // Add the render state to the render pass
 renderStateSet->addRenderState(cullFront);

See also QFrontFace.

Member Type Documentation

enum QCullFace::CullingMode

This enumeration specifies values for the culling mode.

ConstantValueDescription
Qt3DRender::QCullFace::NoCulling0x0Culling is disabled
Qt3DRender::QCullFace::Front0x0404Culling is enabled for front facing polygons
Qt3DRender::QCullFace::Back0x0405Culling is enabled for back facing polygons
Qt3DRender::QCullFace::FrontAndBack0x0408Culling is enabled for all polygons, points and lines are drawn

Property Documentation

mode : CullingMode

Holds the culling mode used by QCullFace. Default is set to QCullFace.Back.

Access functions:

Qt3DRender::QCullFace::CullingMode mode() const
void setMode(Qt3DRender::QCullFace::CullingMode mode)

Notifier signal:

void modeChanged(Qt3DRender::QCullFace::CullingMode mode)

Member Function Documentation

QCullFace::QCullFace(Qt3DCore::QNode *parent = nullptr)

Constructs a new QCullFace::QCullFace instance with parent as parent.