Scene3D QML Type

Scene3D 类型提供了可视化三维场景的描述。更多

Import Statement: import QtGraphs
In C++: Q3DScene

属性

信号

详细说明

三维场景包含一个活动相机和一个活动光源。可视化数据假定位于固定位置。

三维场景还会跟踪进行图形渲染的视口、主三维图形视图所在的视口中的主子视口以及数据的二维切片视图所在的辅助子视口。

此外,场景中还有用于跟踪辅助 2D 切片视图当前是否处于活动状态的标记。

注意: 并非所有图形都支持辅助二维切片视图。

属性文档

devicePixelRatio : real

将输入坐标映射到像素坐标时使用的当前设备像素比例。


graphPositionQuery : point

用户输入的坐标,场景应将其作为图形位置查询进行处理。如果此属性设置为invalidSelectionPoint 以外的值,则图形会尝试将图形位置与主视口内的给定点相匹配。渲染结束后,该属性将返回默认状态invalidSelectionPoint 。下一次渲染结束后,可从GraphsItem3D::queriedGraphPosition 属性中读取查询到的图形位置。

没有一个正确的三维坐标与特定的屏幕位置相匹配,因此为了保持一致,查询总是针对图形周围的一个不可见方框的内侧进行。

注意: 条形图只允许在图形底层进行图形位置查询。

另请参阅 GraphsItem3D::queriedGraphPosition


invalidSelectionPoint : point [read-only]

提供无效选择点的常量属性。


primarySubViewport : rect

图形主视图所在视口中的当前子视口矩形。

如果主次视口未明确设置,则它将是视口的五分之一。

注意: 设置 primarySubViewport 大于或小于视口时,视口大小也会相应调整。


secondarySubViewport : rect

辅助视口用于在某些图形中绘制二维切片视图。如果没有显式设置,它将等于视口的大小。

注意: 如果辅助子视口大于视口或位于视口之外,则会相应调整视口大小。


secondarySubviewOnTop : bool

定义是在顶部绘制二维切片视图还是三维视图。


selectionQueryPosition : point

用户输入的坐标,场景应将其作为选区处理。如果该属性设置为invalidSelectionPoint 以外的值,则图形会尝试在主视口内的给定点选择一个数据项。渲染结束后,该属性将返回默认状态invalidSelectionPoint


slicingActive : bool

定义二维切片视图当前是否处于活动状态。如果true ,Graphs3D::selectionMode 必须将Graphs3D.SelectionRowGraphs3D.SelectionColumn 设置为有效选择。

注意: 并非所有图形都支持二维切片视图。


信号文档

devicePixelRatioChanged(qreal pixelRatio)

devicePixelRatio 变为pixelRatio 时,将发出此信号。

注: 相应的处理程序是onDevicePixelRatioChanged


graphPositionQueryChanged(point position)

graphPositionQuery 更改为position 时,会发出此信号。

注: 相应的处理程序是onGraphPositionQueryChanged


primarySubViewportChanged(rect subViewport)

primarySubViewport 变更为subViewport 时,发出该信号。

注: 相应的处理程序是onPrimarySubViewportChanged


secondarySubViewportChanged(rect subViewport)

secondarySubViewport 变更为subViewport 时,发出此信号。

注: 相应的处理程序是onSecondarySubViewportChanged


secondarySubviewOnTopChanged(bool isSecondaryOnTop)

secondarySubviewOnTop 变更为isSecondaryOnTop 时,发出此信号。

注: 相应的处理程序是onSecondarySubviewOnTopChanged


selectionQueryPositionChanged(point position)

selectionQueryPosition 变更为position 时,发出此信号。

注: 相应的处理程序是onSelectionQueryPositionChanged


slicingActiveChanged(bool isSlicingActive)

slicingActive 变更为isSlicingActive 时,发出此信号。

注: 相应的处理程序是onSlicingActiveChanged


viewportChanged(rect viewport)

当视口更改为viewport 时,发出此信号。

注: 相应的处理程序是onViewportChanged


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