X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FWorkspace.cxx;h=faef957a1aa042ff1285d46b2b099c14e57617de;hb=f1747c7248d5eead5ea9d7e57bda0b081bcef065;hp=d1d2c0daa7b412935ce6c4909b1ccdfc4b879c2d;hpb=3393941bf8f26babc7b592db434b40c1b747a687;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Workspace.cxx b/lib/cpPlugins/Interface/Workspace.cxx index d1d2c0d..faef957 100644 --- a/lib/cpPlugins/Interface/Workspace.cxx +++ b/lib/cpPlugins/Interface/Workspace.cxx @@ -44,6 +44,24 @@ GetFilter( const std::string& name ) const return( NULL ); } +// ------------------------------------------------------------------------- +cpPlugins::Interface::Workspace:: +TWidget* cpPlugins::Interface::Workspace:: +GetWidget( const std::string& name ) +{ + TProcess* process = this->GetFilter( name ); + return( dynamic_cast< TWidget* >( process ) ); +} + +// ------------------------------------------------------------------------- +const cpPlugins::Interface::Workspace:: +TWidget* cpPlugins::Interface::Workspace:: +GetWidget( const std::string& name ) const +{ + const TProcess* process = this->GetFilter( name ); + return( dynamic_cast< const TWidget* >( process ) ); +} + // ------------------------------------------------------------------------- bool cpPlugins::Interface::Workspace:: HasFilter( const std::string& name ) const @@ -51,6 +69,14 @@ HasFilter( const std::string& name ) const return( this->m_Filters.find( name ) != this->m_Filters.end( ) ); } +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Workspace:: +HasWidget( const std::string& name ) const +{ + const TWidget* wdg = this->GetWidget( name ); + return( wdg != NULL ); +} + // ------------------------------------------------------------------------- cpPlugins::Interface::Workspace:: TProcess* cpPlugins::Interface::Workspace:: @@ -324,12 +350,17 @@ GetConnections( { for( auto i = ins.begin( ); i != ins.end( ); ++i ) { - auto od = orig->GetOutput( *o ); - auto id = dest->GetInput( *i ); - if( od != NULL && od == id ) - conns.push_back( - std::pair< std::string, std::string >( *o, *i ) - ); + unsigned int nInputs = dest->GetInputSize( *i ); + for( unsigned j = 0; j < nInputs; ++j ) + { + auto od = orig->GetOutput( *o ); + auto id = dest->GetInput( *i, j ); + if( od != NULL && od == id ) + conns.push_back( + std::pair< std::string, std::string >( *o, *i ) + ); + + } // rof } // rof