]> Creatis software - cpPlugins.git/blobdiff - lib/cpBaseQtApplication/MainWindow.cxx
..
[cpPlugins.git] / lib / cpBaseQtApplication / MainWindow.cxx
index bfe8b5b9d4b5b9943b3e36080dbd4b7c543529a9..9b16236acb94760f09af7f12bf3fb1f8d7e8c6ad 100644 (file)
@@ -1,6 +1,8 @@
 #include <cpBaseQtApplication/MainWindow.h>
 #include <cpBaseQtApplication/Plugins/Navigator.h>
 #include <cpBaseQtApplication/Pipeline/Canvas.h>
+#include <cpExtensions/QT/ConfigurationChooser.h>
+#include <cpExtensions/QT/ActorsWidgetInterface.h>
 
 #include <QDir>
 #include <QFileDialog>
@@ -131,6 +133,14 @@ void cpBaseQtApplication::MainWindow::
 setViewer( cpExtensions::QT::ActorsWidgetInterface* v )
 {
   this->m_Viewer = v;
+  if( this->m_Viewer != NULL )
+  {
+    auto interactors = this->m_Viewer->GetInteractors( );
+    for( auto wIt : this->m_Workspaces )
+      for( auto i : interactors )
+        wIt.second->AddInteractor( i );
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------
@@ -223,6 +233,16 @@ _addWorkspace( const std::string& name )
     if( this->m_SingleWorkspace )
       this->m_Workspaces.clear( );
     this->m_Workspaces[ name ] = TWorkspace::New( );
+    if( this->m_Canvas != NULL )
+      this->m_Canvas->setWorkspace( this->m_Workspaces[ name ] );
+    if( this->m_Viewer !=  NULL )
+    {
+      auto interactors = this->m_Viewer->GetInteractors( );
+      auto wIt = this->m_Workspaces.find( name );
+      for( auto i : interactors )
+        wIt->second->AddInteractor( i );
+
+    } // fi
     this->setWindowTitle( ( this->m_BaseWindowTitle + name ).c_str( ) );
 
   } // fi
@@ -388,4 +408,21 @@ _loadWorkspace( )
   this->_loadWorkspace( dlg.selectedFiles( ).begin( )->toStdString( ) );
 }
 
+// -------------------------------------------------------------------------
+void cpBaseQtApplication::MainWindow::
+_actorsProperties( )
+{
+  auto data =
+    dynamic_cast< cpExtensions::QT::ActorsWidgetInterface* >(
+      this->m_Viewer
+      );
+  if( data != NULL )
+  {
+    auto dlg = new cpExtensions::QT::ConfigurationChooser( this );
+    dlg->setData( data );
+    dlg->exec( );
+
+  } // fi
+}
+
 // eof - $RCSfile$