X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FcpPipelineEditor%2FApp_cpPipelineEditor.cxx;h=6227c17ddd18998b2d8284b37edba19a19c4a758;hb=7e29f3aec097ba1bff1894fed6eb1094276c5b72;hp=864d96fb99f7ebaabd075c3baf164caae633f6d3;hpb=19a9e1774044cc32c415ad38695800c1d169820d;p=cpPlugins.git diff --git a/appli/cpPipelineEditor/App_cpPipelineEditor.cxx b/appli/cpPipelineEditor/App_cpPipelineEditor.cxx index 864d96f..6227c17 100644 --- a/appli/cpPipelineEditor/App_cpPipelineEditor.cxx +++ b/appli/cpPipelineEditor/App_cpPipelineEditor.cxx @@ -31,7 +31,8 @@ App_cpPipelineEditor:: App_cpPipelineEditor( int argc, char* argv[], QWidget* parent ) : QMainWindow( parent ), m_UI( new Ui::App_cpPipelineEditor ), - m_Workspace( NULL ) + m_Workspace( NULL ), + m_PluginsPath( "." ) { this->m_UI->setupUi( this ); @@ -40,10 +41,10 @@ App_cpPipelineEditor( int argc, char* argv[], QWidget* parent ) QFileInfo info( argv[ 0 ] ); if( info.exists( ) ) { - std::string path = info.canonicalPath( ).toStdString( ); - if( !( this->m_Plugins->LoadDefaultConfiguration( path ) ) ) - if( this->m_Plugins->LoadFromFolder( path, false ) ) - if( !( this->m_Plugins->SaveDefaultConfiguration( path ) ) ) + this->m_PluginsPath = info.canonicalPath( ).toStdString( ); + if( !( this->m_Plugins->LoadDefaultConfiguration( this->m_PluginsPath ) ) ) + if( this->m_Plugins->LoadFromFolder( this->m_PluginsPath, false ) ) + if( !( this->m_Plugins->SaveDefaultConfiguration( this->m_PluginsPath ) ) ) QMessageBox::critical( this, "Error creating default plugins configuration", @@ -57,10 +58,7 @@ App_cpPipelineEditor( int argc, char* argv[], QWidget* parent ) this->m_Workspace = new cpPlugins::Interface::Workspace( ); this->m_Workspace->SetPlugins( this->m_Plugins ); this->m_UI->Canvas->editor( )->setWorkspace( this->m_Workspace ); - this->m_Workspace->AddInteractor( this->m_UI->Viewer->GetInteractor( 0 ) ); - this->m_Workspace->AddInteractor( this->m_UI->Viewer->GetInteractor( 1 ) ); - this->m_Workspace->AddInteractor( this->m_UI->Viewer->GetInteractor( 2 ) ); - this->m_Workspace->AddInteractor( this->m_UI->Viewer->GetInteractor( 3 ) ); + this->m_Workspace->SetMPRViewer( this->m_UI->Viewer ); // Connect actions to slots App_cpPipelineEditor_ConnectButton( LoadPluginsFile ); @@ -185,6 +183,7 @@ _ButtonLoadPluginsFile( ) ); // Update view + this->m_Plugins->SaveDefaultConfiguration( this->m_PluginsPath ); this->_UpdateLoadedPlugins( ); } @@ -208,6 +207,7 @@ _ButtonLoadPluginsPath( ) ); // Update view + this->m_Plugins->SaveDefaultConfiguration( this->m_PluginsPath ); this->_UpdateLoadedPlugins( ); } @@ -230,6 +230,7 @@ _ActionOpenWorkspace( ) delete this->m_Workspace; this->m_Workspace = new cpPlugins::Interface::Workspace( ); this->m_Workspace->SetPlugins( this->m_Plugins ); + this->m_Workspace->SetMPRViewer( this->m_UI->Viewer ); std::string err = this->m_Workspace->LoadWorkspace( fname ); if( err != "" ) { @@ -307,7 +308,7 @@ _ShowFilterOutput( auto filter = this->m_Workspace->GetFilter( filter_name ); if( filter != NULL ) { - auto output = filter->GetOutput< _TDataObject >( output_name ); + auto output = filter->GetOutputData< _TDataObject >( output_name ); if( output != NULL ) { std::string data_name = output_name + "@" + filter_name;