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( );
130 void _ClearWorkspace( );
131 void _LoadPlugins( const std::string& filename );
132 void _LoadPluginsFromPath( const std::string& path );
134 void _LoadWorkspace( const std::string& filename );
135 void _SaveWorkspace( const std::string& filename );
137 void _BackgroundProperties( unsigned int i );
138 void _DataProperties( const std::string& actor );
140 void _AddEnviromentPaths( );
141 void _LoadPlugins( );
142 void _LoadPluginsFromPath( );
143 void _ShowPlugins( );
144 void _LoadWorkspace( );
145 void _SaveWorkspace( );
146 void _DataProperties(
147 const std::string& filter_name, const std::string& output_name
152 QApplication* m_Application;
155 std::string m_RunPath;
156 TPlugins::Pointer m_Plugins;
157 TWorkspace::Pointer m_Workspace;
159 PluginsNavigator* m_Navigator;
169 #endif // __cpBaseQtApplication__MainWindow__h__