]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/ProcessObject.h
Widget integration (step 3/6). WARNING: IT DOES NOT COMPILE YET
[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 #include <vtkSmartPointer.h>
19 #include <vtkAlgorithm.h>
20
21 namespace cpPlugins
22 {
23   namespace Interface
24   {
25     /**
26      */
27     class cpPlugins_Interface_EXPORT ProcessObject
28       : public Object
29     {
30     public:
31       typedef ProcessObject                   Self;
32       typedef Object                          Superclass;
33       typedef itk::SmartPointer< Self >       Pointer;
34       typedef itk::SmartPointer< const Self > ConstPointer;
35
36     public:
37       itkTypeMacro( ProcessObject, Object );
38
39     public:
40       virtual const Parameters& GetDefaultParameters( ) const;
41       virtual void SetParameters( const Parameters& params );
42
43       virtual unsigned int GetNumberOfInputs( ) const;
44       virtual unsigned int GetNumberOfOutputs( ) const;
45
46       virtual void SetNumberOfInputs( unsigned int n );
47       virtual void SetNumberOfOutputs( unsigned int n );
48
49       virtual void SetInput( unsigned int idx, DataObject* dobj );
50
51       virtual std::string Update( );
52       virtual void DisconnectOutputs( );
53
54       virtual bool ExecConfigurationDialog( QWidget* parent );
55
56       template< class T >
57         inline T* GetITK( );
58
59       template< class T >
60         inline const T* GetITK( ) const;
61
62       template< class T >
63         inline T* GetVTK( );
64
65       template< class T >
66         inline const T* GetVTK( ) const;
67
68       template< class T >
69         inline T* GetInput( unsigned int idx );
70
71       template< class T >
72         inline const T* GetInput( unsigned int idx ) const;
73
74       template< class T >
75         inline T* GetOutput( unsigned int idx );
76
77       template< class T >
78         inline const T* GetOutput( unsigned int idx ) const;
79
80     protected:
81       ProcessObject( );
82       virtual ~ProcessObject( );
83
84       template< class F >
85         inline F* _CreateITK( );
86
87       template< class F >
88         inline F* _CreateVTK( );
89
90       template< class O >
91         inline void _MakeOutput( unsigned int idx );
92
93       virtual std::string _GenerateData( ) = 0;
94
95     private:
96       // Purposely not implemented
97       ProcessObject( const Self& );
98       Self& operator=( const Self& );
99
100     protected:
101       itk::ProcessObject::Pointer     m_ITKObject;
102       vtkSmartPointer< vtkAlgorithm > m_VTKObject;
103
104       Parameters m_DefaultParameters;
105       Parameters m_Parameters;
106
107       std::vector< DataObject::Pointer > m_Inputs;
108       std::vector< DataObject::Pointer > m_Outputs;
109     };
110
111   } // ecapseman
112
113 } // ecapseman
114
115 #include <cpPlugins/Interface/ProcessObject.hxx>
116
117 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
118
119 // eof - $RCSfile$