From cfece3ef2e3f9da8de9b3c5158546d33e55db0a9 Mon Sep 17 00:00:00 2001
From: kgv <kgv@opencascade.com>
Date: Mon, 30 Jan 2017 13:09:22 +0300
Subject: [PATCH] 0028407: Visualization - remove ::UpdateMode() from
 Graphic3d_StructureManager

---
 dox/dev_guides/upgrade/upgrade.md             |  9 ++-
 .../visualization/visualization.md            | 68 ++++++++-----------
 src/Aspect/Aspect_TypeOfUpdate.hxx            | 29 --------
 src/Aspect/FILES                              |  1 -
 src/Graphic3d/Graphic3d_CView.cxx             | 60 +++++-----------
 src/Graphic3d/Graphic3d_CView.hxx             | 21 ++----
 src/Graphic3d/Graphic3d_Group.cxx             |  2 +-
 src/Graphic3d/Graphic3d_Structure.cxx         | 25 ++-----
 src/Graphic3d/Graphic3d_StructureManager.cxx  |  6 +-
 src/Graphic3d/Graphic3d_StructureManager.hxx  | 29 +-------
 src/OpenGl/OpenGl_View.cxx                    |  4 +-
 src/V3d/FILES                                 |  1 -
 src/V3d/V3d_DirectionalLight.cxx              |  4 --
 src/V3d/V3d_PositionLight.cxx                 |  4 --
 src/V3d/V3d_PositionalLight.cxx               |  4 --
 src/V3d/V3d_SpotLight.cxx                     |  4 --
 src/V3d/V3d_TypeOfUpdate.hxx                  | 29 --------
 src/V3d/V3d_View.cxx                          |  4 +-
 src/V3d/V3d_Viewer.cxx                        | 20 ------
 src/V3d/V3d_Viewer.hxx                        | 11 ---
 src/ViewerTest/ViewerTest_OpenGlCommands.cxx  |  2 +-
 21 files changed, 73 insertions(+), 264 deletions(-)
 delete mode 100644 src/Aspect/Aspect_TypeOfUpdate.hxx
 delete mode 100644 src/V3d/V3d_TypeOfUpdate.hxx

diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md
index 2654c04619..91e7b3c555 100644
--- a/dox/dev_guides/upgrade/upgrade.md
+++ b/dox/dev_guides/upgrade/upgrade.md
@@ -887,7 +887,7 @@ void UserDrawObject::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrs
   aGroup->AddElement(anElem);
 
   // invalidate bounding box of the scene
-  thePrsMgr->StructureManager()->Update (thePrsMgr->StructureManager()->UpdateMode());
+  thePrsMgr->StructureManager()->Update();
 }
 ~~~~~
 
@@ -1200,6 +1200,13 @@ The follow AIS_InteractiveContext methods have been changed:
   UpdateSelected, AddOrRemoveSelected, HilightSelected, UnhilightSelected, ClearSelected, ResetOriginalState,
   SubIntensityOn, SubIntensityOff, FitSelected, EraseGlobal, ClearGlobal, ClearGlobalPrs.
 
+In addition, the API for immediate viewer update has been removed from V3d_View and Graphic3d_StructureManager classes
+(enumerations *Aspect_TypeOfUpdate* and *V3d_TypeOfUpdate*):
+  V3d::SetUpdateMode(), V3d::UpdateMode(), Graphic3d_StructureManager::SetUpdateMode(), Graphic3d_StructureManager::UpdateMode().
+
+The argument theUpdateMode has been removed from methods Graphic3d_CView::Display(), ::Erase(), ::Update().
+Method Graphic3d_CView::Update() does not redraw the view and does not re-compute structures anymore.
+
 @subsection upgrade_720_Result_Of_BOP_On_Containers Result of Boolean operations on containers
 
 * The result of Boolean operations on arguments of collection types (WIRE/SHELL/COMPSOLID) is now filtered from duplicating containers.
diff --git a/dox/user_guides/visualization/visualization.md b/dox/user_guides/visualization/visualization.md
index 65835eb9f6..b9fd634f3c 100644
--- a/dox/user_guides/visualization/visualization.md
+++ b/dox/user_guides/visualization/visualization.md
@@ -1945,63 +1945,51 @@ The *V3d* package is basically a set of tools directed by  commands from the vie
 
 @subsubsection occt_visu_4_4_2 A programming example
 
-This sample TEST program for the *V3d* Package uses primary  packages *Xw* and *Graphic3d* and secondary packages *Visual3d, Aspect, Quantity,  Phigs* and *math*.  
+This sample TEST program for the *V3d* Package uses primary packages *Xw* and *Graphic3d* and secondary packages *Visual3d, Aspect, Quantity* and *math*.
 
 ~~~~~
-//Create a default display  connection
-Handle(Aspect_DisplayConnection)  aDisplayConnection = new  Aspect_DisplayConnection(); 
+// Create a default display connection
+Handle(Aspect_DisplayConnection) aDispConnection = new Aspect_DisplayConnection();
 
-//Create a Graphic Driver from  the default Aspect_DisplayConnection
-Handle(OpenGl_GraphicDriver)  GD = new OpenGl_GraphicDriver (aDisplayConnection);
+// Create a Graphic Driver from the default Aspect_DisplayConnection
+Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver (aDispConnection);
 
-//Create a Viewer to this Driver 
-Handle(V3d_Viewer)  VM = new V3d_Viewer(GD, 400.,  
-	// Space size  
-	V3d_Xpos,
-	// Default projection  
-	Quantity_NOC_DARKVIOLET, 
-	// Default  background  
-	V3d_ZBUFFER, 
-	// Type of  visualization  
-	V3d_GOURAUD, 
-	// Shading  model  
-	V3d_WAIT); 
-	// Update mode   
-// Create a structure in this  Viewer 
-Handle(Graphic3d_Structure) S =  new  Graphic3d_Structure(VM->Viewer()) ;  
+// Create a Viewer to this Driver
+Handle(V3d_Viewer) VM = new V3d_Viewer (aGraphicDriver);
+VM->SetDefaultBackgroundColor (Quantity_NOC_DARKVIOLET);
+VM->SetDefaultViewProj (V3d_Xpos);
+// Create a structure in this Viewer
+Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (VM->Viewer());
 
-// Type of structure 
-S->SetVisual (Graphic3d_TOS_SHADING);  
+// Type of structure
+aStruct->SetVisual (Graphic3d_TOS_SHADING);
 
 // Create a group of primitives  in this structure
-Handle(Graphic3d_Group) G = new Graphic3d_Group(S) ;  
+Handle(Graphic3d_Group) aPrsGroup = new Graphic3d_Group (aStruct);
 
-// Fill this group with  one polygon of size 100  
-Graphic3d_Array1OfVertex Points(0,3) ;  
-Points(0).SetCoord(-100./2.,-100./2.,-100./2.) ;  
-Points(1).SetCoord(-100./2., 100./2.,-100./2.) ;  
-Points(2).SetCoord( 100./2., 100./2.,-100./2.) ;  
-Points(3).SetCoord( 100./2.,-100./2.,-100./2.) ;  
-Normal.SetCoord(0.,0.,1.) ;  
-G->Polygon(Points,Normal) ;  
+// Fill this group with one quad of size 100
+Handle(Graphic3d_ArrayOfTriangleStrips) aTriangles = new Graphic3d_ArrayOfTriangleStrips (4);
+aTriangles->AddVertex (-100./2., -100./2., 0.0);
+aTriangles->AddVertex (-100./2.,  100./2., 0.0);
+aTriangles->AddVertex ( 100./2., -100./2., 0.0);
+aTriangles->AddVertex ( 100./2.,  100./2., 0.0);
+aPrsGroup->Polygon (aTriangles);
 
 //  Create Ambient and Infinite Lights in this Viewer
-Handle(V3d_AmbientLight) L1  = new V3d_AmbientLight  
-	(VM,Quantity_NOC_GRAY50)  ;  
-Handle(V3d_DirectionalLight)  L2 = new V3d_DirectionalLight  
-	(VM,V3d_XnegYnegZneg,Quantity_NOC_WHITE)  ;  
+Handle(V3d_AmbientLight) aLight1 = new V3d_AmbientLight (VM, Quantity_NOC_GRAY50);
+Handle(V3d_DirectionalLight) aLight2 = new V3d_DirectionalLight (VM, V3d_XnegYnegZneg, Quantity_NOC_WHITE);
 
 // Create a 3D quality  Window with the same DisplayConnection
-Handle(Xw_Window) W =  new Xw_Window(aDisplayConnection,"Test  V3d",0.5,0.5,0.5,0.5) ;  
+Handle(Xw_Window) aWindow = new Xw_Window (aDispConnection, "Test V3d", 0.5, 0.5, 0.5, 0.5);
 
-// Map this Window to  this screen
-W->Map() ;  
+// Map this Window to this screen
+aWindow->Map();
 
 // Create a Perspective  View in this Viewer
-Handle(V3d_View) aView = new V3d_View(VM);
+Handle(V3d_View) aView = new V3d_View (VM);
 aView->Camera()->SetProjectionType (Graphic3d_Camera::Projection_Perspective);
 // Associate this View with the Window
-aView ->SetWindow(W);
+aView ->SetWindow (aWindow);
 // Display ALL structures in this View
 VM->Viewer()->Display();
 // Finally update the Visualization in this View
diff --git a/src/Aspect/Aspect_TypeOfUpdate.hxx b/src/Aspect/Aspect_TypeOfUpdate.hxx
deleted file mode 100644
index 69fa6a5a40..0000000000
--- a/src/Aspect/Aspect_TypeOfUpdate.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
-// Created by: NW,JPB,CAL
-// Copyright (c) 1991-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _Aspect_TypeOfUpdate_HeaderFile
-#define _Aspect_TypeOfUpdate_HeaderFile
-
-//! Definition of screen refresh mode
-//!
-//! TOU_ASAP    as soon as possible
-//! TOU_WAIT    on demand (Update)
-enum Aspect_TypeOfUpdate
-{
-Aspect_TOU_ASAP,
-Aspect_TOU_WAIT
-};
-
-#endif // _Aspect_TypeOfUpdate_HeaderFile
diff --git a/src/Aspect/FILES b/src/Aspect/FILES
index 7cc4364a75..64a8a080c1 100755
--- a/src/Aspect/FILES
+++ b/src/Aspect/FILES
@@ -53,7 +53,6 @@ Aspect_TypeOfPrimitive.hxx
 Aspect_TypeOfResize.hxx
 Aspect_TypeOfStyleText.hxx
 Aspect_TypeOfTriedronPosition.hxx
-Aspect_TypeOfUpdate.hxx
 Aspect_Units.hxx
 Aspect_WidthOfLine.hxx
 Aspect_Window.cxx
diff --git a/src/Graphic3d/Graphic3d_CView.cxx b/src/Graphic3d/Graphic3d_CView.cxx
index 16411af29a..bb63a602b5 100644
--- a/src/Graphic3d/Graphic3d_CView.cxx
+++ b/src/Graphic3d/Graphic3d_CView.cxx
@@ -86,12 +86,12 @@ void Graphic3d_CView::Activate()
       if (anAnswer == Graphic3d_TOA_YES
        || anAnswer == Graphic3d_TOA_COMPUTE)
       {
-        Display (aStruct, Aspect_TOU_WAIT);
+        Display (aStruct);
       }
     }
   }
 
-  Update (myStructureManager->UpdateMode());
+  Update();
 }
 
 // =======================================================================
@@ -122,11 +122,11 @@ void Graphic3d_CView::Deactivate()
       if (anAnswer == Graphic3d_TOA_YES
        || anAnswer == Graphic3d_TOA_COMPUTE)
       {
-        Erase (aStruct, Aspect_TOU_WAIT);
+        Erase (aStruct);
       }
     }
 
-    Update (myStructureManager->UpdateMode());
+    Update();
     myIsActive = Standard_False;
   }
 }
@@ -146,7 +146,7 @@ void Graphic3d_CView::Remove()
 
   for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (aDisplayedStructs); aStructIter.More(); aStructIter.Next())
   {
-    Erase (aStructIter.Value(), Aspect_TOU_WAIT);
+    Erase (aStructIter.Value());
   }
 
   myStructsToCompute.Clear();
@@ -212,7 +212,7 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
       eraseStructure   (aStruct->CStructure());
       displayStructure (myStructsComputed.Value (anIndex)->CStructure(), aStruct->DisplayPriority());
 
-      Display (aStruct, Aspect_TOU_WAIT);
+      Display (aStruct);
       if (aStruct->IsHighlighted())
       {
         const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.Value (anIndex);
@@ -262,7 +262,7 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
       displayStructure (aCompStruct->CStructure(), aStruct->DisplayPriority());
     }
   }
-  Update (myStructureManager->UpdateMode());
+  Update();
 }
 
 // =======================================================================
@@ -347,16 +347,9 @@ void Graphic3d_CView::ReCompute (const Handle(Graphic3d_Structure)& theStruct)
 // function : Update
 // purpose  :
 // =======================================================================
-void Graphic3d_CView::Update (const Aspect_TypeOfUpdate theUpdateMode,
-                              const Graphic3d_ZLayerId  theLayerId)
+void Graphic3d_CView::Update (const Graphic3d_ZLayerId theLayerId)
 {
   InvalidateZLayerBoundingBox (theLayerId);
-
-  if (theUpdateMode == Aspect_TOU_ASAP)
-  {
-    Compute();
-    Redraw();
-  }
 }
 
 // =======================================================================
@@ -589,10 +582,9 @@ Graphic3d_TypeOfAnswer Graphic3d_CView::acceptDisplay (const Graphic3d_TypeOfStr
 void Graphic3d_CView::Compute()
 {
   // force HLRValidation to False on all structures calculated in the view
-  const Standard_Integer aNbCompStructs = myStructsComputed.Length();
-  for (Standard_Integer aStructIter = 1; aStructIter <= aNbCompStructs; ++aStructIter)
+  for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructsComputed); aStructIter.More(); aStructIter.Next())
   {
-    myStructsComputed.Value (aStructIter)->SetHLRValidation (Standard_False);
+    aStructIter.Value()->SetHLRValidation (Standard_False);
   }
 
   if (!ComputedMode())
@@ -615,7 +607,7 @@ void Graphic3d_CView::Compute()
 
   for (NCollection_Sequence<Handle(Graphic3d_Structure)>::Iterator aStructIter (aStructsSeq); aStructIter.More(); aStructIter.Next())
   {
-    Display (aStructIter.ChangeValue(), Aspect_TOU_WAIT);
+    Display (aStructIter.ChangeValue());
   }
 }
 
@@ -676,16 +668,6 @@ void Graphic3d_CView::Disconnect (const Handle(Graphic3d_Structure)& theMother,
 // purpose  :
 // =======================================================================
 void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
-{
-  Display (theStructure, myStructureManager->UpdateMode());
-}
-
-// =======================================================================
-// function : Display
-// purpose  :
-// =======================================================================
-void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
-                               const Aspect_TypeOfUpdate theUpdateMode)
 {
   if (!IsActive())
   {
@@ -725,7 +707,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
 
     theStructure->CalculateBoundBox();
     displayStructure (theStructure->CStructure(), theStructure->DisplayPriority());
-    Update (theUpdateMode, theStructure->GetZLayer());
+    Update (theStructure->GetZLayer());
     return;
   }
   else if (anAnswer != Graphic3d_TOA_COMPUTE)
@@ -746,7 +728,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
       }
 
       displayStructure (anOldStruct->CStructure(), theStructure->DisplayPriority());
-      Update (theUpdateMode, anOldStruct->GetZLayer());
+      Update (anOldStruct->GetZLayer());
       return;
     }
     else
@@ -769,7 +751,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
         const Handle(Graphic3d_Structure)& aNewStruct = myStructsComputed.Value (aNewIndex);
         myStructsComputed.SetValue (anIndex, aNewStruct);
         displayStructure (aNewStruct->CStructure(), theStructure->DisplayPriority());
-        Update (theUpdateMode, aNewStruct->GetZLayer());
+        Update (aNewStruct->GetZLayer());
         return;
       }
       else
@@ -849,7 +831,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
   myStructsDisplayed.Add (theStructure);
   displayStructure (aStruct->CStructure(), theStructure->DisplayPriority());
 
-  Update (theUpdateMode, aStruct->GetZLayer());
+  Update (aStruct->GetZLayer());
 }
 
 // =======================================================================
@@ -857,16 +839,6 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
 // purpose  :
 // =======================================================================
 void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure)
-{
-  Erase (theStructure, myStructureManager->UpdateMode());
-}
-
-// =======================================================================
-// function : Erase
-// purpose  :
-// =======================================================================
-void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure,
-                             const Aspect_TypeOfUpdate theUpdateMode)
 {
   if (!IsDisplayed (theStructure))
   {
@@ -893,7 +865,7 @@ void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure,
     }
   }
   myStructsDisplayed.Remove (theStructure);
-  Update (theUpdateMode, theStructure->GetZLayer());
+  Update (theStructure->GetZLayer());
 }
 
 // =======================================================================
diff --git a/src/Graphic3d/Graphic3d_CView.hxx b/src/Graphic3d/Graphic3d_CView.hxx
index df29884297..a375607d06 100644
--- a/src/Graphic3d/Graphic3d_CView.hxx
+++ b/src/Graphic3d/Graphic3d_CView.hxx
@@ -16,7 +16,6 @@
 
 #include <Aspect_Handle.hxx>
 #include <Aspect_RenderingContext.hxx>
-#include <Aspect_TypeOfUpdate.hxx>
 #include <Aspect_Window.hxx>
 #include <Graphic3d_BufferType.hxx>
 #include <Graphic3d_Camera.hxx>
@@ -106,10 +105,11 @@ public:
   //! Computes the new presentation of the structure  displayed in this view with the type Graphic3d_TOS_COMPUTED.
   Standard_EXPORT void ReCompute (const Handle(Graphic3d_Structure)& theStructure);
 
-  //! Updates screen in function of modifications of the structures
-  //! and invalidates bounding box of specified ZLayerId.
-  Standard_EXPORT void Update (const Aspect_TypeOfUpdate theUpdateMode,
-                               const Graphic3d_ZLayerId  theLayerId = Graphic3d_ZLayerId_UNKNOWN);
+  //! Invalidates bounding box of specified ZLayerId.
+  Standard_EXPORT void Update (const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN);
+
+  //! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED.
+  Standard_EXPORT void Compute();
 
   //! Returns Standard_True if one of the structures displayed in the view contains Polygons, Triangles or Quadrangles.
   Standard_EXPORT Standard_Boolean ContainsFacet() const;
@@ -158,9 +158,6 @@ private:
   //! Is it possible to display the structure in the view?
   Standard_EXPORT Graphic3d_TypeOfAnswer acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const;
 
-  //! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED.
-  Standard_EXPORT void Compute();
-
   //! Clears the structure in this view.
   Standard_EXPORT void Clear (const Handle(Graphic3d_Structure)& theStructure, const Standard_Boolean theWithDestruction);
 
@@ -175,17 +172,9 @@ private:
   //! Displays the structure in the view.
   Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure);
 
-  //! Display the structure in the view.
-  Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure,
-                                const Aspect_TypeOfUpdate theUpdateMode);
-
   //! Erases the structure from the view.
   Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& theStructure);
 
-  //! Erases the structure from the view.
-  Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& theStructure,
-                              const Aspect_TypeOfUpdate theUpdateMode);
-
   //! Highlights the structure in the view.
   Standard_EXPORT void Highlight (const Handle(Graphic3d_Structure)& theStructure);
 
diff --git a/src/Graphic3d/Graphic3d_Group.cxx b/src/Graphic3d/Graphic3d_Group.cxx
index 0eedb2df1a..46b2c98883 100644
--- a/src/Graphic3d/Graphic3d_Group.cxx
+++ b/src/Graphic3d/Graphic3d_Group.cxx
@@ -208,7 +208,7 @@ void Graphic3d_Group::Update() const
     return;
   }
 
-  myStructure->StructureManager()->Update (myStructure->StructureManager()->UpdateMode());
+  myStructure->StructureManager()->Update();
 }
 
 // =======================================================================
diff --git a/src/Graphic3d/Graphic3d_Structure.cxx b/src/Graphic3d/Graphic3d_Structure.cxx
index 35ef3e7a50..4a0cbe558d 100644
--- a/src/Graphic3d/Graphic3d_Structure.cxx
+++ b/src/Graphic3d/Graphic3d_Structure.cxx
@@ -619,24 +619,10 @@ void Graphic3d_Structure::SetVisual (const Graphic3d_TypeOfStructure theVisual)
   }
   else
   {
-    Aspect_TypeOfUpdate anUpdateMode  = myStructureManager->UpdateMode();
-    if (anUpdateMode == Aspect_TOU_WAIT)
-    {
-      Erase();
-      myVisual = theVisual;
-      SetComputeVisual (theVisual);
-      Display();
-    }
-    else {
-      // To avoid calling method : Update ()
-      // Not useful and can be costly.
-      myStructureManager->SetUpdateMode (Aspect_TOU_WAIT);
-      Erase();
-      myVisual = theVisual;
-      SetComputeVisual (theVisual);
-      myStructureManager->SetUpdateMode (anUpdateMode);
-      Display();
-    }
+    Erase();
+    myVisual = theVisual;
+    SetComputeVisual (theVisual);
+    Display();
   }
 }
 
@@ -1254,8 +1240,7 @@ void Graphic3d_Structure::Update (const bool theUpdateLayer) const
     return;
   }
 
-  myStructureManager->Update (myStructureManager->UpdateMode(),
-                              theUpdateLayer ? myCStructure->ZLayer() : Graphic3d_ZLayerId_UNKNOWN);
+  myStructureManager->Update (theUpdateLayer ? myCStructure->ZLayer() : Graphic3d_ZLayerId_UNKNOWN);
 }
 
 //=============================================================================
diff --git a/src/Graphic3d/Graphic3d_StructureManager.cxx b/src/Graphic3d/Graphic3d_StructureManager.cxx
index 1da498fc14..5d2673a059 100644
--- a/src/Graphic3d/Graphic3d_StructureManager.cxx
+++ b/src/Graphic3d/Graphic3d_StructureManager.cxx
@@ -30,7 +30,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_StructureManager,MMgt_TShared)
 // ========================================================================
 Graphic3d_StructureManager::Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver)
 : myViewGenId (0, 31),
-  myUpdateMode (Aspect_TOU_WAIT),
   myGraphicDriver (theDriver)
 {
   //
@@ -51,12 +50,11 @@ Graphic3d_StructureManager::~Graphic3d_StructureManager()
 // function : Update
 // purpose  :
 // ========================================================================
-void Graphic3d_StructureManager::Update (const Aspect_TypeOfUpdate theMode,
-                                         const Graphic3d_ZLayerId  theLayerId) const
+void Graphic3d_StructureManager::Update (const Graphic3d_ZLayerId theLayerId) const
 {
   for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
   {
-    aViewIt.Value()->Update (theMode, theLayerId);
+    aViewIt.Value()->Update (theLayerId);
   }
 }
 
diff --git a/src/Graphic3d/Graphic3d_StructureManager.hxx b/src/Graphic3d/Graphic3d_StructureManager.hxx
index 4157f21418..0fc09435d9 100644
--- a/src/Graphic3d/Graphic3d_StructureManager.hxx
+++ b/src/Graphic3d/Graphic3d_StructureManager.hxx
@@ -19,7 +19,6 @@
 
 #include <Aspect_GenId.hxx>
 #include <Aspect_TypeOfHighlightMethod.hxx>
-#include <Aspect_TypeOfUpdate.hxx>
 #include <Graphic3d_CView.hxx>
 #include <Graphic3d_MapOfObject.hxx>
 #include <Graphic3d_MapOfStructure.hxx>
@@ -66,31 +65,8 @@ public:
   //! Deletes the manager <me>.
   Standard_EXPORT ~Graphic3d_StructureManager();
 
-  //! Modifies the screen update mode.
-  //!
-  //! TOU_ASAP - as soon as possible
-  //! TOU_WAIT - on demand (with the Update function)
-  //! Note : Dynamic Operations and Update Mode
-  //! Use SetUpdateMode to control when changes to
-  //! the display are made.   Use one of the   following
-  //! functions to update one or more views:
-  //! - Update all views of the viewer: Graphic3d_StructureManager::Update()
-  //! - Update one view of the viewer:  Graphic3d_View::Update()
-  //! Use one of the following functions to update the entire display:
-  //! - Redraw all structures in all views: Graphic3d_StructureManager::Redraw()
-  //! - Redraw all structures in one view:  Graphic3d_View::Redraw()
-  void SetUpdateMode (const Aspect_TypeOfUpdate theType) { myUpdateMode = theType; }
-
-  //! Returns the screen update mode.
-  //!
-  //! TOU_ASAP	as soon as possible
-  //! TOU_WAIT	on demand (Update)
-  Aspect_TypeOfUpdate UpdateMode() const { return myUpdateMode; }
-
-  //! Updates screen in function of modifications of the structures
-  //! and invalidates bounding box of specified ZLayerId.
-  Standard_EXPORT virtual void Update (const Aspect_TypeOfUpdate theMode = Aspect_TOU_ASAP,
-                                       const Graphic3d_ZLayerId  theLayerId = Graphic3d_ZLayerId_UNKNOWN) const;
+  //! Invalidates bounding box of specified ZLayerId.
+  Standard_EXPORT virtual void Update (const Graphic3d_ZLayerId  theLayerId = Graphic3d_ZLayerId_UNKNOWN) const;
 
   //! Deletes and erases the 3D structure manager.
   Standard_EXPORT virtual void Remove();
@@ -193,7 +169,6 @@ protected:
 protected:
 
   Aspect_GenId myViewGenId;
-  Aspect_TypeOfUpdate myUpdateMode;
   Graphic3d_MapOfStructure myDisplayedStructure;
   Graphic3d_MapOfStructure myHighlightedStructure;
   Graphic3d_MapOfObject myRegisteredObjects;
diff --git a/src/OpenGl/OpenGl_View.cxx b/src/OpenGl/OpenGl_View.cxx
index c60c68452c..0dc123bda7 100644
--- a/src/OpenGl/OpenGl_View.cxx
+++ b/src/OpenGl/OpenGl_View.cxx
@@ -799,8 +799,8 @@ void OpenGl_View::changeZLayer (const Handle(Graphic3d_CStructure)& theStructure
   const Graphic3d_ZLayerId anOldLayer = theStructure->ZLayer();
   const OpenGl_Structure* aStruct = reinterpret_cast<const OpenGl_Structure*> (theStructure.operator->());
   myZLayers.ChangeLayer (aStruct, anOldLayer, theNewLayerId);
-  Update (Aspect_TOU_WAIT, anOldLayer);
-  Update (Aspect_TOU_WAIT, theNewLayerId);
+  Update (anOldLayer);
+  Update (theNewLayerId);
 }
 
 //=======================================================================
diff --git a/src/V3d/FILES b/src/V3d/FILES
index 335e70ad34..13db126437 100755
--- a/src/V3d/FILES
+++ b/src/V3d/FILES
@@ -35,7 +35,6 @@ V3d_TypeOfPickCamera.hxx
 V3d_TypeOfPickLight.hxx
 V3d_TypeOfRepresentation.hxx
 V3d_TypeOfShadingModel.hxx
-V3d_TypeOfUpdate.hxx
 V3d_TypeOfView.hxx
 V3d_TypeOfVisualization.hxx
 V3d_UnMapped.hxx
diff --git a/src/V3d/V3d_DirectionalLight.cxx b/src/V3d/V3d_DirectionalLight.cxx
index dc310e64ec..335a42da40 100644
--- a/src/V3d/V3d_DirectionalLight.cxx
+++ b/src/V3d/V3d_DirectionalLight.cxx
@@ -274,7 +274,6 @@ void V3d_DirectionalLight::Display (const Handle(V3d_View)& theView,
   Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
   Standard_Real R1,G1,B1;
   V3d_TypeOfRepresentation Pres;
-  V3d_TypeOfUpdate UpdSov;
 
 //  Creation of a structure of markable elements (position of the
 //  light, and the domain of lighting represented by a circle)
@@ -283,8 +282,6 @@ void V3d_DirectionalLight::Display (const Handle(V3d_View)& theView,
 
     Pres = theTPres;
     Handle(V3d_Viewer) TheViewer = theView->Viewer();
-    UpdSov = TheViewer->UpdateMode();
-    TheViewer->SetUpdateMode(V3d_WAIT);
     if (!myGraphicStructure.IsNull()) {
        myGraphicStructure->Disconnect(myGraphicStructure1);
        myGraphicStructure->Clear();
@@ -369,7 +366,6 @@ void V3d_DirectionalLight::Display (const Handle(V3d_View)& theView,
 //    cout << "MyGraphicStructure exploration \n" << flush; MyGraphicStructure->Exploration();
   myTypeOfRepresentation = Pres;
   myGraphicStructure->Display();
-  TheViewer->SetUpdateMode(UpdSov);
 }
 
 // =======================================================================
diff --git a/src/V3d/V3d_PositionLight.cxx b/src/V3d/V3d_PositionLight.cxx
index 57702c41a6..4a5a6e43d0 100644
--- a/src/V3d/V3d_PositionLight.cxx
+++ b/src/V3d/V3d_PositionLight.cxx
@@ -171,7 +171,6 @@ void V3d_PositionLight::Display (const Handle(V3d_View)& theView, const V3d_Type
   Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
   Standard_Real R1,G1,B1;
   V3d_TypeOfRepresentation Pres;
-  V3d_TypeOfUpdate UpdSov;
 
 //  Creation of a structure of markable elements (position of the
 //  light, and the domain of lighting represented by a circle)
@@ -180,8 +179,6 @@ void V3d_PositionLight::Display (const Handle(V3d_View)& theView, const V3d_Type
 
   Pres = theTPres;
   Handle(V3d_Viewer) TheViewer = theView->Viewer();
-  UpdSov = TheViewer->UpdateMode();
-  TheViewer->SetUpdateMode(V3d_WAIT);
   if (!myGraphicStructure.IsNull()) {
     myGraphicStructure->Disconnect(myGraphicStructure1);
     myGraphicStructure->Clear();
@@ -289,7 +286,6 @@ void V3d_PositionLight::Display (const Handle(V3d_View)& theView, const V3d_Type
   myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
   myTypeOfRepresentation = Pres;
   myGraphicStructure->Display();
-  TheViewer->SetUpdateMode(UpdSov);
 }
 
 // =======================================================================
diff --git a/src/V3d/V3d_PositionalLight.cxx b/src/V3d/V3d_PositionalLight.cxx
index 5c198c99e3..f6cfc5ea9d 100644
--- a/src/V3d/V3d_PositionalLight.cxx
+++ b/src/V3d/V3d_PositionalLight.cxx
@@ -233,7 +233,6 @@ void V3d_PositionalLight::Display (const Handle(V3d_View)& theView,
   Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
   Standard_Real R1,G1,B1;
   V3d_TypeOfRepresentation Pres;
-  V3d_TypeOfUpdate UpdSov;
 
 //  Creation of a structure slight of markable elements (position of the
 //  light, and the domain of lighting represented by a circle)
@@ -242,8 +241,6 @@ void V3d_PositionalLight::Display (const Handle(V3d_View)& theView,
 
   Pres = theRepresentation;
   Handle(V3d_Viewer) TheViewer = theView->Viewer();
-  UpdSov = TheViewer->UpdateMode();
-  TheViewer->SetUpdateMode(V3d_WAIT);
   if (!myGraphicStructure.IsNull()) {
     myGraphicStructure->Disconnect(myGraphicStructure1);
     myGraphicStructure->Clear();
@@ -347,5 +344,4 @@ void V3d_PositionalLight::Display (const Handle(V3d_View)& theView,
   myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
   myTypeOfRepresentation = Pres;
   myGraphicStructure->Display();
-  TheViewer->SetUpdateMode(UpdSov);
 }
diff --git a/src/V3d/V3d_SpotLight.cxx b/src/V3d/V3d_SpotLight.cxx
index aaeff1cb17..0fa5b8ff6a 100644
--- a/src/V3d/V3d_SpotLight.cxx
+++ b/src/V3d/V3d_SpotLight.cxx
@@ -271,7 +271,6 @@ void V3d_SpotLight::Display (const Handle(V3d_View)& theView,
   Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
   Standard_Real R1,G1,B1;
   V3d_TypeOfRepresentation Pres;
-  V3d_TypeOfUpdate UpdSov;
 
 //  Creation of a structure slight of markable elements (position of the
 //  light, and the domain of lighting represented by a circle)
@@ -280,8 +279,6 @@ void V3d_SpotLight::Display (const Handle(V3d_View)& theView,
 
   Pres = theTPres;
   Handle(V3d_Viewer) TheViewer = theView->Viewer();
-  UpdSov = TheViewer->UpdateMode();
-  TheViewer->SetUpdateMode(V3d_WAIT);
   if (!myGraphicStructure.IsNull()) {
     myGraphicStructure->Disconnect(myGraphicStructure1);
     myGraphicStructure->Clear();
@@ -385,5 +382,4 @@ void V3d_SpotLight::Display (const Handle(V3d_View)& theView,
   myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
   myTypeOfRepresentation = Pres;
   myGraphicStructure->Display();
-  TheViewer->SetUpdateMode(UpdSov);
 }
diff --git a/src/V3d/V3d_TypeOfUpdate.hxx b/src/V3d/V3d_TypeOfUpdate.hxx
deleted file mode 100644
index 0ff5cb8003..0000000000
--- a/src/V3d/V3d_TypeOfUpdate.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
-// Created on: 1992-11-13
-// Created by: GG
-// Copyright (c) 1992-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _V3d_TypeOfUpdate_HeaderFile
-#define _V3d_TypeOfUpdate_HeaderFile
-
-//! Determines the type of update of the view
-//! -   V3d_ASAP: as soon as possible. The view is updated immediately after a modification.
-//! -   V3d_WAIT: deferred. The view is updated when the Update function is called.
-enum V3d_TypeOfUpdate
-{
-V3d_ASAP,
-V3d_WAIT
-};
-
-#endif // _V3d_TypeOfUpdate_HeaderFile
diff --git a/src/V3d/V3d_View.cxx b/src/V3d/V3d_View.cxx
index ed2f10cc23..676276ed40 100644
--- a/src/V3d/V3d_View.cxx
+++ b/src/V3d/V3d_View.cxx
@@ -218,7 +218,9 @@ void V3d_View::Update() const
     return;
   }
 
-  myView->Update (Aspect_TOU_ASAP);
+  myView->Update();
+  myView->Compute();
+  myView->Redraw();
 }
 
 //=============================================================================
diff --git a/src/V3d/V3d_Viewer.cxx b/src/V3d/V3d_Viewer.cxx
index 46bc8c34f2..1af781ffac 100644
--- a/src/V3d/V3d_Viewer.cxx
+++ b/src/V3d/V3d_Viewer.cxx
@@ -70,7 +70,6 @@ V3d_Viewer::V3d_Viewer (const Handle(Graphic3d_GraphicDriver)& theDriver,
                         const Quantity_NameOfColor    theViewBackground,
                         const V3d_TypeOfVisualization theVisualization,
                         const V3d_TypeOfShadingModel  theShadingModel,
-                        const V3d_TypeOfUpdate        theUpdateMode,
                         const Standard_Boolean        theComputedMode,
                         const Standard_Boolean        theDefaultComputedMode)
 : myDriver (theDriver),
@@ -94,7 +93,6 @@ V3d_Viewer::V3d_Viewer (const Handle(Graphic3d_GraphicDriver)& theDriver,
   myRGrid = new V3d_RectangularGrid (this, Quantity_Color (Quantity_NOC_GRAY50), Quantity_Color (Quantity_NOC_GRAY70));
   myCGrid = new V3d_CircularGrid    (this, Quantity_Color (Quantity_NOC_GRAY50), Quantity_Color (Quantity_NOC_GRAY70));
   SetDefaultViewSize (theViewSize);
-  SetUpdateMode (theUpdateMode);
 }
 
 // ========================================================================
@@ -237,24 +235,6 @@ void V3d_Viewer::SetDefaultViewSize (const Standard_Real theSize)
   myViewSize = theSize;
 }
 
-// ========================================================================
-// function : SetUpdateMode
-// purpose  :
-// ========================================================================
-void V3d_Viewer::SetUpdateMode (const V3d_TypeOfUpdate theMode)
-{
-  myStructureManager->SetUpdateMode (static_cast<Aspect_TypeOfUpdate> (theMode));
-}
-
-// ========================================================================
-// function : UpdateMode
-// purpose  :
-// ========================================================================
-V3d_TypeOfUpdate V3d_Viewer::UpdateMode() const
-{
-  return static_cast<V3d_TypeOfUpdate> (myStructureManager->UpdateMode());
-}
-
 // ========================================================================
 // function : IfMoreViews
 // purpose  :
diff --git a/src/V3d/V3d_Viewer.hxx b/src/V3d/V3d_Viewer.hxx
index 0452b0fb37..148c340743 100644
--- a/src/V3d/V3d_Viewer.hxx
+++ b/src/V3d/V3d_Viewer.hxx
@@ -47,7 +47,6 @@
 #include <V3d_ListOfView.hxx>
 #include <V3d_TypeOfOrientation.hxx>
 #include <V3d_TypeOfShadingModel.hxx>
-#include <V3d_TypeOfUpdate.hxx>
 #include <V3d_TypeOfView.hxx>
 #include <V3d_TypeOfVisualization.hxx>
 
@@ -194,15 +193,6 @@ public:
   //! Gives the default type of SHADING.
   void SetDefaultShadingModel (const V3d_TypeOfShadingModel theType) { myShadingModel = theType; }
 
-  //! Returns the regeneration mode of views in the viewer.
-  Standard_EXPORT V3d_TypeOfUpdate UpdateMode() const;
-
-  //! Defines the mode of regenerating the views making
-  //! up the viewer. This can be immediate <ASAP> or
-  //! deferred <WAIT>. In this latter case, the views are
-  //! updated when the method Update(me) is called.
-  Standard_EXPORT void SetUpdateMode (const V3d_TypeOfUpdate theMode);
-  
   void SetDefaultTypeOfView (const V3d_TypeOfView theType) { myDefaultTypeOfView = theType; }
 
   //! Returns the default background colour object.
@@ -447,7 +437,6 @@ public: //! @name deprecated methods
                               const Quantity_NameOfColor theViewBackground = Quantity_NOC_GRAY30,
                               const V3d_TypeOfVisualization theVisualization = V3d_ZBUFFER,
                               const V3d_TypeOfShadingModel theShadingModel = V3d_GOURAUD,
-                              const V3d_TypeOfUpdate theUpdateMode = V3d_WAIT,
                               const Standard_Boolean theComputedMode = Standard_True,
                               const Standard_Boolean theDefaultComputedMode = Standard_True);
 
diff --git a/src/ViewerTest/ViewerTest_OpenGlCommands.cxx b/src/ViewerTest/ViewerTest_OpenGlCommands.cxx
index 20fa75454b..e7e63f15cc 100644
--- a/src/ViewerTest/ViewerTest_OpenGlCommands.cxx
+++ b/src/ViewerTest/ViewerTest_OpenGlCommands.cxx
@@ -136,7 +136,7 @@ void VUserDrawObj::Compute(const Handle(PrsMgr_PresentationManager3d)& thePrsMgr
   aGroup->AddElement(anElem);
 
   // invalidate bounding box of the scene
-  thePrsMgr->StructureManager()->Update (thePrsMgr->StructureManager()->UpdateMode());
+  thePrsMgr->StructureManager()->Update();
 }
 
 void VUserDrawObj::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,