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