- // Execute filter
- /*
- if( res == TPlugins::TProcessObject::DialogResult_NoModal )
- {
- this->_Block( );
- std::string filter_err = this->m_ActiveFilter->Update( );
- this->_Unblock( );
- if( filter_err != "" )
- {
- QMessageBox::critical(
- this,
- tr( "Error executing" ),
- tr( filter_err.c_str( ) )
- );
- this->m_ActiveFilter = NULL;
- return;
-
- } // fi
-
- // Get outputs
- std::vector< std::string > outputs_names = filter->GetOutputsNames( );
- for(
- auto oIt = outputs_names.begin( );
- oIt != outputs_names.end( );
- ++oIt
- )
- {
- std::string out_name = filter_name + "_" + *oIt;
-
- TPlugins::TImage* image =
- this->m_ActiveFilter->GetOutput< TPlugins::TImage >( *oIt );
- if( image != NULL )
- {
- if( filter_cate == "ImageToBinaryImageFilter" )
- {
- this->m_UI->MPR->ShowImage(
- image->GetVTK< vtkImageData >( ),
- out_name,
- data_name, 1, 0, 0
- );
- }
- else if( filter_cate == "ImageToImageFilter" )
- {
- } // fi
-
- // Keep a track on a local data tree and go to next output
- this->m_Objects[ out_name ] = TTreeNode( data_name, image );
- continue;
-
- } // fi
-
- TPlugins::TMesh* mesh = filter->GetOutput< TPlugins::TMesh >( *oIt );
- if( mesh != NULL )
- {
- // Show mesh
- this->_Block( );
- this->m_UI->MPR->ShowMesh(
- mesh->GetVTK< vtkPolyData >( ),
- out_name,
- data_name
- );
- this->_Unblock( );
-
- // Keep a track on a local data tree and go to next output
- this->m_Objects[ out_name ] = TTreeNode( data_name, mesh );
- continue;
-
- } // fi
-
- } // rof
-
- // No-modal filters just exists for one usage
- this->m_ActiveFilter = NULL;
+ // Configure paramereters
+ auto dlg_res = this->m_Plugins.ConfigureActiveFilter( );
+ if( dlg_res == TPlugins::TProcessObject::DialogResult_Cancel )
+ {
+ // Just deactivate filter, since it was canceled
+ this->m_Plugins.DeactivateFilter( );
+ return;
+ }
+ else if( dlg_res == TPlugins::TProcessObject::DialogResult_NoModal )
+ {
+ // Execute automatic filter and associate outputs
+ this->UpdateActualFilter( );
+ this->m_Plugins.DeactivateFilter( );