Custom3DItem QML Type

Adds a custom item to a graph. 更多...

import 語句: import QtGraphs
在 C++: QCustom3DItem
繼承者:

Custom3DLabel and Custom3DVolume

特性

信號

方法

詳細描述

A custom item has a custom mesh, position, scaling, rotation, and an optional texture.

特性文檔編製

meshFile : string

The item mesh file name. The item in the file must be mesh format. The mesh files are recommended to include vertices, normals, and UVs.

位置 : vector3d

The item position as a vector3d 。默認為 vector3d(0.0, 0.0, 0.0) .

Item position is specified either in data coordinates or in absolute coordinates, depending on the value of the positionAbsolute property. When using absolute coordinates, values between -1.0...1.0 are within axis ranges.

注意: Items positioned outside any axis range are not rendered if positionAbsolute is false , unless the item is a Custom3DVolume that would be partially visible and scalingAbsolute is also false . In that case, the visible portion of the volume will be rendered.

另請參閱 positionAbsolute and scalingAbsolute .

positionAbsolute : bool

Defines whether item position is to be handled in data coordinates or in absolute coordinates. Defaults to false . Items with absolute coordinates will always be rendered, whereas items with data coordinates are only rendered if they are within axis ranges.

另請參閱 position .

rotation : quaternion

The item rotation as a quaternion 。默認為 quaternion(0.0, 0.0, 0.0, 0.0) .

scaling : vector3d

The item scaling as a vector3d type. Defaults to vector3d(0.1, 0.1, 0.1) .

Item scaling is specified either in data values or in absolute values, depending on the value of the scalingAbsolute property. The default vector interpreted as absolute values sets the item to 10% of the height of the graph, provided the item mesh is normalized and the graph aspect ratios have not been changed from the defaults.

注意: Only absolute scaling is supported for Custom3DLabel items or for custom items used in polar 圖形。

注意: In Qt 6.8 models were incorrectly assumed to be scaled to a size of 1 (-0.5...0.5) by default, when they in reality are scaled to the size of 2 (-1...1). Because of this, all custom items from Qt 6.9 onwards are twice the size compared to Qt 6.8

另請參閱 scalingAbsolute .

scalingAbsolute : bool

Defines whether item scaling is to be handled in data values or in absolute values. Defaults to true . Items with absolute scaling will be rendered at the same size, regardless of axis ranges. Items with data scaling will change their apparent size according to the axis ranges. If positionAbsolute is true , this property is ignored and scaling is interpreted as an absolute value. If the item has rotation, the data scaling is calculated on the unrotated item. Similarly, for Custom3DVolume items, the range clipping is calculated on the unrotated item.

注意: Only absolute scaling is supported for Custom3DLabel items or for custom items used in polar 圖形。

注意: The custom item's mesh must be normalized to the range [-1 ,1] , or the data scaling will not be accurate.

另請參閱 scaling and positionAbsolute .

shadowCasting : bool

Defines whether shadow casting for the item is enabled. Defaults to true 。若 false , the item does not cast shadows regardless of ShadowQuality .

textureFile : string

The texture file name for the item. If left unset, a solid gray texture will be used.

注意: To conserve memory, the QImage loaded from the file is cleared after a texture is created.

visible : bool

The visibility of the item. Defaults to true .

信號文檔編製

meshFileChanged ( string meshFile )

此信號發射,當 meshFile changes to meshFile .

注意: 相應處理程序是 onMeshFileChanged .

positionAbsoluteChanged ( bool positionAbsolute )

此信號發射,當 positionAbsolute changes to positionAbsolute .

注意: 相應處理程序是 onPositionAbsoluteChanged .

positionChanged ( vector3d position )

This signal is emitted when item position changes to position .

注意: 相應處理程序是 onPositionChanged .

rotationChanged ( quaternion rotation )

此信號發射,當 rotation changes to rotation .

注意: 相應處理程序是 onRotationChanged .

scalingAbsoluteChanged ( bool scalingAbsolute )

此信號發射,當 scalingAbsolute changes to scalingAbsolute .

注意: 相應處理程序是 onScalingAbsoluteChanged .

scalingChanged ( vector3d scaling )

此信號發射,當 scaling changes to scaling .

注意: 相應處理程序是 onScalingChanged .

shadowCastingChanged ( bool shadowCasting )

此信號發射,當 shadowCasting changes to shadowCasting .

注意: 相應處理程序是 onShadowCastingChanged .

textureFileChanged ( string textureFile )

此信號發射,當 textureFile changes to textureFile .

注意: 相應處理程序是 onTextureFileChanged .

visibleChanged ( bool visible )

此信號發射,當 visible changes to visible .

注意: 相應處理程序是 onVisibleChanged .

方法文檔編製

void setRotationAxisAndAngle ( vector3d axis , real angle )

A convenience function to construct the rotation quaternion from axis and angle .

另請參閱 rotation .