]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/IO/MeshReader.cxx
Widget integration (step 1/6)
[cpPlugins.git] / lib / cpPlugins / Plugins / IO / MeshReader.cxx
index 67069046163d768395fc55d2e23c5b8a871f6497..b8da8a36f1e582502cb5d07bbaea85327ee6529b 100644 (file)
@@ -4,6 +4,45 @@
 #include <vtkPolyData.h>
 #include <vtkPolyDataReader.h>
 
+#ifdef cpPlugins_Interface_QT4
+#include <QFileDialog>
+#endif // cpPlugins_Interface_QT4
+
+// -------------------------------------------------------------------------
+bool cpPlugins::IO::MeshReader::
+ExecConfigurationDialog( QWidget* parent )
+{
+  bool r = false;
+
+#ifdef cpPlugins_Interface_QT4
+
+  // Show dialog and check if it was accepted
+  QFileDialog dialog( parent );
+  dialog.setFileMode( QFileDialog::ExistingFile );
+  dialog.setDirectory( QFileDialog::tr( "." ) );
+  dialog.setNameFilter( QFileDialog::tr( "All files (*)" ) );
+  if( dialog.exec( ) )
+  {
+    this->m_Parameters = this->m_DefaultParameters;
+    QStringList names = dialog.selectedFiles( );
+    this->m_Parameters.AddValueToStringList(
+      "FileNames", names[ 0 ].toStdString( )
+      );
+
+    /* TODO
+       this->m_Parameters.SetValueAsString( "PixelType", "float" );
+       this->m_Parameters.SetValueAsUint( "Dimension", 3 );
+    */
+
+    r = true;
+
+  } // fi
+
+#endif // cpPlugins_Interface_QT4
+
+  return( r );
+}
+
 // -------------------------------------------------------------------------
 cpPlugins::IO::MeshReader::
 MeshReader( )