1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
4 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
9 #include <cpPlugins/Interface/Config.h>
10 #include <cpPlugins/Interface/Object.h>
11 #include <cpPlugins/Interface/DataObject.h>
12 #include <cpPlugins/Interface/Parameters.h>
14 #ifdef cpPlugins_Interface_QT4
18 #endif // cpPlugins_Interface_QT4
20 #include <itkProcessObject.h>
22 #include <vtkSmartPointer.h>
23 #include <vtkAlgorithm.h>
25 class vtkRenderWindowInteractor;
31 #ifdef cpPlugins_Interface_QT4
32 class ParametersQtDialog;
34 typedef char ParametersQtDialog;
35 #endif // cpPlugins_Interface_QT4
39 class cpPlugins_Interface_EXPORT ProcessObject
43 typedef ProcessObject Self;
44 typedef Object Superclass;
45 typedef itk::SmartPointer< Self > Pointer;
46 typedef itk::SmartPointer< const Self > ConstPointer;
48 typedef Parameters TParameters;
52 DialogResult_NoModal = 0,
58 itkTypeMacro( ProcessObject, Object );
60 cpPlugins::Interface::ProcessObject, "BaseObject"
65 virtual void Modified( ) const;
67 virtual TParameters* GetParameters( );
68 virtual const TParameters* GetParameters( ) const;
70 virtual unsigned int GetNumberOfInputs( ) const;
71 virtual unsigned int GetNumberOfOutputs( ) const;
73 virtual std::vector< std::string > GetInputsNames( ) const;
74 virtual std::vector< std::string > GetOutputsNames( ) const;
76 virtual void SetInput( const std::string& id, DataObject* dobj );
78 virtual std::string Update( );
79 virtual void DisconnectOutputs( );
81 virtual void AddInteractor( vtkRenderWindowInteractor* interactor );
82 virtual DialogResult ExecConfigurationDialog( QWidget* parent );
88 inline const T* GetITK( ) const;
94 inline const T* GetVTK( ) const;
97 inline T* GetInput( const std::string& id );
100 inline const T* GetInput( const std::string& id ) const;
103 inline T* GetOutput( const std::string& id );
106 inline const T* GetOutput( const std::string& id ) const;
110 virtual ~ProcessObject( );
112 virtual void _AddInput( const std::string& name );
115 inline F* _CreateITK( );
118 inline F* _CreateVTK( );
121 inline void _MakeOutput( const std::string& id );
123 virtual std::string _GenerateData( ) = 0;
126 // Purposely not implemented
127 ProcessObject( const Self& );
128 Self& operator=( const Self& );
131 itk::ProcessObject::Pointer m_ITKObject;
132 vtkSmartPointer< vtkAlgorithm > m_VTKObject;
134 Parameters::Pointer m_Parameters;
135 ParametersQtDialog* m_ParametersDialog;
137 typedef std::map< std::string, DataObject::Pointer > _TDataContainer;
138 _TDataContainer m_Inputs;
139 _TDataContainer m_Outputs;
146 #include <cpPlugins/Interface/ProcessObject.hxx>
148 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__