1 #include <IO/MeshWriter.h>
2 #include <cpPlugins/DataObjects/Mesh.h>
4 #include <vtkPolyData.h>
5 #include <vtkPolyDataWriter.h>
7 // -------------------------------------------------------------------------
8 cpPluginsIO::MeshWriter::
12 typedef cpPlugins::DataObjects::Mesh _TMesh;
14 this->_ConfigureInput< _TMesh >( "Input", true, false );
15 this->m_Parameters.Clear( );
16 this->m_Parameters.ConfigureAsSaveFileName( "FileName" );
17 this->m_Parameters.SetAcceptedFileExtensions(
23 // -------------------------------------------------------------------------
24 cpPluginsIO::MeshWriter::
29 // -------------------------------------------------------------------------
30 void cpPluginsIO::MeshWriter::
33 auto mesh = this->GetInputData< vtkPolyData >( "Input" );
35 this->_Error( "Invalid input image." );
37 auto f = this->_CreateVTK< vtkPolyDataWriter >( );
38 f->SetFileName( this->m_Parameters.GetSaveFileName( "FileName" ).c_str( ) );
39 f->SetInputData( mesh );
40 f->SetFileTypeToBinary( );