0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / src / QABugs / QABugs_19.cxx
index efe20de..18c9387 100644 (file)
@@ -16,8 +16,7 @@
 #include <QABugs.hxx>
 
 #include <AIS_InteractiveContext.hxx>
-#include <AIS_LocalContext.hxx>
-#include <AIS_TexturedShape.hxx>
+#include <AIS_Shape.hxx>
 #include <BRepAlgoAPI_Cut.hxx>
 #include <BRepOffsetAPI_MakePipe.hxx>
 #include <BRepPrimAPI_MakeBox.hxx>
@@ -53,6 +52,8 @@
 #include <ViewerTest.hxx>
 #include <XmlDrivers_DocumentRetrievalDriver.hxx>
 #include <XmlDrivers_DocumentStorageDriver.hxx>
+#include <TDataStd_Real.hxx>
+#include <Standard_Atomic.hxx>
 
 #include <cstdio>
 #include <cmath>
@@ -1532,25 +1533,6 @@ static Standard_Integer OCC24271 (Draw_Interpretor& di,
 #include <GeomInt_IntSS.hxx>
 #include <Geom_ConicalSurface.hxx>
 #include <Standard_ErrorHandler.hxx>
-//=======================================================================
-//function : OCC23972
-//purpose  : 
-//=======================================================================
-static void DoGeomIntSSTest (const Handle(Geom_Surface)& theSurf1,
-                            const Handle(Geom_Surface)& theSurf2,
-                            const Standard_Integer theNbSol,
-                            Draw_Interpretor& di)
-{
-  try {
-    OCC_CATCH_SIGNALS
-        GeomInt_IntSS anInter;
-        anInter.Perform (theSurf1, theSurf2, Precision::Confusion(), Standard_True);
-        QVERIFY (anInter.IsDone());
-        QCOMPARE (anInter.NbLines(), theNbSol);
-  } catch (...) {
-    QVERIFY (Standard_False);
-  }
-}
 
 namespace {
   static Handle(Geom_ConicalSurface) CreateCone (const gp_Pnt& theLoc,
@@ -1567,28 +1549,30 @@ namespace {
   }
 }
 
-static Standard_Integer OCC23972 (Draw_Interpretor& di,Standard_Integer n, const char**)
+static Standard_Integer OCC23972(Draw_Interpretor& /*theDI*/,
+                                 Standard_Integer theNArg, const char** theArgs)
 {
-  if (n != 1) return 1;
-
-  //process specific cones, cannot read them from files because due to rounding the original error
-  //in math_FunctionRoots gets hidden
-  Handle(Geom_Surface) aS1 = CreateCone (
-                                        gp_Pnt (123.694345356663, 789.9, 68.15),
-                                        gp_Dir (-1, 3.48029791472957e-016, -8.41302743359754e-017),
-                                        gp_Dir (-3.48029791472957e-016, -1, -3.17572289932207e-016),
-                                        3.28206830417112,
-                                        0.780868809443031,
-                                        0.624695047554424);
-  Handle(Geom_Surface) aS2 = CreateCone (
-                                        gp_Pnt (123.694345356663, 784.9, 68.15),
-                                        gp_Dir (-1, -2.5209507537117e-016, -1.49772808948866e-016),
-                                        gp_Dir (1.49772808948866e-016, 3.17572289932207e-016, -1),
-                                        3.28206830417112,
-                                        0.780868809443031,
-                                        0.624695047554424);
+  if (theNArg != 3) return 1;
+
+  //process specific cones, cannot read them from files because 
+  //due to rounding the original error in math_FunctionRoots gets hidden
+  const Handle(Geom_Surface) aS1 = CreateCone(
+                              gp_Pnt(123.694345356663, 789.9, 68.15),
+                              gp_Dir(-1, 3.48029791472957e-016, -8.41302743359754e-017),
+                              gp_Dir(-3.48029791472957e-016, -1, -3.17572289932207e-016),
+                              3.28206830417112,
+                              0.780868809443031,
+                              0.624695047554424);
+  const Handle(Geom_Surface) aS2 = CreateCone(
+                              gp_Pnt(123.694345356663, 784.9, 68.15),
+                              gp_Dir(-1, -2.5209507537117e-016, -1.49772808948866e-016),
+                              gp_Dir(1.49772808948866e-016, 3.17572289932207e-016, -1),
+                              3.28206830417112,
+                              0.780868809443031,
+                              0.624695047554424);
   
-  DoGeomIntSSTest (aS1, aS2, 2, di);
+  DrawTrSurf::Set(theArgs[1], aS1);
+  DrawTrSurf::Set(theArgs[2], aS2);
 
   return 0;
 }
@@ -1792,65 +1776,6 @@ static Standard_Integer OCC23950 (Draw_Interpretor& di, Standard_Integer argc, c
   return 0;
 }
 
-//=======================================================================
-//function : OCC24622
-//purpose  : The command tests sourcing Image_PixMap to AIS_TexturedShape
-//=======================================================================
-static Standard_Integer OCC24622 (Draw_Interpretor& /*theDi*/, Standard_Integer theArgNb, const char** theArgVec)
-{
-  if (theArgNb != 2)
-  {
-    std::cout << "Usage : " << theArgVec[0] << " texture={1D|2D}";
-    return 1;
-  }
-
-  const Handle(AIS_InteractiveContext)& anAISContext = ViewerTest::GetAISContext();
-  if (anAISContext.IsNull())
-  {
-    std::cout << "Please initialize view with \"vinit\".\n";
-    return 1;
-  }
-
-  Handle(Image_PixMap) anImage = new Image_PixMap();
-
-  static const Image_ColorRGB aBitmap[8] =
-  {
-    {{255,   0, 0}}, {{0,  148, 255}}, {{ 0, 148, 255}}, {{255,  94, 0}},
-    {{255, 121, 0}}, {{76, 255,   0}}, {{76, 255,   0}}, {{255, 202, 0}}
-  };
-
-  TCollection_AsciiString aTextureTypeArg (theArgVec[1]);
-  aTextureTypeArg.UpperCase();
-  if (aTextureTypeArg == "1D")
-  {
-    anImage->InitWrapper (Image_Format_RGB, (Standard_Byte*)aBitmap, 8, 1);
-  }
-  else if (aTextureTypeArg == "2D")
-  {
-    anImage->InitTrash (Image_Format_RGB, 8, 8);
-    for (Standard_Integer aRow = 0; aRow < 8; ++aRow)
-    {
-      for (Standard_Integer aCol = 0; aCol < 8; ++aCol)
-      {
-        anImage->ChangeValue<Image_ColorRGB> (aRow, aCol) = aBitmap[aRow];
-      }
-    }
-  }
-  else
-  {
-    std::cout << "Please specify type of texture to test {1D|2D}.\n";
-    return 1;
-  }
-
-  TopoDS_Shape aBlankShape = BRepPrimAPI_MakeBox (10.0, 10.0, 10.0).Shape();
-
-  Handle(AIS_TexturedShape) aTexturedShape = new AIS_TexturedShape (aBlankShape);
-  aTexturedShape->SetTexturePixMap (anImage);
-  anAISContext->Display (aTexturedShape, 3, 0, Standard_True);
-
-  return 0;
-}
-
 //=======================================================================
 //function : OCC24667
 //purpose  : 
@@ -1983,8 +1908,12 @@ static Standard_Integer OCC24755 (Draw_Interpretor& di, Standard_Integer n, cons
   Handle(TDocStd_Document) aDoc;
   anApp->NewDocument ("BinOcaf", aDoc);
   TDF_Label aLab = aDoc->Main();
+  // Prepend an int value.
   TDataStd_Integer::Set (aLab, 0);
+  // Prepend a name.
   TDataStd_Name::Set (aLab, "test");
+  // Append a double value.
+  aLab.AddAttribute(new TDataStd_Real(), true/*append*/);
 
   TDF_AttributeIterator i (aLab);
   Handle(TDF_Attribute) anAttr = i.Value();
@@ -1992,6 +1921,9 @@ static Standard_Integer OCC24755 (Draw_Interpretor& di, Standard_Integer n, cons
   i.Next();
   anAttr = i.Value();
   QCOMPARE (anAttr->IsKind (STANDARD_TYPE (TDataStd_Name)), Standard_True);
+  i.Next();
+  anAttr = i.Value();
+  QCOMPARE (anAttr->IsKind (STANDARD_TYPE (TDataStd_Real)), Standard_True);
 
   return 0;
 }
@@ -2387,8 +2319,8 @@ static Standard_Integer OCC25043 (Draw_Interpretor& theDI,
     for (; anCheckIter.More(); anCheckIter.Next())
     {
       const BOPAlgo_CheckResult& aCurCheckRes = anCheckIter.Value();
-      const BOPCol_ListOfShape& aCurFaultyShapes = aCurCheckRes.GetFaultyShapes1();
-      BOPCol_ListIteratorOfListOfShape aFaultyIter(aCurFaultyShapes);
+      const TopTools_ListOfShape& aCurFaultyShapes = aCurCheckRes.GetFaultyShapes1();
+      TopTools_ListIteratorOfListOfShape aFaultyIter(aCurFaultyShapes);
       for (; aFaultyIter.More(); aFaultyIter.Next())
       {
         const TopoDS_Shape& aFaultyShape = aFaultyIter.Value();
@@ -2766,10 +2698,8 @@ static Standard_Integer OCC25413 (Draw_Interpretor& di, Standard_Integer narg ,
 #include <BRepAlgoAPI_Cut.hxx>
 #include <BRepAlgoAPI_Section.hxx>
 //
-#include <BOPTools.hxx>
-//
-#include <BOPCol_MapOfShape.hxx>
-#include <BOPCol_ListOfShape.hxx>
+#include <TopExp.hxx>
+#include <TopTools_MapOfShape.hxx>
 //=======================================================================
 //function : OCC25446
 //purpose  :
@@ -2806,7 +2736,7 @@ static Standard_Integer OCC25446 (Draw_Interpretor& theDI,
   aOp = (BOPAlgo_Operation)iOp;
   //
   Standard_Integer iErr;
-  BOPCol_ListOfShape aLS;
+  TopTools_ListOfShape aLS;
   BOPAlgo_PaveFiller aPF;
   //
   aLS.Append(aS1);
@@ -2814,7 +2744,7 @@ static Standard_Integer OCC25446 (Draw_Interpretor& theDI,
   aPF.SetArguments(aLS);
   //
   aPF.Perform();
-  iErr = aPF.ErrorStatus();
+  iErr = aPF.HasErrors();
   if (iErr) {
     theDI << "Intersection failed with error status: " << iErr << "\n";
     return 1;
@@ -2842,7 +2772,7 @@ static Standard_Integer OCC25446 (Draw_Interpretor& theDI,
     break;
   }
   //
-  iErr = pBuilder->ErrorStatus();
+  iErr = pBuilder->HasErrors();
   if (!pBuilder->IsDone()) {
     theDI << "BOP failed with error status: " << iErr << "\n";
     return 1;
@@ -2851,14 +2781,14 @@ static Standard_Integer OCC25446 (Draw_Interpretor& theDI,
   const TopoDS_Shape& aRes = pBuilder->Shape();
   DBRep::Set(argv[1], aRes);
   //
-  BOPCol_MapOfShape aMapArgs, aMapShape;
-  BOPCol_MapIteratorOfMapOfShape aIt;
+  TopTools_MapOfShape aMapArgs, aMapShape;
+  TopTools_MapIteratorOfMapOfShape aIt;
   Standard_Boolean bIsDeletedHist, bIsDeletedMap;
   TopAbs_ShapeEnum aType;
   //
-  BOPTools::MapShapes(aS1, aMapArgs);
-  BOPTools::MapShapes(aS2, aMapArgs);
-  BOPTools::MapShapes(aRes, aMapShape);
+  TopExp::MapShapes(aS1, aMapArgs);
+  TopExp::MapShapes(aS2, aMapArgs);
+  TopExp::MapShapes(aRes, aMapShape);
   //
   aIt.Initialize(aMapArgs);
   for (; aIt.More(); aIt.Next()) {
@@ -2915,19 +2845,19 @@ struct OCC25545_Functor
 //function : OCC25545
 //purpose  : Tests data race when concurrently accessing TopLoc_Location::Transformation()
 //=======================================================================
-#ifdef HAVE_TBB
+
 static Standard_Integer OCC25545 (Draw_Interpretor& di, 
                                   Standard_Integer, 
                                   const char **)
 {
   // Place vertices in a vector, giving the i-th vertex the
   // transformation that translates it on the vector (i,0,0) from the origin.
-  size_t n = 1000;
+  Standard_Integer n = 1000;
   std::vector<TopoDS_Shape> aShapeVec (n);
   std::vector<TopLoc_Location> aLocVec (n);
   TopoDS_Shape aShape = BRepBuilderAPI_MakeVertex (gp::Origin ());
   aShapeVec[0] = aShape;
-  for (size_t i = 1; i < n; ++i) {
+  for (Standard_Integer i = 1; i < n; ++i) {
     gp_Trsf aT;
     aT.SetTranslation (gp_Vec (1, 0, 0));
     aLocVec[i] = aLocVec[i - 1] * aT;
@@ -2938,20 +2868,12 @@ static Standard_Integer OCC25545 (Draw_Interpretor& di,
   // concurrently
   OCC25545_Functor aFunc(aShapeVec);
 
-  //concurrently process
-  tbb::parallel_for (size_t (0), n, aFunc, tbb::simple_partitioner ());
+  // concurrently process
+  OSD_Parallel::For (0, n, aFunc);
+
   QVERIFY (!aFunc.myIsRaceDetected);
   return 0;
 }
-#else
-static Standard_Integer OCC25545 (Draw_Interpretor&, 
-                                  Standard_Integer, 
-                                  const char **argv)
-{
-  cout << "Test skipped: command " << argv[0] << " requires TBB library" << endl;
-  return 0;
-}
-#endif
 
 //=======================================================================
 //function : OCC25547
@@ -3280,103 +3202,6 @@ static Standard_Integer OCC24881 (Draw_Interpretor& di, Standard_Integer narg ,
   return 0;
 }
 
-//=======================================================================
-//function : OCC26172
-//purpose  :
-//=======================================================================
-static Standard_Integer OCC26172 (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
-{
-  if (theArgNb != 1)
-  {
-    std::cerr << "Error: wrong number of arguments! See usage:\n";
-    theDI.PrintHelp (theArgVec[0]);
-    return 1;
-  }
-
-  Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
-  if(anAISContext.IsNull())
-  {
-    std::cerr << "Error: no active view. Please call vinit.\n";
-    return 1;
-  }
-
-  gp_Pnt aStart (100, 100, 100);
-  gp_Pnt anEnd (300, 400, 600);
-  BRepBuilderAPI_MakeEdge anEdgeBuilder (aStart, anEnd);
-  TopoDS_Edge anEdge = anEdgeBuilder.Edge();
-  Handle(AIS_Shape) aTestAISShape = new AIS_Shape (anEdge);
-  anAISContext->Display (aTestAISShape, Standard_True);
-
-  // 2. activate it in selection modes
-  TColStd_SequenceOfInteger aModes;
-  aModes.Append (AIS_Shape::SelectionMode ((TopAbs_ShapeEnum) TopAbs_VERTEX));
-  aModes.Append (AIS_Shape::SelectionMode ((TopAbs_ShapeEnum) TopAbs_EDGE));
-
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  anAISContext->OpenLocalContext();
-  Standard_ENABLE_DEPRECATION_WARNINGS
-  anAISContext->Deactivate (aTestAISShape);
-  anAISContext->Load (aTestAISShape, -1, true);
-  for (Standard_Integer anIt = 1; anIt <= aModes.Length(); ++anIt)
-  {
-    anAISContext->Activate (aTestAISShape, aModes (anIt));
-  }
-
-  // select entities in vertex selection mode
-  Handle(SelectMgr_Selection) aSelection = aTestAISShape->Selection (aModes (1));
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  for (aSelection->Init(); aSelection->More(); aSelection->Next())
-  {
-    Handle(SelectBasics_SensitiveEntity) anEntity = aSelection->Sensitive()->BaseSensitive();
-    if (anEntity.IsNull())
-    {
-      continue;
-    }
-
-    Handle(SelectMgr_EntityOwner) anOwner =
-      Handle(SelectMgr_EntityOwner)::DownCast (anEntity->OwnerId());
-
-    if (anOwner.IsNull())
-    {
-      continue;
-    }
-
-    anAISContext->LocalContext()->AddOrRemoveSelected (anOwner);
-  }
-  Standard_ENABLE_DEPRECATION_WARNINGS
-
-  // select entities in edge selection mode
-  aSelection = aTestAISShape->Selection (aModes (2));
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  for (aSelection->Init(); aSelection->More(); aSelection->Next())
-  {
-    Handle(SelectBasics_SensitiveEntity) anEntity = aSelection->Sensitive()->BaseSensitive();
-    if (anEntity.IsNull())
-    {
-      continue;
-    }
-
-    Handle(SelectMgr_EntityOwner) anOwner =
-      Handle(SelectMgr_EntityOwner)::DownCast (anEntity->OwnerId());
-
-    if (anOwner.IsNull())
-    {
-      continue;
-    }
-
-    anAISContext->LocalContext()->AddOrRemoveSelected (anOwner);
-  }
-  Standard_ENABLE_DEPRECATION_WARNINGS
-
-  // deactivate vertex mode and check clearing of outdated selection
-  anAISContext->Deactivate (aTestAISShape, aModes (1));
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  anAISContext->LocalContext()->ClearOutdatedSelection (aTestAISShape, true);
-  Standard_ENABLE_DEPRECATION_WARNINGS
-
-  return 0;
-}
-
 //=======================================================================
 //function : OCC26284
 //purpose  :
@@ -3540,7 +3365,7 @@ static Standard_Integer OCC24923(
   const Standard_Real aDeviation = 
     1. - (Standard_Real)(aPointsNb - aFailedNb) / (Standard_Real)aPointsNb;
 
-  theDI << "Number of failed cases: " << aFailedNb << " (Total " << aPointsNb << ")\n";
+  theDI << "Number of incorrect cases: " << aFailedNb << " (Total " << aPointsNb << ")\n";
   if (aDeviation > aMaxDeviation)
   {
     theDI << "Failed. Number of incorrect results is too huge: " << 
@@ -4835,162 +4660,6 @@ static Standard_Integer OCC26746(
   return 0;     
 }
 
-DEFINE_STANDARD_HANDLE(QABugs_VertexFilter, SelectMgr_Filter)
-class QABugs_VertexFilter: public SelectMgr_Filter
-{
-public:
-  Standard_EXPORT QABugs_VertexFilter() : SelectMgr_Filter() {}
-
-  Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)&) const
-  {
-    return Standard_False;
-  }
-};
-
-//=======================================================================
-//function : BUC26658 
-//purpose  : Checks selection in the context after using a selection filter
-//=======================================================================
-static Standard_Integer BUC26658 (Draw_Interpretor& theDI,
-                                  Standard_Integer  /*theNArg*/,
-                                  const char ** theArgVal)
-{
-  Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
-  if(aContext.IsNull()) {
-    theDI << "use 'vinit' command before " << theArgVal[0] << "\n";
-    return 1;
-  }
-
-  TopoDS_Shape aBoxShape = BRepPrimAPI_MakeBox(20,20,20).Shape();
-  Handle(AIS_Shape) anAISIO = new AIS_Shape(aBoxShape);
-
-  // visualization of the box in the local mode with possibility to
-  // select box vertices
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  aContext->OpenLocalContext();
-  Standard_ENABLE_DEPRECATION_WARNINGS
-
-  int aDispMode = 0;// wireframe
-  anAISIO->SetDisplayMode(aDispMode);
-  aContext->Display(anAISIO, aDispMode, 0, false, true, AIS_DS_Displayed); 
-  theDI.Eval(" vfit");
-
-  aContext->Load(anAISIO, -1, true); /// load allowing decomposition
-  aContext->Deactivate(anAISIO);
-  aContext->Activate(anAISIO, AIS_Shape::SelectionMode(TopAbs_VERTEX), false);
-  aContext->UpdateCurrentViewer();
-
-  // select a point on the box
-  Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
-  double Xv,Yv;
-  myV3dView->Project(20,20,0,Xv,Yv);
-  Standard_Integer Xp,Yp;
-  myV3dView->Convert(Xv,Yv,Xp,Yp);
-
-  aContext->MoveTo (Xp, Yp, myV3dView, Standard_False);
-  aContext->Select (Standard_False);
-  bool aHasSelected = false;
-  for (aContext->InitSelected(); aContext->MoreSelected() && !aHasSelected; aContext->NextSelected()) {
-    Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
-    if (!anIO.IsNull()) {
-      const TopoDS_Shape aShape = aContext->SelectedShape();
-      if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX)
-        aHasSelected = true;
-    }
-  }
-  if (aHasSelected)
-     cout << "has selected vertex : OK"   << endl;
-  else {
-    theDI << "has selected vertex : bugged - Faulty\n";
-    return 1;
-  }
-  // filter to deny any selection in the viewer
-  Handle(QABugs_VertexFilter) aFilter = new QABugs_VertexFilter();
-  aContext->AddFilter(aFilter);
-
-  // update previous selection by hand
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  aContext->LocalContext()->ClearOutdatedSelection(anAISIO, true);
-  Standard_ENABLE_DEPRECATION_WARNINGS
-
-  // check that there are no selected vertices
-  aContext->Select (Standard_True);
-  aHasSelected = false;
-  for (aContext->InitSelected(); aContext->MoreSelected() && !aHasSelected; aContext->NextSelected()) {
-    Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
-    if (!anIO.IsNull()) {
-      const TopoDS_Shape aShape = aContext->SelectedShape();
-      if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX)
-        aHasSelected = true;
-    }
-  }
-  if (!aHasSelected) cout << "has no selected vertex after filter : OK"   << endl;
-  else {
-    theDI << "has no selected vertex after filter : bugged - Faulty\n";
-    return 1;
-  }
-
-  return 0;
-}
-
-//=======================================================================
-//function : OCC26945_open
-//purpose  : Opens local context and activates given standard selection mode
-//=======================================================================
-static Standard_Integer OCC26945_open (Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv)
-{
-  const Handle(AIS_InteractiveContext)& aCtx = ViewerTest::GetAISContext();
-  if (aCtx.IsNull())
-  {
-    std::cout << "No interactive context. Use 'vinit' command before " << theArgv[0] << "\n";
-    return 1;
-  }
-
-  if (theArgc < 2)
-  {
-    std::cout << "Not enough arguments. See usage:\n";
-    theDI.PrintHelp (theArgv[0]);
-    return 1;
-  }
-
-  const TopAbs_ShapeEnum aSelType = AIS_Shape::SelectionType (Draw::Atoi (theArgv[1]));
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  Standard_Integer aLocalCtxIdx = aCtx->OpenLocalContext();
-  aCtx->ActivateStandardMode (aSelType);
-  Standard_ENABLE_DEPRECATION_WARNINGS
-  theDI << aLocalCtxIdx;
-
-  return 0;
-}
-
-//=======================================================================
-//function : OCC26945_close
-//purpose  : Closes local context with the id given
-//=======================================================================
-static Standard_Integer OCC26945_close (Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv)
-{
-  const Handle(AIS_InteractiveContext)& aCtx = ViewerTest::GetAISContext();
-  if (aCtx.IsNull())
-  {
-    std::cout << "No interactive context. Use 'vinit' command before " << theArgv[0] << "\n";
-    return 1;
-  }
-
-  if (theArgc < 2)
-  {
-    std::cout << "Not enough arguments. See usage:\n";
-    theDI.PrintHelp (theArgv[0]);
-    return 1;
-  }
-
-  const Standard_Integer aCtxToClose = Draw::Atoi (theArgv[1]);
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  aCtx->CloseLocalContext (aCtxToClose);
-  Standard_ENABLE_DEPRECATION_WARNINGS
-
-  return 0;
-}
-
 //=======================================================================
 //function : OCC27048
 //purpose  : Calculate value of B-spline surface N times
@@ -5158,7 +4827,7 @@ static Standard_Integer OCC27523 (Draw_Interpretor& theDI, Standard_Integer theA
   aModes.Append (AIS_Shape::SelectionMode ((TopAbs_ShapeEnum) TopAbs_VERTEX));
 
   anAISContext->Deactivate (aTestAISShape);
-  anAISContext->Load (aTestAISShape, -1, true);
+  anAISContext->Load (aTestAISShape, -1);
   anAISContext->Activate (aTestAISShape, 0);
   anAISContext->Deactivate (aTestAISShape, 0);
 
@@ -5393,6 +5062,52 @@ static Standard_Integer OCC28310 (Draw_Interpretor& /*theDI*/, Standard_Integer
   return 0;
 }
 
+// repetitive display and removal of multiple small objects in the viewer for 
+// test of memory leak in visualization (OCCT 6.9.0 - 7.0.0)
+static Standard_Integer OCC29412 (Draw_Interpretor& /*theDI*/, Standard_Integer theArgNb, const char** theArgVec)
+{
+  Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+  if (aCtx.IsNull())
+  {
+    std::cout << "Error: no active view.\n";
+    return 1;
+  }
+
+  const int aNbIters = (theArgNb <= 1 ? 10000 : Draw::Atoi (theArgVec[1]));
+  int aProgressPrev = -1;
+  for (int m_loopIndex = 0; m_loopIndex < aNbIters; m_loopIndex++)
+  {
+    gp_Pnt pos;
+    gp_Vec dir(0, 0,1);
+
+    gp_Ax2 center (pos, dir);
+    gp_Circ circle (center, 1);
+    Handle(AIS_Shape) feature;
+
+    BRepBuilderAPI_MakeEdge builder( circle );
+
+    if( builder.Error() == BRepBuilderAPI_EdgeDone )
+    {
+      TopoDS_Edge E1 = builder.Edge();
+      TopoDS_Shape W2 = BRepBuilderAPI_MakeWire(E1).Wire();
+      feature = new AIS_Shape(W2);
+      aCtx->Display (feature, true);
+    }
+
+    aCtx->CurrentViewer()->Update();
+    ViewerTest::CurrentView()->FitAll();
+    aCtx->Remove (feature, true);
+
+    const int aProgress = (m_loopIndex * 100) / aNbIters;
+    if (aProgress != aProgressPrev)
+    {
+      std::cerr << aProgress << "%\r";
+      aProgressPrev = aProgress;
+    }
+  }
+  return 0;
+}
+
 //========================================================================
 //function : Commands_19
 //purpose  :
@@ -5431,7 +5146,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
   theCommands.Add ("OCC24533", "OCC24533", __FILE__, OCC24533, group);
   theCommands.Add ("OCC24012", "OCC24012 face edge", __FILE__, OCC24012, group);
   theCommands.Add ("OCC24086", "OCC24086 face wire", __FILE__, OCC24086, group);
-  theCommands.Add ("OCC24622", "OCC24622 texture={1D|2D}\n Tests sourcing of 1D/2D pixmaps for AIS_TexturedShape", __FILE__, OCC24622, group);
   theCommands.Add ("OCC24667", "OCC24667 result Wire_spine Profile [Mode [Approx]], no args to get help", __FILE__, OCC24667, group);
   theCommands.Add ("OCC24755", "OCC24755", __FILE__, OCC24755, group);
   theCommands.Add ("OCC24834", "OCC24834", __FILE__, OCC24834, group);
@@ -5461,7 +5175,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
                    __FILE__, OCC25545, group);
   theCommands.Add ("OCC25547", "OCC25547", __FILE__, OCC25547, group);
   theCommands.Add ("OCC24881", "OCC24881 shape", __FILE__, OCC24881, group);
-  theCommands.Add ("OCC26172", "OCC26172", __FILE__, OCC26172, group);
   theCommands.Add ("xprojponf", "xprojponf p f", __FILE__, xprojponf, group);
   theCommands.Add ("OCC24923", "OCC24923", __FILE__, OCC24923, group);
   theCommands.Add ("OCC26139", "OCC26139 [-boxsize value] [-boxgrid value] [-compgrid value]", __FILE__, OCC26139, group);
@@ -5492,17 +5205,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
   theCommands.Add ("OCC25574", "OCC25574", __FILE__, OCC25574, group);
   theCommands.Add ("OCC26746", "OCC26746 torus [toler NbCheckedPoints] ", __FILE__, OCC26746, group);
 
-  theCommands.Add ("BUC26658", "BUC26658 unexpected selection in the context using a selection filter", __FILE__, BUC26658, group);
-  theCommands.Add ("OCC26945_open",
-                   "OCC26945 selectionModeToActivate"
-                   "\n\t\t: Opens a new local context with selectionModeToActivate activated."
-                   "\n\t\t: Prints the ID of newely opened local context in case of success.",
-                   __FILE__, OCC26945_open, group);
-  theCommands.Add ("OCC26945_close",
-                   "OCC26945 localCtxToClose"
-                   "\n\t\t: Closes local context with the ID localCtxToClose",
-                   __FILE__, OCC26945_close, group);
-
   theCommands.Add ("OCC27048",
                    "OCC27048 surf U V N\nCalculate value of surface N times in the point (U, V)",
                    __FILE__, OCC27048, group);
@@ -5532,5 +5234,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
   theCommands.Add("OCC28310",
                   "OCC28310: Tests validness of iterator in AIS_InteractiveContext after an removing object from it",
                   __FILE__, OCC28310, group);
+  theCommands.Add("OCC29412", "OCC29412 [nb cycles]: test display / remove of many small objects", __FILE__, OCC29412, group);
   return;
 }