#include #include // ------------------------------------------------------------------------- void cpPlugins::DataObjects::Skeleton:: SetITK( itk::LightObject* o ) { /* TODO typedef cpExtensions::DataStructures::Skeleton< 1 > _T1; typedef cpExtensions::DataStructures::Skeleton< 2 > _T2; typedef cpExtensions::DataStructures::Skeleton< 3 > _T3; typedef cpExtensions::DataStructures::Skeleton< 4 > _T4; 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 */ } // ------------------------------------------------------------------------- void cpPlugins::DataObjects::Skeleton:: SetVTK( vtkObjectBase* o ) { // Do nothing this->m_ITK = NULL; this->m_VTK = NULL; this->m_ITKvVTK = NULL; } // ------------------------------------------------------------------------- cpPlugins::DataObjects::Skeleton:: Skeleton( ) : Superclass( ) { } // ------------------------------------------------------------------------- cpPlugins::DataObjects::Skeleton:: ~Skeleton( ) { } // ------------------------------------------------------------------------- template< class _TSkeleton > void cpPlugins::DataObjects::Skeleton:: _ITK_2_VTK( _TSkeleton* sk ) { typedef cpExtensions::Visualization::SkeletonToPolyData< _TSkeleton > _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( sk ); f->Update( ); // Keep object track this->m_ITK = sk; this->m_VTK = f->GetOutput( ); } // eof - $RCSfile$