X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FProcessObject.cxx;h=db873e9d4f854724c7606a79af4e4f00a705c5b6;hb=de874ea850042e77a99a456188f423c8df2e374f;hp=1e89c859aafdb52bebce3aa40a680694bf7c79e9;hpb=f4ed5b2e93a5c96abf19b77f4a989b6614e238f7;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/ProcessObject.cxx b/lib/cpPlugins/Interface/ProcessObject.cxx index 1e89c85..db873e9 100644 --- a/lib/cpPlugins/Interface/ProcessObject.cxx +++ b/lib/cpPlugins/Interface/ProcessObject.cxx @@ -38,6 +38,20 @@ GetOutputsNames( std::set< std::string >& names ) const names.insert( dIt->first ); } +// ------------------------------------------------------------------------- +unsigned int cpPlugins::Interface::ProcessObject:: +GetNumberOfInputs( ) const +{ + return( this->m_Inputs.size( ) ); +} + +// ------------------------------------------------------------------------- +unsigned int cpPlugins::Interface::ProcessObject:: +GetNumberOfOutputs( ) const +{ + return( this->m_Outputs.size( ) ); +} + // ------------------------------------------------------------------------- bool cpPlugins::Interface::ProcessObject:: SetOutputObjectName( @@ -78,10 +92,15 @@ Update( ) _TDataContainer::iterator i = this->m_Inputs.begin( ); for( ; i != this->m_Inputs.end( ) && r == ""; ++i ) { - Self* src = dynamic_cast< Self* >( i->second->GetSource( ) ); - if( src != NULL ) - r = src->Update( ); - + if( i->second.IsNotNull( ) ) + { + Self* src = dynamic_cast< Self* >( i->second->GetSource( ) ); + if( src != NULL ) + r = src->Update( ); + } + else + r = "cpPlugins::Interface::ProcessObject: No input connected."; + } // rof // Current update @@ -121,6 +140,7 @@ AddInteractor( vtkRenderWindowInteractor* interactor ) this->m_ParametersDialog = new ParametersQtDialog( ); this->m_ParametersDialog->addInteractor( interactor ); #endif // cpPlugins_Interface_QT4 + this->m_Interactors.insert( interactor ); } // ------------------------------------------------------------------------- @@ -136,26 +156,19 @@ ExecConfigurationDialog( QWidget* parent ) { if( this->m_ParametersDialog == NULL ) this->m_ParametersDialog = new ParametersQtDialog( ); - this->m_ParametersDialog->setTitle( - this->GetClassName( ) + std::string( " basic configuration" ) - ); + /* TODO + this->m_ParametersDialog->setTitle( + this->GetClassName( ) + std::string( " basic configuration" ) + ); + */ this->m_ParametersDialog->setParent( NULL ); this->m_ParametersDialog->setParameters( this->m_Parameters ); - if( !( this->m_ParametersDialog->IsModal( ) ) ) - { - this->m_ParametersDialog->show( ); - r = Self::DialogResult_Modal; - } + if( this->m_ParametersDialog->exec( ) == 1 ) + r = Self::DialogResult_NoModal; else - { - if( this->m_ParametersDialog->exec( ) == 1 ) - r = Self::DialogResult_NoModal; - else - r = Self::DialogResult_Cancel; - - } // fi + r = Self::DialogResult_Cancel; } else r = Self::DialogResult_Cancel;