29 const double layer_thickness = 100.0 * Units::nanometer;
 
   30 const double length = 50.0 * Units::nanometer;
 
   31 const double width = 20.0 * Units::nanometer;
 
   32 const double height = 10.0 * Units::nanometer;
 
   39     Layer vacuum_layer(refMat::Vacuum);
 
   40     Layer middle_layer(refMat::Teflon, layer_thickness);
 
   41     middle_layer.addLayout(layout);
 
   42     Layer substrate(refMat::Substrate2);
 
   55 MultiLayer* BoxCompositionRotateXBuilder::buildSample()
 const 
   59     composition.addParticle(box, 
kvector_t(0.0, 0.0, 0.0));
 
   60     composition.addParticle(box, 
kvector_t(length / 2.0, 0.0, 0.0));
 
   63     return finalizeMultiLayer(composition);
 
   68 MultiLayer* BoxCompositionRotateYBuilder::buildSample()
 const 
   72     composition.addParticle(box, 
kvector_t(0.0, 0.0, 0.0));
 
   73     composition.addParticle(box, 
kvector_t(length / 2.0, 0.0, 0.0));
 
   76     return finalizeMultiLayer(composition);
 
   81 MultiLayer* BoxCompositionRotateZBuilder::buildSample()
 const 
   85     composition.addParticle(box, 
kvector_t(0.0, 0.0, 0.0));
 
   86     composition.addParticle(box, 
kvector_t(length / 2.0, 0.0, 0.0));
 
   89     return finalizeMultiLayer(composition);
 
   94 MultiLayer* BoxCompositionRotateZandYBuilder::buildSample()
 const 
   98     composition.addParticle(box, 
kvector_t(0.0, 0.0, 0.0));
 
   99     composition.addParticle(box, 
kvector_t(length / 2.0, 0.0, 0.0));
 
  103     return finalizeMultiLayer(composition);
 
  109 MultiLayer* BoxStackCompositionBuilder::buildSample()
 const 
  114     const double box1_length = 20;
 
  115     const double box1_width = 50;
 
  116     const double box1_height = 5;
 
  118     box1.setRotation(
RotationZ(90. * Units::degree));
 
  121     const double box2_length = 5.0;
 
  122     const double box2_width = 20.0;
 
  123     const double box2_height = 50.0;
 
  125     box2.setRotation(
RotationY(90. * Units::degree));
 
  126     box2.setPosition(
kvector_t(-box2_height / 2.0, 0.0, box2_length / 2.0));
 
  128     composition.addParticle(box1, 
kvector_t(0.0, 0.0, 0.0));
 
  129     composition.addParticle(box2, 
kvector_t(0.0, 0.0, box1_height));
 
  133     return finalizeMultiLayer(composition);
 
Defines classes of BoxCompositionBuilder family.
Defines class MultiLayer.
Defines class ParticleComposition.
Defines class ParticleLayout.
Defines materials in namespace refMat.
Defines some unit conversion factors and other constants in namespace Units.
void setPosition(kvector_t position)
Sets relative position of the particle's reference point in the coordinate system of parent.
void rotate(const IRotation &rotation) override final
Rotates the particle.
void setRotation(const IRotation &rotation)
Sets transformation.
A layer, with thickness (in nanometer) and material.
A wrapper for underlying material implementation.
Our sample model: a stack of layers one below the other.
void addLayer(const Layer &layer)
Adds object to multilayer.
A composition of particles at fixed positions.
Decorator class that adds particles to ISample objects.
void addParticle(const IAbstractParticle &particle, double abundance=-1.0, const kvector_t position={}, const IRotation &rotation=IdentityRotation())
Adds particle to the layout with abundance, position and the rotation defined.
A particle with a form factor and refractive index.
A rotation about the x axis.
A rotation about the y axis.
A rotation about the z axis.
Material HomogeneousMaterial(const std::string &name, complex_t refractive_index, kvector_t magnetization)
Constructs a material with name, refractive_index and magnetization (in A/m).