]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Fit All after was added stream selection and displaying in embedded viewer.
authorstv <stv@opencascade.com>
Tue, 31 Mar 2015 10:06:33 +0000 (13:06 +0300)
committerstv <stv@opencascade.com>
Tue, 31 Mar 2015 10:06:33 +0000 (13:06 +0300)
src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx
src/HYDROGUI/HYDROGUI_ViewerDlg.h

index 34fc43ceebd94afc60d41cc8de7e57d082a45e1f..4f3286288aeecfa7e0c1cb1d5791e368bc3be441 100644 (file)
@@ -42,8 +42,9 @@
 #include <LightApp_UpdateFlags.h>
 
 #include <OCCViewer_ViewModel.h>
-#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewPort3d.h>
 #include <OCCViewer_ViewWindow.h>
+#include <OCCViewer_ViewManager.h>
 #include <OCCViewer_AISSelector.h>
 
 #include <AIS_ListOfInteractive.hxx>
@@ -189,7 +190,7 @@ void HYDROGUI_ProfileInterpolateOp::updatePreview()
             {
                 myPreview = new AIS_Shape( aShape );
                 myPreview->SetColor( Quantity_NOC_RED );
-                aCtx->Display( myPreview, 0, -1, false );
+                aCtx->Display( myPreview, 1, -1, false );
             }
         }
     }
@@ -354,7 +355,22 @@ void HYDROGUI_ProfileInterpolateOp::onRiverChanged( const QString& theRiver )
                     Handle(AIS_Shape) aPrs = new AIS_Shape( aProfile->GetShape3D() );
                     aPrs->SetOwner( aProfile );
                     aPrs->SetColor( Quantity_NOC_BLACK );
-                    aCtx->Display( aPrs, 0, 0, false );
+                    aCtx->Display( aPrs, 1, 0, false );
+                }
+            }
+            OCCViewer_ViewManager* vm = aDlg->viewManager();
+            if ( vm )
+            {
+                QVector<SUIT_ViewWindow*> winList = vm->getViews();
+                for ( QVector<SUIT_ViewWindow*>::iterator it = winList.begin(); it != winList.end(); ++it )
+                {
+                    OCCViewer_ViewWindow* occWin = ::qobject_cast<OCCViewer_ViewWindow*>( *it );
+                    if ( occWin )
+                    {
+                        OCCViewer_ViewPort3d* vp = occWin->getViewPort();
+                        if ( vp )
+                            vp->fitAll();
+                    }
                 }
             }
         }
index b806c520906d60940406fbcd2f5c2430dbf369dd..e41b60e7d5dc0c769397ddf936b6f53834c98fe8 100644 (file)
@@ -46,14 +46,14 @@ public:
 
   Handle(AIS_InteractiveContext) getAISContext();
 
-  virtual bool                   event( QEvent* );
-  virtual bool                   eventFilter( QObject*, QEvent* );
-
-protected:
   OCCViewer_Viewer*              viewer() const;
   OCCViewer_ViewManager*         viewManager() const;
   SUIT_SelectionMgr*             selectionMgr() const;
 
+  virtual bool                   event( QEvent* );
+  virtual bool                   eventFilter( QObject*, QEvent* );
+
+protected:
   virtual Handle(AIS_Trihedron)  trihedron();
 
 protected slots: