#ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #include #include #include #include #include // Some forward declarations class vtkRenderWindowInteractor; namespace cpPlugins { namespace Interface { // Some forward declarations #ifdef cpPlugins_Interface_QT4 class ParametersQtDialog; class SimpleMPRWidget; #else typedef char ParametersQtDialog; typedef char SimpleMPRWidget; #endif // cpPlugins_Interface_QT4 /** */ class cpPlugins_Interface_EXPORT ProcessObject : public Object { public: typedef ProcessObject Self; typedef Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Parameters TParameters; typedef std::set< vtkRenderWindowInteractor* > TInteractors; typedef bool DialogResult; public: itkTypeMacro( ProcessObject, Object ); cpPlugins_Id_Macro( ProcessObject, BaseObject ); itkGetConstObjectMacro( Parameters, TParameters ); itkGetObjectMacro( Parameters, TParameters ); itkGetMacro( ParametersDialog, ParametersQtDialog* ); itkGetMacro( SingleInteractor, vtkRenderWindowInteractor* ); itkGetMacro( MPRViewer, SimpleMPRWidget* ); itkSetObjectMacro( ParametersDialog, ParametersQtDialog ); itkSetObjectMacro( SingleInteractor, vtkRenderWindowInteractor ); itkSetObjectMacro( MPRViewer, SimpleMPRWidget ); public: virtual void SetITK( itk::LightObject* o ); virtual void SetVTK( vtkObjectBase* o ); // IO management std::set< std::string > GetInputsNames( ) const; std::set< std::string > GetOutputsNames( ) const; unsigned int GetNumberOfInputs( ) const; unsigned int GetNumberOfOutputs( ) const; OutputProcessObjectPort& GetOutput( const std::string& id ); const OutputProcessObjectPort& GetOutput( const std::string& id ) const; template< class T > inline T* GetInputData( const std::string& id ); template< class T > inline const T* GetInputData( const std::string& id ) const; template< class T > inline T* GetOutputData( const std::string& id ); template< class T > inline const T* GetOutputData( const std::string& id ) const; bool SetInput( const std::string& id, const OutputProcessObjectPort& port ); void DisconnectInputs( ); void DisconnectOutputs( ); void Disconnect( ); // Pipeline execution virtual itk::ModifiedTimeType GetMTime( ) const; virtual std::string Update( ); protected: ProcessObject( ); virtual ~ProcessObject( ); void _AddInput( const std::string& name, bool required = true ); template< class O > inline void _AddOutput( const std::string& name ); template< class F > inline F* _CreateITK( ); template< class F > inline F* _CreateVTK( ); virtual std::string _GenerateData( ) = 0; private: // Purposely not implemented ProcessObject( const Self& ); Self& operator=( const Self& ); protected: typedef std::map< std::string, InputProcessObjectPort > _TInputs; typedef std::map< std::string, OutputProcessObjectPort > _TOutputs; _TInputs m_Inputs; _TOutputs m_Outputs; Parameters::Pointer m_Parameters; itk::ModifiedTimeType m_LastExecutionTime; ParametersQtDialog* m_ParametersDialog; vtkRenderWindowInteractor* m_SingleInteractor; SimpleMPRWidget* m_MPRViewer; }; } // ecapseman } // ecapseman #include #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ // eof - $RCSfile$