BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
graphcanvas.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/graphcanvas.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_GRAPHCANVAS_H
16 #define BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_GRAPHCANVAS_H
17 
18 #include "mvvm/view_export.h"
19 #include <QWidget>
20 #include <memory>
21 
22 namespace ModelView {
23 
24 class GraphViewportItem;
25 class SceneAdapterInterface;
26 
27 //! Widget to show scientific figure with multiple 1D graphs.
28 //! Contains embedded QCustomPlot widget, shows content of GraphViewportItem.
29 
30 class MVVM_VIEW_EXPORT GraphCanvas : public QWidget {
31  Q_OBJECT
32 
33 public:
34  explicit GraphCanvas(QWidget* parent = nullptr);
35  ~GraphCanvas() override;
36 
37  void setItem(GraphViewportItem* viewport_item);
38 
39  std::unique_ptr<SceneAdapterInterface> createSceneAdapter() const;
40 
41  void setViewportToContent(double left, double top, double right, double bottom);
42 
43  void setViewportToContent();
44 
45  void setAxisMargins(int left, int top, int right, int bottom);
46 
47 signals:
48  void axisMarginsChanged(int left, int top, int right, int bottom);
49 
50 private:
51  struct GraphCanvasImpl;
52  std::unique_ptr<GraphCanvasImpl> p_impl;
53 };
54 
55 } // namespace ModelView
56 
57 #endif // BORNAGAIN_MVVM_VIEW_MVVM_PLOTTING_GRAPHCANVAS_H
Widget to show scientific figure with multiple 1D graphs.
Definition: graphcanvas.h:30
std::unique_ptr< GraphCanvasImpl > p_impl
Definition: graphcanvas.h:51
void axisMarginsChanged(int left, int top, int right, int bottom)
2D viewport specialized for showing multiple GraphItem's.
materialitems.h Collection of materials to populate MaterialModel.