+ for(
+ unsigned int i = 0;
+ i < destination->GetInputSize( destination_input );
+ ++i
+ )
+ if(
+ destination->GetInput( destination_input, i )->GetSource( ) ==
+ input->GetSource( )
+ )
+ ok = false;
+ }
+ else
+ ok = ( destination->GetInput( destination_input ) == NULL );
+ if( ok )
+ destination->AddInput(
+ destination_input,
+ input
+ );
+ return( ok );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Interface::Workspace::
+Disconnect(
+ const std::string& origin_filter,
+ const std::string& origin_output,
+ const std::string& destination_filter,
+ const std::string& destination_input
+ )
+{
+ // Get filters and check pertinence
+ TFilter* origin = this->GetFilter( origin_filter );
+ TFilter* destination = this->GetFilter( destination_filter );
+ if( origin == NULL || destination == NULL )
+ return( false );
+ if( !( destination->HasInput( destination_input ) ) )
+ return( false );
+ if( !( origin->HasOutput( origin_output ) ) )
+ return( false );
+
+ // Check if there is room for a new connection
+ bool ok = false;
+ unsigned int del_id = 0;
+ for(
+ unsigned int i = 0;
+ i < destination->GetInputSize( destination_input );
+ ++i
+ )
+ if(
+ destination->GetInput( destination_input, i )->GetSource( ) == origin
+ )