]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/DataObjects/PolyLineParametricPath.cxx
...
[cpPlugins.git] / lib / cpPlugins / DataObjects / PolyLineParametricPath.cxx
index 36d11f37ac94d5c34afab0d0408e591f4961a15f..cab593afa3ca7ecf7d608186f764649a325fa724 100644 (file)
@@ -5,21 +5,28 @@
 void cpPlugins::DataObjects::PolyLineParametricPath::
 SetITK( itk::LightObject* o )
 {
-  this->Superclass::SetITK( o );
-  auto l1 = dynamic_cast< itk::PolyLineParametricPath< 1 >* >( o );
-  auto l2 = dynamic_cast< itk::PolyLineParametricPath< 2 >* >( o );
-  auto l3 = dynamic_cast< itk::PolyLineParametricPath< 3 >* >( o );
-  auto l4 = dynamic_cast< itk::PolyLineParametricPath< 4 >* >( o );
-  if     ( l1 != NULL ) this->_ITK_2_VTK( l1 );
-  else if( l2 != NULL ) this->_ITK_2_VTK( l2 );
-  else if( l3 != NULL ) this->_ITK_2_VTK( l3 );
-  else if( l4 != NULL ) this->_ITK_2_VTK( l4 );
-  else
-  {
-    this->m_VTK = NULL;
-    this->m_ITKvVTK = NULL;
+  /* TODO
+     typedef cpExtensions::DataStructures::PolyLineParametricPath< 1 > _T1;
+     typedef cpExtensions::DataStructures::PolyLineParametricPath< 2 > _T2;
+     typedef cpExtensions::DataStructures::PolyLineParametricPath< 3 > _T3;
+     typedef cpExtensions::DataStructures::PolyLineParametricPath< 4 > _T4;
 
-  } // fi
+     this->Superclass::SetITK( o );
+     auto l1 = dynamic_cast< _T1* >( o );
+     auto l2 = dynamic_cast< _T2* >( o );
+     auto l3 = dynamic_cast< _T3* >( o );
+     auto l4 = dynamic_cast< _T4* >( o );
+     if     ( l1 != NULL ) this->_ITK_2_VTK( l1 );
+     else if( l2 != NULL ) this->_ITK_2_VTK( l2 );
+     else if( l3 != NULL ) this->_ITK_2_VTK( l3 );
+     else if( l4 != NULL ) this->_ITK_2_VTK( l4 );
+     else
+     {
+     this->m_VTK = NULL;
+     this->m_ITKvVTK = NULL;
+
+     } // fi
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -53,6 +60,20 @@ _ITK_2_VTK( _TPolyLine* pl )
   typedef
     cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >
     _TFilter;
+  _TFilter* f = dynamic_cast< _TFilter* >( this->m_ITKvVTK.GetPointer( ) );
+  if( f == NULL )
+  {
+    _TFilter* nf = _TFilter::New( );
+    this->m_ITKvVTK = nf;
+    f = nf;
+
+  } // fi
+  f->SetInput( pl );
+  f->Update( );
+
+  // Keep object track
+  this->m_ITK = pl;
+  this->m_VTK = f->GetOutput( );
 }
 
 // eof - $RCSfile$