1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
6 #include <cpPlugins/Interface/DataObject.h>
7 #include <cpPlugins/Interface/Parameters.h>
9 #include <itkProcessObject.h>
10 #include <vtkSmartPointer.h>
11 #include <vtkAlgorithm.h>
13 // Some forward declarations
14 class vtkRenderWindowInteractor;
15 #ifdef cpPlugins_Interface_QT4
19 #endif // cpPlugins_Interface_QT4
25 // Some forward declarations
27 #ifdef cpPlugins_Interface_QT4
28 class ParametersQtDialog;
30 typedef char ParametersQtDialog;
31 #endif // cpPlugins_Interface_QT4
35 class cpPlugins_Interface_EXPORT ProcessObject
39 typedef ProcessObject Self;
40 typedef Object Superclass;
41 typedef itk::SmartPointer< Self > Pointer;
42 typedef itk::SmartPointer< const Self > ConstPointer;
44 typedef Parameters TParameters;
48 DialogResult_NoModal = 0,
54 itkTypeMacro( ProcessObject, Object );
55 cpPlugins_Id_Macro( ProcessObject, "BaseObject" );
57 itkBooleanMacro( Interactive );
59 itkGetConstObjectMacro( Parameters, TParameters );
60 itkGetObjectMacro( Parameters, TParameters );
61 itkGetConstMacro( Plugins, const Plugins* );
62 itkGetMacro( Plugins, Plugins* );
63 itkGetConstMacro( Interactive, bool );
65 itkSetObjectMacro( Plugins, Plugins );
66 itkSetMacro( Interactive, bool );
70 virtual void Modified( ) const;
72 virtual void GetInputsNames( std::set< std::string >& names ) const;
73 virtual void GetOutputsNames( std::set< std::string >& names ) const;
75 virtual bool SetOutputObjectName(
76 const std::string& new_object_name,
77 const std::string& output_name
80 virtual void SetInput( const std::string& id, DataObject* dobj );
82 virtual std::string Update( );
83 virtual void DisconnectOutputs( );
85 virtual void AddInteractor( vtkRenderWindowInteractor* interactor );
86 virtual DialogResult ExecConfigurationDialog( QWidget* parent );
92 inline const T* GetITK( ) const;
98 inline const T* GetVTK( ) const;
101 inline T* GetInput( const std::string& id );
104 inline const T* GetInput( const std::string& id ) const;
107 inline T* GetOutput( const std::string& id );
110 inline const T* GetOutput( const std::string& id ) const;
114 virtual ~ProcessObject( );
116 virtual void _AddInput( const std::string& name );
119 inline F* _CreateITK( );
122 inline F* _CreateVTK( );
125 inline void _MakeOutput( const std::string& id );
127 virtual std::string _GenerateData( ) = 0;
130 // Purposely not implemented
131 ProcessObject( const Self& );
132 Self& operator=( const Self& );
135 itk::ProcessObject::Pointer m_ITKObject;
136 vtkSmartPointer< vtkAlgorithm > m_VTKObject;
138 Parameters::Pointer m_Parameters;
139 ParametersQtDialog* m_ParametersDialog;
143 typedef std::map< std::string, DataObject::Pointer > _TDataContainer;
144 _TDataContainer m_Inputs;
145 _TDataContainer m_Outputs;
146 std::map< std::string, std::string > m_OutputObjectsNames;
152 CPPLUGINS_PROVIDER_HEADER( ProcessObject );
158 #include <cpPlugins/Interface/ProcessObject.hxx>
160 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__