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;
45 typedef std::set< vtkRenderWindowInteractor* > TInteractors;
46 typedef bool DialogResult;
49 itkTypeMacro( ProcessObject, Object );
50 cpPlugins_Id_Macro( ProcessObject, BaseObject );
52 itkBooleanMacro( Interactive );
54 itkGetConstObjectMacro( Parameters, TParameters );
55 itkGetObjectMacro( Parameters, TParameters );
56 itkGetConstMacro( Plugins, const Plugins* );
57 itkGetMacro( Plugins, Plugins* );
58 itkGetConstMacro( Interactive, bool );
60 itkSetObjectMacro( Plugins, Plugins );
61 itkSetMacro( Interactive, bool );
65 virtual void Modified( ) const;
67 virtual void GetInputsNames( std::set< std::string >& names ) const;
68 virtual void GetOutputsNames( std::set< std::string >& names ) const;
69 unsigned int GetNumberOfInputs( ) const;
70 unsigned int GetNumberOfOutputs( ) const;
72 virtual bool SetOutputObjectName(
73 const std::string& new_object_name,
74 const std::string& output_name
77 virtual void SetInput( const std::string& id, DataObject* dobj );
79 virtual std::string Update( );
80 virtual void DisconnectOutputs( );
82 virtual const TInteractors& GetInteractors( ) const;
83 virtual void AddInteractor( vtkRenderWindowInteractor* interactor );
84 virtual bool ExecConfigurationDialog( QWidget* parent );
90 inline const T* GetITK( ) const;
96 inline const T* GetVTK( ) const;
99 inline T* GetInput( const std::string& id );
102 inline const T* GetInput( const std::string& id ) const;
105 inline T* GetOutput( const std::string& id );
108 inline const T* GetOutput( const std::string& id ) const;
112 virtual ~ProcessObject( );
114 virtual void _AddInput( const std::string& name );
117 inline F* _CreateITK( );
120 inline F* _CreateVTK( );
123 inline void _MakeOutput( const std::string& id );
125 virtual std::string _GenerateData( ) = 0;
128 // Purposely not implemented
129 ProcessObject( const Self& );
130 Self& operator=( const Self& );
133 itk::ProcessObject::Pointer m_ITKObject;
134 vtkSmartPointer< vtkAlgorithm > m_VTKObject;
136 Parameters::Pointer m_Parameters;
137 ParametersQtDialog* m_ParametersDialog;
138 TInteractors m_Interactors;
142 typedef std::map< std::string, DataObject::Pointer > _TDataContainer;
143 _TDataContainer m_Inputs;
144 _TDataContainer m_Outputs;
145 std::map< std::string, std::string > m_OutputObjectsNames;
151 CPPLUGINS_PROVIDER_HEADER( ProcessObject );
157 #include <cpPlugins/Interface/ProcessObject.hxx>
159 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__