이 페이지에서

QCustom3DItem Class

QCustom3DItem 클래스는 그래프에 사용자 정의 항목을 추가합니다. 더 보기...

헤더: #include <QCustom3DItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
버전: QtDataVisualization 1.1
QML에서: Custom3DItem
상속: QObject
상속받는 클래스:

QCustom3DLabel 그리고 QCustom3DVolume

상태: 사용 중단

이 클래스는 더 이상 사용되지 않습니다. 새로운 코드에서는 이 클래스를 사용하지 않는 것이 좋습니다.

속성

공개 함수

QCustom3DItem(QObject *parent = nullptr)
QCustom3DItem(const QString &meshFile, const QVector3D &position, const QVector3D &scaling, const QQuaternion &rotation, const QImage &texture, QObject *parent = nullptr)
virtual ~QCustom3DItem()
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(const QVector3D &position)
void setPositionAbsolute(bool positionAbsolute)
void setRotation(const QQuaternion &rotation)
void setRotationAxisAndAngle(const QVector3D &axis, float angle)
void setScaling(const 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(const QVector3D &position)
void rotationChanged(const QQuaternion &rotation)
void scalingAbsoluteChanged(bool scalingAbsolute)
void scalingChanged(const QVector3D &scaling)
void shadowCastingChanged(bool shadowCasting)
void textureFileChanged(const QString &textureFile)
void visibleChanged(bool visible)

상세 설명

사용자 정의 아이템은 사용자 정의 메시, 위치, 크기 조정, 회전 및 선택적 텍스처를 가집니다.

QAbstract3DGraph::addCustomItem()도 참조하십시오 .

속성 문서

meshFile : QString

이 속성에는 아이템 메시 파일 이름이 저장됩니다.

파일 내 아이템은 Wavefront OBJ 형식이어야 하며, 정점, 법선, UV를 포함해야 합니다. 또한 삼각형으로 구성되어야 합니다. 파일에 법선이나 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(const QVector3D &position)

Notifier 신호:

void positionChanged(const 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(const QVector3D &scaling)

알림 신호:

void scalingChanged(const QVector3D &scaling)

scalingAbsolute도 참조하십시오 .

[since QtDataVisualization 1.2] scalingAbsolute : bool

이 속성은 항목의 크기 조정을 데이터 값으로 처리할지, 아니면 절대 값으로 처리할지를 결정합니다.

기본값은 ' true'입니다.

절대 스케일링이 적용된 항목은 축 범위에 관계없이 동일한 크기로 렌더링됩니다. 데이터 스케일링이 적용된 항목은 축 범위에 따라 표시 크기가 변경됩니다. positionAbsolute 가 true 인 경우, 이 속성은 무시되고 스케일링은 절대값으로 해석됩니다. 항목에 회전이 적용된 경우, 데이터 스케일링은 회전되지 않은 항목을 기준으로 계산됩니다. 마찬가지로, QCustom3DVolume 항목의 경우 범위 클리핑은 회전되지 않은 항목을 기준으로 계산됩니다.

참고: QCustom3DLabel 항목이나 polar 그래프에서 사용되는 사용자 정의 항목의 경우 절대 스케일링만 지원됩니다.

참고: 사용자 정의 항목의메시는 [-1 ,1] 범위로 정규화되어야 하며, 그렇지 않으면 데이터 스케일링이 정확하지 않을 수 있습니다.

이 열거형은 QtDataVisualization 1.2에서 도입되었습니다.

액세스 함수:

bool isScalingAbsolute() const
void setScalingAbsolute(bool scalingAbsolute)

알림 신호:

void scalingAbsoluteChanged(bool scalingAbsolute)

scaling 및 positionAbsolute도 참조하십시오 .

shadowCasting : bool

이 속성은 해당 아이템의 그림자 투사 기능이 활성화되어 있는지 여부를 나타냅니다.

기본값은 ` true`입니다. ` false`인 경우, ` QAbstract3DGraph::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, const QVector3D &position, const QVector3D &scaling, const QQuaternion &rotation, const QImage &texture, QObject *parent = nullptr)

지정된 meshFile, position, scaling, rotation, texture 이미지 및 선택 사항인 parent 를 사용하여 사용자 지정 3D 항목을 생성합니다.

[virtual noexcept] QCustom3DItem::~QCustom3DItem()

사용자 지정 3D 항목을 삭제합니다.

[invokable] void QCustom3DItem::setRotationAxisAndAngle(const 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.