]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/IO/MeshReader.cxx
Widget integration (step 3/6). WARNING: IT DOES NOT COMPILE YET
[cpPlugins.git] / lib / cpPlugins / Plugins / IO / MeshReader.cxx
index b8da8a36f1e582502cb5d07bbaea85327ee6529b..e6bba2bd4045ef4e3d2fb2df571ebf7042ae4e5d 100644 (file)
@@ -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( "" );