1 #ifndef __CPBASEQTAPPLICATION__MAINWINDOW__H__
2 #define __CPBASEQTAPPLICATION__MAINWINDOW__H__
4 #include <cpBaseQtApplication_Export.h>
6 #include <cpPlugins/Interface.h>
7 #include <cpPlugins/Workspace.h>
9 // -------------------------------------------------------------------------
10 #define cpBaseQtApplication_ConnectAction( _action_, _slot_ ) \
12 this->m_UI->_action_, SIGNAL( triggered( ) ), \
13 this, SLOT( _slot_( ) ) \
16 // -------------------------------------------------------------------------
17 #define cpBaseQtApplication_Execute( _command_ ) \
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 namespace cpExtensions
58 class SimpleMPRWidget;
63 namespace cpBaseQtApplication
69 class cpBaseQtApplication_EXPORT MainWindow
75 typedef MainWindow Self;
76 typedef QMainWindow Superclass;
85 virtual bool eventFilter( QObject* obj, QEvent* event ) ITK_OVERRIDE;
90 int argc, char* argv[],
92 QWidget* parent = NULL
94 virtual ~MainWindow( );
96 void UpdateEnvironment( );
101 cpExtensions::QT::SimpleMPRWidget* mpr,
102 cpBaseQtApplication::Editor* editor
104 void _ClearWorkspace( );
105 void _AddEnvironments( const std::string& environments );
106 void _LoadPlugins( const std::string& filename );
107 void _LoadPluginsFromPath( const std::string& path );
108 void _UpdateLoadedPlugins( );
112 void _LoadWorkspace( const std::string& filename );
113 void _SaveWorkspace( const std::string& filename );
115 void _BackgroundProperties( unsigned int i );
116 void _DataProperties( const std::string& actor );
119 void _InteractiveLoadPlugins( );
120 void _InteractiveLoadPluginsFromPath( );
121 void _ShowPlugins( );
122 void _InteractiveLoadWorkspace( );
123 void _InteractiveSaveWorkspace( );
124 void _InteractiveAddEnviromentPaths( );
125 void _ExecFilter( const std::string& filter_name );
127 const std::string& filter_name, const std::string& output_name
130 const std::string& filter_name, const std::string& output_name
132 void _DataProperties(
133 const std::string& filter_name, const std::string& output_name
137 QApplication* m_Application;
139 std::string m_PluginsPath;
141 std::string m_RunPath;
142 cpPlugins::Interface m_Interface;
143 cpPlugins::Workspace m_Workspace;
145 QTreeWidget* m_TreeWidget;
147 cpExtensions::QT::SimpleMPRWidget* m_MPR;
152 #endif // __CPBASEQTAPPLICATION__MAINWINDOW__H__