]> Creatis software - cpPlugins.git/blobdiff - plugins/cpPluginsIO/MeshReader.cxx
...
[cpPlugins.git] / plugins / cpPluginsIO / MeshReader.cxx
index 49b76a2406840e98f5a5c62ec323b2a3ad110cd4..eead3dae5e4141760e5859407370d1c7cfa9f4d1 100644 (file)
@@ -37,29 +37,29 @@ cpPluginsIO::MeshReader::
 }
 
 // -------------------------------------------------------------------------
-std::string cpPluginsIO::MeshReader::
+void cpPluginsIO::MeshReader::
 _GenerateData( )
 {
-  auto dim = this->m_Parameters.GetUint( "Dimension" );
-  if     ( dim == 2 ) return( this->_GD0< 2 >( ) );
-  else if( dim == 3 ) return( this->_GD0< 3 >( ) );
-  else                return( "MeshReader: Mesh dimension not supported." );
+  auto d = this->m_Parameters.GetUint( "Dimension" );
+  if     ( d == 2 ) this->_GD0< 2 >( );
+  else if( d == 3 ) this->_GD0< 3 >( );
+  else              this->_Error( "Mesh dimension not supported." );
 }
 
 // -------------------------------------------------------------------------
 template< unsigned int _Dim >
-std::string cpPluginsIO::MeshReader::
+void cpPluginsIO::MeshReader::
 _GD0( )
 {
-  auto st = this->m_Parameters.GetSelectedChoice( "ScalarType" );
-  if     ( st == "float" )  return( this->_GD1< float, _Dim >( ) );
-  else if( st == "double" ) return( this->_GD1< double, _Dim >( ) );
-  else                      return( "MeshReader: Mesh type not supported." );
+  auto s = this->m_Parameters.GetSelectedChoice( "ScalarType" );
+  if     ( s == "float" )  this->_GD1< float, _Dim >( );
+  else if( s == "double" ) this->_GD1< double, _Dim >( );
+  else                     this->_Error( "Mesh type not supported." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TScalar, unsigned int _Dim >
-std::string cpPluginsIO::MeshReader::
+void cpPluginsIO::MeshReader::
 _GD1( )
 {
   auto fname = this->m_Parameters.GetOpenFileName( "FileName" );
@@ -79,7 +79,6 @@ _GD1( )
     stlr->Update( );
 
     this->GetOutputData( "Output" )->SetVTK( stlr->GetOutput( ) );
-    return( "" );
   }
   else if( ext == "obj" )
   {
@@ -88,7 +87,6 @@ _GD1( )
     objr->Update( );
 
     this->GetOutputData( "Output" )->SetVTK( objr->GetOutput( ) );
-    return( "" );
   }
   else if( ext == "vtk" )
   {
@@ -97,10 +95,9 @@ _GD1( )
     pdr->Update( );
 
     this->GetOutputData( "Output" )->SetVTK( pdr->GetOutput( ) );
-    return( "" );
   }
   else
-    return( "MeshReader: Input file format not recognized." );
+    this->_Error( "Input file format not recognized." );
 }
 
 // eof - $RCSfile$