]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/ProcessObject.hxx
First dump for version 0.1.0
[cpPlugins.git] / lib / cpPlugins / ProcessObject.hxx
1 #ifndef __CPPLUGINS__PROCESSOBJECT__HXX__
2 #define __CPPLUGINS__PROCESSOBJECT__HXX__
3
4 // -------------------------------------------------------------------------
5 template< class O >
6 void cpPlugins::ProcessObject::
7 _AddOutput( const std::string& name )
8 {
9   auto i = this->m_Outputs.find( name );
10   if( i == this->m_Outputs.end( ) )
11   {
12     typename O::Pointer o = O::New( );
13     o->SetSource( this );
14     this->m_Outputs[ name ] = o;
15     this->Modified( );
16
17   } // fi
18 }
19
20 // -------------------------------------------------------------------------
21 template< class F >
22 F* cpPlugins::ProcessObject::
23 _CreateITK( )
24 {
25   F* filter = this->GetITK< F >( );
26   if( filter == NULL )
27   {
28     typename F::Pointer filter_ptr = F::New( );
29     this->m_ITKObject = filter_ptr;
30     this->m_VTKObject = NULL;
31     filter = filter_ptr.GetPointer( );
32     this->Modified( );
33
34   } // fi
35   return( filter );
36 }
37
38 // -------------------------------------------------------------------------
39 template< class F >
40 F* cpPlugins::ProcessObject::
41 _CreateVTK( )
42 {
43   F* filter = this->GetVTK< F >( );
44   if( filter == NULL )
45   {
46     vtkSmartPointer< F > filter_ptr = vtkSmartPointer< F >::New( );
47     this->m_ITKObject = NULL;
48     this->m_VTKObject = filter_ptr;
49     filter = filter_ptr.GetPointer( );
50     this->Modified( );
51
52   } // fi
53   return( filter );
54 }
55
56 #endif // __CPPLUGINS__PROCESSOBJECT__HXX__
57
58 // eof - $RCSfile$