QCustom3DItem Class
QCustom3DItem 클래스는 그래프에 사용자 지정 항목을 추가합니다. 더 보기...
Header: | #include <QCustom3DItem> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
qmake: | QT += graphs |
QML에서: | Custom3DItem |
상속합니다: | QObject |
Inherited By: |
- 상속된 멤버를 포함한 모든 멤버 목록
- QCustom3DItem은 Qt Graphs 3D용 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 | 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 | 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 | 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
이 속성은 항목 메시 파일 이름을 저장합니다.
파일의 항목은 메시 형식이어야 합니다. 다른 유형은 발삼 에셋 가져오기 툴로 변환할 수 있습니다. 메시 파일에는 버텍스, 노멀, 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) |
scaling : QVector3D
이 속성은 항목 스케일링을 QVector3D 로 유지합니다.
기본값은 QVector3D(0.1, 0.1, 0.1)
입니다.
항목 배율은 scalingAbsolute 속성에 따라 데이터 값 또는 절대값으로 설정됩니다. 절대값으로 해석되는 기본 벡터는 항목 메시가 정규화되어 있고 그래프 가로 세로 비율이 기본값에서 변경되지 않은 경우 항목을 그래프 높이의 10%로 설정합니다.
기능에 액세스합니다:
QVector3D | scaling() const |
void | setScaling(QVector3D scaling) |
알림 신호:
void | scalingChanged(QVector3D scaling) |
scalingAbsolute 를참조하세요 .
scalingAbsolute : bool
이 속성은 항목 배율을 데이터 값으로 처리할지, 절대값으로 처리할지를 결정합니다.
기본값은 true
입니다.
절대 배율을 사용하는 항목은 축 범위에 관계없이 동일한 크기로 렌더링됩니다. 데이터 스케일링이 있는 항목은 축 범위에 따라 겉보기 크기가 변경됩니다. positionAbsolute 가 true
인 경우 이 속성은 무시되고 배율은 절대값으로 해석됩니다. 항목에 회전이 있는 경우 데이터 배율은 회전되지 않은 항목에 대해 계산됩니다. 마찬가지로 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 은 지워집니다.
© 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.