BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
mousemovereporter.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/mousemovereporter.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_MOUSEMOVEREPORTER_H
16 #define BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_MOUSEMOVEREPORTER_H
17 
18 #include "mvvm/view_export.h"
19 #include <functional>
20 #include <memory>
21 
22 class QCustomPlot;
23 
24 namespace ModelView {
25 
26 struct MousePosInfo;
27 
28 //! Tracks mouse moves in QCustomPlot canvas.
29 //! Notifies client about mouse moves and corresponding pointer coordinates expressed in axes units
30 //! at current zoom level.
31 
32 class MVVM_VIEW_EXPORT MouseMoveReporter {
33 public:
34  using callback_t = std::function<void(const MousePosInfo& pos_info)>;
35  MouseMoveReporter(QCustomPlot* custom_plot, callback_t callback);
37 
38 private:
39  struct MouseMoveReporterImpl;
40  std::unique_ptr<MouseMoveReporterImpl> p_impl;
41 };
42 
43 } // namespace ModelView
44 
45 #endif // BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_MOUSEMOVEREPORTER_H
Tracks mouse moves in QCustomPlot canvas.
std::function< void(const MousePosInfo &pos_info)> callback_t
std::unique_ptr< MouseMoveReporterImpl > p_impl
materialitems.h Collection of materials to populate MaterialModel.
Aggregate to hold mouse position info in QCustomPlot context.
Definition: mouseposinfo.h:27