Salome HOME
According to "operation-widget_factory-property"
[modules/shaper.git] / src / XGUI / XGUI_ViewerProxy.cpp
index e07c3693e75ca6e91446ddefc12c7d9d2b16b020..19453efdb3a4719691ba02a5952c86c9a4cf14fe 100644 (file)
@@ -51,6 +51,16 @@ void XGUI_ViewerProxy::setViewProjection(double theX, double theY, double theZ)
   }
 }
 
+void XGUI_ViewerProxy::fitAll()
+{
+  if (myWorkshop->isSalomeMode()) {
+    myWorkshop->salomeConnector()->viewer()->fitAll();
+  }
+  else {
+    XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
+    aViewer->activeViewWindow()->viewPort()->fitAll();
+  }
+}
 
 void XGUI_ViewerProxy::connectToViewer()
 {
@@ -85,6 +95,11 @@ void XGUI_ViewerProxy::connectToViewer()
     
     connect(aViewer, SIGNAL(keyRelease(QKeyEvent*)),
             this, SIGNAL(keyRelease(QKeyEvent*)));
+
+    connect(aViewer, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
+    connect(aViewer, SIGNAL(contextMenuRequested(QContextMenuEvent*)), 
+            this, SIGNAL(contextMenuRequested(QContextMenuEvent*)));
+
   } else {
     XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
 
@@ -111,6 +126,10 @@ void XGUI_ViewerProxy::connectToViewer()
             this, SLOT(onKeyPress(XGUI_ViewWindow*, QKeyEvent*)));
     connect(aViewer, SIGNAL(keyRelease(XGUI_ViewWindow*, QKeyEvent*)),
             this, SLOT(onKeyRelease(XGUI_ViewWindow*, QKeyEvent*)));
+
+    connect(aViewer, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
+    connect(aViewer, SIGNAL(contextMenuRequested(QContextMenuEvent*)), 
+            this, SIGNAL(contextMenuRequested(QContextMenuEvent*)));
   }
 }