Qt3DExtras::QCuboidGeometry Class

class Qt3DExtras::QCuboidGeometry

QCuboidGeometry 类允许在三维空间中创建一个长方体。更多

页首 #include <Qt3DExtras/QCuboidGeometry>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
在 QML 中: CuboidGeometry
继承: Qt3DCore::QGeometry
状态:已废弃

属性

公共功能

QCuboidGeometry(Qt3DCore::QNode *parent = nullptr)
Qt3DCore::QAttribute *indexAttribute() const
Qt3DCore::QAttribute *normalAttribute() const
Qt3DCore::QAttribute *positionAttribute() const
Qt3DCore::QAttribute *tangentAttribute() const
Qt3DCore::QAttribute *texCoordAttribute() const
void updateIndices()
void updateVertices()
float xExtent() const
QSize xyMeshResolution() const
QSize xzMeshResolution() const
float yExtent() const
QSize yzMeshResolution() const
float zExtent() const

公共插槽

void setXExtent(float xExtent)
void setXYMeshResolution(const QSize &resolution)
void setXZMeshResolution(const QSize &resolution)
void setYExtent(float yExtent)
void setYZMeshResolution(const QSize &resolution)
void setZExtent(float zExtent)

信号

void xExtentChanged(float xExtent)
void xyMeshResolutionChanged(const QSize &xyMeshResolution)
void xzMeshResolutionChanged(const QSize &xzMeshResolution)
void yExtentChanged(float yExtent)
void yzMeshResolutionChanged(const QSize &yzMeshResolution)
void zExtentChanged(float zExtent)

详细说明

QCuboidGeometry 类最常用于QCuboidMesh 内部,但也可用于自定义Qt3DRender::QGeometryRenderer 子类。

属性文档

[read-only] indexAttribute : Qt3DCore::QAttribute* const

保存几何体索引属性。

访问功能:

Qt3DCore::QAttribute *indexAttribute() const

[read-only] normalAttribute : Qt3DCore::QAttribute* const

保存几何法线属性。

访问功能:

Qt3DCore::QAttribute *normalAttribute() const

[read-only] positionAttribute : Qt3DCore::QAttribute* const

保存几何体位置属性。

访问功能:

Qt3DCore::QAttribute *positionAttribute() const

[read-only] tangentAttribute : Qt3DCore::QAttribute* const

保存几何体切线属性。

访问功能:

Qt3DCore::QAttribute *tangentAttribute() const

[read-only] texCoordAttribute : Qt3DCore::QAttribute* const

保存几何纹理坐标属性。

访问功能:

Qt3DCore::QAttribute *texCoordAttribute() const

xExtent : float

保存几何体的 x 范围。

访问功能:

float xExtent() const
void setXExtent(float xExtent)

通知信号:

void xExtentChanged(float xExtent)

xyMeshResolution : QSize

保留 x-y 分辨率。此属性的宽度和高度值指定了为网格的 x-Y 面生成的顶点数量。

访问功能

QSize xyMeshResolution() const
void setXYMeshResolution(const QSize &resolution)

通知信号:

void xyMeshResolutionChanged(const QSize &xyMeshResolution)

xzMeshResolution : QSize

表示 x-z 分辨率。此属性的宽度和高度值指定了为网格的 x-z 面生成的顶点数量。

访问功能:

QSize xzMeshResolution() const
void setXZMeshResolution(const QSize &resolution)

通知信号:

void xzMeshResolutionChanged(const QSize &xzMeshResolution)

yExtent : float

保存几何体的 Y 轴范围。

访问功能:

float yExtent() const
void setYExtent(float yExtent)

通知信号:

void yExtentChanged(float yExtent)

yzMeshResolution : QSize

表示 Y-Z 方向的分辨率。此属性的宽度和高度值指定了为网格的 y-z 面生成的顶点数量。

访问功能:

QSize yzMeshResolution() const
void setYZMeshResolution(const QSize &resolution)

通知信号:

void yzMeshResolutionChanged(const QSize &yzMeshResolution)

zExtent : float

保存几何体的 Z 轴范围。

访问功能:

float zExtent() const
void setZExtent(float zExtent)

通知信号:

void zExtentChanged(float zExtent)

成员函数 文档

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

parent 构建一个新的 QCuboidGeometry。

void QCuboidGeometry::updateIndices()

根据网格分辨率更新索引。

void QCuboidGeometry::updateVertices()

根据网格分辨率更新顶点。

© 2025 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.