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;
49 DialogResult_NoModal = 0,
55 itkTypeMacro( ProcessObject, Object );
56 cpPlugins_Id_Macro( ProcessObject, BaseObject );
58 itkBooleanMacro( Interactive );
60 itkGetConstObjectMacro( Parameters, TParameters );
61 itkGetObjectMacro( Parameters, TParameters );
62 itkGetConstMacro( Plugins, const Plugins* );
63 itkGetMacro( Plugins, Plugins* );
64 itkGetConstMacro( Interactive, bool );
66 itkSetObjectMacro( Plugins, Plugins );
67 itkSetMacro( Interactive, bool );
71 virtual void Modified( ) const;
73 virtual void GetInputsNames( std::set< std::string >& names ) const;
74 virtual void GetOutputsNames( std::set< std::string >& names ) const;
75 unsigned int GetNumberOfInputs( ) const;
76 unsigned int GetNumberOfOutputs( ) const;
78 virtual bool SetOutputObjectName(
79 const std::string& new_object_name,
80 const std::string& output_name
83 virtual void SetInput( const std::string& id, DataObject* dobj );
85 virtual std::string Update( );
86 virtual void DisconnectOutputs( );
88 virtual void AddInteractor( vtkRenderWindowInteractor* interactor );
89 virtual DialogResult ExecConfigurationDialog( QWidget* parent );
95 inline const T* GetITK( ) const;
101 inline const T* GetVTK( ) const;
104 inline T* GetInput( const std::string& id );
107 inline const T* GetInput( const std::string& id ) const;
110 inline T* GetOutput( const std::string& id );
113 inline const T* GetOutput( const std::string& id ) const;
117 virtual ~ProcessObject( );
119 virtual void _AddInput( const std::string& name );
122 inline F* _CreateITK( );
125 inline F* _CreateVTK( );
128 inline void _MakeOutput( const std::string& id );
130 virtual std::string _GenerateData( ) = 0;
133 // Purposely not implemented
134 ProcessObject( const Self& );
135 Self& operator=( const Self& );
138 itk::ProcessObject::Pointer m_ITKObject;
139 vtkSmartPointer< vtkAlgorithm > m_VTKObject;
141 Parameters::Pointer m_Parameters;
142 ParametersQtDialog* m_ParametersDialog;
143 TInteractors m_Interactors;
147 typedef std::map< std::string, DataObject::Pointer > _TDataContainer;
148 _TDataContainer m_Inputs;
149 _TDataContainer m_Outputs;
150 std::map< std::string, std::string > m_OutputObjectsNames;
156 CPPLUGINS_PROVIDER_HEADER( ProcessObject );
162 #include <cpPlugins/Interface/ProcessObject.hxx>
164 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__