1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
5 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
10 #include <cpPlugins/Interface/Config.h>
11 #include <cpPlugins/Interface/DataObject.h>
13 #include <cpPlugins/Interface/DataObject.h>
14 #include <cpPlugins/Interface/Parameters.h>
16 #include <itkProcessObject.h>
17 #include <vtkSmartPointer.h>
18 #include <vtkAlgorithm.h>
20 // Some forward declarations
21 class vtkRenderWindowInteractor;
22 #ifdef cpPlugins_Interface_QT4
26 #endif // cpPlugins_Interface_QT4
32 // Some forward declarations
34 #ifdef cpPlugins_Interface_QT4
35 class ParametersQtDialog;
37 typedef char ParametersQtDialog;
38 #endif // cpPlugins_Interface_QT4
42 class cpPlugins_Interface_EXPORT ProcessObject
46 typedef ProcessObject Self;
47 typedef Object Superclass;
48 typedef itk::SmartPointer< Self > Pointer;
49 typedef itk::SmartPointer< const Self > ConstPointer;
51 typedef Parameters TParameters;
55 DialogResult_NoModal = 0,
61 itkTypeMacro( ProcessObject, Object );
62 cpPlugins_Id_Macro( ProcessObject, "BaseObject" );
64 itkBooleanMacro( Interactive );
66 itkGetConstObjectMacro( Parameters, TParameters );
67 itkGetObjectMacro( Parameters, TParameters );
68 itkGetConstMacro( Plugins, const Plugins* );
69 itkGetMacro( Plugins, Plugins* );
70 itkGetConstMacro( Interactive, bool );
72 itkSetObjectMacro( Plugins, Plugins );
73 itkSetMacro( Interactive, bool );
77 virtual void Modified( ) const;
79 virtual std::vector< std::string > GetInputsNames( ) const;
80 virtual std::vector< std::string > GetOutputsNames( ) const;
82 virtual void SetInput( const std::string& id, DataObject* dobj );
84 virtual std::string Update( );
85 virtual void DisconnectOutputs( );
87 virtual void AddInteractor( vtkRenderWindowInteractor* interactor );
88 virtual DialogResult ExecConfigurationDialog( QWidget* parent );
94 inline const T* GetITK( ) const;
100 inline const T* GetVTK( ) const;
103 inline T* GetInput( const std::string& id );
106 inline const T* GetInput( const std::string& id ) const;
109 inline T* GetOutput( const std::string& id );
112 inline const T* GetOutput( const std::string& id ) const;
116 virtual ~ProcessObject( );
118 virtual void _AddInput( const std::string& name );
121 inline F* _CreateITK( );
124 inline F* _CreateVTK( );
127 inline void _MakeOutput( const std::string& id );
129 virtual std::string _GenerateData( ) = 0;
132 // Purposely not implemented
133 ProcessObject( const Self& );
134 Self& operator=( const Self& );
137 itk::ProcessObject::Pointer m_ITKObject;
138 vtkSmartPointer< vtkAlgorithm > m_VTKObject;
140 Parameters::Pointer m_Parameters;
141 ParametersQtDialog* m_ParametersDialog;
145 typedef std::map< std::string, DataObject::Pointer > _TDataContainer;
146 _TDataContainer m_Inputs;
147 _TDataContainer m_Outputs;
153 CPPLUGINS_PROVIDER_HEADER( ProcessObject );
159 #include <cpPlugins/Interface/ProcessObject.hxx>
161 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__