]> Creatis software - cpPlugins.git/blob - lib/cpPipelineEditor/BaseQtMainWindow.h
7b4837d6f49aa2abe5cd97b81bf625ff69f5fc6e
[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 _LoadPlugins( const std::string& filename );
58     void _LoadPluginsFromPath( const std::string& path );
59     void _UpdateLoadedPlugins( );
60     void _Block( );
61     void _UnBlock( );
62
63     void _LoadWorkspace( const std::string& filename );
64     void _SaveWorkspace( const std::string& filename );
65
66     void _ShowData(
67       const std::string& filter_name, const std::string& output_name
68       );
69     void _HideData(
70       const std::string& filter_name, const std::string& output_name
71       );
72     void _DataProperties(
73       const std::string& filter_name, const std::string& output_name
74       );
75     void _BackgroundProperties( unsigned int i );
76
77   protected slots:
78     void _InteractiveLoadPlugins( );
79     void _InteractiveLoadPluginsFromPath( );
80     void _InteractiveLoadWorkspace( );
81     void _InteractiveSaveWorkspace( );
82     void _ExecFilter( const std::string& filter_name );
83
84   protected:
85     QApplication*        m_Application;
86     _TBlocker            m_Blocker;
87     cpPlugins::Workspace m_Workspace;
88     cpPlugins::Interface m_Interface;
89     std::string          m_PluginsPath;
90
91     QTreeWidget* m_TreeWidget;
92     Editor*      m_Editor;
93     cpExtensions::QT::SimpleMPRWidget* m_MPR;
94   };
95
96 } // ecapseman
97
98 #endif // __CPPIPELINEEDITOR__BASEQTMAINWINDOW__H__
99
100 // eof - $RCSfile$