1 #include <VTKIO/MeshReader.h>
2 #include <cpInstances/Mesh.h>
3 #include <cpPlugins/QT/OpenFileDialog.h>
5 #include <vtkPolyData.h>
6 #include <vtkPolyDataReader.h>
9 # include <QApplication>
10 #endif // cpPlugins_QT4
12 // -------------------------------------------------------------------------
13 QDialog* cpPluginsVTKIO::MeshReader::
17 cpPlugins::QT::OpenFileDialog* dlg = NULL;
18 if( QApplication::instance( ) != NULL )
20 dlg = new cpPlugins::QT::OpenFileDialog( );
21 dlg->SetParameters( &( this->m_Parameters ), "FileName" );
25 #else // cpPlugins_QT4
27 #endif // cpPlugins_QT4
30 // -------------------------------------------------------------------------
31 cpPluginsVTKIO::MeshReader::
35 this->_ConfigureOutput< cpInstances::Mesh >( "Output" );
36 this->m_Parameters.Clear( );
37 this->m_Parameters.ConfigureAsOpenFileName( "FileName", "" );
38 this->m_Parameters.SetAcceptedFileExtensions(
44 // -------------------------------------------------------------------------
45 cpPluginsVTKIO::MeshReader::
50 // -------------------------------------------------------------------------
51 void cpPluginsVTKIO::MeshReader::
54 auto f = this->_CreateVTK< vtkPolyDataReader >( );
55 f->SetFileName( this->m_Parameters.GetOpenFileName( "FileName" ).c_str( ) );
57 this->GetOutput( "Output" )->SetVTK( f->GetOutput( ) );