]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/ProcessObject.hxx
median filter added
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.hxx
index 6dcbb7de08ddfe6f7024b859096032ebe449e7bb..f84d4a6301e202cf44bfbb95fb8b0e4b9b7a4bb2 100644 (file)
@@ -1,6 +1,54 @@
 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 
+// -------------------------------------------------------------------------
+template< class T >
+T* cpPlugins::Interface::ProcessObject::
+GetInput( unsigned int idx )
+{
+  if( idx < this->m_Inputs.size( ) )
+    return( dynamic_cast< T* >( this->m_Inputs[ idx ].GetPointer( ) ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+const T* cpPlugins::Interface::ProcessObject::
+GetInput( unsigned int idx ) const
+{
+  if( idx < this->m_Inputs.size( ) )
+    return(
+      dynamic_cast< const T* >( this->m_Inputs[ idx ].GetPointer( ) )
+      );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+T* cpPlugins::Interface::ProcessObject::
+GetOutput( unsigned int idx )
+{
+  if( idx < this->m_Outputs.size( ) )
+    return( dynamic_cast< T* >( this->m_Outputs[ idx ].GetPointer( ) ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+const T* cpPlugins::Interface::ProcessObject::
+GetOutput( unsigned int idx ) const
+{
+  if( idx < this->m_Outputs.size( ) )
+    return(
+      dynamic_cast< const T* >( this->m_Outputs[ idx ].GetPointer( ) )
+      );
+  else
+    return( NULL );
+}
+
 // -------------------------------------------------------------------------
 template< class O >
 void cpPlugins::Interface::ProcessObject::