#include "MeshWriter.h" #include #include #include #include // ------------------------------------------------------------------------- cpPlugins::IO::MeshWriter:: MeshWriter( ) : Superclass( ) { this->_AddInput( "Input" ); this->m_Parameters->ConfigureAsString( "FileName", "" ); } // ------------------------------------------------------------------------- cpPlugins::IO::MeshWriter:: ~MeshWriter( ) { } // ------------------------------------------------------------------------- std::string cpPlugins::IO::MeshWriter:: _GenerateData( ) { cpPlugins::Interface::Mesh* mesh = this->GetInput< cpPlugins::Interface::Mesh >( "Input" ); if( mesh == NULL ) return( "MeshWriter: No input mesh." ); vtkPolyData* i = mesh->GetVTK< vtkPolyData >( ); if( i == NULL ) return( "MeshWriter: No suitable input." ); std::string fname = this->m_Parameters->GetString( "FileName" ); vtkPolyDataWriter* pdw = this->_CreateVTK< vtkPolyDataWriter >( ); pdw->SetInputData( i ); pdw->SetFileName( fname.c_str( ) ); pdw->Update( ); if( pdw->GetErrorCode( ) != 0 ) return( "MeshWriter: someting wrong happened." ); return( "" ); } // eof - $RCSfile$