From 27dee12695d4e4f624df5453f3636956b5321f98 Mon Sep 17 00:00:00 2001 From: stv Date: Fri, 25 Nov 2005 11:42:22 +0000 Subject: [PATCH] Miltiple updates of viewer in onResetView() --- src/OCCViewer/OCCViewer_ViewPort.h | 2 +- src/OCCViewer/OCCViewer_ViewPort3d.cxx | 15 ++++++--------- src/OCCViewer/OCCViewer_ViewPort3d.h | 2 +- src/OCCViewer/OCCViewer_ViewWindow.cxx | 7 +++++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/OCCViewer/OCCViewer_ViewPort.h b/src/OCCViewer/OCCViewer_ViewPort.h index 10fd2ce67..330c29f91 100755 --- a/src/OCCViewer/OCCViewer_ViewPort.h +++ b/src/OCCViewer/OCCViewer_ViewPort.h @@ -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* ); diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index 68d66d670..995bbcd07 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -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 ); } /*! diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.h b/src/OCCViewer/OCCViewer_ViewPort3d.h index c2e0bf8ac..3b5ea5303 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.h +++ b/src/OCCViewer/OCCViewer_ViewPort3d.h @@ -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 ); diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 5fa27acd1..ed1ee55b9 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -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(); } //**************************************************************** -- 2.39.2