BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
graphitem.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/graphitem.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_GRAPHITEM_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_GRAPHITEM_H
17 
19 
20 namespace ModelView {
21 
22 class Data1DItem;
23 class PenItem;
24 
25 //! One-dimensional graph representation of Data1DItem.
26 //! Contains plot properties (i.e. color, line type etc) and link to Data1DItem, which will provide
27 //! actual data to plot. GraphItem is intended for plotting only via GraphViewportItem.
28 
29 class MVVM_MODEL_EXPORT GraphItem : public CompoundItem {
30 public:
31  static inline const std::string P_LINK = "P_LINK";
32  static inline const std::string P_GRAPH_TITLE = "P_GRAPH_TITLE";
33  static inline const std::string P_PEN = "P_PEN";
34  static inline const std::string P_DISPLAYED = "P_DISPLAYED";
35 
36  GraphItem(const std::string& model_type = Constants::GraphItemType);
37 
38  void setDataItem(const Data1DItem* item);
39 
40  void setFromGraphItem(const GraphItem* graph_item);
41 
42  Data1DItem* dataItem() const;
43 
44  std::vector<double> binCenters() const;
45 
46  std::vector<double> binValues() const;
47 
48  std::vector<double> binErrors() const;
49 
50  std::string colorName() const;
51  void setNamedColor(const std::string& named_color);
52 
53  PenItem* penItem() const;
54 };
55 
56 } // namespace ModelView
57 
58 #endif // BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_GRAPHITEM_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
Represents basics settings of QPen.
Defines class CLASS?
const model_type GraphItemType
Definition: mvvm_types.h:53
materialitems.h Collection of materials to populate MaterialModel.
std::string model_type
Definition: types.h:23
std::vector< double > binValues(const QCPGraph *graph)
Returns vector representing y-values on QCPgraph.
std::vector< double > binErrors(const QCPGraph *graph)
Returns vector representing bin errors of QCPGraph.
std::vector< double > binCenters(const QCPGraph *graph)
Returns vector representing bin centers on QCPgraph.