1、修改运动属性-转轴原点的设置

feature/struct-menu-20241023
mzh 1 week ago
parent 0d8f1d50cd
commit 7070440bad

@ -29,7 +29,11 @@ void CFDStructDataSolverSportsAttributesItemManager::saveDataToDom(rapidjson::Do
jsonAdd(dom, m_MotionName, {"region", 0, "motion", this->getId(), "meshMotion", "name"});
jsonAdd(dom, m_MotionType, {"region", 0, "motion", this->getId(), "meshMotion", "MotionType"});
jsonAdd(dom, m_MotionMode, {"region", 0, "motion", this->getId(), "meshMotion", "attrtype"});
jsonAdd(dom, m_RotationAxisOrigin, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"});
// jsonAdd(dom, m_RotationAxisOrigin, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"});
jsonAdd(dom, m_originX, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 0});
jsonAdd(dom, m_originY, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 1});
jsonAdd(dom, m_originZ, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 2});
jsonAdd(dom, m_RotationAxisDirection, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial"});
jsonAdd(dom, m_RotationSpeed, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"});
}
@ -48,9 +52,17 @@ void CFDStructDataSolverSportsAttributesItemManager::readDataFromDom(rapidjson::
if (temp != QVariant()) {
m_MotionType = temp.toInt();
}
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"});
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 0});
if (temp != QVariant()) {
m_originX = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 1});
if (temp != QVariant()) {
m_RotationAxisOrigin = temp.toString();
m_originY = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 2});
if (temp != QVariant()) {
m_originZ = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial"});
if (temp != QVariant()) {
@ -102,11 +114,36 @@ CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genMovingFrameModeUIC
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_MotionMode)},
}),
// new CUIConfig({
// {"type", "LineEdit"}, // 转轴原点
// {"name", tr("Axis origin")},
// {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
// {"value_origin", QVA_GLOBAL(&m_RotationAxisOrigin)},
// }),
new CUIConfig({
{"type", "LineEdit"}, // 转轴原点
{"name", tr("Axis origin")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_RotationAxisOrigin)},
{"type", "GroupBox"}, // 转轴原点
{"name", "Axis origin"},
{"layout", "QHBoxLayout"},
},
{
new CUIConfig({
{"type", "LineEdit"},
{"name", "X:"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", m_originX},
}),
new CUIConfig({
{"type", "LineEdit"},
{"name", "X:"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", m_originX},
}),
new CUIConfig({
{"type", "LineEdit"},
{"name", "Z:"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", m_originZ},
}),
}),
new CUIConfig({
{"type", "LineEdit"}, // 转轴方向

@ -46,7 +46,10 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager
QString m_MotionMode; // Motion Mode
// 转轴原点
QString m_RotationAxisOrigin; // Rotation Axis Origin
// QString m_RotationAxisOrigin; // Rotation Axis Origin
double m_originX = 0;
double m_originY = 0;
double m_originZ = 0;
// 转轴方向
QString m_RotationAxisDirection; // Rotation Axis Direction

Loading…
Cancel
Save