BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
viewportitem.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/model/mvvm/standarditems/viewportitem.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_MODEL_MVVM_STANDARDITEMS_VIEWPORTITEM_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_VIEWPORTITEM_H
17 
19 
20 namespace ModelView {
21 
22 class ViewportAxisItem;
23 
24 //! Base class to represent 2D viewport.
25 //! Contains x,y axis, indended to display graphs or 2d colormaps.
26 
27 class MVVM_MODEL_EXPORT ViewportItem : public CompoundItem {
28 public:
29  static inline const std::string P_XAXIS = "P_XAXIS";
30  static inline const std::string P_YAXIS = "P_YAXIS";
31  static inline const std::string T_ITEMS = "T_ITEMS";
32 
33  ViewportItem(const model_type& model);
34 
35  ViewportAxisItem* xAxis() const;
36 
37  ViewportAxisItem* yAxis() const;
38 
39  virtual void setViewportToContent(double left, double top, double right, double bottom);
40 
41  virtual void setViewportToContent();
42 
43 protected:
44  void register_xy_axes();
45 
46 protected:
47  virtual std::pair<double, double> data_xaxis_range() const = 0;
48  virtual std::pair<double, double> data_yaxis_range() const = 0;
49 };
50 
51 } // namespace ModelView
52 
53 #endif // BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_VIEWPORTITEM_H
Complex item holding mixed SessionItem types (single properties and other CompountItems).
Definition: compounditem.h:28
Item to represent viewport axis.
Definition: axisitems.h:43
Base class to represent 2D viewport.
Definition: viewportitem.h:27
virtual std::pair< double, double > data_xaxis_range() const =0
virtual std::pair< double, double > data_yaxis_range() const =0
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
std::string model_type
Definition: types.h:23