QCustom3DItem Class
QCustom3DItem 클래스는 그래프에 사용자 정의 항목을 추가합니다. 더 보기...
| 헤더: | #include <QCustom3DItem> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
| qmake: | QT += graphs |
| QML에서: | Custom3DItem |
| 상속: | QObject |
| 상속받는 클래스: |
- 상속받은 멤버를 포함한 모든 멤버 목록
- QCustom3DItem은 3D용Qt Graphs C++ 클래스의 일부입니다.
속성
|
|
공개 함수
| QCustom3DItem(QObject *parent = nullptr) | |
| QCustom3DItem(const QString &meshFile, QVector3D position, QVector3D scaling, const QQuaternion &rotation, const QImage &texture, QObject *parent = nullptr) | |
| virtual | ~QCustom3DItem() override |
| bool | isPositionAbsolute() const |
| bool | isRotationAbsolute() const |
| bool | isScalingAbsolute() const |
| bool | isShadowCasting() const |
| bool | isVisible() const |
| QString | meshFile() const |
| QVector3D | position() const |
| QQuaternion | rotation() |
| QVector3D | scaling() const |
| void | setMeshFile(const QString &meshFile) |
| void | setPosition(QVector3D position) |
| void | setPositionAbsolute(bool positionAbsolute) |
| void | setRotation(const QQuaternion &rotation) |
| void | setRotationAbsolute(bool rotationAbsolute) |
| void | setRotationAxisAndAngle(QVector3D axis, float angle) |
| void | setScaling(QVector3D scaling) |
| void | setScalingAbsolute(bool scalingAbsolute) |
| void | setShadowCasting(bool enabled) |
| void | setTextureFile(const QString &textureFile) |
| void | setTextureImage(const QImage &textureImage) |
| void | setVisible(bool visible) |
| QString | textureFile() const |
신호
| void | meshFileChanged(const QString &meshFile) |
| void | positionAbsoluteChanged(bool positionAbsolute) |
| void | positionChanged(QVector3D position) |
| void | rotationAbsoluteChanged(bool newRotationAbsolute) |
| void | rotationChanged(const QQuaternion &rotation) |
| void | scalingAbsoluteChanged(bool scalingAbsolute) |
| void | scalingChanged(QVector3D scaling) |
| void | shadowCastingChanged(bool shadowCasting) |
| void | textureFileChanged(const QString &textureFile) |
| void | visibleChanged(bool visible) |
Q3DGraphsWidgetItem::addCustomItem()도 참조하십시오 .
속성 문서
meshFile : QString
이 속성은 아이템 메쉬 파일 이름을 저장합니다.
파일 내의 아이템은 메쉬 형식이어야 합니다. 다른 형식의 파일은 Balsam 애셋 임포트 도구를 통해 변환할 수 있습니다. 메쉬 파일에는 정점, 법선, UV 정보가 포함되는 것이 권장됩니다.
액세스 함수:
| QString | meshFile() const |
| void | setMeshFile(const QString &meshFile) |
알림 신호:
| void | meshFileChanged(const QString &meshFile) |
position : QVector3D
이 속성은 항목의 위치를 ` QVector3D` 형식으로 저장합니다.
기본값은 ` QVector3D(0.0, 0.0, 0.0)`입니다.
항목 위치는 ` positionAbsolute ` 속성에 따라 데이터 좌표 또는 절대 좌표로 지정됩니다. 절대 좌표를 사용할 경우, ` -1.0...1.0 ` 사이의 값이 축 범위 내에 포함됩니다.
참고: positionAbsolute 가 false 인 경우, 축 범위 외부에 배치된항목은 렌더링되지 않습니다. 단, 해당 항목이 부분적으로 표시될 수 있는 QCustom3DVolume 이고 scalingAbsolute 도 false 인 경우는 예외입니다. 이 경우, 볼륨의 표시 가능한 부분이 렌더링됩니다.
액세스 함수:
| QVector3D | position() const |
| void | setPosition(QVector3D position) |
알림 신호:
| void | positionChanged(QVector3D position) |
positionAbsolute도 참조하십시오 .
positionAbsolute : bool
이 속성은 항목의 위치를 데이터 좌표로 처리할지, 아니면 절대 좌표로 처리할지를 지정합니다.
기본값은 ` false`입니다. 절대 좌표를 가진 항목은 항상 렌더링되는 반면, 데이터 좌표를 가진 항목은 축 범위 내에 있을 때만 렌더링됩니다.
액세스 함수:
| bool | isPositionAbsolute() const |
| void | setPositionAbsolute(bool positionAbsolute) |
알림 신호:
| void | positionAbsoluteChanged(bool positionAbsolute) |
position도 참조하십시오 .
rotation : QQuaternion
이 속성은 항목의 회전 각도를 QQuaternion 형식으로 저장합니다.
기본값은 ` QQuaternion(0.0, 0.0, 0.0, 0.0)`입니다.
액세스 함수:
| QQuaternion | rotation() |
| void | setRotation(const QQuaternion &rotation) |
알림 신호:
| void | rotationChanged(const QQuaternion &rotation) |
[since 6.11] rotationAbsolute : bool
이 속성은 항목 회전을 데이터 축 좌표계에서 처리할지, 아니면 절대 좌표계에서 처리할지를 결정합니다.
항목 회전을 데이터 값으로 처리할지, 아니면 절대값으로 처리할지를 정의합니다. 기본값은 ` true`입니다. 절대 회전을 사용하는 항목은 축에 관계없이 기본 좌표계를 기준으로 회전합니다. 데이터 회전을 사용하는 항목은 축 좌표계에 따라 회전합니다.
이 열거형은 Qt 6.11에서 도입되었습니다.
액세스 함수:
| bool | isRotationAbsolute() const |
| void | setRotationAbsolute(bool rotationAbsolute) |
알림 신호:
| void | rotationAbsoluteChanged(bool newRotationAbsolute) |
rotation도 참조하십시오 .
scaling : QVector3D
이 속성은 항목의 배율을 ‘ QVector3D ’로 저장합니다.
기본값은 ` QVector3D(0.1, 0.1, 0.1)`입니다.
항목 스케일링은 ` scalingAbsolute ` 속성에 따라 데이터 값 또는 절대 값으로 지정됩니다. 절대 값으로 해석되는 기본 벡터는 항목 메쉬가 정규화되어 있고 그래프의 종횡비가 기본값에서 변경되지 않은 경우, 항목을 그래프 높이의 10%로 설정합니다.
참고: Qt 6.8에서는 모델이 실제로 2(-1...1) 크기로 스케일링되었음에도 불구하고, 기본적으로 1(-0.5...0.5) 크기로 스케일링된 것으로 잘못 가정되었습니다. 이 때문에 Qt 6.9부터 모든 사용자 정의 항목의 크기는 Qt 6.8에 비해 두 배가 됩니다.
액세스 함수:
| QVector3D | scaling() const |
| void | setScaling(QVector3D scaling) |
Notifier 신호:
| void | scalingChanged(QVector3D scaling) |
scalingAbsolute도 참조하십시오 .
scalingAbsolute : bool
이 속성은 항목의 크기 조정을 데이터 값으로 처리할지, 아니면 절대값으로 처리할지를 결정합니다.
기본값은 ' true'입니다.
절대 스케일링이 적용된 항목은 축 범위에 관계없이 동일한 크기로 렌더링됩니다. 데이터 스케일링이 적용된 항목은 축 범위에 따라 보이는 크기가 변경됩니다. positionAbsolute 가 true 인 경우, 이 속성은 무시되고 스케일링은 절대값으로 해석됩니다. 항목에 회전(rotation)이 적용된 경우, 데이터 스케일링은 회전되지 않은 항목을 기준으로 계산됩니다. 마찬가지로, QCustom3DVolume 항목의 경우, 범위 클리핑은 회전되지 않은 항목을 기준으로 계산됩니다.
참고: QCustom3DLabel 항목이나 polar 그래프에서 사용되는 사용자 정의 항목의 경우 절대 스케일링만 지원됩니다.
참고: 사용자 정의 항목의메시는 [-1 ,1] 범위로 정규화되어야 하며, 그렇지 않으면 데이터 스케일링이 정확하지 않을 수 있습니다.
액세스 함수:
| bool | isScalingAbsolute() const |
| void | setScalingAbsolute(bool scalingAbsolute) |
알림 신호:
| void | scalingAbsoluteChanged(bool scalingAbsolute) |
scaling 및 positionAbsolute도 참조하십시오 .
shadowCasting : bool
이 속성은 해당 아이템의 그림자 투사 기능이 활성화되어 있는지 여부를 나타냅니다.
기본값은 ` true`입니다. ` false`인 경우, `Q3DGraphsWidgetItem::ShadowQuality` 설정과 관계없이 항목은 그림자를 드리우지 않습니다.
액세스 함수:
| bool | isShadowCasting() const |
| void | setShadowCasting(bool enabled) |
알림 신호:
| void | shadowCastingChanged(bool shadowCasting) |
textureFile : QString
이 속성은 아이템의 텍스처 파일 이름을 저장합니다.
이 속성과 텍스처 이미지가 모두 설정되지 않은 경우, 단색 회색 텍스처가 사용됩니다.
참고: 메모리를 절약하기위해 , 파일에서 불러온 QImage 는 텍스처가 생성된 후 지워집니다.
액세스 함수:
| QString | textureFile() const |
| void | setTextureFile(const QString &textureFile) |
알림 신호:
| void | textureFileChanged(const QString &textureFile) |
visible : bool
이 속성은 항목의 표시 여부를 나타냅니다.
기본값은 ' true'입니다.
액세스 함수:
| bool | isVisible() const |
| void | setVisible(bool visible) |
알림 신호:
| void | visibleChanged(bool visible) |
멤버 함수 문서
[explicit] QCustom3DItem::QCustom3DItem(QObject *parent = nullptr)
지정된 parent 를 사용하여 사용자 정의 3D 항목을 생성합니다.
[explicit] QCustom3DItem::QCustom3DItem(const QString &meshFile, QVector3D position, QVector3D scaling, const QQuaternion &rotation, const QImage &texture, QObject *parent = nullptr)
지정된 meshFile, position, scaling, rotation, texture 이미지 및 선택 사항인 parent 을 사용하여 사용자 정의 3D 항목을 생성합니다.
[override virtual noexcept] QCustom3DItem::~QCustom3DItem()
사용자 정의 3D 항목을 삭제합니다.
[invokable] void QCustom3DItem::setRotationAxisAndAngle(QVector3D axis, float angle)
axis 및 angle 로부터 회전 쿼터니언을 생성하는 편의 함수입니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
rotation도 참조하십시오 .
void QCustom3DItem::setTextureImage(const QImage &textureImage)
해당 항목의 textureImage 값을 QImage 로 설정합니다. 텍스처는 기본적으로 균일한 회색으로 설정됩니다.
참고: 메모리를 절약하기위해 , 텍스처가 생성된 후에는 지정된 ` QImage `가 지워집니다.
© 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.