]> Creatis software - cpPlugins.git/blobdiff - appli/PipelineEditor/PipelineEditor.cxx
Visual properties dialog finished.
[cpPlugins.git] / appli / PipelineEditor / PipelineEditor.cxx
index 65fb82b7f816cd9c8403844a6c5e05b4bae47b7d..cd3876f7949dbc3de41414cd36f402f0da54c9fd 100644 (file)
@@ -25,6 +25,14 @@ PipelineEditor( int argc, char* argv[], QApplication* app, QWidget* parent )
     );
 
   // Connect actions to slots
+  this->connect(
+    this->m_UI->ActionBackgroundMPR, SIGNAL( triggered( ) ),
+    this, SLOT( _ActionBackgroundMPR( ) )
+    );
+  this->connect(
+    this->m_UI->ActionBackground3D, SIGNAL( triggered( ) ),
+    this, SLOT( _ActionBackground3D( ) )
+    );
   this->connect(
     this->m_UI->ButtonLoadPluginsFile, SIGNAL( clicked( ) ),
     this, SLOT( _InteractiveLoadPlugins( ) )
@@ -74,32 +82,28 @@ PipelineEditor::
   delete this->m_UI;
 }
 
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ActionBackgroundMPR( )
+{
+  this->_BackgroundProperties( 4 );
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ActionBackground3D( )
+{
+  this->_BackgroundProperties( 3 );
+}
+
 // -------------------------------------------------------------------------
 void PipelineEditor::
 _ShowFilterOutput(
   const std::string& filter_name, const std::string& output_name
   )
 {
-  // Update filter, if needed
   this->_ExecFilter( filter_name );
-
-  // Get output
-  auto output = this->m_Workspace.GetOutput( filter_name, output_name );
-  if( output == NULL )
-  {
-    QMessageBox::critical(
-      this,
-      QMessageBox::tr( "Error showing data" ),
-      QMessageBox::tr( "Unknown port name." )
-      );
-    return;
-
-  } // fi
-
-  // Create and associate actor
-  this->_Block( );
-  this->m_UI->Viewer->AddActor( output->GetVTKActor( ) );
-  this->_UnBlock( );
+  this->_ShowData( filter_name, output_name );
 }
 
 // -------------------------------------------------------------------------
@@ -108,21 +112,7 @@ _HideFilterOutput(
   const std::string& filter_name, const std::string& output_name
   )
 {
-  // Get output
-  /* TODO
-     auto filter = this->m_Workspace.GetFilter( filter_name );
-     if( filter != NULL )
-     {
-     auto output = filter->GetOutputData( output_name );
-     if( output != NULL )
-     {
-     std::string data_name = output_name + "@" + filter_name;
-     this->m_UI->Viewer->HideData( data_name );
-
-     } // fi
-
-     } // fi
-  */
+  this->_HideData( filter_name, output_name );
 }
 
 // -------------------------------------------------------------------------
@@ -131,35 +121,7 @@ _PropertiesFilterOutput(
   const std::string& filter_name, const std::string& output_name
   )
 {
-  /* TODO
-     auto filter = this->m_Workspace.GetFilter( filter_name );
-     if( filter != NULL )
-     {
-     auto output = filter->GetOutputData< vtkPolyData >( output_name );
-     if( output != NULL )
-     {
-     auto actor = this->m_UI->Viewer->GetActor( output );
-     if( actor != NULL )
-     {
-     cpExtensions::QT::PropertyWidget* wdg =
-     new cpExtensions::QT::PropertyWidget( NULL );
-     wdg->SetProp( actor );
-     wdg->SetRenderWindow(
-     this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( )
-     );
-     wdg->show( );
-
-     } // fi
-     }
-     else
-     QMessageBox::critical(
-     this,
-     QMessageBox::tr( "Error showing data" ),
-     QMessageBox::tr( "No known VTK conversion!" )
-     );
-
-     } // fi
-  */
+  this->_DataProperties( filter_name, output_name );
 }
 
 // eof - $RCSfile$