1 #include <cpPlugins/DataObjects/Simple3DCurve.h>
2 #include <cpExtensions/DataStructures/Simple3DCurve.h>
3 #include <cpExtensions/Visualization/Simple3DCurveToPolyData.h>
5 // -------------------------------------------------------------------------
6 void cpPlugins::DataObjects::Simple3DCurve::
7 SetITK( itk::LightObject* o )
9 typedef cpExtensions::DataStructures::Simple3DCurve< float > _TF;
10 typedef cpExtensions::DataStructures::Simple3DCurve< double > _TD;
12 this->Superclass::SetITK( o );
13 auto lf = dynamic_cast< _TF* >( o );
14 auto ld = dynamic_cast< _TD* >( o );
15 if ( lf != NULL ) this->_ITK_2_VTK( lf );
16 else if( ld != NULL ) this->_ITK_2_VTK( ld );
20 this->m_ITKvVTK = NULL;
25 // -------------------------------------------------------------------------
26 void cpPlugins::DataObjects::Simple3DCurve::
27 SetVTK( vtkObjectBase* o )
32 this->m_ITKvVTK = NULL;
35 // -------------------------------------------------------------------------
36 cpPlugins::DataObjects::Simple3DCurve::
42 // -------------------------------------------------------------------------
43 cpPlugins::DataObjects::Simple3DCurve::
48 // -------------------------------------------------------------------------
49 template< class _TSimple3DCurve >
50 void cpPlugins::DataObjects::Simple3DCurve::
51 _ITK_2_VTK( _TSimple3DCurve* curve )
54 cpExtensions::Visualization::Simple3DCurveToPolyData< _TSimple3DCurve >
56 _TFilter* f = dynamic_cast< _TFilter* >( this->m_ITKvVTK.GetPointer( ) );
59 _TFilter* nf = _TFilter::New( );
69 this->m_VTK = f->GetOutput( );