]> Creatis software - cpPlugins.git/blobdiff - plugins/cpPluginsIO/MeshWriter.cxx
...
[cpPlugins.git] / plugins / cpPluginsIO / MeshWriter.cxx
index ad5501ac0e091e4ffb062c1471df67110bc7a005..699d3822858d503150c65976deede45559d7277a 100644 (file)
@@ -27,12 +27,12 @@ cpPluginsIO::MeshWriter::
 }
 
 // -------------------------------------------------------------------------
-std::string cpPluginsIO::MeshWriter::
+void cpPluginsIO::MeshWriter::
 _GenerateData( )
 {
   auto mesh = this->GetInputData( "Input" )->GetVTK< vtkPolyData >( );
   if( mesh == NULL )
-    return( "MeshWriter: No suitable input." );
+    this->_Error( "No suitable input." );
 
   // Get file extension
   auto fname = this->m_Parameters.GetSaveFileName( "FileName" );
@@ -50,9 +50,7 @@ _GenerateData( )
     stlw->SetFileName( fname.c_str( ) );
     stlw->Update( );
     if( stlw->GetErrorCode( ) != 0 )
-      return( "MeshWriter: someting wrong happened." );
-    else
-      return( "" );
+      this->_Error( "Someting wrong happened." );
   }
   else if( ext == "vtk" )
   {
@@ -61,12 +59,10 @@ _GenerateData( )
     pdw->SetFileName( fname.c_str( ) );
     pdw->Update( );
     if( pdw->GetErrorCode( ) != 0 )
-      return( "MeshWriter: someting wrong happened." );
-    else
-      return( "" );
+      this->_Error( "Someting wrong happened." );
   }
   else
-    return( "MeshWriter: Input file format not recognized." );
+    this->_Error( "Input file format not recognized." );
 }
 
 // eof - $RCSfile$