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
@@ -80,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_layer)
{
if (i_layer == 0)
return nullptr;
return sample.layer(i_layer)->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.
@@ -120,7 +112,7 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
} else {
if (i == nLayers - 1)
ASSERT(tl == 0);
const LayerRoughness* roughness = layerTopRoughness(sample, i);
const LayerRoughness* roughness = sample.layer(i)->roughness();
const double rms = sample.layerRoughnessRMS(i);
result.addSlice(tl, *material, roughness, rms);
}
@@ -135,7 +127,7 @@ 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 LayerRoughness* roughness = sample.layer(i)->roughness();
const double rms = sample.layerRoughnessRMS(i);
// if no slicing is needed, create single slice for the layer
Loading