0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
[occt.git] / src / QABugs / QABugs_17.cxx
index 580329e..a4c7c94 100644 (file)
@@ -56,8 +56,8 @@
 #include <Geom_Axis2Placement.hxx>
 #include <V3d_View.hxx>
 #include <BRepBuilderAPI_MakeVertex.hxx>
-#include <AIS_LengthDimension.hxx>
-#include <AIS_RadiusDimension.hxx>
+#include <PrsDim_LengthDimension.hxx>
+#include <PrsDim_RadiusDimension.hxx>
 #include <BRepPrimAPI_MakeBox.hxx>
 #include <GeomAdaptor_Surface.hxx>
 #include <Extrema_ExtPS.hxx>
@@ -69,7 +69,6 @@
 #include <TopoDS_Compound.hxx>
 #include <TopoDS_CompSolid.hxx>
 #include <StdSelect_ShapeTypeFilter.hxx>
-#include <Prs3d_Projector.hxx>
 #include <HLRAlgo_Projector.hxx>
 #include <Standard_ErrorHandler.hxx>
 #include <Font_NameOfFont.hxx>
@@ -94,7 +93,7 @@ static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*
   if(!aContext.IsNull()) {
     Handle(AIS_Shape) aisp = 
       new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
-    aContext->Display (aisp);
+    aContext->Display (aisp, Standard_False);
   }
 
   Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d (cir, pln);
@@ -103,7 +102,7 @@ static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*
   if(!aContext.IsNull()) {
     Handle(AIS_Shape) aisp = 
       new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
-    aContext->Display (aisp);
+    aContext->Display (aisp, Standard_False);
   }
 
   Geom2dAdaptor_Curve acur (curve2d), afromcur (fromcurve2d);
@@ -117,9 +116,11 @@ static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*
     DrawTrSurf::Set(st,glin);
     if(!aContext.IsNull()) {
       Handle(AIS_Shape) aisp = 
-        new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());      aContext->Display (aisp);
+        new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
+      aContext->Display (aisp, Standard_False);
     }
   }
+  aContext->UpdateCurrentViewer();
   di << " Is Done = \n" << (Standard_Integer) lintan.IsDone();
   return 0;
 }
@@ -210,7 +211,7 @@ static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, c
   di << "total no of wires are ............. " << i << "\n"; 
 
   TopoDS_Wire spineWire = bRepSpineWire.Wire(); 
-  aContext->Display(new AIS_Shape(spineWire)); 
+  aContext->Display (new AIS_Shape(spineWire), Standard_False);
 
   DBRep::Set("slineW",spineWire);
 
@@ -226,7 +227,7 @@ static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, c
   gp_Circ gpCirc(gpAx2, 2.5); 
   BRepBuilderAPI_MakeWire aMWire(BRepBuilderAPI_MakeEdge(new Geom_Circle(gpCirc)).Edge());
   TopoDS_Wire topoWire(aMWire); 
-  aContext->Display(new AIS_Shape(topoWire));
+  aContext->Display (new AIS_Shape(topoWire), Standard_False);
 
   DBRep::Set("topoW",topoWire);
 
@@ -234,60 +235,13 @@ static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, c
   bRepPipe.Add(topoWire); 
   bRepPipe.Build(); 
 
-  aContext->Display(new AIS_Shape(bRepPipe.Shape())); 
+  aContext->Display (new AIS_Shape(bRepPipe.Shape()), Standard_True);
 
   DBRep::Set(argv[2],bRepPipe.Shape());
 
   return 0;
 }
 
-static Standard_Integer  BUC60818(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
-  if(argc!=1)
-  {
-    di << "Usage : " << argv[0] << "\n";
-    return -1;
-  }
-
-  Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
-  if(myAISContext.IsNull()) 
-  {
-    di << "use 'vinit' command before " << argv[0] << "\n";
-    return -1;
-  }
-
-  // TRIHEDRON
-  Handle(AIS_Trihedron) aTrihedron;
-  Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
-  aTrihedron=new AIS_Trihedron(aTrihedronAxis);
-  myAISContext->Display(aTrihedron);
-
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  myAISContext->OpenLocalContext(); 
-  Standard_ENABLE_DEPRECATION_WARNINGS
-  myAISContext->Load(aTrihedron,0); 
-
-  myAISContext->SetAutomaticHilight(  Standard_False );
-
-  Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
-  double Xv,Yv;
-  myV3dView->Project(0,0,0,Xv,Yv);
-
-  Standard_Integer Xp,Yp;
-  myV3dView->Convert(Xv,Yv,Xp,Yp);
-
-  myAISContext->MoveTo( Xp,Yp, myV3dView  );
-  myAISContext->MoveTo( Xp,Yp, myV3dView  );
-
-  if (myAISContext->HasDetected(  )) 
-    di << "has detected shape : OK"   << "\n";
-  else       di << "has detected shape : bugged - Faulty "   << "\n";
-
-  myAISContext->SetAutomaticHilight(  Standard_True );
-
-  return 0;
-}
-
 static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if (argc > 1) {
@@ -332,50 +286,50 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc,
   /***************************************/
   //dimension "L 502.51"
   /***************************************/
-  Handle(AIS_LengthDimension) len = new AIS_LengthDimension(V2, V3, pln->Pln());
+  Handle(PrsDim_LengthDimension) len = new PrsDim_LengthDimension(V2, V3, pln->Pln());
   anAspect->ArrowAspect()->SetLength (30.0);
   len->SetDimensionAspect (anAspect);
-  context->Display(len);
+  context->Display (len, Standard_False);
   /***************************************/
   //dimension "L 90"
   /***************************************/
-  Handle(AIS_LengthDimension) len1 = new AIS_LengthDimension(V7, V4, pln->Pln());
+  Handle(PrsDim_LengthDimension) len1 = new PrsDim_LengthDimension(V7, V4, pln->Pln());
   len1->SetDimensionAspect (anAspect);
   len1->SetFlyout (30.0);
   anAspect->ArrowAspect()->SetLength (100.0);
-  context->Display(len1);
+  context->Display (len1, Standard_False);
   /***************************************/
   //dimension "L 150"
   /***************************************/
-  Handle(AIS_LengthDimension) len2 = new AIS_LengthDimension(V1, V2, pln->Pln());
+  Handle(PrsDim_LengthDimension) len2 = new PrsDim_LengthDimension(V1, V2, pln->Pln());
   len2->SetDimensionAspect (anAspect);
-  context->Display(len2);
+  context->Display (len2, Standard_False);
   /***************************************/
   //dimension "R 88.58"
   /***************************************/
   gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58);
   TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir,gp_Pnt(191.09,0,0.),gp_Pnt(191.09,-177.16,0.) );
-  Handle(AIS_RadiusDimension) dim1 = new AIS_RadiusDimension(E1);
+  Handle(PrsDim_RadiusDimension) dim1 = new PrsDim_RadiusDimension(E1);
   dim1->SetDimensionAspect (anAspect);
-  context->Display(dim1);
+  context->Display (dim1, Standard_False);
   /***************************************/
   //dimension "R 43.80"
   /***************************************/
   gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80);
   TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1);
-  dim1 = new AIS_RadiusDimension(E_cir1);
+  dim1 = new PrsDim_RadiusDimension(E_cir1);
   anAspect->ArrowAspect()->SetLength (60.0);
   dim1->SetDimensionAspect (anAspect);
-  context->Display(dim1);
+  context->Display (dim1, Standard_False);
   /***************************************/
   //dimension "R 17.86"
   /***************************************/
   gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86);
   TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2);
-  dim1 = new AIS_RadiusDimension(E_cir2);
+  dim1 = new PrsDim_RadiusDimension(E_cir2);
   anAspect->ArrowAspect()->SetLength (40.0);
   dim1->SetDimensionAspect (anAspect);
-  context->Display(dim1);
+  context->Display (dim1, Standard_True);
 
   return 0;
 }
@@ -396,13 +350,13 @@ static Standard_Integer  OCC138 (Draw_Interpretor& di, Standard_Integer /*argc*/
   Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
   Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
 
-  aContext->Display(ais1);
-  aContext->Display(ais2);
-  aContext->Display(ais3);
+  aContext->Display (ais1, Standard_False);
+  aContext->Display (ais2, Standard_False);
+  aContext->Display (ais3, Standard_False);
 
-  aContext->AddOrRemoveSelected(ais1);
-  aContext->AddOrRemoveSelected(ais2);
-  aContext->AddOrRemoveSelected(ais3);
+  aContext->AddOrRemoveSelected (ais1, Standard_False);
+  aContext->AddOrRemoveSelected (ais2, Standard_False);
+  aContext->AddOrRemoveSelected (ais3, Standard_False);
 
   di << "\n No of currents = " << aContext->NbSelected();
 
@@ -413,10 +367,12 @@ static Standard_Integer  OCC138 (Draw_Interpretor& di, Standard_Integer /*argc*/
   {
     di << "\n count is = " << count++;
     Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
-    aContext->AddOrRemoveSelected(ais);
+    aContext->AddOrRemoveSelected (ais, Standard_False);
     aContext->InitSelected();
   }
 
+  aContext->UpdateCurrentViewer();
+
   return 0; 
 }
 
@@ -541,61 +497,6 @@ static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, con
   return 0;
 }
 
-static Standard_Integer  OCC232 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
-{
-  Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
-  if(aContext.IsNull()) { 
-    di << "use 'vinit' command before " << argv[0] << "\n";
-    return 1;
-  }
-
-  BRep_Builder builder;
-  TopoDS_Compound comp;
-  TopoDS_CompSolid cs1, cs2;
-
-  builder.MakeCompound(comp);
-  builder.MakeCompSolid(cs1);
-  builder.MakeCompSolid(cs2);
-
-  TopoDS_Shape sh1 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), 100, 100, 100).Shape();
-  TopoDS_Shape sh2 = BRepPrimAPI_MakeBox(gp_Pnt(100, 0, 0), 100, 100, 100).Shape();
-  TopoDS_Shape sh3 = BRepPrimAPI_MakeBox(gp_Pnt(200, 0, 0), 100, 100, 100).Shape();
-  builder.Add(cs1, sh1);
-  builder.Add(cs1, sh2);
-  builder.Add(cs1, sh3);
-
-  TopoDS_Shape sh4 = BRepPrimAPI_MakeBox(gp_Pnt(0, 500, 0), 100, 100, 100).Shape();
-  TopoDS_Shape sh5 = BRepPrimAPI_MakeBox(gp_Pnt(100, 500, 0), 100, 100, 100).Shape();
-  TopoDS_Shape sh6 = BRepPrimAPI_MakeBox(gp_Pnt(200, 500, 0), 100, 100, 100).Shape();
-
-  builder.Add(cs2, sh4);
-  builder.Add(cs2, sh5);
-  builder.Add(cs2, sh6);
-
-  builder.Add(comp, cs1);
-  builder.Add(comp, cs2);
-
-  Handle(AIS_Shape) ais = new AIS_Shape(comp);
-  aContext->Display(ais);
-
-  TopExp_Explorer exp(comp,  TopAbs_COMPSOLID);
-  while(exp.More())
-  {
-    //printf("\n TopAbs_COMPSOLID is  there \n");
-    di << "\n TopAbs_COMPSOLID is  there \n";
-    exp.Next();
-  }
-
-  Handle (StdSelect_ShapeTypeFilter) filt = new StdSelect_ShapeTypeFilter(TopAbs_COMPSOLID);
-  aContext->AddFilter(filt);
-  Standard_DISABLE_DEPRECATION_WARNINGS
-  aContext->CloseAllContexts();
-  aContext->OpenLocalContext(); 
-  aContext->ActivateStandardMode(TopAbs_SOLID);
-  Standard_ENABLE_DEPRECATION_WARNINGS
-  return 0; 
-}
-
 static Standard_Integer  OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
 {
   Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
@@ -612,13 +513,13 @@ static Standard_Integer  OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc
   Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
   Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
 
-  aContext->Display(ais1);
-  aContext->Display(ais2);
-  aContext->Display(ais3);
+  aContext->Display (ais1, Standard_False);
+  aContext->Display (ais2, Standard_False);
+  aContext->Display (ais3, Standard_False);
 
-  aContext->AddOrRemoveSelected(ais1);
-  aContext->AddOrRemoveSelected(ais2);
-  aContext->AddOrRemoveSelected(ais3);
+  aContext->AddOrRemoveSelected (ais1, Standard_False);
+  aContext->AddOrRemoveSelected (ais2, Standard_False);
+  aContext->AddOrRemoveSelected (ais3, Standard_False);
 
   di << "\n No of selected = " << aContext->NbSelected();
 
@@ -629,10 +530,12 @@ static Standard_Integer  OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc
   {
     di << "\n count is = %d" << count++;
     Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
-    aContext->AddOrRemoveSelected(ais);
+    aContext->AddOrRemoveSelected (ais, Standard_False);
     aContext->InitSelected();
   }
 
+  aContext->UpdateCurrentViewer();
+
   return 0; 
 }
 
@@ -719,7 +622,7 @@ static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,cons
 
       DBRep::Set(argv[1],aFinalShape);
     }
-    catch(Standard_Failure)
+    catch(Standard_Failure const&)
     {
       di << argv[0] << ": Exception in fillet\n";
       return 2;
@@ -875,7 +778,6 @@ static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const
     {
       OCC_CATCH_SIGNALS
         GeomFill_NSections b_surface1(n_curves1, np);
-      b_surface1.ComputeSurface();
       Handle(Geom_BSplineSurface) result_surf1 = b_surface1.BSplineSurface();
       if (!result_surf1.IsNull())
       {
@@ -884,7 +786,7 @@ static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const
         DBRep::Set(a[1],bsp_face1);
       }
     }
-    catch(Standard_Failure)
+    catch(Standard_Failure const&)
     {
       di<<"ERROR: Exception in GeomFill_NSections\n";
     }
@@ -934,7 +836,7 @@ static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,cons
   if(!aContext.IsNull()) {
     Handle(AIS_Shape) aisp = 
       new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
-    aContext->Display (aisp);
+    aContext->Display (aisp, Standard_False);
   }
 
   //This does not give any solutions.
@@ -951,10 +853,16 @@ static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,cons
     DrawTrSurf::Set(st,glin);
     if(!aContext.IsNull()) {
       Handle(AIS_Shape) aisp = 
-        new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());      aContext->Display (aisp);
+        new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
+      aContext->Display (aisp, Standard_False);
     }
   }
 
+  if (!aContext.IsNull())
+  {
+    aContext->UpdateCurrentViewer();
+  }
+
   return 0;
 }
 
@@ -995,12 +903,12 @@ static Standard_Integer OCC814 (Draw_Interpretor& di, Standard_Integer argc,cons
   if(!aContext.IsNull()) {
     Handle(AIS_Shape) aisp = 
       new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
-    aContext->Display (aisp);
+    aContext->Display (aisp, Standard_False);
   }
   if(!aContext.IsNull()) {
     Handle(AIS_Shape) aisp = 
       new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
-    aContext->Display (aisp);
+    aContext->Display (aisp, Standard_False);
   }
 
   Geom2dAdaptor_Curve acur(curve2d), afromcur(fromcurve2d);
@@ -1022,10 +930,16 @@ static Standard_Integer OCC814 (Draw_Interpretor& di, Standard_Integer argc,cons
     DrawTrSurf::Set(st,glin);
     if(!aContext.IsNull()) {
       Handle(AIS_Shape) aisp = 
-        new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());      aContext->Display (aisp);
+        new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
+      aContext->Display (aisp, Standard_False);
     }
   }
 
+  if (!aContext.IsNull())
+  {
+    aContext->UpdateCurrentViewer();
+  }
+
   return 0;
 }
 
@@ -1162,48 +1076,6 @@ static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, con
   return 0;
 }
 
-#include <Aspect_FillMethod.hxx>
-//=======================================================================
-//function : OCC1188
-//purpose  : 
-//=======================================================================
-static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
-  if (argc < 2 || argc > 3)
-  {
-    di << "Usage : " << argv[0] << " imagefile [filltype] : Load image as background\n";
-    return 1;
-  }
-
-  Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
-  if(AISContext.IsNull()) 
-  {
-    di << "use 'vinit' command before " << argv[0] << "\n";
-    return 1;
-  }
-
-  Aspect_FillMethod aFillType = Aspect_FM_CENTERED;
-  if (argc == 3)
-  {
-    const char* szType = argv[2];
-    if      (strcmp(szType, "NONE"    ) == 0) aFillType = Aspect_FM_NONE;
-    else if (strcmp(szType, "CENTERED") == 0) aFillType = Aspect_FM_CENTERED;
-    else if (strcmp(szType, "TILED"   ) == 0) aFillType = Aspect_FM_TILED;
-    else if (strcmp(szType, "STRETCH" ) == 0) aFillType = Aspect_FM_STRETCH;
-    else
-    {
-      di << "Wrong fill type : " << szType << "\n";
-      di << "Must be one of CENTERED, TILED, STRETCH, NONE\n";
-      return 1;
-    }
-  }
-
-  Handle(V3d_View) V3dView = ViewerTest::CurrentView();
-  V3dView->SetBackgroundImage(argv[1], aFillType, Standard_True);
-
-  return 0;
-}
-
 #include <Graphic3d_MaterialAspect.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_ShadingAspect.hxx>
@@ -1230,8 +1102,8 @@ static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc,
 
   Handle(AIS_Shape) anAisIO = new AIS_Shape(aShape);
 
-  Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_RGB);
-  Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_RGB);
+  Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
+  Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
 
   Handle(Prs3d_Drawer) aDrawer = anAisIO->Attributes();
   Handle(Prs3d_ShadingAspect) aShadingAspect = aDrawer->ShadingAspect();
@@ -1240,7 +1112,7 @@ static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc,
   aFront.SetAmbientColor(aColF);
   aFront.SetDiffuseColor(aColF);
   aFront.SetSpecularColor(aColF);
-  aFront.SetEmissiveColor(aColF);
+  aFront.SetEmissiveColor(Quantity_NOC_BLACK);
   aFront.SetTransparency(0.0);
   aShadingAspect->SetMaterial(aFront,Aspect_TOFM_FRONT_SIDE);
 
@@ -1248,18 +1120,18 @@ static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc,
   aBack.SetAmbientColor(aColB);
   aBack.SetDiffuseColor(aColB);
   aBack.SetSpecularColor(aColB);
-  aBack.SetEmissiveColor(aColB);
+  aBack.SetEmissiveColor(Quantity_NOC_BLACK);
   aBack.SetTransparency(0.0);
   aShadingAspect->SetMaterial(aBack,Aspect_TOFM_BACK_SIDE);
 
   aDrawer->SetShadingAspect (aShadingAspect);
 
-  anAISContext->Display(anAisIO, 1, 0);
+  anAISContext->Display (anAisIO, 1, 0, Standard_True);
 
   Standard_Real r, g, b; 
-  aShadingAspect->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
+  aShadingAspect->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_sRGB);
   di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
-  aShadingAspect->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
+  aShadingAspect->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_sRGB);
   di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
 
   return 0;
@@ -1287,30 +1159,30 @@ static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc,
   TopoDS_Shape sh = DBRep::Get(argv[1]);
 
   Handle(AIS_Shape) ais = new AIS_Shape(sh); 
-  AISContext->Display(ais,1,0); 
-  AISContext->SetMaterial(ais,Graphic3d_NOM_SHINY_PLASTIC); 
+  AISContext->Display (ais, 1, 0, Standard_False);
+  AISContext->SetMaterial (ais, Graphic3d_NOM_SHINY_PLASTIC, Standard_False);
 
-  Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB); 
-  Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB); 
+  Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
+  Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
   Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect(); 
 
   Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE); 
   front.SetAmbientColor(colf); 
   front.SetDiffuseColor(colf); 
   front.SetSpecularColor(colf); 
-  front.SetEmissiveColor(colf); 
-  front.SetTransparency(0.4); 
+  front.SetEmissiveColor(Quantity_NOC_BLACK);
+  front.SetTransparency (0.4f);
   sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE); 
 
   Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE); 
   back.SetAmbientColor(colb); 
   back.SetDiffuseColor(colb); 
   back.SetSpecularColor(colb); 
-  back.SetEmissiveColor(colb); 
-  back.SetTransparency(0.2); 
+  back.SetEmissiveColor(Quantity_NOC_BLACK);
+  back.SetTransparency (0.2f);
   sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE); 
 
-  AISContext->Redisplay(ais,1,0);
+  AISContext->Redisplay (ais, 1, 0);
 
   return 0;
 }
@@ -1378,7 +1250,6 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons
 #include <BRepPrimAPI_MakeCylinder.hxx>
 #include <BRepPrimAPI_MakeSphere.hxx>
 #include <BRepAlgoAPI_Section.hxx>
-#include <BRepAlgo_Section.hxx>
 //=======================================================================
 //function : OCCN2
 //purpose  : BOOLEAN OPERATION
@@ -1386,18 +1257,9 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons
 static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if (argc > 2) {
-    di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+    di << "Usage : " << argv[0] << "\n";
     return 1;
   }
-  Standard_Boolean IsBRepAlgoAPI = Standard_True;
-  if (argc == 2) {
-    Standard_Integer IsB = Draw::Atoi(argv[1]);
-    if (IsB != 1) {
-      IsBRepAlgoAPI = Standard_False;
-#if ! defined(BRepAlgo_def04)
-#endif
-    }
-  }
 
   Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
   if(aContext.IsNull()) 
@@ -1412,27 +1274,12 @@ static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, cons
   BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
   TopoDS_Shape sphere_sh = sphere.Shape();
 
-  //BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
-  //TopoDS_Shape shape = section.Shape();
-
-  TopoDS_Shape shape;
-  if (IsBRepAlgoAPI) {
-    di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n";
-    BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
-    section.Build();
-    if(!section.IsDone()){
-      di << "Error performing intersection: not done.\n";
-    }
-    shape = section.Shape();
-  } else {
-    di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)\n";
-    BRepAlgo_Section section(cylinder_sh, sphere_sh);
-    section.Build();
-    if(!section.IsDone()){
-      di << "Error performing intersection: not done.\n";
-    }
-    shape = section.Shape();
+  di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n";
+  BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
+  if (!section.IsDone()){
+    di << "Error performing intersection: not done.\n";
   }
+  const TopoDS_Shape& shape = section.Shape();
 
   DBRep::Set("OCCN2_cylinder",cylinder_sh);
   DBRep::Set("OCCN2_sphere",sphere_sh);
@@ -1471,7 +1318,7 @@ static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, co
   }
   TopoDS_Edge sh = BRepBuilderAPI_MakeEdge(bez).Edge(); 
   Handle(AIS_Shape) ais = new AIS_Shape(sh); 
-  aContext->Display(ais); 
+  aContext->Display (ais, Standard_True);
   DrawTrSurf::Set(argv[2],bez);
   return 0;
 }
@@ -1514,7 +1361,7 @@ static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, co
     IntRes2d_SequenceOfIntersectionPoint points2d;
     TColgp_SequenceOfPnt points3d;
 
-    cout << "\n j =" << j << ",  CheckSelfIntersectingEdge = " <<
+    std::cout << "\n j =" << j << ",  CheckSelfIntersectingEdge = " <<
       advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
 
 
@@ -1673,12 +1520,10 @@ void QABugs::Commands_17(Draw_Interpretor& theCommands) {
   theCommands.Add ("BUC60842", "BUC60842", __FILE__, BUC60842, group);
   theCommands.Add ("BUC60843", "BUC60843 result_shape name_of_circle name_of_curve [ par1 [ tol ] ]", __FILE__, BUC60843, group);
   theCommands.Add ("BUC60970", "BUC60970 shape result", __FILE__, BUC60970, group);
-  theCommands.Add ("BUC60818", "BUC60818", __FILE__, BUC60818, group);
   theCommands.Add ("BUC60915", "BUC60915", __FILE__, BUC60915_1, group);
   theCommands.Add ("OCC138", "OCC138", __FILE__, OCC138, group);
   theCommands.Add ("OCC353","OCC353",__FILE__,OCC353,group);
   theCommands.Add ("OCC280","OCC280 hlr=0/1 setsurfecedetail=0/1; set perspecrive view",__FILE__,OCC280,group);
-  theCommands.Add ("OCC232", "OCC232", __FILE__, OCC232 , group);
   theCommands.Add ("OCC138LC", "OCC138LC", __FILE__, OCC138LC, group);
   theCommands.Add ("OCC566", "OCC566 shape [ xmin ymin zmin xmax ymax zmax] ; print bounding box", __FILE__, OCC566, group);
   theCommands.Add ("OCC570", "OCC570 result", __FILE__, OCC570, group);
@@ -1701,7 +1546,6 @@ void QABugs::Commands_17(Draw_Interpretor& theCommands) {
   theCommands.Add ("OCC813", "OCC813 U V", __FILE__, OCC813, group);
   theCommands.Add ("OCC814", "OCC814", __FILE__, OCC814, group);
   theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, group);
-  theCommands.Add ("OCC1188", "OCC1188 imagefile [filltype] : Load image as background", __FILE__, OCC1188, group);
 
   theCommands.Add ("OCC1174_1", "OCC1174_1 shape", __FILE__, OCC1174_1, group);
   theCommands.Add ("OCC1174_2", "OCC1174_2 shape", __FILE__, OCC1174_2, group);