diff --git a/GUI/Models/FormFactorItems.cpp b/GUI/Models/FormFactorItems.cpp index 6c7815cf4b9b9361cbbc13cd2c4e78f440f0a14f..d387567907778a998d9cc56703049ac4d4881e3c 100644 --- a/GUI/Models/FormFactorItems.cpp +++ b/GUI/Models/FormFactorItems.cpp @@ -857,6 +857,27 @@ std::unique_ptr<IFormFactor> SawtoothRippleLorentzItem::createFormFactor() const getItemValue(P_HEIGHT).toDouble(), getItemValue(P_ASYMMETRY).toDouble()); } + +void SawtoothRippleLorentzItem::setLength(const double length) +{ + setItemValue(P_LENGTH, length); +} + +void SawtoothRippleLorentzItem::setWidth(const double width) +{ + setItemValue(P_WIDTH, width); +} + +void SawtoothRippleLorentzItem::setHeight(const double height) +{ + setItemValue(P_HEIGHT, height); +} + +void SawtoothRippleLorentzItem::setAsymmetry(const double asymmetry) +{ + setItemValue(P_ASYMMETRY, asymmetry); +} + /* ------------------------------------------------ */ const QString TetrahedronItem::P_BASEEDGE("BaseEdge"); diff --git a/GUI/Models/FormFactorItems.h b/GUI/Models/FormFactorItems.h index b1061a1e91019bde365225dca2703f1496982819..558c8e20e5863ec5efa2a0453101e923bee9cbd7 100644 --- a/GUI/Models/FormFactorItems.h +++ b/GUI/Models/FormFactorItems.h @@ -394,16 +394,22 @@ public: }; class BA_CORE_API_ SawtoothRippleLorentzItem : 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; SawtoothRippleLorentzItem(); 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_ TetrahedronItem : public FormFactorItem { diff --git a/GUI/Models/GUIDomainSampleVisitor.cpp b/GUI/Models/GUIDomainSampleVisitor.cpp index c0775167f91f2d91dee82e4ea2cb8565021fa81e..30b9a598fb0f9f34146ae452063228354effe554 100644 --- a/GUI/Models/GUIDomainSampleVisitor.cpp +++ b/GUI/Models/GUIDomainSampleVisitor.cpp @@ -390,11 +390,11 @@ void GUIDomainSampleVisitor::visit(const FormFactorSawtoothRippleGauss* sample) void GUIDomainSampleVisitor::visit(const FormFactorSawtoothRippleLorentz* sample) { SessionItem* particle_item = m_levelToParentItem[depth() - 1]; - SessionItem* ff_item = AddFormFactorItem<SawtoothRippleLorentzItem>(particle_item); - ff_item->setItemValue(SawtoothRippleLorentzItem::P_LENGTH, sample->getLength()); - ff_item->setItemValue(SawtoothRippleLorentzItem::P_WIDTH, sample->getWidth()); - ff_item->setItemValue(SawtoothRippleLorentzItem::P_HEIGHT, sample->getHeight()); - ff_item->setItemValue(SawtoothRippleLorentzItem::P_ASYMMETRY, sample->getAsymmetry()); + SawtoothRippleLorentzItem* ff_item = AddFormFactorItem<SawtoothRippleLorentzItem>(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; }