X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FIO%2FMeshReader.cxx;h=e6bba2bd4045ef4e3d2fb2df571ebf7042ae4e5d;hb=f989f3f91e2a17832652e345928eac26dcfb6d52;hp=b8da8a36f1e582502cb5d07bbaea85327ee6529b;hpb=b4cc15873d07ef87910a4aa6492e74022cda1a25;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/IO/MeshReader.cxx b/lib/cpPlugins/Plugins/IO/MeshReader.cxx index b8da8a3..e6bba2b 100644 --- a/lib/cpPlugins/Plugins/IO/MeshReader.cxx +++ b/lib/cpPlugins/Plugins/IO/MeshReader.cxx @@ -46,8 +46,7 @@ ExecConfigurationDialog( QWidget* parent ) // ------------------------------------------------------------------------- cpPlugins::IO::MeshReader:: MeshReader( ) - : Superclass( ), - m_Reader( NULL ) + : Superclass( ) { this->m_ClassName = "cpPlugins::IO::MeshReader"; this->m_ClassCategory = "MeshReader"; @@ -68,8 +67,6 @@ MeshReader( ) cpPlugins::IO::MeshReader:: ~MeshReader( ) { - if( this->m_Reader != NULL ) - this->m_Reader = NULL; } // ------------------------------------------------------------------------- @@ -109,18 +106,14 @@ _GD1( ) Parameters::TString fname = this->m_Parameters.GetValueAsString( "FileName" ); - if( this->m_Reader != NULL ) - this->m_Reader->Delete( ); - - vtkPolyDataReader* pdr = vtkPolyDataReader::New( ); - this->m_Reader = pdr; + vtkPolyDataReader* pdr = this->_CreateVTK< vtkPolyDataReader >( ); pdr->SetFileName( fname.c_str( ) ); pdr->Update( ); cpPlugins::Interface::Mesh* out = this->GetOutput< cpPlugins::Interface::Mesh >( 0 ); if( out != NULL ) - out->SetVTKMesh( pdr->GetOutput( ) ); + out->SetVTK( pdr->GetOutput( ) ); else return( "MeshReader: output not correctly created." ); return( "" );