Salome HOME
Miltiple updates of viewer in onResetView()
authorstv <stv@opencascade.com>
Fri, 25 Nov 2005 11:42:22 +0000 (11:42 +0000)
committerstv <stv@opencascade.com>
Fri, 25 Nov 2005 11:42:22 +0000 (11:42 +0000)
src/OCCViewer/OCCViewer_ViewPort.h
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h
src/OCCViewer/OCCViewer_ViewWindow.cxx

index 10fd2ce67bb9e71e1a02207dcdfef469e5a279a2..330c29f918088bfe984b030bc89c936c90ccf4ab 100755 (executable)
@@ -59,7 +59,7 @@ protected:
        virtual void                     setCenter( int, int ) = 0;
        virtual void                     fitRect( const QRect& ) = 0;
   virtual void                  zoom( int, int, int, int ) = 0;
-  virtual void                  fitAll( bool keepScale = false, bool withZ = true ) = 0;
+  virtual void                  fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
 
 // POPUP
 //  void                             onCreatePopup( QPopupMenu* );
index 68d66d67090ca22fc66fd5b0ce1a88a9016ec657..995bbcd078c72ef4f0a5fca1486c7b92483d5b58 100755 (executable)
@@ -371,20 +371,17 @@ void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
 /*!
     Fits all objects in view. [ virtual protected ]
 */
-void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ )
+void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
 {
        if ( activeView().IsNull() )
-        return;
-
+    return;
 
-    if ( keepScale )
-        myScale = activeView()->Scale();
 
-    Standard_Real margin = 0.01;
-    activeView()->FitAll( margin, withZ );
+  if ( keepScale )
+    myScale = activeView()->Scale();
 
-//    double zsize = getZSize();
-//    setZSize( zsize );
+  Standard_Real margin = 0.01;
+  activeView()->FitAll( margin, withZ, upd );
 }
 
 /*!
index c2e0bf8acb2832a8e50e345fd5fe827cec27b90f..3b5ea5303265a1044461abf69d204919e6c44ba6 100755 (executable)
@@ -44,7 +44,7 @@ public:
        virtual void            setCenter( int , int );
        virtual void            fitRect( const QRect& );
        virtual void            zoom( int, int, int, int );
-  virtual void         fitAll( bool keepScale = false, bool withZ = true );
+  virtual void         fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
 
        void                    startRotation( int, int );
        void                    rotate( int, int );
index 5fa27acd137ef323a221bb5c02bed5d9e0789e5b..ed1ee55b9aa5751eb9e28716d45d32dc0d2fa93f 100755 (executable)
@@ -765,8 +765,11 @@ void OCCViewer_ViewWindow::onRightView()
 void OCCViewer_ViewWindow::onResetView()
 {
   emit vpTransformationStarted( RESETVIEW );
-  myViewPort->getView()->Reset();
-  myViewPort->fitAll();
+  bool upd = myViewPort->getView()->SetImmediateUpdate( false );
+  myViewPort->getView()->Reset( false );
+  myViewPort->fitAll( false, true, false );
+  myViewPort->getView()->SetImmediateUpdate( upd );
+  myViewPort->getView()->Update();
 }
 
 //****************************************************************