+++ /dev/null
-#include <VTKIO/MeshWriter.h>
-#include <cpInstances/DataObjects/Mesh.h>
-#include <cpPlugins/QT/SaveFileDialog.h>
-
-#include <vtkPolyData.h>
-#include <vtkPolyDataWriter.h>
-
-#ifdef cpPlugins_QT4
-# include <QApplication>
-#endif // cpPlugins_QT4
-
-// -------------------------------------------------------------------------
-QDialog* cpPluginsVTKIO::MeshWriter::
-CreateQDialog( )
-{
-#ifdef cpPlugins_QT4
- cpPlugins::QT::SaveFileDialog* dlg = NULL;
- if( QApplication::instance( ) != NULL )
- {
- dlg = new cpPlugins::QT::SaveFileDialog( );
- dlg->SetParameters( &( this->m_Parameters ), "FileName" );
-
- } // fi
- return( dlg );
-#else // cpPlugins_QT4
- return( NULL );
-#endif // cpPlugins_QT4
-}
-
-// -------------------------------------------------------------------------
-cpPluginsVTKIO::MeshWriter::
-MeshWriter( )
- : Superclass( )
-{
- this->_ConfigureInput< cpInstances::DataObjects::Mesh >( "Input", true, false );
- this->m_Parameters.Clear( );
- this->m_Parameters.ConfigureAsSaveFileName( "FileName", "" );
- this->m_Parameters.SetAcceptedFileExtensions(
- "FileName",
- "Mesh files (*.vtk)"
- );
-}
-
-// -------------------------------------------------------------------------
-cpPluginsVTKIO::MeshWriter::
-~MeshWriter( )
-{
-}
-
-// -------------------------------------------------------------------------
-void cpPluginsVTKIO::MeshWriter::
-_GenerateData( )
-{
- auto mesh = this->GetInputData< vtkPolyData >( "Input" );
- if( mesh == NULL )
- this->_Error( "Invalid input mesh." );
-
- auto f = this->_CreateVTK< vtkPolyDataWriter >( );
- f->SetFileName( this->m_Parameters.GetSaveFileName( "FileName" ).c_str( ) );
- f->SetInputData( mesh );
- f->SetFileTypeToBinary( );
- f->Update( );
-}
-
-// eof - $RCSfile$