Qt3DExtras::QCuboidGeometry Class
class Qt3DExtras::QCuboidGeometryQCuboidGeometry 类可用于在三维空间中创建长方体。更多内容...
| 头文件: | #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()
根据网格分辨率更新顶点。
© 2026 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.