BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
graphplotcontroller.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/view/mvvm/plotting/graphplotcontroller.h
6 //! @brief Defines 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 Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_GRAPHPLOTCONTROLLER_H
16 #define BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_GRAPHPLOTCONTROLLER_H
17 
19 #include "mvvm/view_export.h"
20 #include <memory>
21 
22 class QCustomPlot;
23 
24 namespace ModelView {
25 
26 class GraphItem;
27 
28 //! Establish communication between QCPGraph and GraphItem.
29 //! Provides update on QCPGraph (data points, line style, color, etc) when GraphItem is changed.
30 //! QCPGraph is added to QCustomPlot plottables, when controller is created, and removed from
31 //! plottables when controller is destroyed.
32 
33 class MVVM_VIEW_EXPORT GraphPlotController : public ItemListener<GraphItem> {
34 public:
35  explicit GraphPlotController(QCustomPlot* plot);
37 
38 protected:
39  void subscribe() override;
40  void unsubscribe() override;
41 
42 private:
44  std::unique_ptr<GraphItemControllerImpl> p_impl;
45 };
46 
47 } // namespace ModelView
48 
49 #endif // BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_GRAPHPLOTCONTROLLER_H
Establish communication between QCPGraph and GraphItem.
std::unique_ptr< GraphItemControllerImpl > p_impl
Base class to subscribe to signals generated by SessionItem of certin type.
Definition: itemlistener.h:26
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.