Salome HOME
refs #1458: disable chained panning on operations
authorasl <asl@opencascade.com>
Fri, 1 Dec 2017 08:37:29 +0000 (11:37 +0300)
committerasl <asl@opencascade.com>
Fri, 1 Dec 2017 08:37:29 +0000 (11:37 +0300)
src/HYDROGUI/HYDROGUI_Operations.cxx

index 194e38a18ce1461563025d25363c020dbff01d12..dfa569fad0fe543f8b61531e4dc3547869605d74 100644 (file)
 
 #include <LightApp_Application.h>
 
-#include <CAM_Application.h>
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewWindow.h>
+#include <OCCViewer_ViewFrame.h>
 
 #include <QtxListAction.h>
 #include <QtxActionToolMgr.h>
@@ -457,7 +460,33 @@ void HYDROGUI_Module::onOperation()
   const QAction* anAction = dynamic_cast<const QAction*>( sender() );
   int anId = actionId( anAction );
   if( anId >= 0 )
+  {
+    OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( 
+      getApp()->viewManager( OCCViewer_Viewer::Type() ) );
+    if( mgr )
+    {
+      foreach( SUIT_ViewWindow* wnd, mgr->getViews() )
+      {
+        OCCViewer_ViewFrame* vf = dynamic_cast<OCCViewer_ViewFrame*>( wnd );
+        if( vf )
+        {
+          for( int i=OCCViewer_ViewFrame::MAIN_VIEW; i<=OCCViewer_ViewFrame::TOP_RIGHT; i++ )
+          {
+            OCCViewer_ViewWindow* iwnd = vf->getView(i);
+            if( iwnd )
+              iwnd->resetState();
+          }
+        }
+        else
+        {
+          OCCViewer_ViewWindow* ownd = dynamic_cast<OCCViewer_ViewWindow*>( wnd );
+          if( ownd )
+            ownd->resetState();
+        }
+      }
+    }
     startOperation( anId );
+  }
 
   if( anId==ShowHideArrows )
   {