BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
sceneadapterinterface.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/sceneadapterinterface.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_SCENEADAPTERINTERFACE_H
16 #define BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_SCENEADAPTERINTERFACE_H
17 
18 #include "mvvm/view_export.h"
19 
20 class QRectF;
21 
22 namespace ModelView {
23 
24 //! Interface to convert coordinates of "scene" to coordinates of "widget".
25 //! Used in the context of QCustomPlot being embedded into QGraphicsScene. Converts QGraphicsScene
26 //! coordinates in the coordinates of local system of QCustomPlot and vice versa.
27 
28 class MVVM_VIEW_EXPORT SceneAdapterInterface {
29 public:
30  virtual ~SceneAdapterInterface() = default;
31 
32  //! convert local x-coordinate to scene coordinate
33  virtual double toSceneX(double) const = 0;
34 
35  //! convert local y-coordinate to scene coordinate
36  virtual double toSceneY(double) const = 0;
37 
38  //! convert scene x-coordinate to local axis coordinate
39  virtual double fromSceneX(double) const = 0;
40 
41  //! convert scene y-coordinate to local axis coordinate
42  virtual double fromSceneY(double) const = 0;
43 
44  //! returns viewport rectangle in scene coordinates
45  virtual QRectF viewportRectangle() const = 0;
46 };
47 
48 } // namespace ModelView
49 
50 #endif // BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_SCENEADAPTERINTERFACE_H
Interface to convert coordinates of "scene" to coordinates of "widget".
virtual ~SceneAdapterInterface()=default
virtual double toSceneY(double) const =0
convert local y-coordinate to scene coordinate
virtual double fromSceneY(double) const =0
convert scene y-coordinate to local axis coordinate
virtual double toSceneX(double) const =0
convert local x-coordinate to scene coordinate
virtual double fromSceneX(double) const =0
convert scene x-coordinate to local axis coordinate
virtual QRectF viewportRectangle() const =0
returns viewport rectangle in scene coordinates
materialitems.h Collection of materials to populate MaterialModel.