- /*
- // Show dialog and check if it was accepted
- QFileDialog dialog( this );
- dialog.setFileMode( QFileDialog::ExistingFile );
- dialog.setDirectory( "." );
- dialog.setNameFilter( tr( "VTK file (*.vtk);;All files (*)" ) );
- dialog.setDefaultSuffix( tr( "vtk" ) );
- if( !( dialog.exec( ) ) )
- return;
-
- std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
-
- this->m_InputMesh = NULL;
-
- // Get a reader from plugins
- TPluginFilter::Pointer reader =
- this->m_Plugins.CreateProcessObject(
- this->m_BaseClasses[ "MeshReader" ]
- );
-
- // Configure plugin
- TParameters reader_params = reader->GetDefaultParameters( );
- reader_params.SetValueAsString( "FileName", fname );
- reader->SetParameters( reader_params );
-
- // Execute and get error message, if any
- std::string err = reader->Update( );
-
- // Assign fresh image, if any
- if( err == "" )
- {
- this->m_InputMesh =
- dynamic_cast< TPluginMesh* >( reader->GetOutput( 0 ) );
- reader->DisconnectOutputs( );
- if( this->m_InputMesh.IsNotNull( ) )
- {
- this->m_InputMeshMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
- this->m_InputMeshMapper->SetInputData( this->m_InputMesh->GetVTKPolyData( ) );
- this->m_InputMeshActor = vtkSmartPointer< vtkActor >::New( );
- this->m_InputMeshActor->SetMapper( this->m_InputMeshMapper );
- this->m_MPR->Add3DActor( this->m_InputMeshActor );