0023044: Regression: 3D views are not invalidated by some modifications of OpenGl_Str...
authorsan <san@opencascade.com>
Fri, 30 Mar 2012 13:29:19 +0000 (17:29 +0400)
committersan <san@opencascade.com>
Fri, 30 Mar 2012 13:29:19 +0000 (17:29 +0400)
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
src/OpenGl/OpenGl_GraphicDriver.hxx
src/OpenGl/OpenGl_GraphicDriver_4.cxx
src/OpenGl/OpenGl_GraphicDriver_7.cxx
src/OpenGl/OpenGl_GraphicDriver_9.cxx
src/OpenGl/OpenGl_Workspace.cxx
src/OpenGl/OpenGl_Workspace.hxx
src/OpenGl/OpenGl_Workspace_1.cxx
src/OpenGl/OpenGl_Workspace_2.cxx
src/V3d/V3d_View.cdl
src/V3d/V3d_Viewer.cdl

index 8e3a8e0..260adbe 100755 (executable)
@@ -82,12 +82,12 @@ NCollection_DataMap<Standard_Integer, OpenGl_Structure*>& OpenGl_GraphicDriver::
 }
 
 //TsmInitUpdateState
+// Deprecated, need to decide what to do with EraseAnimation() call
 void OpenGl_GraphicDriver::InvalidateAllWorkspaces()
 {
   for (NCollection_DataMap<Standard_Integer, Handle(OpenGl_Workspace)>::Iterator anIt (OpenGl_GraphicDriver::GetMapOfWorkspaces());
        anIt.More(); anIt.Next())
   {
-    anIt.ChangeValue()->Invalidate();
     anIt.ChangeValue()->EraseAnimation();
   }
 }
index 45baa3b..a852dba 100644 (file)
@@ -338,7 +338,7 @@ private:
   //! Access the global map of structures.
   static NCollection_DataMap<Standard_Integer, OpenGl_Structure*>& GetMapOfStructures();
 
-  //! Invalidates all workspaces - thus they will be redrawn on next update call.
+  //! Deprecated.
   static void InvalidateAllWorkspaces();
 
 public:
index 2d229f5..9734c2a 100755 (executable)
@@ -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)
index 90c93b1..1b4d667 100755 (executable)
@@ -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();
     }
   }
 }
index 982f9b9..b867ad5 100755 (executable)
@@ -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();
   }
 }
 
index 878ac64..a52fd0f 100644 (file)
@@ -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;
   }
 }
index 7a75db4..c946267 100644 (file)
@@ -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
index 8ee9ffb..afe38ef 100644 (file)
@@ -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;
 }
 
 /*----------------------------------------------------------------------*/
index c3ec00f..e49b809 100644 (file)
@@ -849,8 +849,6 @@ void OpenGl_Workspace::Redraw1 (const Graphic3d_CView& ACView,
   }
   else
     glFlush();
-
-  myIsUpdated = Standard_True;
 }
 
 /*----------------------------------------------------------------------*/
index b758a72..6bcbaa4 100755 (executable)
@@ -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
index a25528e..ab70e36 100755 (executable)
@@ -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