47 item_pool = std::make_shared<ItemPool>();
48 m_material_model = std::make_unique<MaterialModel>(item_pool);
49 m_sample_model = std::make_unique<SampleModel>(item_pool);
50 m_sld_view_model = std::make_unique<SLDElementModel>();
51 m_job_model = std::make_unique<JobModel>(item_pool);
52 m_experimental_model = std::make_unique<ExperimentalDataModel>(item_pool);
53 m_instrument_model = std::make_unique<InstrumentModel>(item_pool);
54 m_material_controller = std::make_unique<MaterialPropertyController>(m_material_model.get(),
55 m_sample_model.get());
56 m_data_controller = std::make_unique<ExperimentalDataController>(m_experimental_model.get(),
57 m_instrument_model.get());
58 m_sample_model->create_default_multilayer();
59 update_material_properties();
67 auto multilayer = Utils::TopItem<MultiLayerItem>(m_sample_model.get());
70 for (
const auto& material_property : m_material_model->material_data()) {
71 if (index < layers.size())
80 return {m_material_model.get(), m_sample_model.get(), m_instrument_model.get(),
81 m_experimental_model.get()};
87 return {m_material_model.get(), m_sample_model.get(), m_instrument_model.get(),
88 m_sld_view_model.get(), m_job_model.get(), m_experimental_model.get()};
98 return p_impl->m_material_model.get();
103 return p_impl->m_sample_model.get();
108 return p_impl->m_sld_view_model.get();
113 return p_impl->m_job_model.get();
118 return p_impl->m_experimental_model.get();
123 return p_impl->m_instrument_model.get();
128 return p_impl->persistent_models();
135 return p_impl->application_models();
SampleModel * sampleModel()
std::vector< ModelView::SessionModel * > application_models() const
Return vector of all models of our application.
SLDElementModel * sldViewModel()
ExperimentalDataModel * experimentalDataModel()
MaterialModel * materialModel()
std::unique_ptr< ApplicationModelsImpl > p_impl
std::vector< ModelView::SessionModel * > persistent_models() const override
Returns vector of models intended for saving on disk.
InstrumentModel * instrumentModel()
The model to store imported reflectometry data.
Model to store specular instruments settings.
The model to store results of (possibly) multiple reflectometry simulation, and all viewports,...
Layer with name, thickness and reference to material.
static const std::string P_MATERIAL
Model to hold MaterialItems.
static const std::string T_LAYERS
The model of the sld layer visual representation.
Model to hold layers and multi-layers.
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
std::unique_ptr< MaterialModel > m_material_model
std::unique_ptr< SLDElementModel > m_sld_view_model
std::unique_ptr< SampleModel > m_sample_model
std::unique_ptr< ExperimentalDataModel > m_experimental_model
std::unique_ptr< JobModel > m_job_model
std::unique_ptr< MaterialPropertyController > m_material_controller
std::shared_ptr< ItemPool > item_pool
std::vector< SessionModel * > application_models() const
All application models.
std::unique_ptr< InstrumentModel > m_instrument_model
std::vector< SessionModel * > persistent_models() const
Models intended for saving.
void update_material_properties()
Runs through all layers and assign materials.
std::unique_ptr< ExperimentalDataController > m_data_controller