X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FWorkspace.cxx;fp=lib%2FcpPlugins%2FInterface%2FWorkspace.cxx;h=4fbcb2bbf3b154e11332f29b0a32cd7201630f95;hb=406ebd171557827b3fa0133073dd69780a6e3f6f;hp=3822969f30b977a5f53b52ecd6b6680961f31018;hpb=95c0f25df04b873644ebb440e84c4fe53e11eef9;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Workspace.cxx b/lib/cpPlugins/Interface/Workspace.cxx index 3822969..4fbcb2b 100644 --- a/lib/cpPlugins/Interface/Workspace.cxx +++ b/lib/cpPlugins/Interface/Workspace.cxx @@ -78,7 +78,10 @@ HasWidget( const std::string& name ) const // ------------------------------------------------------------------------- cpPlugins::Interface::Workspace:: TFilter* cpPlugins::Interface::Workspace:: -CreateFilter( const std::string& category, const std::string& filter ) +CreateFilter( + const std::string& category, const std::string& filter, + const std::string& name + ) { typedef cpPlugins::Pipeline::Widget _TWidget; @@ -86,11 +89,11 @@ CreateFilter( const std::string& category, const std::string& filter ) if( o.IsNotNull( ) ) { // Choose a name - std::string name = filter; - while( this->GetFilter( name ) != NULL ) - name += std::string( "_" ); + std::string real_name = name; + while( this->GetFilter( real_name ) != NULL ) + real_name += std::string( "_" ); o->SetPrintExecution( this->m_PrintExecution ); - o->SetName( name ); + o->SetName( real_name ); // Interactors for( @@ -101,12 +104,20 @@ CreateFilter( const std::string& category, const std::string& filter ) o->AddInteractor( *i ); // Finish association - this->m_Filters[ name ] = o; + this->m_Filters[ real_name ] = o; } // fi return( o.GetPointer( ) ); } +// ------------------------------------------------------------------------- +cpPlugins::Interface::Workspace:: +TFilter* cpPlugins::Interface::Workspace:: +CreateFilter( const std::string& category, const std::string& filter ) +{ + return( this->CreateFilter( category, filter, filter ) ); +} + // ------------------------------------------------------------------------- bool cpPlugins::Interface::Workspace:: RenameFilter( const std::string& old_name, const std::string& new_name )