]> Creatis software - cpPlugins.git/blob - lib/cpPipelineEditor/BaseQtMainWindow.h
786349aa3d2354ecf3cea61b6d3a2d6d49481d61
[cpPlugins.git] / lib / cpPipelineEditor / BaseQtMainWindow.h
1 #ifndef __CPPIPELINEEDITOR__BASEQTMAINWINDOW__H__
2 #define __CPPIPELINEEDITOR__BASEQTMAINWINDOW__H__
3
4 #include <cpPipelineEditor/cpPipelineEditor_Export.h>
5 #include <QMainWindow>
6 #include <cpPlugins/Interface.h>
7 #include <cpPlugins/Workspace.h>
8
9 namespace cpExtensions
10 {
11   namespace QT
12   {
13     class SimpleMPRWidget;
14   }
15 }
16 class QTreeWidget;
17
18 namespace cpPipelineEditor
19 {
20   class Editor;
21
22   /**
23    */
24   class cpPipelineEditor_EXPORT BaseQtMainWindow
25     : public QMainWindow
26   {
27     Q_OBJECT;
28
29   public:
30     typedef BaseQtMainWindow Self;
31     typedef QMainWindow      Superclass;
32
33   protected:
34     /**
35      */
36     class _TBlocker
37       : public QObject
38     {
39     protected:
40       virtual bool eventFilter( QObject* obj, QEvent* event ) ITK_OVERRIDE;
41     };
42
43   public:
44     explicit BaseQtMainWindow(
45       int argc, char* argv[],
46       QApplication* app,
47       QWidget* parent = NULL
48       );
49     virtual ~BaseQtMainWindow( );
50
51   protected:
52     void _Configure(
53       QTreeWidget* tree,
54       cpExtensions::QT::SimpleMPRWidget* mpr,
55       cpPipelineEditor::Editor* editor
56       );
57     void _CreateWorkspace( );
58     void _LoadPlugins( const std::string& filename );
59     void _LoadPluginsFromPath( const std::string& path );
60     void _UpdateLoadedPlugins( );
61     void _Block( );
62     void _UnBlock( );
63
64     void _LoadWorkspace( const std::string& filename );
65     void _SaveWorkspace( const std::string& filename );
66
67     void _ShowData(
68       const std::string& filter_name, const std::string& output_name
69       );
70     void _HideData(
71       const std::string& filter_name, const std::string& output_name
72       );
73     void _DataProperties(
74       const std::string& filter_name, const std::string& output_name
75       );
76     void _BackgroundProperties( unsigned int i );
77
78   protected slots:
79     void _InteractiveLoadPlugins( );
80     void _InteractiveLoadPluginsFromPath( );
81     void _InteractiveLoadWorkspace( );
82     void _InteractiveSaveWorkspace( );
83     void _ExecFilter( const std::string& filter_name );
84
85   protected:
86     QApplication* m_Application;
87     _TBlocker     m_Blocker;
88     std::string   m_PluginsPath;
89     std::string   m_ApplicationPath;
90
91     cpPlugins::Interface* m_Interface;
92     cpPlugins::Workspace* m_Workspace;
93
94     QTreeWidget* m_TreeWidget;
95     Editor*      m_Editor;
96     cpExtensions::QT::SimpleMPRWidget* m_MPR;
97   };
98
99 } // ecapseman
100
101 #endif // __CPPIPELINEEDITOR__BASEQTMAINWINDOW__H__
102
103 // eof - $RCSfile$