diff --git a/GUI/Models/FormFactorItems.cpp b/GUI/Models/FormFactorItems.cpp index 329ea81275992a294302e796c42db4cfdc7bca49..79e836df004c4eb6bb7a3cb876f7cc4a46423fc4 100644 --- a/GUI/Models/FormFactorItems.cpp +++ b/GUI/Models/FormFactorItems.cpp @@ -765,6 +765,26 @@ std::unique_ptr<IFormFactor> SawtoothRippleBoxItem::createFormFactor() const getItemValue(P_HEIGHT).toDouble(), getItemValue(P_ASYMMETRY).toDouble()); } +void SawtoothRippleBoxItem::setLength(const double length) +{ + setItemValue(P_LENGTH, length); +} + +void SawtoothRippleBoxItem::setWidth(const double width) +{ + setItemValue(P_WIDTH, width); +} + +void SawtoothRippleBoxItem::setHeight(const double height) +{ + setItemValue(P_HEIGHT, height); +} + +void SawtoothRippleBoxItem::setAsymmetry(const double asymmetry) +{ + setItemValue(P_ASYMMETRY, asymmetry); +} + /* ------------------------------------------------ */ const QString SawtoothRippleGaussItem::P_LENGTH("Length"); diff --git a/GUI/Models/FormFactorItems.h b/GUI/Models/FormFactorItems.h index d23f7a533f407ee5749dbaf4b55ae426db64e366..a5ed3efe364d35038c15aae1cc6ec1042aa4a944 100644 --- a/GUI/Models/FormFactorItems.h +++ b/GUI/Models/FormFactorItems.h @@ -356,16 +356,22 @@ public: }; class BA_CORE_API_ SawtoothRippleBoxItem : public FormFactorItem { -public: +private: static const QString P_LENGTH; static const QString P_WIDTH; static const QString P_HEIGHT; static const QString P_ASYMMETRY; +public: static const QString M_TYPE; SawtoothRippleBoxItem(); std::unique_ptr<IFormFactor> createFormFactor() const override; + + void setLength(double length); + void setWidth(double width); + void setHeight(double height); + void setAsymmetry(double asymmetry); }; class BA_CORE_API_ SawtoothRippleGaussItem : public FormFactorItem { diff --git a/GUI/Models/GUIDomainSampleVisitor.cpp b/GUI/Models/GUIDomainSampleVisitor.cpp index 708377c807d705cd6313aa619f2f7465ddf93d3b..2df1fda43f06912c7d6d1f8eda342926a347e21d 100644 --- a/GUI/Models/GUIDomainSampleVisitor.cpp +++ b/GUI/Models/GUIDomainSampleVisitor.cpp @@ -368,11 +368,11 @@ void GUIDomainSampleVisitor::visit(const FormFactorCosineRippleLorentz* sample) void GUIDomainSampleVisitor::visit(const FormFactorSawtoothRippleBox* sample) { SessionItem* particle_item = m_levelToParentItem[depth() - 1]; - SessionItem* ff_item = AddFormFactorItem<SawtoothRippleBoxItem>(particle_item); - ff_item->setItemValue(SawtoothRippleBoxItem::P_LENGTH, sample->getLength()); - ff_item->setItemValue(SawtoothRippleBoxItem::P_WIDTH, sample->getWidth()); - ff_item->setItemValue(SawtoothRippleBoxItem::P_HEIGHT, sample->getHeight()); - ff_item->setItemValue(SawtoothRippleBoxItem::P_ASYMMETRY, sample->getAsymmetry()); + SawtoothRippleBoxItem* ff_item = AddFormFactorItem<SawtoothRippleBoxItem>(particle_item); + ff_item->setLength(sample->getLength()); + ff_item->setWidth(sample->getWidth()); + ff_item->setHeight(sample->getHeight()); + ff_item->setAsymmetry(sample->getAsymmetry()); m_levelToParentItem[depth()] = particle_item; }