Defines an attribute and how data should be read from a QBuffer . 更多...
头: | #include <Qt3DCore/QAttribute> |
CMake: |
find_package(Qt6 COMPONENTS 3dcore REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::3dcore) |
qmake: | QT += 3dcore |
实例化: | Attribute |
继承: | Qt3DCore::QNode |
enum | AttributeType { VertexAttribute, IndexAttribute, DrawIndirectAttribute } |
enum | VertexBaseType { Byte, UnsignedByte, Short, UnsignedShort, Int, …, Double } |
|
|
QAttribute (Qt3DCore::QBuffer * buf , const QString & name , Qt3DCore::QAttribute::VertexBaseType type , uint dataSize , uint count , uint offset = 0, uint stride = 0, Qt3DCore::QNode * parent = nullptr) | |
QAttribute (Qt3DCore::QBuffer * buf , Qt3DCore::QAttribute::VertexBaseType type , uint dataSize , uint count , uint offset = 0, uint stride = 0, Qt3DCore::QNode * parent = nullptr) | |
QAttribute (Qt3DCore::QNode * parent = nullptr) | |
Qt3DCore::QAttribute::AttributeType | attributeType () const |
Qt3DCore::QBuffer * | buffer () const |
uint | byteOffset () const |
uint | byteStride () const |
uint | count () const |
uint | divisor () const |
QString | name () const |
Qt3DCore::QAttribute::VertexBaseType | vertexBaseType () const |
uint | vertexSize () const |
void | setAttributeType (Qt3DCore::QAttribute::AttributeType attributeType ) |
void | setBuffer (Qt3DCore::QBuffer * buffer ) |
void | setByteOffset (uint byteOffset ) |
void | setByteStride (uint byteStride ) |
void | setCount (uint count ) |
void | setDivisor (uint divisor ) |
void | setName (const QString & name ) |
void | setVertexBaseType (Qt3DCore::QAttribute::VertexBaseType type ) |
void | setVertexSize (uint size ) |
void | attributeTypeChanged (Qt3DCore::QAttribute::AttributeType attributeType ) |
void | bufferChanged (Qt3DCore::QBuffer * buffer ) |
void | byteOffsetChanged (uint byteOffset ) |
void | byteStrideChanged (uint byteStride ) |
void | countChanged (uint count ) |
void | dataSizeChanged (uint vertexSize ) |
void | dataTypeChanged (Qt3DCore::QAttribute::VertexBaseType vertexBaseType ) |
void | divisorChanged (uint divisor ) |
void | nameChanged (const QString & name ) |
void | vertexBaseTypeChanged (Qt3DCore::QAttribute::VertexBaseType vertexBaseType ) |
void | vertexSizeChanged (uint vertexSize ) |
QString | defaultColorAttributeName () |
QString | defaultJointIndicesAttributeName () |
QString | defaultJointWeightsAttributeName () |
QString | defaultNormalAttributeName () |
QString | defaultPositionAttributeName () |
QString | defaultTangentAttributeName () |
QString | defaultTextureCoordinate1AttributeName () |
QString | defaultTextureCoordinate2AttributeName () |
QString | defaultTextureCoordinateAttributeName () |
QBufferPtr |
There are 3 types of attributes.
注意: when an attribute is of type DrawIndirectAttribute , only count, stride and offset are relevant.
When providing your own attributes, it may make sense to name your attribute using helpers such as QAttribute::defaultPositionAttributeName () as that will ensure your geometry will be compatible with picking and the various materials provided in the Qt3DExtras 模块。
另请参阅 QBuffer .
The type of the attribute.
常量 | 值 |
---|---|
Qt3DCore::QAttribute::VertexAttribute
|
0
|
Qt3DCore::QAttribute::IndexAttribute
|
1
|
Qt3DCore::QAttribute::DrawIndirectAttribute
|
2
|
The type of the data.
常量 | 值 |
---|---|
Qt3DCore::QAttribute::Byte
|
0
|
Qt3DCore::QAttribute::UnsignedByte
|
1
|
Qt3DCore::QAttribute::Short
|
2
|
Qt3DCore::QAttribute::UnsignedShort
|
3
|
Qt3DCore::QAttribute::Int
|
4
|
Qt3DCore::QAttribute::UnsignedInt
|
5
|
Qt3DCore::QAttribute::HalfFloat
|
6
|
Qt3DCore::QAttribute::Float
|
7
|
Qt3DCore::QAttribute::Double
|
8
|
Holds the attribute type.
访问函数:
Qt3DCore::QAttribute::AttributeType | attributeType () const |
void | setAttributeType (Qt3DCore::QAttribute::AttributeType attributeType ) |
通知程序信号:
void | attributeTypeChanged (Qt3DCore::QAttribute::AttributeType attributeType ) |
Holds the buffer.
访问函数:
Qt3DCore::QBuffer * | buffer () const |
void | setBuffer (Qt3DCore::QBuffer * buffer ) |
通知程序信号:
void | bufferChanged (Qt3DCore::QBuffer * buffer ) |
Holds the byte offset.
访问函数:
uint | byteOffset () const |
void | setByteOffset (uint byteOffset ) |
通知程序信号:
void | byteOffsetChanged (uint byteOffset ) |
Holds the byte stride.
访问函数:
uint | byteStride () const |
void | setByteStride (uint byteStride ) |
通知程序信号:
void | byteStrideChanged (uint byteStride ) |
Holds the count.
访问函数:
uint | count () const |
void | setCount (uint count ) |
通知程序信号:
void | countChanged (uint count ) |
Holds the divisor.
访问函数:
uint | divisor () const |
void | setDivisor (uint divisor ) |
通知程序信号:
void | divisorChanged (uint divisor ) |
Holds the name.
访问函数:
QString | name () const |
void | setName (const QString & name ) |
通知程序信号:
void | nameChanged (const QString & name ) |
Holds the data type.
访问函数:
Qt3DCore::QAttribute::VertexBaseType | vertexBaseType () const |
void | setVertexBaseType (Qt3DCore::QAttribute::VertexBaseType type ) |
通知程序信号:
void | vertexBaseTypeChanged (Qt3DCore::QAttribute::VertexBaseType vertexBaseType ) |
Holds the data size, it can only be 1 to 4 units (scalars and vectors), 9 units (3x3 matrices) or 16 units (4x4 matrices).
访问函数:
uint | vertexSize () const |
void | setVertexSize (uint size ) |
通知程序信号:
void | vertexSizeChanged (uint vertexSize ) |
Constructs a new QAttribute named name from buf of type , dataSize , count , offset ,和 stride with parent .
Constructs a new QAttribute from buf of type , dataSize , count , offset ,和 stride with parent .
Constructs a new QAttribute with parent .
[signal]
void
QAttribute::
dataSizeChanged
(
uint
vertexSize
)
The signal is emitted with vertexSize when the dataSize changes.
[signal]
void
QAttribute::
dataTypeChanged
(
Qt3DCore::QAttribute::VertexBaseType
vertexBaseType
)
The signal is emitted with vertexBaseType when the dataType changed.
[static invokable]
QString
QAttribute::
defaultColorAttributeName
()
QAttribute::defaultColorAttributeName Returns the name of the default color attribute
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
注意: Getter function for property defaultColorAttributeName.
[static]
QString
QAttribute::
defaultJointIndicesAttributeName
()
QAttribute::defaultJointIndicesAttributeName Returns the name of the default joint indices attribute
注意: Getter function for property defaultJointIndicesAttributeName.
[static]
QString
QAttribute::
defaultJointWeightsAttributeName
()
QAttribute::defaultJointIndicesAttributeName Returns the name of the default joint weights attribute
注意: Getter function for property defaultJointWeightsAttributeName.
[static invokable]
QString
QAttribute::
defaultNormalAttributeName
()
QAttribute::defaultNormalAttributeName Returns the name of the default normal attribute
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
注意: Getter function for property defaultNormalAttributeName.
[static invokable]
QString
QAttribute::
defaultPositionAttributeName
()
QAttribute::defaultPositionAttributeName Returns the name of the default position attribute
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
注意: Getter function for property defaultPositionAttributeName.
[static invokable]
QString
QAttribute::
defaultTangentAttributeName
()
QAttribute::defaultTangentAttributeName Returns the name of the default tangent attribute
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
注意: Getter function for property defaultTangentAttributeName.
[static]
QString
QAttribute::
defaultTextureCoordinate1AttributeName
()
QAttribute::defaultTextureCoordinate1AttributeName Returns the name of the default attribute for the second layer of texture coordinates
注意: Getter function for property defaultTextureCoordinate1AttributeName.
[static]
QString
QAttribute::
defaultTextureCoordinate2AttributeName
()
QAttribute::defaultTextureCoordinate2AttributeName Returns the name of the default attribute for the third layer of texture coordinates
注意: Getter function for property defaultTextureCoordinate2AttributeName.
[static invokable]
QString
QAttribute::
defaultTextureCoordinateAttributeName
()
QAttribute::defaultTextureCoordinateAttributeName Returns the name of the default texture coordinate attribute
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
注意: Getter function for property defaultTextureCoordinateAttributeName.