#ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #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 { 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 ); itkBooleanMacro( Interactive ); itkGetConstMacro( Interactive, bool ); itkSetMacro( Interactive, bool ); itkGetConstObjectMacro( Parameters, TParameters ); itkGetObjectMacro( Parameters, TParameters ); public: virtual std::set< std::string > GetInputsNames( ) const; virtual std::set< std::string > GetOutputsNames( ) const; unsigned int GetNumberOfInputs( ) const; unsigned int GetNumberOfOutputs( ) const; virtual bool SetInput( const std::string& id, DataObject::Pointer* dobj ); virtual std::string Update( ); virtual void DisconnectOutputs( ); // 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* 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; DataObject::Pointer* GetOutputPort( const std::string& id ) { auto i = this->m_Outputs.find( id ); if( i != this->m_Outputs.end( ) ) return( i->second ); else return( NULL ); } const DataObject::Pointer* GetOutputPort( const std::string& id ) const { auto i = this->m_Outputs.find( id ); if( i != this->m_Outputs.end( ) ) return( i->second ); else return( NULL ); } protected: ProcessObject( ); virtual ~ProcessObject( ); 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( ); virtual std::string _GenerateData( ) = 0; private: // Purposely not implemented ProcessObject( const Self& ); Self& operator=( const Self& ); protected: Parameters::Pointer m_Parameters; ParametersQtDialog* m_ParametersDialog; vtkSmartPointer< vtkRenderWindowInteractor > m_SingleInteractor; SimpleMPRWidget* m_MPRViewer; bool m_Interactive; typedef std::map< std::string, DataObject::Pointer* > _TDataContainer; _TDataContainer m_Inputs; _TDataContainer m_Outputs; }; } // ecapseman } // ecapseman #include #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ // eof - $RCSfile$