1 #ifndef __CPPLUGINS__PROCESSOBJECT__H__
2 #define __CPPLUGINS__PROCESSOBJECT__H__
6 #include <cpPlugins/Object.h>
7 #include <cpPlugins/Parameters.h>
8 #include <cpPlugins/Port.h>
12 // Forward declaration
14 class ParametersQtDialog;
19 class cpPlugins_EXPORT ProcessObject
23 typedef ProcessObject Self;
24 typedef Object Superclass;
25 typedef itk::SmartPointer< Self > Pointer;
26 typedef itk::SmartPointer< const Self > ConstPointer;
29 itkTypeMacro( ProcessObject, Object );
30 cpPlugins_Id_Macro( ProcessObject, Object );
33 Parameters* GetParameters( );
34 const Parameters* GetParameters( ) const;
36 virtual void SetITK( itk::LightObject* o ) final;
37 virtual void SetVTK( vtkObjectBase* o ) final;
40 std::set< std::string > GetInputsNames( ) const;
41 std::set< std::string > GetOutputsNames( ) const;
42 unsigned int GetNumberOfInputs( ) const;
43 unsigned int GetNumberOfOutputs( ) const;
45 OutputPort& GetOutput( const std::string& id );
46 const OutputPort& GetOutput( const std::string& id ) const;
48 DataObject* GetInputData( const std::string& id );
49 const DataObject* GetInputData( const std::string& id ) const;
50 DataObject* GetOutputData( const std::string& id );
51 const DataObject* GetOutputData( const std::string& id ) const;
53 bool SetInput( const std::string& id, const OutputPort& port );
55 void DisconnectInputs( );
56 void DisconnectOutputs( );
60 virtual itk::ModifiedTimeType GetMTime( ) const;
61 virtual std::string Update( );
64 virtual ParametersQtDialog* CreateQtDialog( );
68 virtual ~ProcessObject( );
70 void _AddInput( const std::string& name, bool required = true );
73 inline void _AddOutput( const std::string& name );
76 inline F* _CreateITK( );
78 inline F* _CreateVTK( );
80 virtual std::string _GenerateData( ) = 0;
83 // Purposely not implemented
84 ProcessObject( const Self& );
85 Self& operator=( const Self& );
88 Parameters m_Parameters;
90 typedef std::map< std::string, InputPort > _TInputs;
91 typedef std::map< std::string, OutputPort > _TOutputs;
95 itk::ModifiedTimeType m_LastExecutionTime;
100 #include <cpPlugins/ProcessObject.hxx>
102 #endif // __CPPLUGINS__PROCESSOBJECT__H__