]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 5 Feb 2016 22:37:25 +0000 (17:37 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 5 Feb 2016 22:37:25 +0000 (17:37 -0500)
lib/cpExtensions/DataStructures/Graph.h
lib/cpExtensions/DataStructures/Graph.hxx
lib/cpPlugins/Interface/DataObject.cxx
lib/cpPlugins/Interface/DataObject.h
lib/cpPlugins/Interface/Object.cxx
lib/cpPlugins/Interface/Object.h
lib/cpPlugins/Interface/ProcessObject.cxx
lib/cpPlugins/Interface/ProcessObject.h
lib/cpPlugins/Interface/ProcessObjectPort.cxx
lib/cpPlugins/Interface/ProcessObjectPort.h

index db07f2e0cf8ca52eeed617b92f832c8a49cacbd7..75bdd6821aef2a1be03cce89b7ce627b8ceff72c 100644 (file)
@@ -56,10 +56,14 @@ namespace cpExtensions
        *    vIt->second; --> this is the vertex's value <--
        *  }
        */
-      typename TVertices::iterator BeginVertices( );
-      typename TVertices::iterator EndVertices( );
-      typename TVertices::const_iterator BeginVertices( ) const;
-      typename TVertices::const_iterator EndVertices( ) const;
+      inline typename TVertices::iterator BeginVertices( )
+        { return( this->m_Vertices.begin( ) ); }
+      inline typename TVertices::iterator EndVertices( )
+        { return( this->m_Vertices.end( ) ); }
+      inline typename TVertices::const_iterator BeginVertices( ) const
+        { return( this->m_Vertices.begin( ) ); }
+      inline typename TVertices::const_iterator EndVertices( ) const
+        { return( this->m_Vertices.end( ) ); }
 
       /*! \brief Iterators over edges.
        *         These allow you to iterate over all of graph's edges.
@@ -82,10 +86,14 @@ namespace cpExtensions
        *    }
        *  }
        */
-      typename TMatrix::iterator BeginEdgesRows( );
-      typename TMatrix::iterator EndEdgetsRows( );
-      typename TMatrix::const_iterator BeginEdgesRows( ) const;
-      typename TMatrix::const_iterator EndEdgesRows( ) const;
+      inline typename TMatrix::iterator BeginEdgesRows( )
+        { return( this->m_Matrix.begin( ) ); }
+      inline typename TMatrix::iterator EndEdgetsRows( )
+        { return( this->m_Matrix.end( ) ); }
+      inline typename TMatrix::const_iterator BeginEdgesRows( ) const
+        { return( this->m_Matrix.begin( ) ); }
+      inline typename TMatrix::const_iterator EndEdgesRows( ) const
+        { return( this->m_Matrix.end( ) ); }
 
       /*! \brief Clear all vertices and edges.
        */
@@ -93,27 +101,35 @@ namespace cpExtensions
 
       /*! \brief Clear all edges.
        */
-      void ClearEdges( );
+      inline void ClearEdges( )
+        { this->m_Matrix.clear( ); }
 
       /*! \brief Vertex manipulation methods.
        *         Names are self-explanatory.
        */
-      bool HasVertexIndex( const I& index ) const;
-      void SetVertex( const I& index, V& vertex );
+      inline bool HasVertexIndex( const I& i ) const
+        { return( this->m_Vertices.find( i ) != this->m_Vertices.end( ) ); }
+      inline void SetVertex( const I& index, V& vertex )
+        { this->m_Vertices[ index ] = vertex; }
+      inline V& GetVertex( const I& index )
+        { return( this->m_Vertices[ index ] ); }
+      inline const V& GetVertex( const I& index ) const
+        { return( this->m_Vertices[ index ] ); }
       bool RenameVertex( const I& old_index, const I& new_index );
       void RemoveVertex( const I& index );
-      V& GetVertex( const I& index );
-      const V& GetVertex( const I& index ) const;
 
       /*! \brief Edge manipulation methods.
        *         Names are self-explanatory.
        */
+      inline void AddEdge( const I& orig, const I& dest, const C& cost )
+        { this->m_Matrix[ orig ][ dest ].push_back( cost ); }
+      inline TEdges& GetEdges( const I& orig, const I& dest )
+        { return( this->m_Matrix[ orig ][ dest ] ); }
+      inline const TEdges& GetEdges( const I& orig, const I& dest ) const
+        { return( this->m_Matrix[ orig ][ dest ] ); }
       bool HasEdge( const I& orig, const I& dest ) const;
-      void AddEdge( const I& orig, const I& dest, const C& cost );
       void RemoveEdge( const I& orig, const I& dest, const C& cost );
       void RemoveEdges( const I& orig, const I& dest );
-      TEdges& GetEdges( const I& orig, const I& dest );
-      const TEdges& GetEdges( const I& orig, const I& dest ) const;
 
       /*! \brief Returns graph's sinks.
        *
index 7ca6d88f55fc9b2dd60710871a776cb430a9b7cb..b7b045c0f40c392939b9b236416bd230a19f7ab0 100644 (file)
@@ -1,78 +1,6 @@
 #ifndef __CPEXTENSIONS__DATASTRUCTURES__GRAPH__HXX__
 #define __CPEXTENSIONS__DATASTRUCTURES__GRAPH__HXX__
 
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TVertices::iterator cpExtensions::DataStructures::Graph< V, C, I >::
-BeginVertices( )
-{
-  return( this->m_Vertices.begin( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TVertices::iterator cpExtensions::DataStructures::Graph< V, C, I >::
-EndVertices( )
-{
-  return( this->m_Vertices.end( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TVertices::const_iterator cpExtensions::DataStructures::Graph< V, C, I >::
-BeginVertices( ) const
-{
-  return( this->m_Vertices.begin( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TVertices::const_iterator cpExtensions::DataStructures::Graph< V, C, I >::
-EndVertices( ) const
-{
-  return( this->m_Vertices.end( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TMatrix::iterator cpExtensions::DataStructures::Graph< V, C, I >::
-BeginEdgesRows( )
-{
-  return( this->m_Matrix.begin( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TMatrix::iterator cpExtensions::DataStructures::Graph< V, C, I >::
-EndEdgetsRows( )
-{
-  return( this->m_Matrix.end( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TMatrix::const_iterator cpExtensions::DataStructures::Graph< V, C, I >::
-BeginEdgesRows( ) const
-{
-  return( this->m_Matrix.begin( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TMatrix::const_iterator cpExtensions::DataStructures::Graph< V, C, I >::
-EndEdgesRows( ) const
-{
-  return( this->m_Matrix.end( ) );
-}
-
 // -------------------------------------------------------------------------
 template< class V, class C, class I >
 void cpExtensions::DataStructures::Graph< V, C, I >::
@@ -82,30 +10,6 @@ Clear( )
   this->m_Matrix.clear( );
 }
 
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-void cpExtensions::DataStructures::Graph< V, C, I >::
-ClearEdges( )
-{
-  this->m_Matrix.clear( );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-bool cpExtensions::DataStructures::Graph< V, C, I >::
-HasVertexIndex( const I& index ) const
-{
-  return( this->m_Vertices.find( index ) != this->m_Vertices.end( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-void cpExtensions::DataStructures::Graph< V, C, I >::
-SetVertex( const I& index, V& vertex )
-{
-  this->m_Vertices[ index ] = vertex;
-}
-
 // -------------------------------------------------------------------------
 template< class V, class C, class I >
 bool cpExtensions::DataStructures::Graph< V, C, I >::
@@ -206,22 +110,6 @@ RemoveVertex( const I& index )
     return( false );
 }
 
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-V& cpExtensions::DataStructures::Graph< V, C, I >::
-GetVertex( const I& index )
-{
-  return( this->m_Vertices[ index ] );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-const V& cpExtensions::DataStructures::Graph< V, C, I >::
-GetVertex( const I& index ) const
-{
-  return( this->m_Vertices[ index ] );
-}
-
 // -------------------------------------------------------------------------
 template< class V, class C, class I >
 bool cpExtensions::DataStructures::Graph< V, C, I >::
@@ -234,14 +122,6 @@ HasEdge( const I& orig, const I& dest ) const
     return( false );
 }
 
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-void cpExtensions::DataStructures::Graph< V, C, I >::
-AddEdge( const I& orig, const I& dest, const C& cost )
-{
-  this->m_Matrix[ orig ][ dest ].push_back( cost );
-}
-
 // -------------------------------------------------------------------------
 template< class V, class C, class I >
 void cpExtensions::DataStructures::Graph< V, C, I >::
@@ -293,24 +173,6 @@ RemoveEdges( const I& orig, const I& dest )
 
 }
 
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-typename cpExtensions::DataStructures::Graph< V, C, I >::
-TEdges& cpExtensions::DataStructures::Graph< V, C, I >::
-GetEdges( const I& orig, const I& dest )
-{
-  return( this->m_Matrix[ orig ][ dest ] );
-}
-
-// -------------------------------------------------------------------------
-template< class V, class C, class I >
-const typename cpExtensions::DataStructures::Graph< V, C, I >::
-TEdges& cpExtensions::DataStructures::Graph< V, C, I >::
-GetEdges( const I& orig, const I& dest ) const
-{
-  return( this->m_Matrix[ orig ][ dest ] );
-}
-
 // -------------------------------------------------------------------------
 template< class V, class C, class I >
 std::set< I > cpExtensions::DataStructures::Graph< V, C, I >::
index 2acc980ce24f23def7906467feb03512d024cecb..489392d57651f271eedfbd7032c81b4c78b5e63c 100644 (file)
@@ -9,23 +9,26 @@
 cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject::
 GetSource( )
 {
-  return( this->m_Source );
+  auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source );
+  return( ptr->GetPointer( ) );
 }
 
 // -------------------------------------------------------------------------
 const cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject::
 GetSource( ) const
 {
-  return( this->m_Source );
+  auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source );
+  return( ptr->GetPointer( ) );
 }
 
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::DataObject::
 SetSource( cpPlugins::Interface::ProcessObject* src )
 {
-  if( this->m_Source != src )
+  auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source );
+  if( ptr->GetPointer( ) != src )
   {
-    this->m_Source = src;
+    *ptr = src;
     this->Modified( );
 
   } // fi
@@ -33,7 +36,7 @@ SetSource( cpPlugins::Interface::ProcessObject* src )
 
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::DataObject::
-DisconnectPipeline( )
+DisconnectFromPipeline( )
 {
   // Disconnect input pipelines (ITK)
   itk::DataObject* itk_obj = this->GetITK< itk::DataObject >( );
@@ -60,22 +63,25 @@ DisconnectPipeline( )
   } // fi
 
   // Unbind source
-  this->m_Source = NULL;
+  auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source );
+  *ptr = NULL;
   this->Modified( );
 }
 
 // -------------------------------------------------------------------------
 cpPlugins::Interface::DataObject::
 DataObject( )
-  : Superclass( ),
-    m_Source( NULL )
+  : Superclass( )
 {
+  this->m_Source = new ProcessObject::Pointer( );
 }
 
 // -------------------------------------------------------------------------
 cpPlugins::Interface::DataObject::
 ~DataObject( )
 {
+  auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source );
+  delete ptr;
 }
 
 // eof - $RCSfile$
index e2d79ffcc16ba3313d4b50b2b1e4e7f26759a60e..9293376a36bd39d246bb4b5812aee5a139df9ace 100644 (file)
@@ -31,7 +31,7 @@ namespace cpPlugins
       const ProcessObject* GetSource( ) const;
       void SetSource( ProcessObject* src );
 
-      void DisconnectPipeline( );
+      void DisconnectFromPipeline( );
 
     protected:
       DataObject( );
@@ -43,7 +43,7 @@ namespace cpPlugins
       Self& operator=( const Self& );
 
     protected:
-      ProcessObject* m_Source;
+      void* m_Source;
     };
 
   } // ecapseman
index 3e259169d517d949665405550f98c544c63aa32f..bef169d1f067b6a9f967c8de67142fdcc48d419a 100644 (file)
@@ -3,6 +3,32 @@
 #include <itkObject.h>
 #include <vtkObject.h>
 
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::Object::
+SetViewCoords( float x, float y )
+{
+  this->m_ViewX = x;
+  this->m_ViewY = y;
+  // WARNING: do not call "this->Modified( )" -> It could lead to a
+  //          re-execution of all pipeline
+}
+
+#ifdef cpPlugins_Interface_QT4
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::Object::
+SetViewCoords( const QPointF& coords )
+{
+  this->SetViewCoords( coords.x( ), coords.y( ) );
+}
+
+// -------------------------------------------------------------------------
+QPointF cpPlugins::Interface::Object::
+GetViewCoords( ) const
+{
+  return( QPointF( this->m_ViewX, this->m_ViewY ) );
+}
+#endif // cpPlugins_Interface_QT4
+
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Object::
 Modified( ) const
@@ -15,11 +41,20 @@ Modified( ) const
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::Interface::Object::
-SetViewCoords( float x, float y )
+itk::ModifiedTimeType cpPlugins::Interface::Object::
+GetMTime( ) const
 {
-  this->SetViewX( x );
-  this->SetViewY( y );
+  unsigned long tTime = this->Superclass::GetMTime( );
+  unsigned long iTime = tTime;
+  unsigned long vTime = tTime;
+
+  const itk::Object* i = this->GetITK< itk::Object >( );
+  vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
+  if( i != NULL ) iTime = i->GetMTime( );
+  if( v != NULL ) vTime = v->GetMTime( );
+
+  tTime = ( tTime < iTime )? tTime: iTime;
+  return( ( itk::ModifiedTimeType )( ( tTime < vTime )? tTime: vTime ) );
 }
 
 // -------------------------------------------------------------------------
@@ -52,7 +87,6 @@ Object( )
   : Superclass( ),
     m_ITKObject( NULL ),
     m_VTKObject( NULL ),
-    m_Name( "" ),
     m_ViewX( float( 0 ) ),
     m_ViewY( float( 0 ) )
 {
index dd7d9b61d20aeb63d5baae08f1d0bac09a91a25d..34810d58ec05c17dc258502e1eb7d4f1fc606ed5 100644 (file)
 #include <vtkSmartPointer.h>
 #include <vtkObjectBase.h>
 
+#ifdef cpPlugins_Interface_QT4
+#include <QPointF>
+#endif // cpPlugins_Interface_QT4
+
 namespace cpPlugins
 {
   namespace Interface
@@ -31,20 +35,22 @@ namespace cpPlugins
       itkTypeMacro( Object, itkObject );
       cpPlugins_Id_Macro( Object, BaseObject );
 
-      itkGetStringMacro( Name );
       itkGetConstMacro( ViewX, float );
       itkGetConstMacro( ViewY, float );
 
-      itkSetStringMacro( Name );
-      itkSetMacro( ViewX, float );
-      itkSetMacro( ViewY, float );
-
     public:
-      virtual void Modified( ) const;
       void SetViewCoords( float x, float y );
 
-      void SetITK( itk::LightObject* o );
-      void SetVTK( vtkObjectBase* o );
+#ifdef cpPlugins_Interface_QT4
+      void SetViewCoords( const QPointF& coords );
+      QPointF GetViewCoords( ) const;
+#endif // cpPlugins_Interface_QT4
+
+      virtual void Modified( ) const;
+      virtual itk::ModifiedTimeType GetMTime( ) const;
+
+      virtual void SetITK( itk::LightObject* o );
+      virtual void SetVTK( vtkObjectBase* o );
 
       template< class T >
         inline T* GetITK( );
@@ -70,7 +76,6 @@ namespace cpPlugins
     protected:
       itk::LightObject::Pointer        m_ITKObject;
       vtkSmartPointer< vtkObjectBase > m_VTKObject;
-      std::string                      m_Name;
 
       float m_ViewX;
       float m_ViewY;
index 17fe21b6c427a1b9d698d4eb6ca14fa56423a64a..f012f5701d3131a7b86d5f5acedf615a59137d99 100644 (file)
@@ -124,16 +124,7 @@ GetMTime( ) const
 {
   auto params_time = this->m_Parameters->GetMTime( );
   auto filter_time = this->Superclass::GetMTime( );
-  auto ipobj = this->GetITK< itk::ProcessObject >( );
-  if( ipobj == NULL )
-  {
-    auto vpobj = this->GetVTK< vtkAlgorithm >( );
-    if( vpobj != NULL )
-      filter_time = ( const_cast< vtkAlgorithm* >( vpobj ) )->GetMTime( );
-  }
-  else
-    filter_time = ipobj->GetMTime( );
-  return( ( params_time < filter_time )? filter_time: params_time );
+  return( ( params_time < filter_time )? params_time: filter_time );
 }
 
 // -------------------------------------------------------------------------
@@ -143,7 +134,7 @@ Update( )
   std::string r = "";
 
   // Force upstream updates
-  _TDataContainer::iterator i = this->m_Inputs.begin( );
+  auto i = this->m_Inputs.begin( );
   bool need_to_update = false;
   for( ; i != this->m_Inputs.end( ) && r == ""; ++i )
   {
@@ -156,9 +147,8 @@ Update( )
         r = src->Update( );
 
       } // fi
-    }
-    else
-      r = "cpPlugins::Interface::ProcessObject: No input connected.";
+
+    } // fi
 
   } // rof
 
index 862da18b48a949f46fcd4b033ec9928d6846d701..e99e8fce440715735c5bf6f53f684b8f82bf231f 100644 (file)
@@ -87,7 +87,7 @@ namespace cpPlugins
       ProcessObject( );
       virtual ~ProcessObject( );
 
-      void _AddInput( const std::string& name );
+      void _AddInput( const std::string& name, bool required );
       template< class O >
         inline void _AddOutput( const std::string& name );
       template< class F >
index cec8facce9ae630ab506726939bc682458aeb083..6dd0282d1b8ed221f7f6504eaf1867a2a5c96e55 100644 (file)
@@ -7,20 +7,6 @@ ProcessObjectPort( )
   this->m_Data = NULL;
 }
 
-// -------------------------------------------------------------------------
-cpPlugins::Interface::ProcessObjectPort::
-ProcessObjectPort( DataObject* obj )
-{
-  this->m_Data = obj;
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::ProcessObjectPort::
-ProcessObjectPort( const Self& other )
-{
-  this->m_Data = other.m_Data.GetPointer( );
-}
-
 // -------------------------------------------------------------------------
 cpPlugins::Interface::ProcessObjectPort::
 ~ProcessObjectPort( )
@@ -52,4 +38,97 @@ IsValid( ) const
   return( this->m_Data.IsNotNull( ) );
 }
 
+// -------------------------------------------------------------------------
+cpPlugins::Interface::InputProcessObjectPort::
+InputProcessObjectPort( bool required )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::InputProcessObjectPort::
+~InputProcessObjectPort( )
+{
+}
+      
+// -------------------------------------------------------------------------
+cpPlugins::Interface::InputProcessObjectPort::
+Self& cpPlugins::Interface::InputProcessObjectPort::
+operator=( DataObject* obj )
+{
+  this->Superclass::operator=( obj );
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::InputProcessObjectPort::
+Self& cpPlugins::Interface::InputProcessObjectPort::
+operator=( const Superclass& other )
+{
+  auto i = dynamic_cast< const InputProcessObjectPort* >( &other );
+  this->Superclass::operator=( other );
+  if( i != NULL )
+    this->m_Required = i->m_Required;
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Interface::InputProcessObjectPort::
+IsRequired( ) const
+{
+  return( this->m_Required );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::InputProcessObjectPort::
+RequiredOn( )
+{
+  this->SetRequired( true );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::InputProcessObjectPort::
+RequiredOff( )
+{
+  this->SetRequired( false );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::InputProcessObjectPort::
+SetRequired( bool required )
+{
+  this->m_Required = required;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::OutputProcessObjectPort::
+OutputProcessObjectPort( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::OutputProcessObjectPort::
+~OutputProcessObjectPort( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::OutputProcessObjectPort::
+Self& cpPlugins::Interface::OutputProcessObjectPort::
+operator=( DataObject* obj )
+{
+  this->Superclass::operator=( obj );
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::OutputProcessObjectPort::
+Self& cpPlugins::Interface::OutputProcessObjectPort::
+operator=( const Superclass& other )
+{
+  this->Superclass::operator=( other );
+  return( *this );
+}
+
 // eof - $RCSfile$
index 393fd53e1d827e3ca3a65de1ec24be712daf9f4b..67186e515307e1ba861508c52a9c21d1ad7249b9 100644 (file)
@@ -16,8 +16,6 @@ namespace cpPlugins
 
     public:
       ProcessObjectPort( );
-      ProcessObjectPort( DataObject* obj );
-      ProcessObjectPort( const Self& other );
       virtual ~ProcessObjectPort( );
       Self& operator=( DataObject* obj );
       Self& operator=( const Self& other );
@@ -25,16 +23,55 @@ namespace cpPlugins
       bool IsValid( ) const;
 
       // This could be seen as a pointer to DataObject's
-      DataObject* GetPointer( )
+      inline DataObject* GetPointer( )
       { return( this->m_Data.GetPointer( ) ); }
-      const DataObject* GetPointer( ) const
+      inline const DataObject* GetPointer( ) const
       { return( this->m_Data.GetPointer( ) ); }
-      DataObject* operator->( ) const
+      inline DataObject* operator->( ) const
       { return( this->m_Data.GetPointer( ) ); }
 
     protected:
       cpPlugins::Interface::DataObject::Pointer m_Data;
+    };
+
+    /**
+     */
+    class cpPlugins_Interface_EXPORT InputProcessObjectPort
+      : public ProcessObjectPort
+    {
+    public:
+      typedef InputProcessObjectPort Self;
+      typedef ProcessObjectPort      Superclass;
+
+    public:
+      InputProcessObjectPort( bool required = false );
+      virtual ~InputProcessObjectPort( );
+      Self& operator=( DataObject* obj );
+      Self& operator=( const Superclass& other );
+
+      bool IsRequired( ) const;
+      void RequiredOn( );
+      void RequiredOff( );
+      void SetRequired( bool required );
 
+    protected:
+      bool m_Required;
+    };
+
+    /**
+     */
+    class cpPlugins_Interface_EXPORT OutputProcessObjectPort
+      : public ProcessObjectPort
+    {
+    public:
+      typedef OutputProcessObjectPort Self;
+      typedef ProcessObjectPort       Superclass;
+
+    public:
+      OutputProcessObjectPort( );
+      virtual ~OutputProcessObjectPort( );
+      Self& operator=( DataObject* obj );
+      Self& operator=( const Superclass& other );
     };
 
   } // ecapseman