Salome HOME
Correction tab logic.
[modules/shaper.git] / src / XGUI / XGUI_ViewerProxy.cpp
index 90178a9670a93c4d8ed2a745ada44217d82348d1..6233d28ff80940973c70c6920d1df3752944f42e 100644 (file)
@@ -22,6 +22,17 @@ XGUI_ViewerProxy::XGUI_ViewerProxy(XGUI_Workshop* theParent)
 {
 }
 
+void XGUI_ViewerProxy::connectViewProxy()
+{
+#ifdef HAVE_SALOME
+  connect(myWorkshop->salomeConnector()->viewer(), SIGNAL(trihedronVisibilityChanged(bool)),
+         SIGNAL(trihedronVisibilityChanged(bool)));
+#else
+  connect(myWorkshop->mainWindow()->viewer(), SIGNAL(trihedronVisibilityChanged(bool)),
+         SIGNAL(trihedronVisibilityChanged(bool)));
+#endif
+}
+
 Handle(AIS_InteractiveContext) XGUI_ViewerProxy::AISContext() const
 {
 #ifdef HAVE_SALOME
@@ -31,6 +42,15 @@ Handle(AIS_InteractiveContext) XGUI_ViewerProxy::AISContext() const
 #endif
 }
 
+Handle(AIS_Trihedron) XGUI_ViewerProxy::trihedron() const
+{
+#ifdef HAVE_SALOME
+  return myWorkshop->salomeConnector()->viewer()->trihedron();
+#else
+  return myWorkshop->mainWindow()->viewer()->trihedron();
+#endif
+}
+
 Handle(V3d_Viewer) XGUI_ViewerProxy::v3dViewer() const
 {
 #ifdef HAVE_SALOME
@@ -52,13 +72,24 @@ Handle(V3d_View) XGUI_ViewerProxy::activeView() const
 #endif
 }
 
+QWidget* XGUI_ViewerProxy::activeViewPort() const
+{
+#ifdef HAVE_SALOME
+  return myWorkshop->salomeConnector()->viewer()->activeViewPort();
+#else
+  AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
+  return (aViewer->activeViewWindow()) ? 
+         aViewer->activeViewWindow()->viewPortApp(): 0;
+#endif
+}
+
 void XGUI_ViewerProxy::setViewProjection(double theX, double theY, double theZ, double theTwist)
 {
   Handle(V3d_View) aView3d = activeView();
   if (!aView3d.IsNull()) {
     aView3d->SetProj(theX, theY, theZ);
     aView3d->SetTwist( theTwist );
-    aView3d->FitAll(0.01, true);
+    aView3d->FitAll(0.01, false);
     aView3d->SetZSize(0.);
     if (aView3d->Depth() < 0.1)
       aView3d->DepthFitAll();