QLayerFilter Class

class Qt3DRender ::QLayerFilter

Controls layers drawn in a frame graph branch. 更多...

头: #include <QLayerFilter>
CMake: find_package(Qt6 COMPONENTS 3drender REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
Since: Qt 5.5
实例化: LayerFilter
继承: Qt3DRender::QFrameGraphNode

公共类型

enum FilterMode { AcceptAnyMatchingLayers, AcceptAllMatchingLayers, DiscardAnyMatchingLayers, DiscardAllMatchingLayers }

特性

公共函数

  QLayerFilter (Qt3DCore::QNode * parent = nullptr)
void addLayer (Qt3DRender::QLayer * layer )
Qt3DRender::QLayerFilter::FilterMode filterMode () const
QList<Qt3DRender::QLayer *> layers () const
void removeLayer (Qt3DRender::QLayer * layer )
void setFilterMode (Qt3DRender::QLayerFilter::FilterMode filterMode )

信号

void filterModeChanged (Qt3DRender::QLayerFilter::FilterMode filterMode )

详细描述

A Qt3DRender::QLayerFilter can be used to instruct the renderer as to which layer(s) to draw in that branch of the frame graph. QLayerFilter selects which entities to draw based on the QLayer instance(s) added to the QLayerFilter and as components to Qt3DCore::QEntity .

QLayerFilter can be configured to select or discard entities with a specific QLayer 从属 filterMode property. By default, entities referencing one of the QLayer objects that are also being referenced by the QLayerFilter are selected ( AcceptAnyMatchingLayers ).

Within the FrameGraph tree, multiple QLayerFilter nodes can be nested within a branch going from root to a leaf. In that case the filtering will first operate on all entities of the scene using the filtering method specified by the first declared QLayerFilter . Then the filtered subset of entities will be filtered again based on the filtering method set on the second QLayerFilter declared. This is then repeated until all QLayerFilter nodes of the branch have been consumed.

成员类型文档编制

enum QLayerFilter:: FilterMode

Specifies the rules for selecting entities to draw.

常量 描述
Qt3DRender::QLayerFilter::AcceptAnyMatchingLayers 0 Accept entities that reference one or more QLayer objects added to this QLayerFilter . This is the default
Qt3DRender::QLayerFilter::AcceptAllMatchingLayers 1 Accept entities that reference all the QLayer objects added to this QLayerFilter
Qt3DRender::QLayerFilter::DiscardAnyMatchingLayers 2 Discard entities that reference one or more QLayer objects added to this QLayerFilter
Qt3DRender::QLayerFilter::DiscardAllMatchingLayers 3 Discard entities that reference all QLayer objects added to this QLayerFilter

特性文档编制

filterMode : FilterMode

Holds the filter mode specifying the entities to select for drawing.

The default value is AcceptMatchingLayers.

访问函数:

Qt3DRender::QLayerFilter::FilterMode filterMode () const
void setFilterMode (Qt3DRender::QLayerFilter::FilterMode filterMode )

通知程序信号:

void filterModeChanged (Qt3DRender::QLayerFilter::FilterMode filterMode )

成员函数文档编制

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

The constructor creates an instance with the specified parent .

void QLayerFilter:: addLayer ( Qt3DRender::QLayer * layer )

添加 layer to the current list of layers

QList < Qt3DRender::QLayer *> QLayerFilter:: layers () const

Returns the current list of layers

void QLayerFilter:: removeLayer ( Qt3DRender::QLayer * layer )

移除 layer from the current list of layers