BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
jobitem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/model/jobitem.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 Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_MODEL_JOBITEM_H
16 #define BORNAGAIN_GUI2_MODEL_JOBITEM_H
17 
18 #include "darefl_export.h"
21 
22 namespace ModelView {
23 class Data1DItem;
24 class GraphViewportItem;
25 class GraphItem;
26 } // namespace ModelView
27 
28 namespace gui2 {
29 
30 class CanvasItem;
31 
32 //! Viewport intended for showing SLD profile.
33 //! Provides custom y-axis range.
34 
35 class DAREFLCORE_EXPORT SLDCanvasItem : public ModelView::GraphViewportItem {
36 public:
37  SLDCanvasItem();
38 
39 protected:
40  std::pair<double, double> data_yaxis_range() const override;
41 };
42 
43 //! Represents state of QuickSimEditor.
44 //! Holds results of realtime simulation, SLD profiles and difference plot.
45 
46 class DAREFLCORE_EXPORT JobItem : public ModelView::CompoundItem {
47 public:
48  static inline const std::string P_SLD_DATA = "P_SLD_DATA";
49  static inline const std::string P_SLD_VIEWPORT = "P_SLD_VIEWPORT";
50  static inline const std::string P_SPECULAR_DATA = "P_SPECULAR_DATA";
51  static inline const std::string P_SPECULAR_VIEWPORT = "P_SPECULAR_VIEWPORT";
52  static inline const std::string P_DIFF_DATA = "P_DIFF_DATA";
53  static inline const std::string P_DIFF_VIEWPORT = "P_DIFF_VIEWPORT";
54 
55  JobItem();
56 
57  ModelView::Data1DItem* sldData() const;
58  SLDCanvasItem* sldViewport() const;
59 
60  ModelView::Data1DItem* specularData() const;
61  CanvasItem* specularViewport() const;
62 
63  ModelView::GraphViewportItem* diffViewport() const;
64 
65  void updateReferenceGraph(const ModelView::GraphItem* graph);
66 
67  void updateDifferenceData();
68 
69 private:
70  ModelView::Data1DItem* differenceData() const;
71  ModelView::GraphItem* specularGraph() const;
72  ModelView::GraphItem* referenceGraph() const;
73  ModelView::GraphItem* differenceGraph() const;
74 
75  void setupReferenceGraphFrom(const ModelView::GraphItem* graph);
76  void setupDifferenceGraphFrom(const ModelView::GraphItem* graph);
77  void removeReferenceGraph();
78  void removeDifferenceGraph();
79 
80  void setup_sld_viewport();
81  void setup_specular_viewport();
82  void setup_diff_viewport();
83 };
84 
85 } // namespace gui2
86 
87 #endif // BORNAGAIN_GUI2_MODEL_JOBITEM_H
Complex item holding mixed SessionItem types (single properties and other CompountItems).
Definition: compounditem.h:28
Represents one-dimensional data (axis and values).
Definition: data1ditem.h:30
One-dimensional graph representation of Data1DItem.
Definition: graphitem.h:29
2D viewport specialized for showing multiple GraphItem's.
Holds a collection of GraphItem's for simultaneous plotting, as well as all information related to pl...
Represents state of QuickSimEditor.
Definition: jobitem.h:46
Viewport intended for showing SLD profile.
Definition: jobitem.h:35
Defines class CLASS?
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20