IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QAttribute Class

Defines an attribute and how data should be read from a QBuffer.

This class was introduced in Qt 5.7.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QAttribute Class

  • Header: Qt3DCore/QAttribute

  • Since: Qt 5.7

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS 3dcore)

    target_link_libraries(mytarget PRIVATE Qt6::3dcore)

  • qmake: QT += 3dcore

  • Inherited By:

  • Instantiated By: qml-qt3d-core-attribute.xml

  • Inherits: Qt3DCore::QNode

Detailed Description

There are 3 types of attributes.

  • VertexAttribute: used to define data to be read on a per vertex basis

  • IndexAttribute: used to define vertex indices when indexed draw calls are to be used

  • DrawIndirectAttribute: used to specify the DrawIndirect buffer to be used when indirect draw calls are to be used

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 module.

See Also

See also QBuffer

Member Type Documentation

 

enum QAttribute::AttributeType

The type of the attribute.

Constant

Qt3DCore::QAttribute::VertexAttribute

0

Qt3DCore::QAttribute::IndexAttribute

1

Qt3DCore::QAttribute::DrawIndirectAttribute

2

enum QAttribute::VertexBaseType

The type of the data.

Constant

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

Property Documentation

 

attributeType : AttributeType

Holds the attribute type.

Access functions:

  • attributeType() const

  • void setAttributeType( attributeType)

Notifier signal:

  • void attributeTypeChanged( attributeType)

buffer : Qt3DCore::QBuffer*

Holds the buffer.

Access functions:

  • *buffer() const

  • void setBuffer( *buffer)

Notifier signal:

  • void bufferChanged( *buffer)

byteOffset : uint

Holds the byte offset.

Access functions:

  • uint byteOffset() const

  • void setByteOffset(uint byteOffset)

Notifier signal:

  • void byteOffsetChanged(uint byteOffset)

byteStride : uint

Holds the byte stride.

Access functions:

  • uint byteStride() const

  • void setByteStride(uint byteStride)

Notifier signal:

  • void byteStrideChanged(uint byteStride)

count : uint

Holds the count.

Access functions:

  • uint count() const

  • void setCount(uint count)

Notifier signal:

  • void countChanged(uint count)

divisor : uint

Holds the divisor.

Access functions:

  • uint divisor() const

  • void setDivisor(uint divisor)

Notifier signal:

  • void divisorChanged(uint divisor)

name : QString

Holds the name.

Access functions:

  • name() const

  • void setName(const &name)

Notifier signal:

  • void nameChanged(const &name)

vertexBaseType : VertexBaseType

Holds the data type.

Access functions:

  • vertexBaseType() const

  • void setVertexBaseType( type)

Notifier signal:

  • void vertexBaseTypeChanged( vertexBaseType)

vertexSize : uint

Holds the data size, it can only be 1 to 4 units (scalars and vectors), 9 units (3x3 matrices) or 16 units (4x4 matrices).

Access functions:

  • uint vertexSize() const

  • void setVertexSize(uint size)

Notifier signal:

  • void vertexSizeChanged(uint vertexSize)

Member Function Documentation

 

[explicit] QAttribute::QAttribute(Qt3DCore::QNode *parent = nullptr)

Constructs a new QAttribute with parent.

[explicit] QAttribute::QAttribute(Qt3DCore::QBuffer *buf, Qt3DCore::QAttribute::VertexBaseType type, uint dataSize, uint count, uint offset = 0, uint stride = 0, Qt3DCore::QNode *parent = nullptr)

Constructs a new QAttribute from buf of type, dataSize, count, offset, and stride with parent.

[explicit] QAttribute::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)

Constructs a new QAttribute named name from buf of type, dataSize, count, offset, and stride with parent.

void QAttribute::dataSizeChanged(uint vertexSize)

The signal is emitted with vertexSize when the dataSize changes.

void QAttribute::dataTypeChanged(Qt3DCore::QAttribute::VertexBaseType vertexBaseType)

The signal is emitted with vertexBaseType when the dataType changed.

[static] QString QAttribute::defaultColorAttributeName()

QAttribute::defaultColorAttributeName Returns the name of the default color attribute

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] QString QAttribute::defaultNormalAttributeName()

QAttribute::defaultNormalAttributeName Returns the name of the default normal attribute

Getter function for property defaultNormalAttributeName.

[static] QString QAttribute::defaultPositionAttributeName()

QAttribute::defaultPositionAttributeName Returns the name of the default position attribute

Getter function for property defaultPositionAttributeName.

[static] QString QAttribute::defaultTangentAttributeName()

QAttribute::defaultTangentAttributeName Returns the name of the default tangent attribute

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] QString QAttribute::defaultTextureCoordinateAttributeName()

QAttribute::defaultTextureCoordinateAttributeName Returns the name of the default texture coordinate attribute

Getter function for property defaultTextureCoordinateAttributeName.

Related Non-Members

 

QBufferPtr

 

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+