Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkGnuplotWidget.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 QmitkGnuplotWidget_h
18 #define QmitkGnuplotWidget_h
19 
21 #include <QProcess>
22 #include <QScopedPointer>
23 #include <QWidget>
24 #include <itkTimeStamp.h>
25 
26 class QAction;
27 class QMenu;
28 
29 namespace Ui
30 {
31  class QmitkGnuplotWidget;
32 }
33 
35 {
36  Q_OBJECT
37 
38 public:
39  explicit QmitkGnuplotWidget(QWidget *parent = nullptr);
41 
42  QString GetGnuplotPath() const;
43  void SetGnuplotPath(const QString &path);
44 
45  QStringList GetCommands() const;
46  void SetCommands(const QStringList &commands);
47 
48  void Update();
49 
50  QSize sizeHint() const override;
51 
52 protected:
53  void contextMenuEvent(QContextMenuEvent *event) override;
54  void resizeEvent(QResizeEvent *event) override;
55 
56 private slots:
57  void OnProcessStateChanged(QProcess::ProcessState state);
58  void OnProcessError(QProcess::ProcessError error);
59  void OnProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
60  void OnCopyPlot();
61  void OnCopyScript();
62 
63 private:
64  void CreateContextMenu();
65  QString CreateSetTermCommand() const;
66 
67  QScopedPointer<Ui::QmitkGnuplotWidget> m_Ui;
68  QMenu *m_ContextMenu;
69  QAction *m_CopyPlotAction;
70  QAction *m_CopyScriptAction;
71  QProcess *m_Process;
72  QString m_GnuplotPath;
73  QStringList m_Commands;
74  itk::TimeStamp m_ModifiedTime;
75  itk::TimeStamp m_UpdateTime;
76 };
77 
78 #endif
#define MITKQTWIDGETSEXT_EXPORT
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35