1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
7 #include <itkDataObject.h>
8 #include <cpPlugins/Interface/ProcessObjectPort.h>
9 #include <cpPlugins/Interface/Parameters.h>
11 // Some forward declarations
12 class vtkRenderWindowInteractor;
18 // Some forward declarations
19 #ifdef cpPlugins_Interface_QT4
20 class ParametersQtDialog;
21 class SimpleMPRWidget;
23 typedef char ParametersQtDialog;
24 typedef char SimpleMPRWidget;
25 #endif // cpPlugins_Interface_QT4
29 class cpPlugins_Interface_EXPORT ProcessObject
33 typedef ProcessObject Self;
34 typedef Object Superclass;
35 typedef itk::SmartPointer< Self > Pointer;
36 typedef itk::SmartPointer< const Self > ConstPointer;
38 typedef Parameters TParameters;
39 typedef std::set< vtkRenderWindowInteractor* > TInteractors;
40 typedef bool DialogResult;
43 itkTypeMacro( ProcessObject, Object );
44 cpPlugins_Id_Macro( ProcessObject, BaseObject );
46 itkGetConstObjectMacro( Parameters, TParameters );
48 itkGetObjectMacro( Parameters, TParameters );
49 itkGetMacro( ParametersDialog, ParametersQtDialog* );
50 itkGetMacro( SingleInteractor, vtkRenderWindowInteractor* );
51 itkGetMacro( MPRViewer, SimpleMPRWidget* );
53 itkSetObjectMacro( ParametersDialog, ParametersQtDialog );
54 itkSetObjectMacro( SingleInteractor, vtkRenderWindowInteractor );
55 itkSetObjectMacro( MPRViewer, SimpleMPRWidget );
58 virtual void SetITK( itk::LightObject* o );
59 virtual void SetVTK( vtkObjectBase* o );
62 std::set< std::string > GetInputsNames( ) const;
63 std::set< std::string > GetOutputsNames( ) const;
64 unsigned int GetNumberOfInputs( ) const;
65 unsigned int GetNumberOfOutputs( ) const;
67 OutputProcessObjectPort& GetOutput( const std::string& id );
68 const OutputProcessObjectPort& GetOutput( const std::string& id ) const;
71 inline T* GetInputData( const std::string& id );
73 inline const T* GetInputData( const std::string& id ) const;
75 inline T* GetOutputData( const std::string& id );
77 inline const T* GetOutputData( const std::string& id ) const;
80 const std::string& id, const OutputProcessObjectPort& port
83 void DisconnectInputs( );
84 void DisconnectOutputs( );
88 virtual itk::ModifiedTimeType GetMTime( ) const;
89 virtual std::string Update( );
93 virtual ~ProcessObject( );
95 void _AddInput( const std::string& name, bool required = true );
97 inline void _AddOutput( const std::string& name );
99 inline F* _CreateITK( );
101 inline F* _CreateVTK( );
103 virtual std::string _GenerateData( ) = 0;
106 // Purposely not implemented
107 ProcessObject( const Self& );
108 Self& operator=( const Self& );
111 typedef std::map< std::string, InputProcessObjectPort > _TInputs;
112 typedef std::map< std::string, OutputProcessObjectPort > _TOutputs;
115 Parameters::Pointer m_Parameters;
117 itk::ModifiedTimeType m_LastExecutionTime;
119 ParametersQtDialog* m_ParametersDialog;
120 vtkRenderWindowInteractor* m_SingleInteractor;
121 SimpleMPRWidget* m_MPRViewer;
128 #include <cpPlugins/Interface/ProcessObject.hxx>
130 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__