X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcpPlugins%2FWorkspace.cxx;h=4c1fe1d298b2976faf57a21b5869bdfa1d0d365a;hb=107144983fb7d178ad07ccfd1b7c703671eb09aa;hp=b29309a77b2377aedb220345d270957f9c7a6e1d;hpb=5d6714fd6192f9f76571ab145d46951f301eb0e2;p=cpPlugins.git diff --git a/lib/cpPlugins/Workspace.cxx b/lib/cpPlugins/Workspace.cxx index b29309a..4c1fe1d 100644 --- a/lib/cpPlugins/Workspace.cxx +++ b/lib/cpPlugins/Workspace.cxx @@ -7,6 +7,7 @@ cpPlugins::Workspace:: Workspace( ) : m_Interface( NULL ), + m_PrintExecution( false ), m_MPRViewer( NULL ) { this->m_Graph = TGraph::New( ); @@ -93,6 +94,28 @@ GetFilter( const std::string& name ) const return( f ); } +// ------------------------------------------------------------------------- +cpPlugins::DataObject* cpPlugins::Workspace:: +GetOutput( const std::string& filter, const std::string& output ) +{ + auto f = this->GetFilter( filter ); + if( f != NULL ) + return( f->GetOutput( output ) ); + else + return( NULL ); +} + +// ------------------------------------------------------------------------- +const cpPlugins::DataObject* cpPlugins::Workspace:: +GetOutput( const std::string& filter, const std::string& output ) const +{ + auto f = this->GetFilter( filter ); + if( f != NULL ) + return( f->GetOutput( output ) ); + else + return( NULL ); +} + // ------------------------------------------------------------------------- bool cpPlugins::Workspace:: HasFilter( const std::string& name ) const @@ -117,8 +140,7 @@ CreateFilter( // Get or create new filter from name if( !( this->m_Graph->HasVertexIndex( name ) ) ) { - ProcessObject::Pointer f = - this->m_Interface->Create( category, filter ); + ProcessObject::Pointer f = this->m_Interface->Create( category, filter ); if( f.IsNotNull( ) ) { if( f->IsInteractive( ) ) @@ -129,6 +151,7 @@ CreateFilter( f->SetInteractionObjects( interactive_objects ); } // fi + f->SetPrintExecution( this->m_PrintExecution ); Object::Pointer o = f.GetPointer( ); this->m_Graph->SetVertex( name, o ); @@ -171,6 +194,7 @@ SetParameter( const std::string& name, const std::string& value ) void cpPlugins::Workspace:: SetPrintExecution( bool b ) { + this->m_PrintExecution = b; auto vIt = this->m_Graph->BeginVertices( ); for( ; vIt != this->m_Graph->EndVertices( ); ++vIt ) { @@ -251,7 +275,7 @@ Connect( return( false ); // Real connection - if( dest->SetInput( input_name, orig->GetOutput( output_name ) ) ) + if( dest->SetInputPort( input_name, orig->GetOutputPort( output_name ) ) ) { this->m_Graph->AddEdge( orig_filter, dest_filter, @@ -272,7 +296,7 @@ Connect( const OutputPort& port, const std::string& exposed_port ) { ProcessObject* filter = this->GetFilter( i->second.first ); if( filter != NULL ) - return( filter->SetInput( i->second.second, port ) ); + return( filter->SetInputPort( i->second.second, port ) ); else return( false ); } @@ -397,7 +421,7 @@ GetExposedOutput( const std::string& name ) { ProcessObject* filter = this->GetFilter( i->second.first ); if( filter != NULL ) - return( filter->GetOutput( i->second.second ) ); + return( filter->GetOutputPort( i->second.second ) ); } // fi return( null_port ); @@ -415,7 +439,7 @@ GetExposedOutput( const std::string& name ) const { const ProcessObject* filter = this->GetFilter( i->second.first ); if( filter != NULL ) - return( filter->GetOutput( i->second.second ) ); + return( filter->GetOutputPort( i->second.second ) ); } // fi return( null_port );