#include <cpPlugins/Interface/ProcessObject.h>
+#include <cpPlugins/Interface/DataObject.h>
// -------------------------------------------------------------------------
cpPlugins::Interface::ProcessObject::
return( this->m_Outputs.size( ) );
}
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ProcessObject::
+SetNumberOfInputs( unsigned int n )
+{
+ this->m_Inputs.clear( );
+ this->m_Inputs.resize( n, NULL );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ProcessObject::
+SetNumberOfOutputs( unsigned int n )
+{
+ this->m_Outputs.clear( );
+ this->m_Outputs.resize( n );
+
+ // Sync outputs with this source
+ for( unsigned int odx = 0; odx < this->m_Outputs.size( ); ++odx )
+ this->m_Outputs[ odx ].SetSource( this );
+}
+
// -------------------------------------------------------------------------
void cpPlugins::Interface::ProcessObject::
SetInput(
// -------------------------------------------------------------------------
cpPlugins::Interface::DataObject* cpPlugins::Interface::ProcessObject::
-GetOutput( unsigned int idx ) const
+GetOutput( unsigned int idx )
{
if( idx < this->m_Outputs.size( ) )
- return( this->m_Outputs[ idx ] );
+ return( &( this->m_Outputs[ idx ] ) );
else
return( NULL );
}
{
// Force upstream updates
for( unsigned int idx = 0; idx < this->m_Inputs.size( ); ++idx )
- this->m_Inputs->GetSource( )->Update( );
+ this->m_Inputs[ idx ]->GetSource( )->Update( );
// Current update
std::string ret = this->_GenerateData( );
- // Sync outputs
- for( unsigned int odx = 0; odx < this->m_Outputs.size( ); ++odx )
- this->m_Outputs->SetSource( this );
-
+ // Return error description, if any
return( ret );
}
+// -------------------------------------------------------------------------
+itk::DataObject* cpPlugins::Interface::ProcessObject::
+_GetInput( unsigned int idx )
+{
+ if( idx < this->m_Inputs.size( ) )
+ return( this->m_Inputs[ idx ]->GetDataObject( ) );
+ else
+ return( NULL );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ProcessObject::
+_SetOutput( unsigned int idx, itk::DataObject* dobj )
+{
+ if( idx < this->m_Outputs.size( ) )
+ this->m_Outputs[ idx ].SetDataObject( dobj );
+}
// eof - $RCSfile$