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

adapt ItemizeSample

parent 2a1c71ef
No related branches found
No related tags found
1 merge request!2712Move out {sigma, hurst, correlationLength} to autocorrelation model class
......@@ -282,29 +282,34 @@ void set_RadialParacrystalItem(InterferenceRadialParacrystalItem* parent,
set_PositionVariance(parent, sample);
}
void set_Roughness(LayerItem* parent, const LayerInterface* top_interface)
void set_InterlayerModel(RoughnessItem* parent, const InterlayerModel* interlayer)
{
parent->roughnessSelection().setCertainItem(nullptr);
if (top_interface) {
const LayerRoughness* roughness = top_interface->roughness();
const auto* autoCorr = dynamic_cast<const BasicAutoCorr*>(roughness->autoCorrModel());
ASSERT(autoCorr); // TODO temporary
if (dynamic_cast<const ErfInterlayer*>(interlayer))
parent->interlayerModelSelection().setCertainItem(new ErfInterlayerItem);
else if (dynamic_cast<const TanhInterlayer*>(interlayer))
parent->interlayerModelSelection().setCertainItem(new TanhInterlayerItem);
else
ASSERT_NEVER;
}
if (roughness && !(autoCorr->allZero())) {
auto* t = new BasicRoughnessItem(roughness->sigma(), autoCorr->hurst(),
autoCorr->lateralCorrLength());
void set_Roughness(LayerItem* parent, const LayerInterface* top_interface)
{
if (!top_interface) {
parent->roughnessSelection().setCertainItem(nullptr);
return;
}
if (dynamic_cast<const ErfInterlayer*>(roughness->interlayerModel()))
t->interlayerModelSelection().setCertainItem(new ErfInterlayerItem);
else if (dynamic_cast<const TanhInterlayer*>(roughness->interlayerModel()))
t->interlayerModelSelection().setCertainItem(new TanhInterlayerItem);
else
ASSERT_NEVER;
const LayerRoughness* roughness = top_interface->roughness();
const AutoCorrModel* autoCorr = roughness->autoCorrModel();
const InterlayerModel* interlayer = roughness->interlayerModel();
parent->roughnessSelection().setCertainItem(t);
}
}
if (const auto* autoCorrItem = dynamic_cast<const BasicAutoCorr*>(autoCorr)) {
auto* br = new BasicRoughnessItem(autoCorrItem->sigma(), autoCorrItem->hurst(),
autoCorrItem->lateralCorrLength());
set_InterlayerModel(br, interlayer);
parent->roughnessSelection().setCertainItem(br);
} else
ASSERT_NEVER;
}
void set_Rotation(ItemWithParticles* parent, const IRotation* rotation)
......
......@@ -44,11 +44,6 @@ public:
#ifndef SWIG
//! Creates the Python constructor of this class
std::string pythonArguments() const;
bool allZero() const
{
return sigma() == 0 && hurst() == 0 && lateralCorrLength() == 0;
}
#endif
//! Returns power spectral density of the surface roughness
......
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