Q3DCamera Class
3D 공간에서의 카메라 표현. 더 보기...
헤더: | #include <Q3DCamera> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS DataVisualization) target_link_libraries(mytarget PRIVATE Qt6::DataVisualization) |
qmake: | QT += datavisualization |
이후: | QtDataVisualization 1.0 |
QML에서: | Camera3D |
상속합니다: | Q3DObject |
공용 유형
enum | CameraPreset { CameraPresetNone, CameraPresetFrontLow, CameraPresetFront, CameraPresetFrontHigh, CameraPresetLeftLow, …, CameraPresetDirectlyBelow } |
속성
|
|
공용 함수
Q3DCamera(QObject *parent = nullptr) | |
virtual | ~Q3DCamera() |
Q3DCamera::CameraPreset | cameraPreset() const |
float | maxZoomLevel() const |
float | minZoomLevel() const |
void | setCameraPosition(float horizontal, float vertical, float zoom = 100.0f) |
void | setCameraPreset(Q3DCamera::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) override |
신호
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) |
상세 설명
Q3DCamera는 데이터 시각화를 렌더링할 때 사용되는 중심점 3D 카메라를 중심으로 한 기본 궤도를 나타냅니다. 이 클래스는 카메라를 원점을 중심으로 회전하고 줌 레벨을 설정하는 간단한 메서드를 제공합니다.
멤버 유형 문서
enum Q3DCamera::CameraPreset
카메라의 사전 정의된 위치.
상수 | 값 | 설명 |
---|---|---|
Q3DCamera::CameraPresetNone | -1 | 프리셋이 설정되지 않았거나 씬이 자유롭게 회전되었음을 나타내는 데 사용됩니다. |
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 에서 CameraPresetFrontBelow 이후부터는 음수 값을 포함한 그래프에만 작동합니다. 양수 값만 포함된 그래프에 대해서는 Preset...Low로 작동합니다. |
Q3DCamera::CameraPresetLeftBelow | 20 | |
Q3DCamera::CameraPresetRightBelow | 21 | |
Q3DCamera::CameraPresetBehindBelow | 22 | |
Q3DCamera::CameraPresetDirectlyBelow | 23 | 양수 전용 막대에 대해서는 CameraPresetFrontLow로 작동합니다. |
프로퍼티 문서
cameraPreset : CameraPreset
이 프로퍼티는 현재 활성화된 카메라 프리셋을 저장합니다.
CameraPreset 값을 설정하지 않으면 CameraPresetNone 값이 기본적으로 사용됩니다.
기능에 액세스합니다:
Q3DCamera::CameraPreset | cameraPreset() const |
void | setCameraPreset(Q3DCamera::CameraPreset preset) |
알림 신호:
void | cameraPresetChanged(Q3DCamera::CameraPreset preset) |
maxZoomLevel : float
이 속성은 허용되는 최대 카메라 줌 레벨을 유지합니다.
최대 레벨이 기존 최소 레벨보다 낮은 새 값으로 설정되면 최소 레벨도 새 최대 레벨로 조정됩니다. 현재 zoomLevel 이 새 범위를 벗어나면 이 값도 조정됩니다. 기본값은 500.0f
입니다.
기능에 액세스합니다:
float | maxZoomLevel() const |
void | setMaxZoomLevel(float zoomLevel) |
알림 신호:
void | maxZoomLevelChanged(float zoomLevel) |
zoomLevel 및 minZoomLevel 을참조하세요 .
minZoomLevel : float
이 속성은 허용되는 최소 카메라 줌 레벨을 유지합니다.
최소 레벨이 기존 최대 레벨보다 높은 새 값으로 설정되면 최대 레벨도 새 최소 레벨로 조정됩니다. 현재 zoomLevel 가 새 범위를 벗어나면 이 값도 조정됩니다. 최소 줌 레벨은 1.0f
이하로 설정할 수 없습니다. 기본값은 10.0f
입니다.
기능에 액세스합니다:
float | minZoomLevel() const |
void | setMinZoomLevel(float zoomLevel) |
알림 신호:
void | minZoomLevelChanged(float zoomLevel) |
zoomLevel 및 maxZoomLevel 을참조하세요 .
[since QtDataVisualization 1.2]
target : QVector3D
이 프로퍼티는 카메라 타깃을 3D 공간에서 벡터 또는 버텍스로 유지합니다.
기본값은 QVector3D(0.0, 0.0, 0.0)
입니다.
유효한 좌표 값은 -1.0...1.0
사이이며, 에지 값은 해당 축 범위의 에지를 나타냅니다. 이 범위를 벗어나는 모든 값은 가장자리에 고정됩니다.
참고: 막대 그래프의 경우 Y 좌표는 무시되고 카메라는 항상 가로 배경의 한 점을 대상으로 합니다.
이 속성은 QtDataVisualization 1.2에 도입되었습니다.
함수에 액세스합니다:
QVector3D | target() const |
void | setTarget(const QVector3D &target) |
알림 신호:
void | targetChanged(const QVector3D &target) |
wrapXRotation : bool
이 속성은 X 회전의 최소 및 최대 제한의 동작을 유지합니다.
true
로 설정하면 카메라의 X 회전이 최소에서 최대로, 최대에서 최소로 래핑됩니다. false
로 설정하면 카메라의 X 회전이 최소값과 최대값에 의해 결정된 섹터로 제한됩니다. 기본값은 true
으로 설정됩니다.
기능 액세스:
bool | wrapXRotation() const |
void | setWrapXRotation(bool isEnabled) |
알림 신호:
void | wrapXRotationChanged(bool isEnabled) |
wrapYRotation : bool
이 속성은 Y 회전의 최소 및 최대 제한의 동작을 유지합니다.
true
인 경우 카메라의 Y 회전은 최소에서 최대로, 최대에서 최소로 래핑됩니다. false
인 경우 카메라의 Y 회전은 최소값과 최대값에 의해 결정된 섹터로 제한됩니다. 기본적으로 true
로 설정됩니다.
기능에 액세스합니다:
bool | wrapYRotation() const |
void | setWrapYRotation(bool isEnabled) |
알림 신호:
void | wrapYRotationChanged(bool isEnabled) |
xRotation : float
이 프로퍼티는 대상 지점을 중심으로 카메라의 X 회전 각도(도)를 보유합니다.
기능에 액세스합니다:
float | xRotation() const |
void | setXRotation(float rotation) |
알림 신호:
void | xRotationChanged(float rotation) |
yRotation : float
이 프로퍼티는 대상 지점을 중심으로 카메라의 Y 회전 각도를 도 단위로 저장합니다.
함수에 액세스합니다:
float | yRotation() const |
void | setYRotation(float rotation) |
알림 신호:
void | yRotationChanged(float rotation) |
zoomLevel : float
이 속성은 카메라 줌 레벨을 백분율로 표시합니다.
기본값인 100.0f
은 카메라에 줌 인 또는 줌 아웃이 설정되어 있지 않음을 의미합니다. 이 값은 minZoomLevel 및 maxZoomLevel 속성에 의해 제한됩니다.
기능에 액세스합니다:
float | zoomLevel() const |
void | setZoomLevel(float zoomLevel) |
알림 신호:
void | zoomLevelChanged(float zoomLevel) |
minZoomLevel 및 maxZoomLevel 을참조하세요 .
멤버 함수 문서
[explicit]
Q3DCamera::Q3DCamera(QObject *parent = nullptr)
기본적으로 위치가 원점으로 설정되고 위쪽 방향이 Y축을 향하며 원점을 바라보는 새 3D 카메라를 생성합니다. 선택적 parent 파라미터를 지정할 수 있으며 QObject 생성자에 전달됩니다.
[virtual noexcept]
Q3DCamera::~Q3DCamera()
카메라 오브젝트를 파괴합니다.
[override virtual]
void Q3DCamera::copyValuesFrom(const Q3DObject &source)
재구현합니다: Q3DObject::copyValuesFrom(const Q3DObject &source).
지정된 소스 카메라에서 3D 카메라의 프로퍼티를 복사합니다. 값은 source 에서 이 오브젝트로 복사됩니다.
void Q3DCamera::setCameraPosition(float horizontal, float vertical, float zoom = 100.0f)
카메라 회전과 거리를 설정하는 유틸리티 기능.horizontal 및 vertical 은 사용할 카메라 회전을 정의합니다. 선택적으로 zoom 매개변수를 지정하여 minZoomLevel 및 maxZoomLevel 속성에 정의된 범위 내에서 카메라의 줌 비율을 설정할 수 있습니다.
© 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.