BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
dataselectionmodel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/importdataview/dataselectionmodel.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_IMPORTDATAVIEW_DATASELECTIONMODEL_H
16 #define BORNAGAIN_GUI2_IMPORTDATAVIEW_DATASELECTIONMODEL_H
17 
18 #include "darefl_export.h"
19 #include <QItemSelectionModel>
20 #include <vector>
21 
22 namespace ModelView {
23 class ViewModel;
24 class SessionItem;
25 class GraphItem;
26 } // namespace ModelView
27 
28 namespace gui2 {
29 
30 class CanvasItem;
31 
32 //! Custom selection model for data view model (AbstractViewModel).
33 
34 class DAREFLCORE_EXPORT DataSelectionModel : public QItemSelectionModel {
35  Q_OBJECT
36 
37 public:
38  DataSelectionModel(ModelView::ViewModel* view_model, QObject* parent = nullptr);
39  ~DataSelectionModel() = default;
40 
41  void selectItem(ModelView::SessionItem* item);
42  void selectItems(std::vector<ModelView::SessionItem*> items);
43 
44  std::vector<ModelView::SessionItem*> selectedItems() const;
45 
46  const ModelView::ViewModel* viewModel() const;
47 
48  CanvasItem* activeCanvas() const;
49  ModelView::GraphItem* selectedGraph() const;
50 
51  std::vector<CanvasItem*> selectedCanvas() const;
52 
53  std::vector<ModelView::GraphItem*> selectedGraphs() const;
54 };
55 
56 } // namespace gui2
57 
58 #endif // BORNAGAIN_GUI2_IMPORTDATAVIEW_DATASELECTIONMODEL_H
One-dimensional graph representation of Data1DItem.
Definition: graphitem.h:29
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
Main class to represent content of SessionModel in Qt's trees and tables.
Definition: viewmodel.h:29
Holds a collection of GraphItem's for simultaneous plotting, as well as all information related to pl...
Custom selection model for data view model (AbstractViewModel).
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