]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Pipeline/ProcessObject.hxx
Moved to version 1.0
[cpPlugins.git] / lib / cpPlugins / Pipeline / ProcessObject.hxx
diff --git a/lib/cpPlugins/Pipeline/ProcessObject.hxx b/lib/cpPlugins/Pipeline/ProcessObject.hxx
deleted file mode 100644 (file)
index 47cd480..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-#ifndef __cpPlugins__Pipeline__ProcessObject__hxx__
-#define __cpPlugins__Pipeline__ProcessObject__hxx__
-
-// -------------------------------------------------------------------------
-template< class _TType >
-_TType* cpPlugins::Pipeline::ProcessObject::
-GetInput( const std::string& n, unsigned int i )
-{
-  auto it = this->m_Inputs.find( n );
-  if( it != this->m_Inputs.end( ) )
-    return( dynamic_cast< _TType* >( it->second->Get( i ) ) );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-const _TType* cpPlugins::Pipeline::ProcessObject::
-GetInput( const std::string& n, unsigned int i ) const
-{
-  auto it = this->m_Inputs.find( n );
-  if( it != this->m_Inputs.end( ) )
-    return( dynamic_cast< const _TType* >( it->second->Get( i ) ) );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-_TType* cpPlugins::Pipeline::ProcessObject::
-GetInputData( const std::string& n, unsigned int i )
-{
-  auto d = this->GetInput( n, i );
-  if( d != NULL )
-  {
-    auto oi = d->m_ITK.GetPointer( );
-    auto ov = d->m_VTK.GetPointer( );
-    if( oi != NULL && ov != NULL )
-    {
-      auto di = dynamic_cast< _TType* >( oi );
-      auto dv = dynamic_cast< _TType* >( ov );
-      if     ( di != NULL ) return( di );
-      else if( dv != NULL ) return( dv );
-      else                  return( NULL );
-    }
-    else if( oi != NULL && ov == NULL )
-    {
-      auto di = dynamic_cast< _TType* >( oi );
-      if( di == NULL )
-        return( d->GetVTK< _TType >( ) );
-      else
-        return( di );
-    }
-    else if( oi == NULL && ov != NULL )
-    {
-      auto dv = dynamic_cast< _TType* >( ov );
-      if( dv == NULL )
-        return( d->GetITK< _TType >( ) );
-      else
-        return( dv );
-    }
-    else
-      return( NULL );
-  }
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-const _TType* cpPlugins::Pipeline::ProcessObject::
-GetInputData( const std::string& n, unsigned int i ) const
-{
-  auto d = this->GetInput( n, i );
-  if( d != NULL )
-  {
-    auto oi = d->m_ITK.GetPointer( );
-    auto ov = d->m_VTK.GetPointer( );
-    if( oi != NULL && ov != NULL )
-    {
-      auto di = dynamic_cast< const _TType* >( oi );
-      auto dv = dynamic_cast< const _TType* >( ov );
-      if     ( di != NULL ) return( di );
-      else if( dv != NULL ) return( dv );
-      else                  return( NULL );
-    }
-    else if( oi != NULL && ov == NULL )
-    {
-      auto di = dynamic_cast< const _TType* >( oi );
-      if( di == NULL )
-        return( d->GetVTK< _TType >( ) );
-      else
-        return( di );
-    }
-    else if( oi == NULL && ov != NULL )
-    {
-      auto dv = dynamic_cast< const _TType* >( ov );
-      if( dv == NULL )
-        return( d->GetITK< _TType >( ) );
-      else
-        return( dv );
-    }
-    else
-      return( NULL );
-  }
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-_TType* cpPlugins::Pipeline::ProcessObject::
-GetOutput( const std::string& n )
-{
-  auto it = this->m_Outputs.find( n );
-  if( it != this->m_Outputs.end( ) )
-    return( dynamic_cast< _TType* >( it->second->Get( ) ) );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-const _TType* cpPlugins::Pipeline::ProcessObject::
-GetOutput( const std::string& n ) const
-{
-  auto it = this->m_Outputs.find( n );
-  if( it != this->m_Outputs.end( ) )
-    return( dynamic_cast< const _TType* >( it->second->Get( ) ) );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-_TType* cpPlugins::Pipeline::ProcessObject::
-GetOutputData( const std::string& n )
-{
-  auto d = this->GetOutput( n );
-  if( d != NULL )
-  {
-    auto oi = d->m_ITK.GetPointer( );
-    auto ov = d->m_VTK.GetPointer( );
-    if( oi != NULL && ov != NULL )
-    {
-      auto di = dynamic_cast< _TType* >( oi );
-      auto dv = dynamic_cast< _TType* >( ov );
-      if     ( di != NULL ) return( di );
-      else if( dv != NULL ) return( dv );
-      else                  return( NULL );
-    }
-    else if( oi != NULL && ov == NULL )
-    {
-      auto di = dynamic_cast< _TType* >( oi );
-      if( di == NULL )
-        return( d->GetVTK< _TType >( ) );
-      else
-        return( di );
-    }
-    else if( oi == NULL && ov != NULL )
-    {
-      auto dv = dynamic_cast< _TType* >( ov );
-      if( dv == NULL )
-        return( d->GetITK< _TType >( ) );
-      else
-        return( dv );
-    }
-    else
-      return( NULL );
-  }
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-const _TType* cpPlugins::Pipeline::ProcessObject::
-GetOutputData( const std::string& n ) const
-{
-  auto d = this->GetOutput( n );
-  if( d != NULL )
-  {
-    auto oi = d->m_ITK.GetPointer( );
-    auto ov = d->m_VTK.GetPointer( );
-    if( oi != NULL && ov != NULL )
-    {
-      auto di = dynamic_cast< const _TType* >( oi );
-      auto dv = dynamic_cast< const _TType* >( ov );
-      if     ( di != NULL ) return( di );
-      else if( dv != NULL ) return( dv );
-      else                  return( NULL );
-    }
-    else if( oi != NULL && ov == NULL )
-    {
-      auto di = dynamic_cast< const _TType* >( oi );
-      if( di == NULL )
-        return( d->GetVTK< _TType >( ) );
-      else
-        return( di );
-    }
-    else if( oi == NULL && ov != NULL )
-    {
-      auto dv = dynamic_cast< const _TType* >( ov );
-      if( dv == NULL )
-        return( d->GetITK< _TType >( ) );
-      else
-        return( dv );
-    }
-    else
-      return( NULL );
-  }
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-void cpPlugins::Pipeline::ProcessObject::
-_ConfigureInput( const std::string& name, bool required, bool multiple )
-{
-  auto it = this->m_Inputs.find( name );
-  if( it == this->m_Inputs.end( ) )
-  {
-    Port* port;
-    if( multiple ) port = new MultipleInputsPort( required );
-    else           port = new InputPort( required );
-    port->Configure< _TType >( );
-    this->m_Inputs[ name ] = port;
-    this->Modified( );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-template< class _TType >
-void cpPlugins::Pipeline::ProcessObject::
-_ConfigureOutput( const std::string& name )
-{
-  auto it = this->m_Outputs.find( name );
-  if( it == this->m_Outputs.end( ) )
-  {
-    Port* port = new OutputPort( true );
-    port->Configure< _TType >( );
-    port->Add( _TType::New( ) );
-    port->Get( )->SetSource( this );
-    this->m_Outputs[ name ] = port;
-    this->Modified( );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-template< class _TFilter >
-_TFilter* cpPlugins::Pipeline::ProcessObject::
-_CreateITK( )
-{
-  // TODO: why this lead to synch issues???
-  _TFilter* filter = this->GetITK< _TFilter >( );
-  if( filter == NULL )
-  {
-    typename _TFilter::Pointer filter_ptr = _TFilter::New( );
-    this->m_ITK = filter_ptr;
-    this->m_VTK = NULL;
-    filter = filter_ptr.GetPointer( );
-    this->Modified( );
-
-  } // fi
-  return( filter );
-}
-
-// -------------------------------------------------------------------------
-template< class _TFilter >
-_TFilter* cpPlugins::Pipeline::ProcessObject::
-_CreateVTK( )
-{
-  // TODO: why this lead to synch issues???
-  _TFilter* filter = this->GetVTK< _TFilter >( );
-  if( filter == NULL )
-  {
-    vtkSmartPointer< _TFilter > filter_ptr =
-      vtkSmartPointer< _TFilter >::New( );
-    this->m_ITK = NULL;
-    this->m_VTK = filter_ptr;
-    filter = filter_ptr.GetPointer( );
-    this->Modified( );
-
-  } // fi
-  return( filter );
-}
-
-#endif // __cpPlugins__Pipeline__ProcessObject__hxx__
-
-// eof - $RCSfile$