BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
simplotcontroller.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/quicksimeditor/simplotcontroller.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
19 #include "gui2/model/jobitem.h"
20 #include "gui2/model/jobmodel.h"
22 
23 namespace gui2 {
24 
25 SimPlotController::SimPlotController(QObject* parent) : QObject(parent) {}
26 
28 {
29  m_models = models;
30 
31  auto on_model_change = [this]() { onInstrumentChange(); };
32  m_instrumentChangedController = std::make_unique<ModelView::ModelHasChangedController>(
33  m_models->instrumentModel(), on_model_change);
34 }
35 
37 {
38  auto instrument = m_models->instrumentModel()->topItem<SpecularInstrumentItem>();
39  auto graph = instrument->beamItem()->experimentalGraphItem();
41 }
42 
44 
45 } // namespace gui2
Defines class CLASS?
T * topItem() const
Returns top item of the given type.
Definition: sessionmodel.h:126
Main class to holds all models of GUI session.
InstrumentModel * instrumentModel()
void updateReferenceGraph(const ModelView::GraphItem *graph)
Definition: jobmodel.cpp:64
void setModels(ApplicationModels *models)
SimPlotController(QObject *parent=nullptr)
std::unique_ptr< ModelView::ModelHasChangedController > m_instrumentChangedController
ApplicationModels * m_models
ModelView::GraphItem * experimentalGraphItem() const
Returns corresponding experimental graph.
Represents specular instrument.
SpecularBeamItem * beamItem() const
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20
Defines class CLASS?