#include #include // ------------------------------------------------------------------------- void cpPlugins::DataObjects::PolyLineParametricPath:: SetITK( itk::LightObject* o ) { this->Superclass::SetITK( o ); auto l1 = dynamic_cast< cpExtensions::DataStructures::PolyLineParametricPath< 1 >* >( o ); auto l2 = dynamic_cast< cpExtensions::DataStructures::PolyLineParametricPath< 2 >* >( o ); auto l3 = dynamic_cast< cpExtensions::DataStructures::PolyLineParametricPath< 3 >* >( o ); auto l4 = dynamic_cast< cpExtensions::DataStructures::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; } // fi } // ------------------------------------------------------------------------- void cpPlugins::DataObjects::PolyLineParametricPath:: SetVTK( vtkObjectBase* o ) { // Do nothing this->m_ITK = NULL; this->m_VTK = NULL; this->m_ITKvVTK = NULL; } // ------------------------------------------------------------------------- cpPlugins::DataObjects::PolyLineParametricPath:: PolyLineParametricPath( ) : Superclass( ) { } // ------------------------------------------------------------------------- cpPlugins::DataObjects::PolyLineParametricPath:: ~PolyLineParametricPath( ) { } // ------------------------------------------------------------------------- template< class _TPolyLine > void cpPlugins::DataObjects::PolyLineParametricPath:: _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$