X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FIO%2FMeshWriter.cxx;h=805ca0ee04b9ef0264bbeb197232654865ba6c13;hb=f2f39f66027a98bd8dac50bade5618e0136bbefa;hp=ade28b87e5b8b85e8d8952ac6e358443151a047d;hpb=b23970017af98ef6617ddf40f225d4d15fa65854;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/IO/MeshWriter.cxx b/lib/cpPlugins/Plugins/IO/MeshWriter.cxx index ade28b8..805ca0e 100644 --- a/lib/cpPlugins/Plugins/IO/MeshWriter.cxx +++ b/lib/cpPlugins/Plugins/IO/MeshWriter.cxx @@ -8,11 +8,8 @@ // ------------------------------------------------------------------------- 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; @@ -24,8 +21,6 @@ MeshWriter( ) cpPlugins::IO::MeshWriter:: ~MeshWriter( ) { - if( this->m_Writer != NULL ) - this->m_Writer->Delete( ); } // ------------------------------------------------------------------------- @@ -36,16 +31,12 @@ _GenerateData( ) 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( );