X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FProcessObject.h;h=ddd1c21aa150ad2cd38987e82ad1bfb4f76d3677;hb=35d769c683c10f5c18d17a3e423d89f5b30a5b77;hp=6c6a8e7b468179cea12172a554d08c0add4c4abb;hpb=dd763c7c99bb59edcc7035738ff1ad10255e2525;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h index 6c6a8e7..ddd1c21 100644 --- a/lib/cpPlugins/Interface/ProcessObject.h +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -3,13 +3,11 @@ #include +#include + #include #include -#include -#include -#include - // Some forward declarations class vtkRenderWindowInteractor; #ifdef cpPlugins_Interface_QT4 @@ -23,11 +21,12 @@ namespace cpPlugins namespace Interface { // Some forward declarations - class Plugins; #ifdef cpPlugins_Interface_QT4 class ParametersQtDialog; + class SimpleMPRWidget; #else typedef char ParametersQtDialog; + typedef char SimpleMPRWidget; #endif // cpPlugins_Interface_QT4 /** @@ -43,62 +42,38 @@ namespace cpPlugins typedef Parameters TParameters; typedef std::set< vtkRenderWindowInteractor* > TInteractors; - - enum DialogResult - { - DialogResult_NoModal = 0, - DialogResult_Modal, - DialogResult_Cancel - }; + typedef bool DialogResult; public: itkTypeMacro( ProcessObject, Object ); - cpPlugins_Id_Macro( ProcessObject, "BaseObject" ); + cpPlugins_Id_Macro( ProcessObject, BaseObject ); itkBooleanMacro( Interactive ); + itkGetConstMacro( Interactive, bool ); + itkSetMacro( Interactive, bool ); itkGetConstObjectMacro( Parameters, TParameters ); itkGetObjectMacro( Parameters, TParameters ); - itkGetConstMacro( Plugins, const Plugins* ); - itkGetMacro( Plugins, Plugins* ); - itkGetConstMacro( Interactive, bool ); - - itkSetObjectMacro( Plugins, Plugins ); - itkSetMacro( Interactive, bool ); public: - // To impact pipeline - virtual void Modified( ) const; - - virtual void GetInputsNames( std::set< std::string >& names ) const; - virtual void GetOutputsNames( std::set< std::string >& names ) const; + virtual std::set< std::string > GetInputsNames( ) const; + virtual std::set< std::string > GetOutputsNames( ) const; unsigned int GetNumberOfInputs( ) const; unsigned int GetNumberOfOutputs( ) const; - virtual bool SetOutputObjectName( - const std::string& new_object_name, - const std::string& output_name - ); - - virtual void SetInput( const std::string& id, DataObject* dobj ); + virtual bool SetInput( const std::string& id, DataObject* dobj ); virtual std::string Update( ); virtual void DisconnectOutputs( ); - virtual void AddInteractor( vtkRenderWindowInteractor* interactor ); - virtual DialogResult ExecConfigurationDialog( QWidget* parent ); - - template< class T > - inline T* GetITK( ); - - template< class T > - inline const T* GetITK( ) const; - - template< class T > - inline T* GetVTK( ); - - template< class T > - inline const T* GetVTK( ) const; + // Widgets management + vtkRenderWindowInteractor* GetSingleInteractor( ); + const vtkRenderWindowInteractor* GetSingleInteractor( ) const; + void SetSingleInteractor( vtkRenderWindowInteractor* interactor ); + SimpleMPRWidget* GetMPRViewer( ); + const SimpleMPRWidget* GetMPRViewer( ) const; + void SetMPRViewer( SimpleMPRWidget* wdg ); + virtual bool ExecConfigurationDialog( QWidget* parent ); template< class T > inline T* GetInput( const std::string& id ); @@ -118,15 +93,15 @@ namespace cpPlugins virtual void _AddInput( const std::string& name ); + template< class O > + inline void _AddOutput( const std::string& id ); + template< class F > inline F* _CreateITK( ); template< class F > inline F* _CreateVTK( ); - template< class O > - inline void _MakeOutput( const std::string& id ); - virtual std::string _GenerateData( ) = 0; private: @@ -135,19 +110,16 @@ namespace cpPlugins Self& operator=( const Self& ); protected: - itk::ProcessObject::Pointer m_ITKObject; - vtkSmartPointer< vtkAlgorithm > m_VTKObject; - Parameters::Pointer m_Parameters; ParametersQtDialog* m_ParametersDialog; - TInteractors m_Interactors; - Plugins* m_Plugins; - bool m_Interactive; + + vtkSmartPointer< vtkRenderWindowInteractor > m_SingleInteractor; + SimpleMPRWidget* m_MPRViewer; + bool m_Interactive; typedef std::map< std::string, DataObject::Pointer > _TDataContainer; _TDataContainer m_Inputs; _TDataContainer m_Outputs; - std::map< std::string, std::string > m_OutputObjectsNames; }; /**