BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
colormapplotcontroller.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/colormapplotcontroller.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_COLORMAPPLOTCONTROLLER_H
16 #define BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_COLORMAPPLOTCONTROLLER_H
17 
19 #include "mvvm/view_export.h"
20 #include <memory>
21 
22 class QCustomPlot;
23 class QCPColorScale;
24 
25 namespace ModelView {
26 
27 class ColorMapItem;
28 
29 //! Establish communication between QCPColorMap and ColorMapItem.
30 //! Provide update on QCPColorMap when ColorMapItem is changed. QCPColorMap is added to
31 //! QCustomPlot plottables, when controller is created, and removed from plottables, when controller
32 //! is destroyed.
33 
34 class MVVM_VIEW_EXPORT ColorMapPlotController : public ItemListener<ColorMapItem> {
35 public:
36  explicit ColorMapPlotController(QCustomPlot* plot, QCPColorScale* color_scale = nullptr);
38 
39 protected:
40  void subscribe() override;
41  void unsubscribe() override;
42 
43 private:
45  std::unique_ptr<ColorMapPlotControllerImpl> p_impl;
46 };
47 
48 } // namespace ModelView
49 
50 #endif // BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_COLORMAPPLOTCONTROLLER_H
Establish communication between QCPColorMap and ColorMapItem.
std::unique_ptr< ColorMapPlotControllerImpl > 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.