1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
4 // -------------------------------------------------------------------------
7 T* cpPlugins::Interface::ProcessObject::
8 GetInputData( const std::string& id )
10 auto i = this->m_Inputs.find( id );
11 if( i != this->m_Inputs.end( ) )
12 return( dynamic_cast< T* >( i->second.GetPointer( ) ) );
17 // -------------------------------------------------------------------------
19 const T* cpPlugins::Interface::ProcessObject::
20 GetInputData( const std::string& id ) const
22 auto i = this->m_Inputs.find( id );
23 if( i != this->m_Inputs.end( ) )
24 return( dynamic_cast< const T* >( i->second.GetPointer( ) ) );
29 // -------------------------------------------------------------------------
31 T* cpPlugins::Interface::ProcessObject::
32 GetOutputData( const std::string& id )
34 auto i = this->m_Outputs.find( id );
35 if( i != this->m_Outputs.end( ) )
36 return( dynamic_cast< T* >( i->second.GetPointer( ) ) );
41 // -------------------------------------------------------------------------
43 const T* cpPlugins::Interface::ProcessObject::
44 GetOutputData( const std::string& id ) const
46 auto i = this->m_Outputs.find( id );
47 if( i != this->m_Outputs.end( ) )
48 return( dynamic_cast< const T* >( i->second.GetPointer( ) ) );
54 // -------------------------------------------------------------------------
56 void cpPlugins::Interface::ProcessObject::
57 _AddOutput( const std::string& name )
59 auto i = this->m_Outputs.find( name );
60 if( i == this->m_Outputs.end( ) )
62 typename O::Pointer o = O::New( );
64 this->m_Outputs[ name ] = o;
70 // -------------------------------------------------------------------------
72 F* cpPlugins::Interface::ProcessObject::
75 F* filter = this->GetITK< F >( );
78 typename F::Pointer filter_ptr = F::New( );
79 this->m_ITKObject = filter_ptr;
80 this->m_VTKObject = NULL;
81 filter = filter_ptr.GetPointer( );
88 // -------------------------------------------------------------------------
90 F* cpPlugins::Interface::ProcessObject::
93 F* filter = this->GetVTK< F >( );
96 vtkSmartPointer< F > filter_ptr = vtkSmartPointer< F >::New( );
97 this->m_ITKObject = NULL;
98 this->m_VTKObject = filter_ptr;
99 filter = filter_ptr.GetPointer( );
106 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__