Skip to content
Snippets Groups Projects
Commit 259b7628 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

rename

parent 448d35b2
No related branches found
No related tags found
1 merge request!2715Replace single crossCorrelationLength parameter by CrosscorrelationModel individual for each interface
......@@ -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();
......
......@@ -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;
......
......@@ -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;
}
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment