QGeometry Class

class Qt3DCore::QGeometry

Encapsulates geometry. More...

Header: #include <QGeometry>
CMake: find_package(Qt6 COMPONENTS 3dcore REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::3dcore)
qmake: QT += 3dcore
Since: Qt 5.7
Instantiated By: Geometry
Inherits: Qt3DCore::QNode
Inherited By:

Qt3DExtras::QConeGeometry, Qt3DExtras::QCuboidGeometry, Qt3DExtras::QCylinderGeometry, Qt3DExtras::QExtrudedTextGeometry, Qt3DExtras::QPlaneGeometry, Qt3DExtras::QSphereGeometry, and Qt3DExtras::QTorusGeometry

Properties

Public Functions

QGeometry(Qt3DCore::QNode *parent = nullptr)
void addAttribute(Qt3DCore::QAttribute *attribute)
QList<Qt3DCore::QAttribute *> attributes() const
Qt3DCore::QAttribute *boundingVolumePositionAttribute() const
QVector3D maxExtent() const
QVector3D minExtent() const
void removeAttribute(Qt3DCore::QAttribute *attribute)

Public Slots

void setBoundingVolumePositionAttribute(Qt3DCore::QAttribute *boundingVolumePositionAttribute)

Signals

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

Detailed Description

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

Property Documentation

boundingVolumePositionAttribute : Qt3DCore::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:

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

Notifier signal:

void boundingVolumePositionAttributeChanged(Qt3DCore::QAttribute *boundingVolumePositionAttribute)

See also Qt3DCore::QAttribute.

[read-only] 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)

[read-only] 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

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

Constructs a new QGeometry with parent.

[invokable] void QGeometry::addAttribute(Qt3DCore::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.

QList<Qt3DCore::QAttribute *> QGeometry::attributes() const

Returns the list of attributes in this geometry.

[invokable] void QGeometry::removeAttribute(Qt3DCore::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.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.