]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/ProcessObject.hxx
Widget integration (step 3/6). WARNING: IT DOES NOT COMPILE YET
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.hxx
index f84d4a6301e202cf44bfbb95fb8b0e4b9b7a4bb2..50c03ce82cdfc0fb4c7a13fc2bd1f30424a56b5d 100644 (file)
@@ -1,6 +1,38 @@
 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 
+// -------------------------------------------------------------------------
+template< class T >
+T* cpPlugins::Interface::ProcessObject::
+GetITK( )
+{
+  return( dynamic_cast< T* >( this->m_ITKObject.GetPointer( ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+const T* cpPlugins::Interface::ProcessObject::
+GetITK( ) const
+{
+  return( dynamic_cast< const T* >( this->m_ITKObject.GetPointer( ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+T* cpPlugins::Interface::ProcessObject::
+GetVTK( )
+{
+  return( dynamic_cast< T* >( this->m_VTKObject.GetPointer( ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+const T* cpPlugins::Interface::ProcessObject::
+GetVTK( ) const
+{
+  return( dynamic_cast< const T* >( this->m_VTKObject.GetPointer( ) ) );
+}
+
 // -------------------------------------------------------------------------
 template< class T >
 T* cpPlugins::Interface::ProcessObject::
@@ -49,6 +81,39 @@ GetOutput( unsigned int idx ) const
     return( NULL );
 }
 
+// -------------------------------------------------------------------------
+template< class F >
+F* cpPlugins::Interface::ProcessObject::
+_CreateITK( )
+{
+  F* filter = dynamic_cast< F* >( this->m_ITKObject.GetPointer( ) );
+  if( filter == NULL )
+  {
+    typename F::Pointer ptr = F::New( );
+    this->m_ITKObject = ptr;
+    filter = ptr.GetPointer( );
+    this->m_VTKObject = NULL;
+
+  } // fi
+  return( filter );
+}
+
+// -------------------------------------------------------------------------
+template< class F >
+F* cpPlugins::Interface::ProcessObject::
+_CreateVTK( )
+{
+  F* filter = dynamic_cast< F* >( this->m_VTKObject.GetPointer( ) );
+  if( filter == NULL )
+  {
+    filter = F::New( );
+    this->m_VTKObject = filter;
+    this->m_ITKObject = NULL;
+
+  } // fi
+  return( filter );
+}
+
 // -------------------------------------------------------------------------
 template< class O >
 void cpPlugins::Interface::ProcessObject::