diff --git a/GUI/Models/FormFactorItems.cpp b/GUI/Models/FormFactorItems.cpp index 6598ba37814c5cc23e374d2cc2390f20c9d1366c..329ea81275992a294302e796c42db4cfdc7bca49 100644 --- a/GUI/Models/FormFactorItems.cpp +++ b/GUI/Models/FormFactorItems.cpp @@ -724,6 +724,21 @@ std::unique_ptr<IFormFactor> CosineRippleLorentzItem::createFormFactor() const getItemValue(P_HEIGHT).toDouble()); } +void CosineRippleLorentzItem::setLength(const double length) +{ + setItemValue(P_LENGTH, length); +} + +void CosineRippleLorentzItem::setWidth(const double width) +{ + setItemValue(P_WIDTH, width); +} + +void CosineRippleLorentzItem::setHeight(const double height) +{ + setItemValue(P_HEIGHT, height); +} + /* ------------------------------------------------ */ const QString SawtoothRippleBoxItem::P_LENGTH("Length"); diff --git a/GUI/Models/FormFactorItems.h b/GUI/Models/FormFactorItems.h index 1f81a841c1a77ab88179c643a48f8c93ca75661c..d23f7a533f407ee5749dbaf4b55ae426db64e366 100644 --- a/GUI/Models/FormFactorItems.h +++ b/GUI/Models/FormFactorItems.h @@ -339,15 +339,20 @@ public: }; class BA_CORE_API_ CosineRippleLorentzItem : public FormFactorItem { -public: +private: static const QString P_LENGTH; static const QString P_WIDTH; static const QString P_HEIGHT; +public: static const QString M_TYPE; CosineRippleLorentzItem(); std::unique_ptr<IFormFactor> createFormFactor() const override; + + void setLength(double length); + void setWidth(double width); + void setHeight(double height); }; class BA_CORE_API_ SawtoothRippleBoxItem : public FormFactorItem { diff --git a/GUI/Models/GUIDomainSampleVisitor.cpp b/GUI/Models/GUIDomainSampleVisitor.cpp index 2984a2f27e793293f1a4670bb5b0aa3536a70e47..708377c807d705cd6313aa619f2f7465ddf93d3b 100644 --- a/GUI/Models/GUIDomainSampleVisitor.cpp +++ b/GUI/Models/GUIDomainSampleVisitor.cpp @@ -358,10 +358,10 @@ void GUIDomainSampleVisitor::visit(const FormFactorCosineRippleGauss* sample) void GUIDomainSampleVisitor::visit(const FormFactorCosineRippleLorentz* sample) { SessionItem* particle_item = m_levelToParentItem[depth() - 1]; - SessionItem* ff_item = AddFormFactorItem<CosineRippleLorentzItem>(particle_item); - ff_item->setItemValue(CosineRippleLorentzItem::P_LENGTH, sample->getLength()); - ff_item->setItemValue(CosineRippleLorentzItem::P_WIDTH, sample->getWidth()); - ff_item->setItemValue(CosineRippleLorentzItem::P_HEIGHT, sample->getHeight()); + CosineRippleLorentzItem* ff_item = AddFormFactorItem<CosineRippleLorentzItem>(particle_item); + ff_item->setLength(sample->getLength()); + ff_item->setWidth(sample->getWidth()); + ff_item->setHeight(sample->getHeight()); m_levelToParentItem[depth()] = particle_item; }