Skip to content
Snippets Groups Projects

Introduce class "LayerStack" (#20)

Merged Mikhail Svechnikov requested to merge m.i20b into main

The sample hierarchy is the following:

Sample owns LayerStack which contains ILayers: Layers or other LayerStacks.

Sample::addLayer(ILayer) adds new element to the internal LayerStack of Sample.

After adding the new element, the internal cache members of Sample, containing the unwrapped layer sequence, are updated.

Sample does not accept stacks or layers as arguments, because is also requires ambient and substrate which should not be repeated and somehow more related to the sample environment rather than layered structure.

In two examples the for loop was replaced with the new stack API: specular/RoughnessModel.py and scatter2d/CorrelatedRoughness.py

The usage:

    # create periodic stack
    n_repetitions = 10
    stack = ba.LayerStack(n_repetitions)
    stack.addLayer(ti_layer)
    stack.addLayer(ni_layer)
    
    # create sample
    sample = ba.Sample()
    sample.addLayer(ambient_layer)
    sample.addLayer(stack)
    sample.addLayer(substrate_layer)

The GUI is untouched.

Edited by Mikhail Svechnikov

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading