X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FDataObjects%2FPolyLineParametricPath.cxx;h=82e995756a7832aaf029488b13d16a4050187768;hb=ea5e17805784e51ec8b8cace8c46f7b3e9065ab2;hp=36d11f37ac94d5c34afab0d0408e591f4961a15f;hpb=8eaa2cf759c39233848cdd5b8346faccbea4c172;p=cpPlugins.git diff --git a/lib/cpPlugins/DataObjects/PolyLineParametricPath.cxx b/lib/cpPlugins/DataObjects/PolyLineParametricPath.cxx index 36d11f3..82e9957 100644 --- a/lib/cpPlugins/DataObjects/PolyLineParametricPath.cxx +++ b/lib/cpPlugins/DataObjects/PolyLineParametricPath.cxx @@ -6,10 +6,10 @@ 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 ); + 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 ); @@ -53,6 +53,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$