Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkPythonVariableStackTableModel.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QmitkPythonVariableStackTableModel_h
18 #define QmitkPythonVariableStackTableModel_h
19 
20 #include <QAbstractTableModel>
21 #include <QVariant>
22 #include <QModelIndex>
23 #include "mitkIPythonService.h"
24 #include <MitkQtPythonExports.h>
25 #include <usServiceReference.h>
26 
31 class MITKQTPYTHON_EXPORT QmitkPythonVariableStackTableModel : public QAbstractTableModel, public mitk::PythonCommandObserver
32 {
33  Q_OBJECT
34 
35 public:
36  static const QString MITK_IMAGE_VAR_NAME;
37  static const QString MITK_SURFACE_VAR_NAME;
38 
39  QmitkPythonVariableStackTableModel(QObject *parent = 0);
41 
42  int rowCount(const QModelIndex &parent = QModelIndex()) const;
43  int columnCount(const QModelIndex &parent = QModelIndex()) const;
44  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
45  Qt::ItemFlags flags( const QModelIndex& index ) const;
46  virtual QVariant headerData(int section, Qt::Orientation orientation,
47  int role) const;
48 
49  QStringList mimeTypes() const;
50  bool dropMimeData ( const QMimeData *, Qt::DropAction, int, int, const QModelIndex & );
51  Qt::DropActions supportedDropActions() const;
52  //Qt::DropActions supportedDragActions() const;
53 
54  void CommandExecuted(const std::string& pythonCommand);
55 
56  std::vector<mitk::PythonVariable> GetVariableStack() const;
57 private:
58  std::vector<mitk::PythonVariable> m_VariableStack;
59  mitk::IPythonService* m_PythonService;
61 };
62 
63 #endif // QmitkPythonVariableStackTableModel_h
virtual void CommandExecuted(const std::string &pythonCommand)=0