1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
4 // -------------------------------------------------------------------------
6 T* cpPlugins::Interface::ProcessObject::
7 GetInputData( const std::string& id )
9 auto 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 GetInputData( const std::string& id ) const
21 auto 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 GetOutputData( const std::string& id )
33 auto 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 GetOutputData( const std::string& id ) const
45 auto 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& name )
57 typedef typename _TDataContainer::value_type _TValue;
58 auto i = this->m_Outputs.find( name );
59 if( i == this->m_Outputs.end( ) )
61 typename O::Pointer o = O::New( );
63 this->m_Outputs[ name ] = o;
69 // -------------------------------------------------------------------------
71 F* cpPlugins::Interface::ProcessObject::
74 F* filter = this->GetITK< F >( );
77 typename F::Pointer filter_ptr = F::New( );
78 this->SetITK( filter_ptr.GetPointer( ) );
80 filter = filter_ptr.GetPointer( );
87 // -------------------------------------------------------------------------
89 F* cpPlugins::Interface::ProcessObject::
92 F* filter = this->GetVTK< F >( );
95 vtkSmartPointer< F > filter_ptr = vtkSmartPointer< F >::New( );
97 this->SetVTK( filter_ptr );
98 filter = filter_ptr.GetPointer( );
105 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__