From 259b7628aca76241cca1d7b7b8bf3497ea9e852b Mon Sep 17 00:00:00 2001 From: Mikhail Svechnikov <m.svechnikov@fz-juelich.de> Date: Mon, 12 Aug 2024 15:00:14 +0200 Subject: [PATCH] rename --- GUI/Model/Sample/CrosscorrelationItems.cpp | 6 +++--- GUI/Model/Sample/CrosscorrelationItems.h | 4 ++-- GUI/Model/Sample/RoughnessCatalog.cpp | 15 ++++++++------- GUI/Model/Sample/RoughnessCatalog.h | 2 +- Sample/Interface/CrosscorrelationModels.cpp | 12 ++++++------ Sample/Interface/CrosscorrelationModels.h | 10 +++++----- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/GUI/Model/Sample/CrosscorrelationItems.cpp b/GUI/Model/Sample/CrosscorrelationItems.cpp index 798ecb21881..74f505a0d18 100644 --- a/GUI/Model/Sample/CrosscorrelationItems.cpp +++ b/GUI/Model/Sample/CrosscorrelationItems.cpp @@ -23,7 +23,7 @@ const QString CrosscorrelationDepth("CrosscorrelationDepth"); } // namespace Tag } // namespace -FixedDepthCrosscorrelationItem::FixedDepthCrosscorrelationItem(double cross_corr_depth) +CommonDepthCrosscorrelationItem::CommonDepthCrosscorrelationItem(double cross_corr_depth) { m_crosscorrelation_depth.init( "Crosscorrelation depth (nm)", @@ -31,12 +31,12 @@ FixedDepthCrosscorrelationItem::FixedDepthCrosscorrelationItem(double cross_corr cross_corr_depth, "crossCorrDepth"); } -void FixedDepthCrosscorrelationItem::writeTo(QXmlStreamWriter* w) const +void CommonDepthCrosscorrelationItem::writeTo(QXmlStreamWriter* w) const { m_crosscorrelation_depth.writeTo2(w, Tag::CrosscorrelationDepth); } -void FixedDepthCrosscorrelationItem::readFrom(QXmlStreamReader* r) +void CommonDepthCrosscorrelationItem::readFrom(QXmlStreamReader* r) { while (r->readNextStartElement()) { QString tag = r->name().toString(); diff --git a/GUI/Model/Sample/CrosscorrelationItems.h b/GUI/Model/Sample/CrosscorrelationItems.h index 04493becf75..021f424ce6b 100644 --- a/GUI/Model/Sample/CrosscorrelationItems.h +++ b/GUI/Model/Sample/CrosscorrelationItems.h @@ -30,9 +30,9 @@ protected: CrosscorrelationItem() = default; }; -class FixedDepthCrosscorrelationItem : public CrosscorrelationItem { +class CommonDepthCrosscorrelationItem : public CrosscorrelationItem { public: - FixedDepthCrosscorrelationItem(double cross_corr_depth); + CommonDepthCrosscorrelationItem(double cross_corr_depth); void writeTo(QXmlStreamWriter* w) const override; void readFrom(QXmlStreamReader* r) override; diff --git a/GUI/Model/Sample/RoughnessCatalog.cpp b/GUI/Model/Sample/RoughnessCatalog.cpp index c3cdd57fb5f..9c9d59f648d 100644 --- a/GUI/Model/Sample/RoughnessCatalog.cpp +++ b/GUI/Model/Sample/RoughnessCatalog.cpp @@ -103,15 +103,15 @@ CrosscorrelationItem* CrosscorrelationCatalog::create(Type type) switch (type) { case Type::None: return nullptr; - case Type::FixDepth: - return new FixedDepthCrosscorrelationItem(0); + case Type::CommonDepth: + return new CommonDepthCrosscorrelationItem(0); } ASSERT_NEVER; } QVector<CrosscorrelationCatalog::Type> CrosscorrelationCatalog::types() { - return {Type::None, Type::FixDepth}; + return {Type::None, Type::CommonDepth}; } UiInfo CrosscorrelationCatalog::uiInfo(Type type) @@ -119,8 +119,9 @@ UiInfo CrosscorrelationCatalog::uiInfo(Type type) switch (type) { case Type::None: return {"None", "", ""}; - case Type::FixDepth: - return {"FixDepth", "Spatial frequency-independent crosscorrelation", ""}; + case Type::CommonDepth: + return {"CommonDepth", "Roughness crosscorrelation does not depend on spatial frequency", + ""}; } ASSERT_NEVER; } @@ -130,8 +131,8 @@ CrosscorrelationCatalog::Type CrosscorrelationCatalog::type(const Crosscorrelati if (!item) return Type::None; - if (dynamic_cast<const FixedDepthCrosscorrelationItem*>(item)) - return Type::FixDepth; + if (dynamic_cast<const CommonDepthCrosscorrelationItem*>(item)) + return Type::CommonDepth; ASSERT_NEVER; } diff --git a/GUI/Model/Sample/RoughnessCatalog.h b/GUI/Model/Sample/RoughnessCatalog.h index a576ebb883d..63ac048c00d 100644 --- a/GUI/Model/Sample/RoughnessCatalog.h +++ b/GUI/Model/Sample/RoughnessCatalog.h @@ -65,7 +65,7 @@ public: class CrosscorrelationCatalog { public: // Do not change the numbering! It is serialized! - enum class Type : uint8_t { None = 0, FixDepth = 1 }; + enum class Type : uint8_t { None = 0, CommonDepth = 1 }; //! Creates the item of the given type. static CrosscorrelationItem* create(Type type); diff --git a/Sample/Interface/CrosscorrelationModels.cpp b/Sample/Interface/CrosscorrelationModels.cpp index 613cf1d5107..268281d24b2 100644 --- a/Sample/Interface/CrosscorrelationModels.cpp +++ b/Sample/Interface/CrosscorrelationModels.cpp @@ -16,18 +16,18 @@ #include "Base/Py/PyFmt.h" #include <cmath> -FixedDepthCrosscorrelation::FixedDepthCrosscorrelation(double cross_corr_depth) +CommonDepthCrosscorrelation::CommonDepthCrosscorrelation(double cross_corr_depth) : m_crosscorrelation_depth(cross_corr_depth) { validateOrThrow(); } -FixedDepthCrosscorrelation* FixedDepthCrosscorrelation::clone() const +CommonDepthCrosscorrelation* CommonDepthCrosscorrelation::clone() const { - return new FixedDepthCrosscorrelation(m_crosscorrelation_depth); + return new CommonDepthCrosscorrelation(m_crosscorrelation_depth); } -std::string FixedDepthCrosscorrelation::validate() const +std::string CommonDepthCrosscorrelation::validate() const { std::vector<std::string> errs; requestGe0(errs, m_crosscorrelation_depth, "crossCorrLength"); @@ -37,12 +37,12 @@ std::string FixedDepthCrosscorrelation::validate() const return ""; } -std::string FixedDepthCrosscorrelation::pythonArguments() const +std::string CommonDepthCrosscorrelation::pythonArguments() const { return Py::Fmt::printArguments({{m_crosscorrelation_depth, parDefs()[0].unit}}); } -double FixedDepthCrosscorrelation::replicationFactor(double thickness) const +double CommonDepthCrosscorrelation::replicationFactor(double thickness) const { if (m_crosscorrelation_depth == 0) return 0; diff --git a/Sample/Interface/CrosscorrelationModels.h b/Sample/Interface/CrosscorrelationModels.h index 61b9c2a58f1..d72630b5cff 100644 --- a/Sample/Interface/CrosscorrelationModels.h +++ b/Sample/Interface/CrosscorrelationModels.h @@ -34,15 +34,15 @@ public: //! The crosscorrelation factor depends on the distance between interfaces and does not depend //! on the spatial frequency of roughness. -class FixedDepthCrosscorrelation : public CrosscorrelationModel { +class CommonDepthCrosscorrelation : public CrosscorrelationModel { public: - FixedDepthCrosscorrelation(double cross_corr_depth = 0); - FixedDepthCrosscorrelation* clone() const override; - std::string className() const override { return "FixedDepthCrosscorrelation"; } + CommonDepthCrosscorrelation(double cross_corr_depth = 0); + CommonDepthCrosscorrelation* clone() const override; + std::string className() const override { return "CommonDepthCrosscorrelation"; } std::string validate() const override; double crossCorrLength(const R3&) const override { return m_crosscorrelation_depth; } double replicationFactor(double thickness) const override; - std::vector<ParaMeta> parDefs() const final { return {{"CrossCorrDepth", "nm"}}; } + std::vector<ParaMeta> parDefs() const final { return {{"CrosscorrDepth", "nm"}}; } #ifndef SWIG std::string pythonArguments() const override; -- GitLab