1 #ifndef __cpBaseQtApplication__MainWindow__h__
2 #define __cpBaseQtApplication__MainWindow__h__
4 #include <cpBaseQtApplication_Export.h>
6 #include <cpPlugins/Interface/Plugins.h>
7 #include <cpPlugins/Interface/Workspace.h>
9 // -------------------------------------------------------------------------
10 #define cpBaseQtApplication_ConnectAction( _act_, _slt_ ) \
12 this->m_UI->_act_, SIGNAL( triggered( ) ), this, SLOT( _slt_( ) ) \
15 // -------------------------------------------------------------------------
16 #define cpBaseQtApplication_Execute( _cmd_ ) \
24 catch( itk::ExceptionObject& err1 ) \
27 QMessageBox::critical( \
29 QMessageBox::tr( "Error executing filter" ), \
30 QMessageBox::tr( err1.GetDescription( ) ) \
33 catch( std::exception& err2 ) \
36 QMessageBox::critical( \
38 QMessageBox::tr( "Error executing filter" ), \
39 QMessageBox::tr( err2.what( ) ) \
45 QMessageBox::critical( \
47 QMessageBox::tr( "Error executing filter" ), \
48 QMessageBox::tr( "Unknown error" ) \
54 // -------------------------------------------------------------------------
55 namespace cpExtensions { namespace QT { class SimpleMPRWidget; } }
57 // -------------------------------------------------------------------------
58 namespace cpBaseQtApplication
61 class PluginsNavigator;
65 class cpBaseQtApplication_EXPORT MainWindow
71 typedef MainWindow Self;
72 typedef QMainWindow Superclass;
74 typedef cpPlugins::Interface::Plugins TPlugins;
75 typedef cpPlugins::Interface::Workspace TWorkspace;
76 typedef cpExtensions::QT::SimpleMPRWidget TMPR;
85 virtual bool eventFilter( QObject* obj, QEvent* event ) cpPlugins_OVERRIDE;
90 int argc, char* argv[],
92 QWidget* parent = NULL
94 virtual ~MainWindow( );
96 void updateEnvironment( );
97 void updateFilter( const std::string& name );
98 void showData( const std::string& name, const std::string& port );
100 cpPlugins::BaseObjects::DataObject* data, const std::string& name
104 void hideData( const std::string& name, const std::string& port );
105 void hideData( const std::string& name );
107 void dataProperties( const std::string& name, const std::string& port );
108 void dataProperties( const std::string& name );
113 void _configure( PluginsNavigator* nav, TMPR* mpr, Editor* edt );
114 void _updatePlugins( );
117 void _loadWorkspace( const std::string& filename );
118 void _loadWorkspace( );
119 void _saveWorkspace( const std::string& filename );
120 void _saveWorkspace( );
121 void _showPlugins( );
122 void _addEnvironmentPaths( const std::string& envs );
123 void _addEnvironmentPaths( );
124 void _loadPlugins( const std::string& filename );
125 void _loadPlugins( );
126 void _loadPluginsFromPath( const std::string& path );
127 void _loadPluginsFromPath( );
128 void _actorsProperties( );
131 void _ClearWorkspace( );
132 void _LoadPlugins( const std::string& filename );
133 void _LoadPluginsFromPath( const std::string& path );
135 void _LoadWorkspace( const std::string& filename );
136 void _SaveWorkspace( const std::string& filename );
138 void _BackgroundProperties( unsigned int i );
139 void _DataProperties( const std::string& actor );
141 void _AddEnviromentPaths( );
142 void _LoadPlugins( );
143 void _LoadPluginsFromPath( );
144 void _ShowPlugins( );
145 void _LoadWorkspace( );
146 void _SaveWorkspace( );
147 void _DataProperties(
148 const std::string& filter_name, const std::string& output_name
153 QApplication* m_Application;
156 std::string m_RunPath;
157 TPlugins::Pointer m_Plugins;
158 TWorkspace::Pointer m_Workspace;
160 PluginsNavigator* m_Navigator;
170 #endif // __cpBaseQtApplication__MainWindow__h__