QLayer Class

( Qt3DRender::QLayer )

The QLayer class provides a way of filtering which entities will be rendered. 更多...

头: #include <QLayer>
qmake: QT += 3drender
Since: Qt 5.5
实例化:
继承: Qt3DCore::QComponent

公共函数

QLayer (Qt3DCore::QNode * parent = nullptr)

保护函数

QLayer (QLayerPrivate & dd , Qt3DCore::QNode * parent = nullptr)

额外继承成员

详细描述

The QLayer class provides a way of filtering which entities will be rendered.

Qt3DRender::QLayer works in conjunction with the Qt3DRender::QLayerFilter in the FrameGraph.

Qt3DRender::QLayer doesn't define any new properties but is supposed to only be referenced.

 #include <Qt3DCore/QEntity>
 #include <Qt3DRender/QGeometryRenderer>
 #include <Qt3DRender/QLayer>
 #include <Qt3DRender/QLayerFilter>
 #include <Qt3DRender/QViewport>
// Scene
Qt3DCore::QEntity *rootEntity = new Qt3DCore::Qt3DCore::QEntity;
Qt3DCore::QEntity *renderableEntity = new Qt3DCore::Qt3DCore::QEntity(rootEntity);
Qt3DRender::QGeometryRenderer *geometryRenderer = new Qt3DCore::QGeometryRenderer(renderableEntity);
Qt3DRender::QLayer *layer1 = new Qt3DCore::QLayer(renderableEntity);
renderableEntity->addComponent(geometryRenderer);
renderableEntity->addComponent(layer1);
...
// FrameGraph
Qt3DRender::QViewport *viewport = new Qt3DRender::QViewport;
Qt3DRender::QLayerFilter *layerFilter = new Qt3DRender::QLayerFilter(viewport);
layerFilter->addLayer(layer1);
...
					

另请参阅 Qt3DRender::QLayerFilter .

成员函数文档编制

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

构造新的 QLayer 采用指定 parent .

[protected] QLayer:: QLayer ( QLayerPrivate & dd , Qt3DCore::QNode * parent = nullptr)

Copy constructor.