Skip to content
Snippets Groups Projects

Move roughness from LayerInterface to Layer (#20)

Merged Mikhail Svechnikov requested to merge m.i20 into main
All threads resolved!
Files
3
@@ -25,7 +25,6 @@
#include "Resample/Specular/ComputeFluxScalar.h"
#include "Sample/Aggregate/IInterference.h"
#include "Sample/Aggregate/ParticleLayout.h"
#include "Sample/Interface/LayerInterface.h"
#include "Sample/Interface/LayerRoughness.h"
#include "Sample/Material/MaterialBySLDImpl.h"
#include "Sample/Material/MaterialUtil.h"
@@ -81,14 +80,6 @@ std::vector<ZLimits> particleSpans(const MultiLayer& sample)
return result;
}
//! Returns top roughness of layer
const LayerRoughness* layerTopRoughness(const MultiLayer& sample, size_t i)
{
if (i == 0)
return nullptr;
return sample.layerInterface(i - 1)->roughness();
}
//! Returns a vector of slices that represent the layer structure of the sample.
//!
//! Each slice is either a layer, or a fraction of a layer.
@@ -121,8 +112,8 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
} else {
if (i == nLayers - 1)
ASSERT(tl == 0);
const LayerRoughness* roughness = layerTopRoughness(sample, i);
const double rms = sample.layerInterfaceRMS(i - 1);
const LayerRoughness* roughness = sample.layer(i)->roughness();
const double rms = sample.layerRoughnessRMS(i);
result.addSlice(tl, *material, roughness, rms);
}
}
@@ -136,8 +127,8 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
double tl = layer->thickness();
const Material* const material = layer->material();
const ZLimits& particle_span = particle_spans[i];
const LayerRoughness* roughness = layerTopRoughness(sample, i);
const double rms = (i >= 1) ? sample.layerInterfaceRMS(i - 1) : 0.0;
const LayerRoughness* roughness = sample.layer(i)->roughness();
const double rms = sample.layerRoughnessRMS(i);
// if no slicing is needed, create single slice for the layer
if (!particle_span.isFinite()) { // also if layer contains no particles
Loading