// -------------------------------------------------------------------------
cpPlugins::Plugins::MeshReader::
MeshReader( )
- : Superclass( )
+ : Superclass( ),
+ m_Reader( NULL )
{
this->m_ClassName = "cpPlugins::MeshReader";
this->m_ClassCategory = "MeshReader";
cpPlugins::Plugins::MeshReader::
~MeshReader( )
{
+ if( this->m_Reader != NULL )
+ this->m_Reader = NULL;
}
// -------------------------------------------------------------------------
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 );
}
this->m_Reader = pdr;
pdr->SetFileName( fname.c_str( ) );
pdr->Update( );
- this->m_Outputs[ 0 ]->SetVTKDataObject( pdr->GetOutput( ) );
+
+ cpPlugins::Interface::Mesh* out =
+ this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
+ if( out != NULL )
+ out->SetVTKMesh( pdr->GetOutput( ) );
+ else
+ return( "MeshReader: output not correctly created." );
return( "" );
}