1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
4 // -------------------------------------------------------------------------
6 T* cpPlugins::Interface::ProcessObject::
7 GetInput( const std::string& id )
9 _TDataContainer::iterator i = this->m_Inputs.find( id );
10 if( i != this->m_Inputs.end( ) )
11 return( dynamic_cast< T* >( i->second.GetPointer( ) ) );
16 // -------------------------------------------------------------------------
18 const T* cpPlugins::Interface::ProcessObject::
19 GetInput( const std::string& id ) const
21 _TDataContainer::const_iterator i = this->m_Inputs.find( id );
22 if( i != this->m_Inputs.end( ) )
23 return( dynamic_cast< const T* >( i->second.GetPointer( ) ) );
28 // -------------------------------------------------------------------------
30 T* cpPlugins::Interface::ProcessObject::
31 GetOutput( const std::string& id )
33 _TDataContainer::iterator i = this->m_Outputs.find( id );
34 if( i != this->m_Outputs.end( ) )
35 return( dynamic_cast< T* >( i->second.GetPointer( ) ) );
40 // -------------------------------------------------------------------------
42 const T* cpPlugins::Interface::ProcessObject::
43 GetOutput( const std::string& id ) const
45 _TDataContainer::const_iterator i = this->m_Outputs.find( id );
46 if( i != this->m_Outputs.end( ) )
47 return( dynamic_cast< const T* >( i->second.GetPointer( ) ) );
52 // -------------------------------------------------------------------------
54 void cpPlugins::Interface::ProcessObject::
55 _AddOutput( const std::string& id )
57 this->m_Outputs[ id ] = O::New( );
58 this->m_Outputs[ id ]->SetSource( this );
62 // -------------------------------------------------------------------------
64 F* cpPlugins::Interface::ProcessObject::
67 F* filter = dynamic_cast< F* >( this->m_ITKObject.GetPointer( ) );
70 typename F::Pointer ptr = F::New( );
71 this->m_ITKObject = ptr;
72 filter = ptr.GetPointer( );
73 this->m_VTKObject = NULL;
79 // -------------------------------------------------------------------------
81 F* cpPlugins::Interface::ProcessObject::
84 F* filter = dynamic_cast< F* >( this->m_VTKObject.GetPointer( ) );
88 this->m_VTKObject = filter;
89 this->m_ITKObject = NULL;
95 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__