34 throw std::runtime_error(
"Error in create_slice(): not a layer.");
41 auto material = layer.
model()->
findItem(material_property.identifier());
45 return {
complex_t{sld_real, sld_imag}, thickness, sigma};
54 result.push_back(create_slice(*item));
57 for (
int i_rep = 0; i_rep < rep_count; ++i_rep)
58 AddToMultiSlice(result, *item);
60 throw std::runtime_error(
"Error in AddToMultiSlice: unsupported item type.");
70 AddToMultiSlice(result, multilayer);
76 std::vector<Slice> result;
77 result.reserve(multislice.size());
79 for (
auto& slice : multislice) {
80 auto material =
MaterialBySLD(
"", slice.material.real(), slice.material.imag());
83 result.emplace_back(slice.thickness, material, roughness);
std::complex< double > complex_t
Defines class LayerRoughness.
Factory functions used to create material instances.
A roughness of interface between two layers.
Property to carry text, color and identifier.
The main object representing an editable/displayable/serializable entity.
std::vector< SessionItem * > getItems(const std::string &tag) const
Returns all children stored at given tag.
SessionModel * model() const
Returns the model to which given item belongs to.
T property(const std::string &tag) const
Returns data stored in property item.
T * item(const std::string &tag) const
Returns first item under given tag casted to a specified type.
model_type modelType() const
Returns item's model type.
SessionItem * findItem(const identifier_type &id)
Returns SessionItem for given identifier.
static const std::string P_MATERIAL
static const std::string P_THICKNESS
static const std::string P_ROUGHNESS
Multi layer capable of holding layers and other multi-layers.
static const std::string T_LAYERS
static const std::string P_NREPETITIONS
static const std::string P_SIGMA
static const std::string P_SLD_REAL
static const std::string P_SLD_IMAG
const std::string MultiLayerItemType
const std::string LayerItemType
DAREFLCORE_EXPORT std::vector< Slice > createBornAgainSlices(const multislice_t &multislice)
DAREFLCORE_EXPORT multislice_t CreateMultiSlice(const MultiLayerItem &multilayer)
Creates multi-slice presentation of internal multilayer structure.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
std::vector< SliceData > multislice_t