From ea5e17805784e51ec8b8cace8c46f7b3e9065ab2 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Thu, 6 Oct 2016 19:21:57 -0500 Subject: [PATCH] Branches representation 2/2 --- .../DataObjects/PolyLineParametricPath.cxx | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) 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$ -- 2.47.1