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