BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
experimentaldataitems.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/model/experimentaldataitems.cpp
6 //! @brief Implements 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 
19 
20 using namespace ModelView;
21 
22 namespace gui2 {
23 
24 CanvasItem::CanvasItem() : GraphViewportItem(Constants::CanvasItemType)
25 {
27  setData(std::string(""));
28 }
29 
30 std::pair<double, double> CanvasItem::data_yaxis_range() const
31 {
32  auto [ymin, ymax] = GraphViewportItem::data_yaxis_range();
33  return {ymin, ymax * 2.0};
34 }
35 
37 
38 std::vector<CanvasItem*> CanvasContainerItem::canvasItems() const
39 {
40  return items<CanvasItem>(T_ITEMS);
41 }
42 
45 {
46 }
47 
48 std::vector<Data1DItem*> ExperimentalDataContainerItem::dataItems() const
49 {
50  return items<ModelView::Data1DItem>(T_ITEMS);
51 }
52 
53 } // namespace gui2
Defines class CLASS?
Simple container to store any type of children.
Definition: containeritem.h:25
static const std::string T_ITEMS
Definition: containeritem.h:27
2D viewport specialized for showing multiple GraphItem's.
std::pair< double, double > data_yaxis_range() const override
Returns lower, upper range on y-axis occupied by all data points of all graphs.
bool setData(const T &value, int role=ItemDataRole::DATA, bool direct=false)
Sets data for a given role.
Definition: sessionitem.h:141
void setProperty(const std::string &tag, const T &value)
Sets value to property item.
Definition: sessionitem.h:190
static const std::string P_IS_LOG
Definition: axisitems.h:46
ViewportAxisItem * yAxis() const
std::vector< CanvasItem * > canvasItems() const
std::pair< double, double > data_yaxis_range() const override
std::vector< ModelView::Data1DItem * > dataItems() const
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
const std::string ExperimentalDataContainerItemType
const std::string CanvasItemType
const std::string CanvasContainerItemType
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20