QGeometry Class

class Qt3DRender::QGeometry

Encapsulates geometry. More...

This class was introduced in Qt 5.7.

Properties

Public Functions

void addAttribute(Qt3DRender::QAttribute *attribute)
QVector<QAttribute *> attributes() const
QAttribute *boundingVolumePositionAttribute() const
QVector3D maxExtent() const
QVector3D minExtent() const
void removeAttribute(Qt3DRender::QAttribute *attribute)

Public Slots

void setBoundingVolumePositionAttribute(QAttribute *boundingVolumePositionAttribute)

Signals

void boundingVolumePositionAttributeChanged(QAttribute *boundingVolumePositionAttribute)
void maxExtentChanged(const QVector3D &maxExtent)
void minExtentChanged(const QVector3D &minExtent)

Detailed Description

A Qt3DRender::QGeometry class is used to group a list of Qt3DRender::QAttribute objects together to form a geometric shape Qt3D is able to render using Qt3DRender::QGeometryRenderer. Special attribute can be set in order to calculate bounding volume of the shape.

Property Documentation

boundingVolumePositionAttribute : Qt3DRender::QAttribute*

Holds the attribute used to compute the bounding volume. The bounding volume is used internally for picking and view frustum culling.

If unspecified, the system will look for the attribute using the name returned by QAttribute::defaultPositionAttributeName.

Access functions:

QAttribute *boundingVolumePositionAttribute() const
void setBoundingVolumePositionAttribute(QAttribute *boundingVolumePositionAttribute)

Notifier signal:

void boundingVolumePositionAttributeChanged(QAttribute *boundingVolumePositionAttribute)

See also Qt3DRender::QAttribute.

maxExtent : const QVector3D

Holds the vertex with the highest x, y, z position values.

Access functions:

QVector3D maxExtent() const

Notifier signal:

void maxExtentChanged(const QVector3D &maxExtent)

minExtent : const QVector3D

Holds the vertex with the lowest x, y, z position values.

Access functions:

QVector3D minExtent() const

Notifier signal:

void minExtentChanged(const QVector3D &minExtent)

Member Function Documentation

void QGeometry::addAttribute(Qt3DRender::QAttribute *attribute)

Adds an attribute to this geometry.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

QVector<QAttribute *> QGeometry::attributes() const

Returns the list of attributes in this geometry.

void QGeometry::removeAttribute(Qt3DRender::QAttribute *attribute)

Removes the given attribute from this geometry.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.