]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/IO/MeshReader.cxx
Intermediary commit
[cpPlugins.git] / lib / cpPlugins / Plugins / IO / MeshReader.cxx
index b8da8a36f1e582502cb5d07bbaea85327ee6529b..fe61d707532d52b9b91f5ab724f6330d39ac026a 100644 (file)
@@ -25,8 +25,8 @@ ExecConfigurationDialog( QWidget* parent )
   {
     this->m_Parameters = this->m_DefaultParameters;
     QStringList names = dialog.selectedFiles( );
-    this->m_Parameters.AddValueToStringList(
-      "FileNames", names[ 0 ].toStdString( )
+    this->m_Parameters.SetValueAsString(
+      "FileName", names[ 0 ].toStdString( )
       );
 
     /* TODO
@@ -46,12 +46,8 @@ ExecConfigurationDialog( QWidget* parent )
 // -------------------------------------------------------------------------
 cpPlugins::IO::MeshReader::
 MeshReader( )
-  : Superclass( ),
-    m_Reader( NULL )
+  : Superclass( )
 {
-  this->m_ClassName = "cpPlugins::IO::MeshReader";
-  this->m_ClassCategory = "MeshReader";
-
   this->SetNumberOfOutputs( 1 );
   this->_MakeOutput< cpPlugins::Interface::Mesh >( 0 );
 
@@ -68,8 +64,6 @@ MeshReader( )
 cpPlugins::IO::MeshReader::
 ~MeshReader( )
 {
-  if( this->m_Reader != NULL )
-    this->m_Reader = NULL;
 }
 
 // -------------------------------------------------------------------------
@@ -109,18 +103,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( "" );