+ QMenu* menu = dynamic_cast< QMenu* >( action->parentWidget( ) );
+ if( menu == NULL )
+ return;
+ std::string filter_cate = menu->title( ).toStdString( );
+ std::string filter_name = action->text( ).toStdString( );
+
+ // Create filter
+ TPlugins::TProcessObject::Pointer filter;
+ if( !( this->m_Plugins->CreateFilter( filter, filter_name ) ) )
+ {
+ QMessageBox::critical(
+ this,
+ tr( "Error creating filter" ),
+ tr( (
+ std::string( "No valid filter \"" ) +
+ filter_name +
+ std::string( "\"defined." )
+ ).c_str( ) )
+ );
+ return;
+
+ } // fi
+
+ // Assign inputs
+ std::vector< std::string > inputs_names = filter->GetInputsNames( );
+ if( inputs_names.size( ) == 1 )
+ {
+ std::string data_name = this->m_UI->MPR->GetSelectedData( );
+ _TImages::iterator iIt = this->m_Images.find( data_name );
+ _TImages::iterator mIt = this->m_Meshes.find( data_name );
+ filter->SetInput( inputs_names[ 0 ]);
+ }
+ else if( inputs_names.size( ) > 1 )
+ {
+ } // fi
+
+ // Get outputs
+ std::vector< std::string > outputs_names = filter->GetOutputsNames( );
+ */
+
+ /*
+
+ // Choose inputs
+ if( filter_cate == "ImageToMeshFilter" )
+ {
+ // Check inputs
+ _TImages::iterator iIt = this->m_Images.find( data_name );
+ if( iIt == this->m_Images.end( ) )
+ {
+ QMessageBox::critical(
+ this,
+ tr( "Error creating filter" ),
+ tr( "No valid input selected." )
+ );
+ return;
+
+ } // fi
+
+ // Execute configuration dialog
+ if( !( filter->ExecConfigurationDialog( this ) ) )
+ return;
+
+ // Execute filter
+ filter->SetInput( "Input", iIt->second );
+ this->_Block( );
+ std::string filter_err = filter->Update( );
+ this->_Unblock( );
+ if( filter_err != "" )
+ {
+ QMessageBox::critical(
+ this,
+ tr( "Error executing" ),
+ tr( filter_err.c_str( ) )
+ );
+ return;
+
+ } // fi
+
+ // Keep and show results
+ TPlugins::TMesh::Pointer mesh =
+ filter->GetOutput< TPlugins::TMesh >( "Output" );
+ this->m_Meshes[ filter_name ] = mesh;
+ this->_Block( );
+ this->m_UI->MPR->ShowMesh(
+ mesh->GetVTK< vtkPolyData >( ),
+ filter_name,
+ data_name
+ );
+ this->_Unblock( );
+
+ } // fi
+ */