]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/ProcessObject.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.h
1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
3
4 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
5 #include <cpPlugins/Interface/Object.h>
6 #include <cpPlugins/Interface/DataObject.h>
7 #include <cpPlugins/Interface/Parameters.h>
8
9 #include <itkProcessObject.h>
10
11 namespace cpPlugins
12 {
13   namespace Interface
14   {
15     /**
16      */
17     class cpPlugins_Interface_EXPORT ProcessObject
18       : public Object
19     {
20     public:
21       typedef ProcessObject                   Self;
22       typedef Object                          Superclass;
23       typedef itk::SmartPointer< Self >       Pointer;
24       typedef itk::SmartPointer< const Self > ConstPointer;
25
26     public:
27       itkTypeMacro( ProcessObject, Object );
28
29     public:
30       virtual const Parameters& GetDefaultParameters( ) const;
31       virtual void SetParameters( const Parameters& params );
32
33       virtual unsigned int GetNumberOfInputs( ) const;
34       virtual unsigned int GetNumberOfOutputs( ) const;
35
36       virtual void SetNumberOfInputs( unsigned int n );
37       virtual void SetNumberOfOutputs( unsigned int n );
38
39       virtual void SetInput( unsigned int idx, DataObject* dobj );
40
41       virtual std::string Update( );
42       virtual void DisconnectOutputs( );
43
44       template< class T >
45         inline T* GetInput( unsigned int idx );
46
47       template< class T >
48         inline const T* GetInput( unsigned int idx ) const;
49
50       template< class T >
51         inline T* GetOutput( unsigned int idx );
52
53       template< class T >
54         inline const T* GetOutput( unsigned int idx ) const;
55
56     protected:
57       ProcessObject( );
58       virtual ~ProcessObject( );
59
60       template< class O >
61         inline void _MakeOutput( unsigned int idx );
62
63       virtual std::string _GenerateData( ) = 0;
64
65     private:
66       // Purposely not implemented
67       ProcessObject( const Self& );
68       Self& operator=( const Self& );
69
70     protected:
71       itk::ProcessObject::Pointer m_RealProcessObject;
72       Parameters m_DefaultParameters;
73       Parameters m_Parameters;
74
75       std::vector< DataObject::Pointer > m_Inputs;
76       std::vector< DataObject::Pointer > m_Outputs;
77     };
78
79   } // ecapseman
80
81 } // ecapseman
82
83 #include <cpPlugins/Interface/ProcessObject.hxx>
84
85 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
86
87 // eof - $RCSfile$