X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FProcessObject.h;h=d201a6c84c09ac57782062d14178420412d206e0;hb=75dc4945344b4a5a7be10a3ca33fa2e6fff87df8;hp=31379136eeb73f5d519420f9e8795c38593629ed;hpb=8c23766af88a29c3e830299dffc4b95d9fe61df9;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h index 3137913..d201a6c 100644 --- a/lib/cpPlugins/Interface/ProcessObject.h +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -1,59 +1,87 @@ #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ -#include -#include +#include #include +#include +#include + +#include namespace cpPlugins { namespace Interface { - class DataObject; - /** */ - class ProcessObject + class cpPlugins_Interface_EXPORT ProcessObject : public Object { public: - typedef ProcessObject Self; - typedef Object Superclass; - - typedef std::pair< std::string, std::string > TParameter; - typedef std::map< std::string, TParameter > TParameters; + typedef ProcessObject Self; + typedef Object Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; public: - ProcessObject( ); - virtual ~ProcessObject( ); + itkTypeMacro( ProcessObject, Object ); - virtual std::string GetClassName( ) const; - virtual const TParameters& GetDefaultParameters( ) const; - virtual void SetParameters( const TParameters& params ); + public: + virtual const Parameters& GetDefaultParameters( ) const; + virtual void SetParameters( const Parameters& params ); virtual unsigned int GetNumberOfInputs( ) const; virtual unsigned int GetNumberOfOutputs( ) const; - virtual void SetInput( unsigned int idx, const DataObject* dobj ); - virtual DataObject* GetOutput( unsigned int idx ) const; + virtual void SetNumberOfInputs( unsigned int n ); + virtual void SetNumberOfOutputs( unsigned int n ); + + virtual void SetInput( unsigned int idx, DataObject* dobj ); virtual std::string Update( ); + virtual void DisconnectOutputs( ); + + template< class T > + inline T* GetInput( unsigned int idx ); + + template< class T > + inline const T* GetInput( unsigned int idx ) const; + + template< class T > + inline T* GetOutput( unsigned int idx ); + + template< class T > + inline const T* GetOutput( unsigned int idx ) const; protected: + ProcessObject( ); + virtual ~ProcessObject( ); + + template< class O > + inline void _MakeOutput( unsigned int idx ); + virtual std::string _GenerateData( ) = 0; + private: + // Purposely not implemented + ProcessObject( const Self& ); + Self& operator=( const Self& ); + protected: - TParameters m_DefaultParameters; - TParameters m_Parameters; + itk::ProcessObject::Pointer m_RealProcessObject; + Parameters m_DefaultParameters; + Parameters m_Parameters; - std::vector< const DataObject* > m_Inputs; - std::vector< DataObject* > m_Outputs; + std::vector< DataObject::Pointer > m_Inputs; + std::vector< DataObject::Pointer > m_Outputs; }; } // ecapseman } // ecapseman +#include + #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ // eof - $RCSfile$