在 3D 空間中的攝像頭錶示。 更多...
| 頭: | #include <Q3DCamera> |
| Since: | QtDataVisualization 1.0 |
| 實例化: | Camera3D |
| 繼承: | Q3DObject |
| enum | CameraPreset { CameraPresetNone, CameraPresetFrontLow, CameraPresetFront, CameraPresetFrontHigh, ..., CameraPresetDirectlyBelow } |
|
|
| Q3DCamera (QObject * parent = Q_NULLPTR) | |
| virtual | ~Q3DCamera () |
| CameraPreset | cameraPreset () const |
| float | maxZoomLevel () const |
| float | minZoomLevel () const |
| void | setCameraPosition (float horizontal , float vertical , float zoom = 100.0f) |
| void | setCameraPreset (CameraPreset preset ) |
| void | setMaxZoomLevel (float zoomLevel ) |
| void | setMinZoomLevel (float zoomLevel ) |
| void | setTarget (const QVector3D & target ) |
| void | setWrapXRotation (bool isEnabled ) |
| void | setWrapYRotation (bool isEnabled ) |
| void | setXRotation (float rotation ) |
| void | setYRotation (float rotation ) |
| void | setZoomLevel (float zoomLevel ) |
| QVector3D | target () const |
| bool | wrapXRotation () const |
| bool | wrapYRotation () const |
| float | xRotation () const |
| float | yRotation () const |
| float | zoomLevel () const |
| virtual void | copyValuesFrom (const Q3DObject & source ) |
| void | cameraPresetChanged (Q3DCamera::CameraPreset preset ) |
| void | maxZoomLevelChanged (float zoomLevel ) |
| void | minZoomLevelChanged (float zoomLevel ) |
| void | targetChanged (const QVector3D & target ) |
| void | wrapXRotationChanged (bool isEnabled ) |
| void | wrapYRotationChanged (bool isEnabled ) |
| void | xRotationChanged (float rotation ) |
| void | yRotationChanged (float rotation ) |
| void | zoomLevelChanged (float zoomLevel ) |
在 3D 空間中的攝像頭錶示。
Q3DCamera represents a basic orbit around centerpoint 3D camera that is used when rendering the data visualization. The class offers simple methods for rotating the camera around the origin and setting zoom level.
用於攝像頭的預定義位置。
| 常量 | 值 | 描述 |
|---|---|---|
Q3DCamera::CameraPresetNone
|
-1
|
Used to indicate a preset has not been set, or the scene has been rotated freely. |
Q3DCamera::CameraPresetFrontLow
|
0
|
|
Q3DCamera::CameraPresetFront
|
1
|
|
Q3DCamera::CameraPresetFrontHigh
|
2
|
|
Q3DCamera::CameraPresetLeftLow
|
3
|
|
Q3DCamera::CameraPresetLeft
|
4
|
|
Q3DCamera::CameraPresetLeftHigh
|
5
|
|
Q3DCamera::CameraPresetRightLow
|
6
|
|
Q3DCamera::CameraPresetRight
|
7
|
|
Q3DCamera::CameraPresetRightHigh
|
8
|
|
Q3DCamera::CameraPresetBehindLow
|
9
|
|
Q3DCamera::CameraPresetBehind
|
10
|
|
Q3DCamera::CameraPresetBehindHigh
|
11
|
|
Q3DCamera::CameraPresetIsometricLeft
|
12
|
|
Q3DCamera::CameraPresetIsometricLeftHigh
|
13
|
|
Q3DCamera::CameraPresetIsometricRight
|
14
|
|
Q3DCamera::CameraPresetIsometricRightHigh
|
15
|
|
Q3DCamera::CameraPresetDirectlyAbove
|
16
|
|
Q3DCamera::CameraPresetDirectlyAboveCW45
|
17
|
|
Q3DCamera::CameraPresetDirectlyAboveCCW45
|
18
|
|
Q3DCamera::CameraPresetFrontBelow
|
19
|
在 Q3DBars from CameraPresetFrontBelow onward these only work for graphs including negative values. They act as Preset...Low for positive-only values. |
Q3DCamera::CameraPresetLeftBelow
|
20
|
|
Q3DCamera::CameraPresetRightBelow
|
21
|
|
Q3DCamera::CameraPresetBehindBelow
|
22
|
|
Q3DCamera::CameraPresetDirectlyBelow
|
23
|
Acts as CameraPresetFrontLow for positive-only bars. |
此特性保持當前活動攝像頭的預置。
若無 CameraPreset 值被設置, CameraPresetNone 被使用默認情況下。
訪問函數:
| CameraPreset | cameraPreset () const |
| void | setCameraPreset (CameraPreset preset ) |
通知程序信號:
| void | cameraPresetChanged (Q3DCamera::CameraPreset preset ) |
此特性保持允許的最大攝像頭縮放級彆。
If the maximum level is set to a new value that is lower than the existing minimum level, the minimum level is adjusted to the new maximum as well. If the current
zoomLevel
is outside the new bounds, it is adjusted as well. Defaults to
500.0f
.
訪問函數:
| float | maxZoomLevel () const |
| void | setMaxZoomLevel (float zoomLevel ) |
通知程序信號:
| void | maxZoomLevelChanged (float zoomLevel ) |
另請參閱 zoomLevel and minZoomLevel .
This property holds the minimum allowed camera zoom level.
If the minimum level is set to a new value that is higher than the existing maximum level, the maximum level is adjusted to the new minimum as well. If the current
zoomLevel
is outside the new bounds, it is adjusted as well. The minZoomLevel cannot be set below
1.0f
。默認為
10.0f
.
訪問函數:
| float | minZoomLevel () const |
| void | setMinZoomLevel (float zoomLevel ) |
通知程序信號:
| void | minZoomLevelChanged (float zoomLevel ) |
另請參閱 zoomLevel and maxZoomLevel .
This property holds the camera target as a a vector or vertex in the 3D space.
默認為
QVector3D(0.0, 0.0, 0.0)
.
Valid coordinate values are between
-1.0...1.0
, where the edge values indicate the edges of the corresponding axis range. Any values outside this range are clamped to the edge.
注意: For bar graphs, the Y-coordinate is ignored and camera always targets a point on the horizontal background.
該特性在 QtDataVisualization 1.2 引入。
訪問函數:
| QVector3D | target () const |
| void | setTarget (const QVector3D & target ) |
通知程序信號:
| void | targetChanged (const QVector3D & target ) |
This property holds the behavior of the minimum and maximum limits in the X-rotation.
若設為
true
, the X-rotation of the camera is wrapped from minimum to maximum and from maximum to minimum. If set to
false
, the X-rotation of the camera is limited to the sector determined by the minimum and maximum values. Set to
true
在默認情況下。
訪問函數:
| bool | wrapXRotation () const |
| void | setWrapXRotation (bool isEnabled ) |
通知程序信號:
| void | wrapXRotationChanged (bool isEnabled ) |
This property holds the behavior of the minimum and maximum limits in the Y-rotation.
若
true
, the Y-rotation of the camera is wrapped from minimum to maximum and from maximum to minimum. If
false
, the Y-rotation of the camera is limited to the sector determined by the minimum and maximum values. Set to
true
在默認情況下。
訪問函數:
| bool | wrapYRotation () const |
| void | setWrapYRotation (bool isEnabled ) |
通知程序信號:
| void | wrapYRotationChanged (bool isEnabled ) |
This property holds the X-rotation angle of the camera around the target point in degrees.
訪問函數:
| float | xRotation () const |
| void | setXRotation (float rotation ) |
通知程序信號:
| void | xRotationChanged (float rotation ) |
This property holds the Y-rotation angle of the camera around the target point in degrees.
訪問函數:
| float | yRotation () const |
| void | setYRotation (float rotation ) |
通知程序信號:
| void | yRotationChanged (float rotation ) |
此特性保持攝像頭的縮放級彆按百分比。
默認值
100.0f
意味著攝像頭沒有設置放大 (或縮小)。值被限製通過
minZoomLevel
and
maxZoomLevel
特性。
訪問函數:
| float | zoomLevel () const |
| void | setZoomLevel (float zoomLevel ) |
通知程序信號:
| void | zoomLevelChanged (float zoomLevel ) |
另請參閱 minZoomLevel and maxZoomLevel .
Constructs a new 3D camera with position set to origin, up direction facing towards the Y-axis and looking at origin by default. An optional parent 參數可以給齣,然後會被傳遞給 QObject 構造函數。
[虛擬]
Q3DCamera::
~Q3DCamera
()
銷毀攝像頭對象。
[虛擬]
void
Q3DCamera::
copyValuesFrom
(const
Q3DObject
&
source
)
重實現自 Q3DObject::copyValuesFrom ().
Copies the 3D camera's properties from the given source camera. Values are copied from the source 到此對象。
Utility function that sets the camera rotations and distance. horizontal and vertical define the camera rotations to be used. Optional zoom parameter can be given to set the zoom percentage of the camera within the bounds defined by minZoomLevel and maxZoomLevel 特性。