#ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
#define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
-#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <set>
-#include <map>
-#include <vector>
+#include <itkDataObject.h>
-#include <cpPlugins/Interface/Config.h>
-#include <cpPlugins/Interface/Object.h>
#include <cpPlugins/Interface/DataObject.h>
#include <cpPlugins/Interface/Parameters.h>
+// Some forward declarations
+class vtkRenderWindowInteractor;
#ifdef cpPlugins_Interface_QT4
class QWidget;
#else
typedef char QWidget;
#endif // cpPlugins_Interface_QT4
-#include <itkProcessObject.h>
-
-#include <vtkSmartPointer.h>
-#include <vtkAlgorithm.h>
-
-class vtkRenderWindowInteractor;
-
namespace cpPlugins
{
namespace Interface
{
- class Plugins;
+ // Some forward declarations
#ifdef cpPlugins_Interface_QT4
class ParametersQtDialog;
+ class SimpleMPRWidget;
#else
typedef char ParametersQtDialog;
+ typedef char SimpleMPRWidget;
#endif // cpPlugins_Interface_QT4
/**
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Parameters TParameters;
-
- enum DialogResult
- {
- DialogResult_NoModal = 0,
- DialogResult_Modal,
- DialogResult_Cancel
- };
+ typedef std::set< vtkRenderWindowInteractor* > TInteractors;
+ typedef bool DialogResult;
public:
itkTypeMacro( ProcessObject, Object );
- cpPlugins_Id_Macro(
- cpPlugins::Interface::ProcessObject, "BaseObject"
- );
-
- public:
- // To impact pipeline
- virtual void Modified( ) const;
-
- virtual bool IsInteractive( ) const;
- virtual TParameters* GetParameters( );
- virtual const TParameters* GetParameters( ) const;
+ cpPlugins_Id_Macro( ProcessObject, BaseObject );
- Plugins* GetPlugins( );
- const Plugins* GetPlugins( ) const;
- void SetPlugins( Plugins* p );
+ itkBooleanMacro( Interactive );
+ itkGetConstMacro( Interactive, bool );
+ itkSetMacro( Interactive, bool );
- virtual unsigned int GetNumberOfInputs( ) const;
- virtual unsigned int GetNumberOfOutputs( ) const;
+ itkGetConstObjectMacro( Parameters, TParameters );
+ itkGetObjectMacro( Parameters, TParameters );
- virtual std::vector< std::string > GetInputsNames( ) const;
- virtual std::vector< std::string > GetOutputsNames( ) const;
+ public:
+ virtual std::set< std::string > GetInputsNames( ) const;
+ virtual std::set< std::string > GetOutputsNames( ) const;
+ unsigned int GetNumberOfInputs( ) const;
+ unsigned int GetNumberOfOutputs( ) const;
- 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 );
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:
Self& operator=( const Self& );
protected:
- itk::ProcessObject::Pointer m_ITKObject;
- vtkSmartPointer< vtkAlgorithm > m_VTKObject;
-
Parameters::Pointer m_Parameters;
ParametersQtDialog* m_ParametersDialog;
- Plugins* m_Plugins;
+
+ vtkSmartPointer< vtkRenderWindowInteractor > m_SingleInteractor;
+ SimpleMPRWidget* m_MPRViewer;
+ bool m_Interactive;
typedef std::map< std::string, DataObject::Pointer > _TDataContainer;
_TDataContainer m_Inputs;
_TDataContainer m_Outputs;
};
+ /**
+ * Plugin provider
+ */
+ CPPLUGINS_PROVIDER_HEADER( ProcessObject );
+
} // ecapseman
} // ecapseman