BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
customplotsceneadapter.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/customplotsceneadapter.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_CUSTOMPLOTSCENEADAPTER_H
16 #define BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_CUSTOMPLOTSCENEADAPTER_H
17 
19 #include <memory>
20 
21 class QCustomPlot;
22 
23 namespace ModelView {
24 
25 //! Converts QGraphicsScene coordinates in the coordinates of local system of QCustomPlot
26 //! and vice versa.
27 
28 class MVVM_VIEW_EXPORT CustomPlotSceneAdapter : public SceneAdapterInterface {
29 public:
30  explicit CustomPlotSceneAdapter(QCustomPlot* custom_plot);
31  ~CustomPlotSceneAdapter() override;
32 
33  double toSceneX(double customplot_x) const override;
34 
35  double toSceneY(double customplot_y) const override;
36 
37  double fromSceneX(double scene_x) const override;
38 
39  double fromSceneY(double scene_y) const override;
40 
41  QRectF viewportRectangle() const override;
42 
43 private:
45  std::unique_ptr<CustomPlotSceneAdapterImpl> p_impl;
46 };
47 
48 } // namespace ModelView
49 
50 #endif // BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_CUSTOMPLOTSCENEADAPTER_H
Converts QGraphicsScene coordinates in the coordinates of local system of QCustomPlot and vice versa.
std::unique_ptr< CustomPlotSceneAdapterImpl > p_impl
Interface to convert coordinates of "scene" to coordinates of "widget".
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?