From 298f9ad7098bbd93988a2ac253327a0c34fd89fd Mon Sep 17 00:00:00 2001 From: san Date: Fri, 30 Mar 2012 17:29:19 +0400 Subject: [PATCH] 0023044: Regression: 3D views are not invalidated by some modifications of OpenGl_Structure myIsUpdated flag and Invalidate() method removed from OpenGl_Workspace class. View redrawing is made unconditional. V3d_View::Update() becomes deprecated and should be replaced with V3d_View::Redraw(). V3d_Viewer::Update() becomes deprecated and equivalent to Redraw() --- src/OpenGl/OpenGl_GraphicDriver.cxx | 2 +- src/OpenGl/OpenGl_GraphicDriver.hxx | 2 +- src/OpenGl/OpenGl_GraphicDriver_4.cxx | 2 -- src/OpenGl/OpenGl_GraphicDriver_7.cxx | 5 ----- src/OpenGl/OpenGl_GraphicDriver_9.cxx | 7 ------- src/OpenGl/OpenGl_Workspace.cxx | 2 -- src/OpenGl/OpenGl_Workspace.hxx | 9 ++------- src/OpenGl/OpenGl_Workspace_1.cxx | 1 - src/OpenGl/OpenGl_Workspace_2.cxx | 2 -- src/V3d/V3d_View.cdl | 4 +--- src/V3d/V3d_Viewer.cdl | 4 +--- 11 files changed, 6 insertions(+), 34 deletions(-) diff --git a/src/OpenGl/OpenGl_GraphicDriver.cxx b/src/OpenGl/OpenGl_GraphicDriver.cxx index 8e3a8e0a29..260adbe335 100755 --- a/src/OpenGl/OpenGl_GraphicDriver.cxx +++ b/src/OpenGl/OpenGl_GraphicDriver.cxx @@ -82,12 +82,12 @@ NCollection_DataMap& OpenGl_GraphicDriver:: } //TsmInitUpdateState +// Deprecated, need to decide what to do with EraseAnimation() call void OpenGl_GraphicDriver::InvalidateAllWorkspaces() { for (NCollection_DataMap::Iterator anIt (OpenGl_GraphicDriver::GetMapOfWorkspaces()); anIt.More(); anIt.Next()) { - anIt.ChangeValue()->Invalidate(); anIt.ChangeValue()->EraseAnimation(); } } diff --git a/src/OpenGl/OpenGl_GraphicDriver.hxx b/src/OpenGl/OpenGl_GraphicDriver.hxx index 45baa3b592..a852dba2b4 100644 --- a/src/OpenGl/OpenGl_GraphicDriver.hxx +++ b/src/OpenGl/OpenGl_GraphicDriver.hxx @@ -338,7 +338,7 @@ private: //! Access the global map of structures. static NCollection_DataMap& GetMapOfStructures(); - //! Invalidates all workspaces - thus they will be redrawn on next update call. + //! Deprecated. static void InvalidateAllWorkspaces(); public: diff --git a/src/OpenGl/OpenGl_GraphicDriver_4.cxx b/src/OpenGl/OpenGl_GraphicDriver_4.cxx index 2d229f5fda..9734c2a97f 100755 --- a/src/OpenGl/OpenGl_GraphicDriver_4.cxx +++ b/src/OpenGl/OpenGl_GraphicDriver_4.cxx @@ -85,7 +85,6 @@ void OpenGl_GraphicDriver::DisplayStructure (const Graphic3d_CView& theCVie return; aCView->View->DisplayStructure (aStructure, thePriority); - aCView->WS->Invalidate(); } void OpenGl_GraphicDriver::EraseStructure (const Graphic3d_CView& theCView, @@ -97,7 +96,6 @@ void OpenGl_GraphicDriver::EraseStructure (const Graphic3d_CView& theCView, return; aCView->View->EraseStructure (aStructure); - aCView->WS->Invalidate(); } void OpenGl_GraphicDriver::RemoveStructure (const Graphic3d_CStructure& theCStructure) diff --git a/src/OpenGl/OpenGl_GraphicDriver_7.cxx b/src/OpenGl/OpenGl_GraphicDriver_7.cxx index 90c93b13af..1b4d667b64 100755 --- a/src/OpenGl/OpenGl_GraphicDriver_7.cxx +++ b/src/OpenGl/OpenGl_GraphicDriver_7.cxx @@ -48,7 +48,6 @@ void OpenGl_GraphicDriver::Background (const Graphic3d_CView& ACView) if (aCView) { aCView->WS->SetBackgroundColor(ACView.DefWindow.Background.r,ACView.DefWindow.Background.g,ACView.DefWindow.Background.b); - aCView->WS->Invalidate(); } } @@ -61,7 +60,6 @@ void OpenGl_GraphicDriver::GradientBackground (const Graphic3d_CView& ACView, if (aCView) { aCView->View->SetBackgroundGradient(AColor1,AColor2,AType); - aCView->WS->Invalidate(); } } @@ -115,7 +113,6 @@ void OpenGl_GraphicDriver::ClipLimit (const Graphic3d_CView& ACView, const Stand if (!AWait) { aCView->WS->Resize(ACView.DefWindow); - aCView->WS->Invalidate(); } } } @@ -485,7 +482,6 @@ void OpenGl_GraphicDriver::ViewMapping (const Graphic3d_CView& ACView, const Sta if (!AWait) { aCView->WS->Resize(ACView.DefWindow); - aCView->WS->Invalidate(); } } } @@ -499,7 +495,6 @@ void OpenGl_GraphicDriver::ViewOrientation (const Graphic3d_CView& ACView, const if (!AWait) { aCView->WS->Resize(ACView.DefWindow); - aCView->WS->Invalidate(); } } } diff --git a/src/OpenGl/OpenGl_GraphicDriver_9.cxx b/src/OpenGl/OpenGl_GraphicDriver_9.cxx index 982f9b9e48..b867ad5c0c 100755 --- a/src/OpenGl/OpenGl_GraphicDriver_9.cxx +++ b/src/OpenGl/OpenGl_GraphicDriver_9.cxx @@ -66,7 +66,6 @@ void OpenGl_GraphicDriver::TriedronDisplay ( if (aCView) { aCView->View->TriedronDisplay(APosition, AColor, AScale, AsWireframe); - aCView->WS->Invalidate(); } } @@ -76,7 +75,6 @@ void OpenGl_GraphicDriver::TriedronErase (const Graphic3d_CView& ACView) if (aCView) { aCView->View->TriedronErase(); - aCView->WS->Invalidate(); } } @@ -93,7 +91,6 @@ void OpenGl_GraphicDriver::BackgroundImage( const Standard_CString FileName, if (aCView) { aCView->View->CreateBackgroundTexture( FileName, FillStyle ); - aCView->WS->Invalidate(); } } @@ -104,7 +101,6 @@ void OpenGl_GraphicDriver::SetBgImageStyle( const Graphic3d_CView& ACView, if (aCView) { aCView->View->SetBackgroundTextureStyle( FillStyle ); - aCView->WS->Invalidate(); } } @@ -114,7 +110,6 @@ void OpenGl_GraphicDriver::SetBgGradientStyle(const Graphic3d_CView& ACView,cons if (aCView) { aCView->View->SetBackgroundGradientType(FillType); - aCView->WS->Invalidate(); } } @@ -124,7 +119,6 @@ void OpenGl_GraphicDriver::GraduatedTrihedronDisplay(const Graphic3d_CView& ACVi if (aCView) { aCView->View->GraduatedTrihedronDisplay(cubic); - aCView->WS->Invalidate(); } } @@ -134,7 +128,6 @@ void OpenGl_GraphicDriver::GraduatedTrihedronErase(const Graphic3d_CView& ACView if (aCView) { aCView->View->GraduatedTrihedronErase(); - aCView->WS->Invalidate(); } } diff --git a/src/OpenGl/OpenGl_Workspace.cxx b/src/OpenGl/OpenGl_Workspace.cxx index 878ac64905..a52fd0f5fb 100644 --- a/src/OpenGl/OpenGl_Workspace.cxx +++ b/src/OpenGl/OpenGl_Workspace.cxx @@ -65,7 +65,6 @@ OpenGl_Workspace::OpenGl_Workspace (const Handle(OpenGl_Display)& theDisplay, const CALL_DEF_WINDOW& theCWindow, Aspect_RenderingContext theGContext) : OpenGl_Window (theDisplay, theCWindow, theGContext), - myIsUpdated (Standard_False), myTransientList (0), myIsTransientOpen (Standard_False), myRetainMode (Standard_False), @@ -158,6 +157,5 @@ void OpenGl_Workspace::UseTransparency (const Standard_Boolean theFlag) { myUseTransparency = theFlag; EraseAnimation(); - myIsUpdated = Standard_False; } } diff --git a/src/OpenGl/OpenGl_Workspace.hxx b/src/OpenGl/OpenGl_Workspace.hxx index 7a75db4929..c946267baf 100644 --- a/src/OpenGl/OpenGl_Workspace.hxx +++ b/src/OpenGl/OpenGl_Workspace.hxx @@ -76,13 +76,12 @@ public: const Aspect_CLayer2d& theCUnderLayer, const Aspect_CLayer2d& theCOverLayer); - //! Redraw window only if needed. + //! Deprecated. Simply calls Redraw(). void Update (const Graphic3d_CView& theCView, const Aspect_CLayer2d& theCUnderLayer, const Aspect_CLayer2d& theCOverLayer) { - if (!myIsUpdated) - Redraw (theCView, theCUnderLayer, theCOverLayer); + Redraw (theCView, theCUnderLayer, theCOverLayer); } //! Special method to perform printing. @@ -129,9 +128,6 @@ public: void FBORelease (Graphic3d_PtrFrameBuffer theFBOPtr); Standard_Boolean BufferDump (OpenGl_FrameBuffer *theFBOPtr, Image_CRawBufferData& theBuffer); - //! Mark this window to be redrawn on next update. - void Invalidate() { myIsUpdated = Standard_False; } - void UseTransparency (const Standard_Boolean theFlag); Standard_Boolean& UseZBuffer() { return myUseZBuffer; } Standard_Boolean& UseDepthTest() { return myUseDepthTest; } @@ -205,7 +201,6 @@ protected: protected: Handle(OpenGl_View) myView; // WSViews - now just one view is supported - Standard_Boolean myIsUpdated; // WSUpdateState Tint myTransientList; // WSTransient Standard_Boolean myIsTransientOpen; // transientOpen Tint myRetainMode; // WSRetainMode diff --git a/src/OpenGl/OpenGl_Workspace_1.cxx b/src/OpenGl/OpenGl_Workspace_1.cxx index 8ee9ffbf66..afe38ef3d8 100644 --- a/src/OpenGl/OpenGl_Workspace_1.cxx +++ b/src/OpenGl/OpenGl_Workspace_1.cxx @@ -43,7 +43,6 @@ void OpenGl_Workspace::EndAnimation () if( (NamedStatus & OPENGL_NS_ANIMATION) == 0 ) return; NamedStatus &= ~(OPENGL_NS_ANIMATION | OPENGL_NS_DEGENERATION | OPENGL_NS_UPDATEAM); - myIsUpdated = Standard_False; } /*----------------------------------------------------------------------*/ diff --git a/src/OpenGl/OpenGl_Workspace_2.cxx b/src/OpenGl/OpenGl_Workspace_2.cxx index c3ec00fdb9..e49b809347 100644 --- a/src/OpenGl/OpenGl_Workspace_2.cxx +++ b/src/OpenGl/OpenGl_Workspace_2.cxx @@ -849,8 +849,6 @@ void OpenGl_Workspace::Redraw1 (const Graphic3d_CView& ACView, } else glFlush(); - - myIsUpdated = Standard_True; } /*----------------------------------------------------------------------*/ diff --git a/src/V3d/V3d_View.cdl b/src/V3d/V3d_View.cdl index b758a72e51..6bcbaa4413 100755 --- a/src/V3d/V3d_View.cdl +++ b/src/V3d/V3d_View.cdl @@ -213,9 +213,7 @@ is Update ( me ) is redefined static; ---Level: Public - ---Purpose: Updates the display of the view. - -- Must be called to update the view - -- when the update mode is deferred (WAIT) . + ---Purpose: Deprecated, Redraw() should be used instead. Redraw ( me ); ---Level: Public diff --git a/src/V3d/V3d_Viewer.cdl b/src/V3d/V3d_Viewer.cdl index a25528ef1c..ab70e36776 100755 --- a/src/V3d/V3d_Viewer.cdl +++ b/src/V3d/V3d_Viewer.cdl @@ -154,9 +154,7 @@ is Update (me:mutable ) is redefined static; ---Level: Public - ---Purpose: Updates the display of all the views of a viewer. - -- Must be called when the views must be updated - -- simultaneously while the Update mode is deferred (WAIT). + ---Purpose: Deprecated, Redraw() should be used instead. UpdateLights (me: mutable); ---Level: Public