// -------------------------------------------------------------------------
cpPlugins::IO::MeshWriter::
MeshWriter( )
- : Superclass( ),
- m_Writer( NULL )
+ : Superclass( )
{
- this->m_ClassName = "cpPlugins::IO::MeshWriter";
- this->m_ClassCategory = "MeshWriter";
this->SetNumberOfInputs( 1 );
using namespace cpPlugins::Interface;
cpPlugins::IO::MeshWriter::
~MeshWriter( )
{
- if( this->m_Writer != NULL )
- this->m_Writer->Delete( );
}
// -------------------------------------------------------------------------
this->GetInput< cpPlugins::Interface::Mesh >( 0 );
if( mesh == NULL )
return( "MeshWriter: No input mesh." );
- vtkPolyData* i = mesh->GetVTKMesh( );
+ vtkPolyData* i = mesh->GetVTK< vtkPolyData >( );
if( i == NULL )
return( "MeshWriter: No suitable input." );
std::string fname = this->m_Parameters.GetValueAsString( "FileName" );
- if( this->m_Writer != NULL )
- this->m_Writer->Delete( );
-
- vtkPolyDataWriter* pdw = vtkPolyDataWriter::New( );
- this->m_Writer = pdw;
+ vtkPolyDataWriter* pdw = this->_CreateVTK< vtkPolyDataWriter >( );
pdw->SetInputData( i );
pdw->SetFileName( fname.c_str( ) );
pdw->Update( );