]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/MeshReader.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / MeshReader.cxx
index 5338c32b3424ebd1464be2406a7144e682fb4042..e658d8611b0fa69d998a85fd2c83fb79dca11210 100644 (file)
@@ -37,7 +37,9 @@ _GenerateData( )
   using namespace cpPlugins::Interface;
   Parameters::TUint dim = this->m_Parameters.GetValueAsUint( "Dimension" );
   std::string r = "MeshReader: Mesh dimension not supported.";
-  if( dim == 3 )
+  if( dim == 2 )
+    r = this->_GD0< 2 >( );
+  else if( dim == 3 )
     r = this->_GD0< 3 >( );
   return( r );
 }
@@ -72,7 +74,13 @@ _GD1( )
   this->m_Reader = pdr;
   pdr->SetFileName( fname.c_str( ) );
   pdr->Update( );
-  this->m_Outputs[ 0 ]->SetVTKDataObject( pdr->GetOutput( ) );
+
+  cpPlugins::Interface::Mesh* out =
+    this->_Output< cpPlugins::Interface::Mesh >( 0 );
+  if( out != NULL )
+    out->SetVTKMesh( pdr->GetOutput( ) );
+  else
+    return( "MeshReader: output not correctly created." );
   return( "" );
 }