QSortPolicy Class

( Qt3DRender::QSortPolicy )

Provides storage for the sort types to be used. 更多...

頭: #include <QSortPolicy>
qmake: QT += 3drender
Since: Qt 5.7
實例化: SortPolicy
繼承: Qt3DRender::QFrameGraphNode

公共類型

enum SortType { StateChangeCost, BackToFront, Material, FrontToBack }

特性

公共函數

QSortPolicy (Qt3DCore::QNode * parent = nullptr)
QVector<Qt3DRender::QSortPolicy::SortType> sortTypes () const
QVector<int> sortTypesInt () const

公共槽

void setSortTypes (const QVector<Qt3DRender::QSortPolicy::SortType> & sortTypes )
void setSortTypes (const QVector<int> & sortTypesInt )

信號

void sortTypesChanged (const QVector<Qt3DRender::QSortPolicy::SortType> & sortTypes )
void sortTypesChanged (const QVector<int> & sortTypes )

靜態公共成員

const QMetaObject staticMetaObject

額外繼承成員

詳細描述

Provides storage for the sort types to be used.

A Qt3DRender::QSortPolicy class stores the sorting type used by the FrameGraph. The sort types determine how drawable entities are sorted before drawing to determine the drawing order. When QSortPolicy is present in the FrameGraph, the sorting mechanism is determined by the sortTypes list. Multiple sort types can be used simultaneously. If QSortPolicy is not present in the FrameGraph, entities are drawn in the order they appear in the entity hierarchy.

成員類型文檔編製

enum QSortPolicy:: SortType

This enum type describes the available sort types.

常量 描述
Qt3DRender::QSortPolicy::StateChangeCost (1 << 0) sort the objects so as to minimize the cost of changing from the currently rendered state
Qt3DRender::QSortPolicy::BackToFront (1 << 1) sort the objects from back to front based on inverted z order. More accurately, the sorting key is the z component of the projection of the camera-to-object-center vector onto the camera's view vector.
Qt3DRender::QSortPolicy::Material (1 << 2) sort the objects based on their material value
Qt3DRender::QSortPolicy::FrontToBack (1 << 3) sort the objects from front to back. The opposite of BackToFront.

特性文檔編製

sortTypes : QVector < int >

Specifies the sorting types to be used.

訪問函數:

QVector<int> sortTypesInt () const
void setSortTypes (const QVector<Qt3DRender::QSortPolicy::SortType> & sortTypes )
void setSortTypes (const QVector<int> & sortTypesInt )

通知程序信號:

void sortTypesChanged (const QVector<Qt3DRender::QSortPolicy::SortType> & sortTypes )
void sortTypesChanged (const QVector<int> & sortTypes )

成員函數文檔編製

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

構造 QSortPolicy with given parent .

QVector < Qt3DRender::QSortPolicy::SortType > QSortPolicy:: sortTypes () const

Returns the current sort types in use

另請參閱 setSortTypes ().