diff --git a/GUI/Model/FromCore/ItemizeSample.cpp b/GUI/Model/FromCore/ItemizeSample.cpp index b5e537755225f63878281148f5390af1e2e2706c..985e7e79b02e26371abc59e5eaa9b7916f0f0250 100644 --- a/GUI/Model/FromCore/ItemizeSample.cpp +++ b/GUI/Model/FromCore/ItemizeSample.cpp @@ -288,10 +288,9 @@ void set_Roughness(LayerItem* parent, const LayerInterface* top_interface) if (top_interface) { const LayerRoughness* roughness = top_interface->roughness(); if (roughness && !(roughness->allZero())) { - auto* t = new BasicRoughnessItem; - t->setSigma(roughness->sigma()); - t->setHurst(roughness->hurst()); - t->setLateralCorrelationLength(roughness->lateralCorrLength()); + auto* t = new BasicRoughnessItem(roughness->sigma(), + roughness->hurst(), + roughness->lateralCorrLength()); parent->roughnessSelection().setCertainItem(t); } } diff --git a/GUI/Model/Sample/RoughnessCatalog.cpp b/GUI/Model/Sample/RoughnessCatalog.cpp index b6ebf75e4fd142571758a07c8f141474ca92697c..0c8d6b937b556613407f46d45526c129d58245d5 100644 --- a/GUI/Model/Sample/RoughnessCatalog.cpp +++ b/GUI/Model/Sample/RoughnessCatalog.cpp @@ -22,7 +22,7 @@ RoughnessItem* RoughnessCatalog::create(Type type) case Type::None: return nullptr; case Type::Basic: - return new BasicRoughnessItem; + return new BasicRoughnessItem(0., .3, 5.); } ASSERT_NEVER; } diff --git a/GUI/Model/Sample/RoughnessItems.cpp b/GUI/Model/Sample/RoughnessItems.cpp index 2037a7a04cee0ff90bfad82899037cbeb6823e79..0aae41d68d8c62fe6c704d7d7c0112fb3e8abaea 100644 --- a/GUI/Model/Sample/RoughnessItems.cpp +++ b/GUI/Model/Sample/RoughnessItems.cpp @@ -25,15 +25,16 @@ const QString LateralCorrelationLength("LateralCorrelationLength"); } // namespace Tag } // namespace -BasicRoughnessItem::BasicRoughnessItem() +BasicRoughnessItem::BasicRoughnessItem(double sigma, double hurst, double corr_length) { - m_sigma.init("Sigma (nm)", "rms of the roughness", 0.0, "sigma"); + m_sigma.init("Sigma (nm)", "rms of the roughness", sigma, "sigma"); m_hurst.init("Hurst", "Hurst parameter which describes how jagged the interface,\n " "dimensionless [0.0, 1.0], where 0.0 gives more spikes, \n1.0 more smoothness.", - 0.3, 3, RealLimits::limited(0.0, 1.0), "hurst"); + hurst, 3, RealLimits::limited(0.0, 1.0), "hurst"); m_lateral_correlation_length.init( - "Correlation length (nm)", "Lateral correlation length of the roughness", 5.0, "corrLen"); + "Correlation length (nm)", "Lateral correlation length of the roughness", corr_length, + "corrLen"); } void BasicRoughnessItem::writeTo(QXmlStreamWriter* w) const diff --git a/GUI/Model/Sample/RoughnessItems.h b/GUI/Model/Sample/RoughnessItems.h index ecaa4c8a2493e1944c2cc58f44b435d8e38cab16..a454d9c8599a24762df46f9a300f3c4db6879271 100644 --- a/GUI/Model/Sample/RoughnessItems.h +++ b/GUI/Model/Sample/RoughnessItems.h @@ -31,7 +31,7 @@ protected: class BasicRoughnessItem : public RoughnessItem { public: - BasicRoughnessItem(); + BasicRoughnessItem(double sigma, double hurst, double corr_length); DoubleProperty& sigma() { return m_sigma; } const DoubleProperty& sigma() const { return m_sigma; }