X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FProcessObject.h;h=e139c994d5e86f9107963ae6acea31fcd626d564;hb=6ffc11d77924d6ab7e94db95d41105982ac73e00;hp=c48d61f3e36ab0f201c30aeac8a8f71b89640473;hpb=273699a71c538630c162de031f0c95014319311d;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h index c48d61f..e139c99 100644 --- a/lib/cpPlugins/Interface/ProcessObject.h +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -1,20 +1,15 @@ #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ +#include #include #include - -#include +#include #include // Some forward declarations class vtkRenderWindowInteractor; -#ifdef cpPlugins_Interface_QT4 -class QWidget; -#else -typedef char QWidget; -#endif // cpPlugins_Interface_QT4 namespace cpPlugins { @@ -23,8 +18,10 @@ namespace cpPlugins // Some forward declarations #ifdef cpPlugins_Interface_QT4 class ParametersQtDialog; + class SimpleMPRWidget; #else typedef char ParametersQtDialog; + typedef char SimpleMPRWidget; #endif // cpPlugins_Interface_QT4 /** @@ -46,52 +43,60 @@ namespace cpPlugins itkTypeMacro( ProcessObject, Object ); cpPlugins_Id_Macro( ProcessObject, BaseObject ); - itkBooleanMacro( Interactive ); - itkGetConstMacro( Interactive, bool ); - itkSetMacro( Interactive, bool ); - 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 std::set< std::string > GetInputsNames( ) const; - virtual std::set< std::string > GetOutputsNames( ) const; + 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; - virtual bool SetInput( const std::string& id, DataObject* dobj ); - - virtual std::string Update( ); - virtual void DisconnectOutputs( ); - - virtual const TInteractors& GetInteractors( ) const; - virtual void AddInteractor( vtkRenderWindowInteractor* interactor ); - virtual bool ExecConfigurationDialog( QWidget* parent ); + OutputProcessObjectPort& GetOutput( const std::string& id ); + const OutputProcessObjectPort& GetOutput( const std::string& id ) const; template< class T > - inline T* GetInput( const std::string& id ); - + inline T* GetInputData( const std::string& id ); template< class T > - inline const T* GetInput( const std::string& id ) const; - + inline const T* GetInputData( const std::string& id ) const; template< class T > - inline T* GetOutput( const std::string& id ); - + inline T* GetOutputData( const std::string& id ); template< class T > - inline const T* GetOutput( const std::string& id ) const; + 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( ); - virtual void _AddInput( const std::string& name ); - + void _AddInput( const std::string& name, bool required = true ); template< class O > - inline void _AddOutput( const std::string& id ); - + inline void _AddOutput( const std::string& name ); template< class F > inline F* _CreateITK( ); - template< class F > inline F* _CreateVTK( ); @@ -103,22 +108,19 @@ namespace cpPlugins 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; - ParametersQtDialog* m_ParametersDialog; - TInteractors m_Interactors; - bool m_Interactive; + itk::ModifiedTimeType m_LastExecutionTime; - typedef std::map< std::string, DataObject::Pointer > _TDataContainer; - _TDataContainer m_Inputs; - _TDataContainer m_Outputs; + ParametersQtDialog* m_ParametersDialog; + vtkRenderWindowInteractor* m_SingleInteractor; + SimpleMPRWidget* m_MPRViewer; }; - /** - * Plugin provider - */ - CPPLUGINS_PROVIDER_HEADER( ProcessObject ); - } // ecapseman } // ecapseman