VPTissue Reference Manual
ConversionList.h
Go to the documentation of this file.
1 #ifndef GUI_CONVERSION_LIST_H_INCLUDED
2 #define GUI_CONVERSION_LIST_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "mesh_drawer/MeshDrawer.h"
23 
24 #include <QWidget>
25 #include <memory>
26 #include <set>
27 
28 class QCheckBox;
29 class QGraphicsScene;
30 class QLineEdit;
31 class QModelIndex;
32 class QStandardItemModel;
33 class QTableView;
34 
35 namespace SimPT_Sim { class SimState; }
36 
37 namespace SimPT_Shell {
38 
39 class StepFilterProxyModel;
40 class LoadedSimState;
41 
45 class ConversionList: public QWidget
46 {
47  Q_OBJECT
48 
49 public:
51  ConversionList(QWidget* parent = nullptr);
52 
54  virtual ~ConversionList();
55 
57  struct EntryType {
58  int timestep;
59  std::string files;
60  };
61 
63  void AddEntry(const EntryType &);
64 
66  void Clear();
67 
69  std::vector<EntryType> GetCheckedEntries() const;
70 
72  bool HasCheckedEntries() const;
73 
74 signals:
80  void SelectionChanged(bool selected);
81 
85  void CheckedChanged();
86 
87 private slots:
88  void EmitSelectionChanged();
89  void UpdateStepFilter();
90  void UpdateFileFilter();
91  void UpdateSelectAllCheckState();
92  void SelectAll();
93 
94 private:
95  void SetupGui();
96  void ResizeColumns();
97 
98 private:
99  QStandardItemModel* m_model;
100  StepFilterProxyModel* m_filter_model;
101  QTableView* m_table_view;
102 
103  QLineEdit* m_step_filter;
104  QLineEdit* m_file_filter;
105  QCheckBox* m_select_all_check_box;
106 
107  Qt::CheckState m_global_check_state;
108 };
109 
110 } // namespace
111 
112 #endif // end-of-include-guard
void AddEntry(const EntryType &)
Add entry.
Custom proxy model to filter a QStandardModel with file names with time steps.
Namespace for SimPT shell package.
Definition: Client.cpp:50
void CheckedChanged()
Signal emitted when the check state of some SimStates in the conversion has changed.
Namespace for the core simulator.
void Clear()
Clear all entries.
void SelectionChanged(bool selected)
Signal emitted when the selection in the conversion changes.
ConversionList(QWidget *parent=nullptr)
Constructor.
Interface for MeshDrawer.
see the online Qt documentation
Widget containing the list of steps in conversion and associated functionality.
virtual ~ConversionList()
Destructor.