+#include <plugins/IO/MeshWriter.h>
+#include <cpPlugins/DataObjects/Mesh.h>
+#include <vtkPolyDataWriter.h>
+
+// -------------------------------------------------------------------------
+cpPluginsIO::MeshWriter::
+MeshWriter( )
+ : Superclass( )
+{
+ this->_ConfigureInput< cpPlugins::DataObjects::Mesh >( "Input", true, false );
+ this->m_Parameters.Clear( );
+ this->m_Parameters.ConfigureAsSaveFileName( "FileName" );
+ this->m_Parameters.SetAcceptedFileExtensions(
+ "FileName",
+ "Mesh files (*.vtk)"
+ );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsIO::MeshWriter::
+~MeshWriter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsIO::MeshWriter::
+_GenerateData( )
+{
+ auto mesh = this->GetInputData< vtkPolyData >( "Input" );
+ if( mesh == NULL )
+ this->_Error( "Invalid input image." );
+
+ auto f = this->_CreateVTK< vtkPolyDataWriter >( );
+ f->SetFileName( this->m_Parameters.GetSaveFileName( "FileName" ).c_str( ) );
+ f->SetInputData( mesh );
+ f->Update( );
+}
+
+// eof - $RCSfile$