+++ /dev/null
-#ifndef __cpBaseQtApplication__MainWindow__h__
-#define __cpBaseQtApplication__MainWindow__h__
-
-#include <cpBaseQtApplication_Export.h>
-#include <QMainWindow>
-#include <QMessageBox>
-#include <cpPlugins/Interface/Loader.h>
-#include <cpPlugins/Interface/Workspace.h>
-#include <cpBaseQtApplication/Blocker.h>
-
-// -------------------------------------------------------------------------
-#define cpBaseQtApplication_ConnectAction( _act_, _slt_ ) \
- this->connect( \
- this->m_UI->_act_, SIGNAL( triggered( ) ), this, SLOT( _slt_( ) ) \
- )
-
-// -------------------------------------------------------------------------
-#define cpBaseQtApplication_Execute( _cmd_ ) \
- { \
- this->m_Blocker.block( ); \
- try \
- { \
- _cmd_; \
- this->m_Blocker.unblock( ); \
- } \
- catch( std::exception& err ) \
- { \
- this->m_Blocker.unblock( ); \
- QMessageBox::critical( \
- this, \
- QMessageBox::tr( "Error executing filter" ), \
- QMessageBox::tr( err.what( ) ) \
- ); \
- } \
- catch( ... ) \
- { \
- this->m_Blocker.unblock( ); \
- QMessageBox::critical( \
- this, \
- QMessageBox::tr( "Error executing filter" ), \
- QMessageBox::tr( "Unknown error" ) \
- ); \
- } \
- this->m_Blocker.unblock( ); \
- }
-
-// -------------------------------------------------------------------------
-namespace cpExtensions { namespace QT { class ActorsWidgetInterface; } }
-
-// -------------------------------------------------------------------------
-namespace cpBaseQtApplication
-{
- namespace Pipeline { class Canvas; }
- namespace Plugins { class Navigator; }
-
- /**
- */
- class cpBaseQtApplication_EXPORT MainWindow
- : public QMainWindow
- {
- Q_OBJECT;
-
- public:
- typedef MainWindow Self;
- typedef QMainWindow Superclass;
-
- typedef cpPlugins::Interface::Loader TLoader;
- typedef cpPlugins::Interface::Workspace TWorkspace;
-
- public:
- explicit MainWindow(
- int argc, char* argv[],
- QWidget* parent = NULL
- );
- virtual ~MainWindow( );
-
- TWorkspace* workspace( );
- const TWorkspace* workspace( ) const;
-
- Pipeline::Canvas* canvas( );
- const Pipeline::Canvas* canvas( ) const;
- void setCanvas( Pipeline::Canvas* c );
-
- Plugins::Navigator* navigator( );
- const Plugins::Navigator* navigator( ) const;
- void setNavigator( Plugins::Navigator* n );
-
- cpExtensions::QT::ActorsWidgetInterface* viewer( );
- const cpExtensions::QT::ActorsWidgetInterface* viewer( ) const;
- void setViewer( cpExtensions::QT::ActorsWidgetInterface* v );
-
- protected:
- template< class _TViewer >
- _TViewer* _configureViewer( QWidget* w )
- {
- _TViewer* v = dynamic_cast< _TViewer* >( w );
- if( v == NULL )
- v = new _TViewer( );
- return( v );
- }
-
- protected slots:
- void _loadPlugins( const std::string& filename );
- void _loadPlugins( );
- void _loadPluginsFromPath( const std::string& path );
- void _loadPluginsFromPath( );
-
- void _clearWorkspace( );
-
- void _saveWorkspace( const std::string& fname );
- void _saveWorkspace( );
-
- void _loadWorkspace( const std::string& fname );
- void _loadWorkspace( );
-
- void _actorsProperties( );
-
- protected:
- Blocker m_Blocker;
- std::string m_RunPath;
- TLoader m_Loader;
- std::string m_LastSaveFileName;
- TWorkspace::Pointer m_Workspace;
-
- std::string m_BaseWindowTitle;
-
- Pipeline::Canvas* m_Canvas;
- Plugins::Navigator* m_Navigator;
- cpExtensions::QT::ActorsWidgetInterface* m_Viewer;
- };
-
-} // ecapseman
-
-#endif // __cpBaseQtApplication__MainWindow__h__
-
-// eof - $RCSfile$