0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
[occt.git] / src / QABugs / QABugs_16.cxx
index 72ff577..bdecc0c 100644 (file)
@@ -4,8 +4,8 @@
 //
 // 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 version 2.1 as published
+// 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.
 #include <gp_Ax2.hxx>
 #include <Geom_Circle.hxx>
 #include <AIS_Circle.hxx>
-#include <V3d_View.hxx>
 #include <TopoDS.hxx>
 #include <Geom_Plane.hxx>
 #include <gp_Pln.hxx>
-#include <AIS_AngleDimension.hxx>
+#include <PrsDim_AngleDimension.hxx>
+
+#include <Aspect_Window.hxx>
+#include <V3d_View.hxx>
 
 #include <TopExp_Explorer.hxx>
 #include <BRepAdaptor_Curve.hxx>
 #include <OSD_Path.hxx>
 #include <Standard_ProgramError.hxx>
 
-//#include <QAModTopOpe_Limitation.hxx>
-#include <QANewModTopOpe_Limitation.hxx>
-
-//#include <QAModTopOpe_Glue.hxx>
-#include <QANewModTopOpe_Glue.hxx>
-
 #include <ShapeFix_Wireframe.hxx>
 #include <ShapeBuild_ReShape.hxx>
 
-#include <ViewerTest_Tool.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
 
-//#include <QAModTopOpe_ReShaper.hxx>
-#include <QANewModTopOpe_ReShaper.hxx>
-
 #include <ViewerTest_EventManager.hxx>
 
 #include <TColgp_Array1OfPnt2d.hxx>
@@ -79,7 +71,7 @@
 #include <TDocStd_Document.hxx>
 #include <Standard_ErrorHandler.hxx>
 
-#if ! defined(WNT)
+#if ! defined(_WIN32)
 extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
 #else
 Standard_EXPORT ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
@@ -88,12 +80,12 @@ Standard_EXPORT ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
 static Standard_Integer BUC60848 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if ( argc != 2 ) {
-    di << "Usage : " << argv[0] << " shape " << "\n";
+    di << "Usage : " << argv[0] << " shape \n";
     return 1;
   }
   TopoDS_Shape S = DBRep::Get( argv[1] );
   if ( S.IsNull() ) {
-    di << "Shape is empty" << "\n";
+    di << "Shape is empty\n";
     return 1;
   }
   GProp_GProps G;
@@ -120,8 +112,8 @@ static Standard_Integer BUC60828 (Draw_Interpretor& di, Standard_Integer /*argc*
   Standard_Boolean aValue1; 
   aValue1=anEdge.Infinite(); 
   di << "Current flag : " << (Standard_Integer) aValue1 << "\n";
-  if(aValue1) di << "Flag was set properly." << "\n";
-  else di << "Faulty : flag was not set properly." << "\n";
+  if(aValue1) di << "Flag was set properly.\n";
+  else di << "Faulty : flag was not set properly.\n";
   return 0;
 }
 
@@ -141,10 +133,10 @@ static Standard_Integer  BUC60814(Draw_Interpretor& di, Standard_Integer argc, c
   }
   
   // TRIHEDRON
-  Handle(AIS_Trihedron) aTrihedron;
+  Handle(AIS_InteractiveObject) aTrihedron;
   Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
   aTrihedron=new AIS_Trihedron(aTrihedronAxis);
-  myAISContext->Display(aTrihedron);
+  myAISContext->Display (aTrihedron, Standard_False);
   
   //Circle
   gp_Pnt P(10,10,10);
@@ -152,77 +144,76 @@ static Standard_Integer  BUC60814(Draw_Interpretor& di, Standard_Integer argc, c
   gp_Ax2 aAx2(P,V);
   
   Handle(Geom_Circle) ahCircle=new Geom_Circle(aAx2,20);
-  Handle(AIS_Circle)   aCircle=new AIS_Circle(ahCircle);
-  myAISContext->Display(aCircle);
+  Handle(AIS_InteractiveObject)   aCircle=new AIS_Circle(ahCircle);
+  myAISContext->Display (aCircle, Standard_False);
     
-  myAISContext->SelectionColor(Quantity_NOC_BLUE1);
+  const Handle(Prs3d_Drawer)& aSelStyle = myAISContext->SelectionStyle();
+  aSelStyle->SetColor (Quantity_NOC_BLUE1);
   
-  myAISContext->AddOrRemoveSelected(aTrihedron);
-  myAISContext->AddOrRemoveSelected(aCircle);
+  myAISContext->AddOrRemoveSelected (aTrihedron, Standard_False);
+  myAISContext->AddOrRemoveSelected (aCircle, Standard_True);
   
   return 0;
 }
 
-static Standard_Integer  BUC60774(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
+//=======================================================================
+//function : BUC60774
+//purpose  : 
+//=======================================================================
+static Standard_Integer BUC60774 (Draw_Interpretor& theDi,
+                                  Standard_Integer theArgNb,
+                                  const char** theArgv)
 {
-  if(argc!=1)
+  if (theArgNb != 1)
   {
-    di << "Usage : " << argv[0] << "\n";
+    std::cout << "Usage : " << theArgv[0] << "\n";
     return -1;
   }
 
-  Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
-  if(myAISContext.IsNull()) 
+  const Handle(AIS_InteractiveContext)& anAISContext = ViewerTest::GetAISContext();
+  if (anAISContext.IsNull())
   {
-    di << "use 'vinit' command before " << argv[0] << "\n";
+    std::cout << "use 'vinit' command before " << theArgv[0] << "\n";
     return -1;
   }
 
-  Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
-  
-  double Xc,Yc,Width, Height;
-  myV3dView->Center(Xc,Yc);
-  myV3dView-> Size (Width, Height);
-  
-  double Xmin,Ymin;
-  Xmin=Xc-Width/2;
-  Ymin=Yc-Height/2;
-  double Xmax,Ymax;
-  Xmax=Xc+Width/2;
-  Ymax=Yc+Height/2;
-    
-  Standard_Integer XPmin,YPmin;
-  myV3dView->Convert(Xmin,Ymin,XPmin,YPmin);
-//  cout<<Xmin<<"\t"<<Ymin<<endl;
-//  cout<<XPmin<<"\t"<<YPmin<<endl;
-
-  Standard_Integer XPmax,YPmax;
-  myV3dView->Convert(Xmax,Ymax,XPmax,YPmax);
-//  cout<<Xmax<<"\t"<<Ymax<<endl;
-//  cout<<XPmax<<"\t"<<YPmax<<endl;
-  
-  AIS_StatusOfPick status;
-  if ((status=myAISContext->Select(XPmin,YPmin,XPmax,YPmax,myV3dView))==AIS_SOP_NothingSelected)
-             di << "status = AIS_SOP_NothingSelected : OK"   << "\n";
-  else       di << "status = AIS_SOP_NothingSelected : bugged - Faulty "   << "\n";
-  
-  di.Eval("box b 10 10 10");
-  di.Eval(" vdisplay b");
+  const Handle(V3d_View)& aV3dView = ViewerTest::CurrentView();
 
-  if ((status=myAISContext->Select(XPmin,YPmin,XPmax,YPmax,myV3dView))==AIS_SOP_OneSelected)
-             di << "status = AIS_SOP_OneSelected : OK"   << "\n";
-  else       di << "status = AIS_SOP_OneSelected : bugged - Faulty "   << "\n";
+  Standard_Integer aWinWidth  = 0;
+  Standard_Integer aWinHeight = 0;
+  aV3dView->Window()->Size (aWinWidth, aWinHeight);
 
-  di.Eval("box w 20 20 20 20 20 20");
-  di.Eval(" vdisplay w");
+  Standard_Integer aXPixMin = 0;
+  Standard_Integer aYPixMin = 0;
+  Standard_Integer aXPixMax = aWinWidth;
+  Standard_Integer aYPixMax = aWinHeight;
 
-  if ((status=myAISContext->Select(XPmin,YPmin,XPmax,YPmax,myV3dView))==AIS_SOP_SeveralSelected)
-             di << "status = AIS_SOP_SeveralSelected : OK"   << "\n";
-  else       di << "status = AIS_SOP_SeveralSelected : bugged - Faulty "   << "\n";
-  
-  return 0;
+  AIS_StatusOfPick aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_False);
+  theDi << (aPickStatus == AIS_SOP_NothingSelected
+    ? "status = AIS_SOP_NothingSelected : OK"
+    : "status = AIS_SOP_NothingSelected : bugged - Faulty ");
+  theDi << "\n";
+
+  theDi.Eval ("box b 10 10 10");
+  theDi.Eval (" vdisplay b");
 
-}  
+  aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_False);
+  theDi << (aPickStatus == AIS_SOP_OneSelected
+    ? "status = AIS_SOP_OneSelected : OK"
+    : "status = AIS_SOP_OneSelected : bugged - Faulty ");
+  theDi << "\n";
+
+  theDi.Eval ("box w 20 20 20 20 20 20");
+  theDi.Eval (" vdisplay w");
+
+  aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_True);
+  theDi << (aPickStatus == AIS_SOP_SeveralSelected
+    ? "status = AIS_SOP_SeveralSelected : OK"
+    : "status = AIS_SOP_SeveralSelected : bugged - Faulty ");
+  theDi << "\n";
+
+  return 0;
+}
 
 static Standard_Integer BUC60972 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
@@ -233,7 +224,7 @@ static Standard_Integer BUC60972 (Draw_Interpretor& di, Standard_Integer argc, c
   }
 
   if(argc != 6) {
-    di << "Usage : " << argv[0] << " edge edge plane val text" << "\n";
+    di << "Usage : " << argv[0] << " edge edge plane val text\n";
     return 1;
   }
   
@@ -250,8 +241,8 @@ static Standard_Integer BUC60972 (Draw_Interpretor& di, Standard_Integer argc, c
   //di << ExtString_aText << " " << Draw::Atof(argv[4]) << "\n";
   di << argv[5] << " " << Draw::Atof(argv[4]) << "\n";
   
-  Handle(AIS_AngleDimension) aDim = new AIS_AngleDimension(aFirst, aSecond);
-  aContext->Display(aDim);                                                         
+  Handle(PrsDim_AngleDimension) aDim = new PrsDim_AngleDimension(aFirst, aSecond);
+  aContext->Display (aDim, Standard_True);
   
   return 0;
 }
@@ -265,13 +256,13 @@ static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc,
   }
 
   if(argc != 5) {
-    di << "Usage : " << argv[0] << " name plane Xlabel Ylabel" << "\n";
+    di << "Usage : " << argv[0] << " name plane Xlabel Ylabel\n";
     return 1;
   }
 
   TopoDS_Shape S = DBRep::Get( argv[2] );
   if ( S.IsNull() ) {
-    di << "Shape is empty" << "\n";
+    di << "Shape is empty\n";
     return 1;
   }
 
@@ -285,13 +276,13 @@ static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc,
   Standard_Boolean IsBound = GetMapOfAIS().IsBound2(name);
   if (IsBound) {
     // on recupere la shape dans la map des objets displayes
-    Handle(AIS_InteractiveObject) aShape = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
+    Handle(AIS_InteractiveObject) aShape = GetMapOfAIS().Find2(name);
       
     // On verifie que l'AIS InteraciveObject est bien 
     // un AIS_PlaneTrihedron
     if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==4) {
       // On downcast aShape de AIS_InteractiveObject a AIS_PlaneTrihedron
-      theAISPlaneTri = *(Handle(AIS_PlaneTrihedron)*) &aShape;
+      theAISPlaneTri = Handle(AIS_PlaneTrihedron)::DownCast (aShape);
 
       theAISPlaneTri->SetXLabel(Xlabel);
       theAISPlaneTri->SetYLabel(Ylabel);
@@ -338,7 +329,7 @@ static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc,
     theAISPlaneTri->SetYLabel(Ylabel);
     
     GetMapOfAIS().Bind ( theAISPlaneTri, name);
-    aContext->Display(theAISPlaneTri );
+    aContext->Display (theAISPlaneTri, Standard_True);
   }
   return 0;
 }
@@ -346,7 +337,7 @@ static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc,
 static Standard_Integer OCC295(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if(argc != 4) {
-    di << "Usage : " << argv[0] << " edge_result edge1 edge2" << "\n";
+    di << "Usage : " << argv[0] << " edge_result edge1 edge2\n";
     return 1;
   }
   
@@ -381,7 +372,7 @@ static Standard_Integer OCC49 (Draw_Interpretor& di, Standard_Integer argc, cons
 {
 
   if ( argc != 2 ) {
-    di << "Usage : " << argv[0] << " name" << "\n";
+    di << "Usage : " << argv[0] << " name\n";
     return 1;
   }
 
@@ -393,9 +384,9 @@ static Standard_Integer OCC49 (Draw_Interpretor& di, Standard_Integer argc, cons
   GProp_PrincipalProps Pr = G.PrincipalProperties();
   Standard_Boolean Result = Pr.HasSymmetryAxis();
   if (Result) {
-    di << "1" << "\n";
+    di << "1\n";
   } else {
-    di << "0" << "\n";
+    di << "0\n";
   }
   return 0;
 }
@@ -421,7 +412,7 @@ static Standard_Integer OCC132 (Draw_Interpretor& di, Standard_Integer argc, con
      */
 
   if ( argc != 2 ) {
-    di << "Usage : " << argv[0] << " DependentName" << "\n";
+    di << "Usage : " << argv[0] << " DependentName\n";
     return 1;
   }
 
@@ -433,8 +424,8 @@ static Standard_Integer OCC132 (Draw_Interpretor& di, Standard_Integer argc, con
       OCC_CATCH_SIGNALS
       OSD_Path Path (argv[1], SysType1);
     }
-    catch (Standard_ProgramError) {
-      di << "1" << "\n";
+    catch (Standard_ProgramError const&) {
+      di << "1\n";
       return 0;
     }
   }
@@ -444,20 +435,20 @@ static Standard_Integer OCC132 (Draw_Interpretor& di, Standard_Integer argc, con
       OCC_CATCH_SIGNALS
       OSD_Path Path (argv[1], SysType2);
     }
-    catch (Standard_ProgramError) {
-      di << "2" << "\n";
+    catch (Standard_ProgramError const&) {
+      di << "2\n";
       return 0;
     }
   }
   
-  di << "0" << "\n";
+  di << "0\n";
   return 0;
 }
 
 static Standard_Integer OCC405 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if(argc != 4) {
-    di << "Usage : " << argv[0] << " edge_result edge1 edge2; merge two edges" << "\n";
+    di << "Usage : " << argv[0] << " edge_result edge1 edge2; merge two edges\n";
     return 1;
   }
   
@@ -512,80 +503,10 @@ static Standard_Integer OCC405 (Draw_Interpretor& di, Standard_Integer argc, con
   else return 1;
 }
 
-static Standard_Integer OCC252 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
-  if(!(argc == 4 || argc == 5)) {
-    di << "Usage : " << argv[0] << " result part tool [ModeOfLimitation=0/1/2]" << "\n";
-    return 1;
-  }
-  
-  TopoDS_Shape s1 = DBRep::Get(argv[2]);
-  TopoDS_Shape s2 = DBRep::Get(argv[3]);
-  if (s1.IsNull() || s2.IsNull()) return 1;
-
-  //QAModTopOpe_ModeOfLimitation ModeOfLimitation = QAModTopOpe_Forward;
-  QANewModTopOpe_ModeOfLimitation ModeOfLimitation = QANewModTopOpe_Forward;
-  if(argc==5) {
-    Standard_Integer ModeOfLimitationInteger = Draw::Atoi(argv[4]);
-    if(!(ModeOfLimitationInteger == 0 || ModeOfLimitationInteger == 1 || ModeOfLimitationInteger == 2)) {
-      di << "Usage : " << argv[0] << " result part tool [ModeOfLimitation=0/1/2]" << "\n";
-      return 1;
-    }
-    //if (ModeOfLimitationInteger == 1) ModeOfLimitation = QAModTopOpe_Reversed;
-    //if (ModeOfLimitationInteger == 2) ModeOfLimitation = QAModTopOpe_BothParts;
-    if (ModeOfLimitationInteger == 1) ModeOfLimitation = QANewModTopOpe_Reversed;
-    if (ModeOfLimitationInteger == 2) ModeOfLimitation = QANewModTopOpe_BothParts;
-  }
-
-  //TopoDS_Shape res = QAModTopOpe_Limitation(s1,s2,ModeOfLimitation);
-  TopoDS_Shape res = QANewModTopOpe_Limitation(s1,s2,ModeOfLimitation);
-  if (res.IsNull()) {
-    di << "Error : result is null" << "\n";
-    return 1;
-  }
-
-  DBRep::Set(argv[1],res);
-
-  return 0;
-}
-
-static Standard_Integer OCC307 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
-  if(!(argc == 4 || argc == 5)) {
-    di << "Usage : " << argv[0] << " result part tool [AllowCutting=0/1]" << "\n";
-    return 1;
-  }
-  
-  TopoDS_Shape s1 = DBRep::Get(argv[2]);
-  TopoDS_Shape s2 = DBRep::Get(argv[3]);
-  if (s1.IsNull() || s2.IsNull()) return 1;
-
-  Standard_Boolean AllowCutting = Standard_False;
-  if(argc==5) {
-    Standard_Integer AllowCuttingInteger = Draw::Atoi(argv[4]);
-    if(!( AllowCuttingInteger == 0 || AllowCuttingInteger == 1)) {
-      di << "Usage : " << argv[0] << " result part tool [AllowCutting=0/1]" << "\n";
-      return 1;
-    }
-    if (AllowCuttingInteger == 1) AllowCutting = Standard_True;
-  }
-
-  //TopoDS_Shape res = QAModTopOpe_Glue(s1,s2,AllowCutting);
-  TopoDS_Shape res = QANewModTopOpe_Glue(s1,s2,AllowCutting);
-  if (res.IsNull()) {
-    di << "Error : result is null" << "\n";
-    return 1;
-  }
-
-  DBRep::Set(argv[1],res);
-
-  return 0;
-}
-
 static Standard_Integer OCC395 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if(argc != 4) {
-    di << "Usage : " << argv[0] << " edge_result edge1 edge2" << "\n";
+    di << "Usage : " << argv[0] << " edge_result edge1 edge2\n";
     return 1;
   }
   //TCollection_AsciiString fnom(a[1]);
@@ -632,7 +553,7 @@ static Standard_Integer OCC395 (Draw_Interpretor& di, Standard_Integer argc, con
 static Standard_Integer OCC394 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if(argc < 3) {
-    di << "Usage : " << argv[0] << " edge_result edge [tol [mode [tolang]]]" << "\n";
+    di << "Usage : " << argv[0] << " edge_result edge [tol [mode [tolang]]]\n";
     return 1;
   }
    TopoDS_Shape Sh = DBRep::Get(argv[2]);
@@ -665,22 +586,20 @@ static Standard_Integer OCC394 (Draw_Interpretor& di, Standard_Integer argc, con
   aSfwr->CheckSmallEdges(theSmallEdges,theEdgeToFaces,theFaceWithSmall, theMultyEdges);
   aSfwr->MergeSmallEdges (theSmallEdges,theEdgeToFaces,theFaceWithSmall, theMultyEdges, aModeDrop,tolang);
    //aSfwr->FixSmallEdges(); 
-  TopoDS_Shape resShape =  aSfwr->Shape();;
+  TopoDS_Shape resShape = aSfwr->Shape();
   DBRep::Set ( argv[1], resShape );
   return 0;
 }
 
 static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
-  //Handle(AIS_InteractiveContext)   context= ViewerTest_Tool::MakeContext ("OCC301");
-  //ViewerTest_Tool::InitViewerTest (context);
   Handle(AIS_InteractiveContext) context = ViewerTest::GetAISContext();
   if(context.IsNull()) {
     di << "use 'vinit' command before " << argv[0] << "\n";
     return 1;
   }
   if ( argc != 3 ) {
-    di << "Usage : " << argv[0] << " ArcRadius ArrowSize" << "\n";
+    di << "Usage : " << argv[0] << " ArcRadius ArrowSize\n";
     return 1;
   }
 
@@ -694,14 +613,14 @@ static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, con
   TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(p1, p2);
   TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(p2, p3);
 
-  context->Display(new AIS_Shape(E1)); 
-  context->Display(new AIS_Shape(E2)); 
+  context->Display (new AIS_Shape(E1), Standard_False);
+  context->Display (new AIS_Shape(E2), Standard_True);
 
   gp_Pnt plnpt(0, 0, 0);
   gp_Dir plndir(0, 0, 1);
   Handle(Geom_Plane) pln = new Geom_Plane(plnpt,plndir);
 
-  Handle(AIS_AngleDimension) anAngleDimension = new AIS_AngleDimension (p1.Mirrored (p2), p2, p3);
+  Handle(PrsDim_AngleDimension) anAngleDimension = new PrsDim_AngleDimension (p1.Mirrored (p2), p2, p3);
 
   Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect;
   anAspect->MakeArrows3d (Standard_True);
@@ -715,91 +634,10 @@ static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, con
   return 0;
 }
 
-static Standard_Integer OCC294 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
-  if(argc < 4) {
-    di << "Usage : " << argv[0] << " shape_result shape edge" << "\n";
-    return 1;
-  }
-  TopoDS_Shape Sh1 = DBRep::Get(argv[2]);
-  TopoDS_Shape Sh2 = DBRep::Get(argv[3]);
-  if(Sh1.IsNull() || Sh2.IsNull()) return 1;
-  if(Sh2.ShapeType() != TopAbs_EDGE) return 1;
-
-  //QAModTopOpe_ReShaper ReShaper(Sh1);
-  QANewModTopOpe_ReShaper ReShaper(Sh1);
-  ReShaper.Remove(Sh2);
-  const TopoDS_Shape& ResultShape = ReShaper.GetResult();
-  if(ResultShape.IsNull()) {
-    di << "Faulty " << argv[0] << " : " << argv[1] << " - shape_result is null" << "\n";
-    return 1;
-  }
-
-  DBRep::Set ( argv[1], ResultShape);
-  return 0;
-}
-
-static Standard_Integer OCC60 (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;
-  }
-  if(argc < 5) {
-    di << "Usage : " << argv[0] << " xmin ymin xmax ymax; selection window" << "\n";
-    return 1;
-  }
-
-  Standard_Integer xmin = Draw::Atoi(argv[1]);
-  Standard_Integer ymin = Draw::Atoi(argv[2]);
-  Standard_Integer xmax = Draw::Atoi(argv[3]);
-  Standard_Integer ymax = Draw::Atoi(argv[4]);
-
-  Handle(V3d_View) V3dView = ViewerTest::CurrentView();
-
-  Handle(ViewerTest_EventManager) EM = ViewerTest::CurrentEventManager();
-  EM->Select(xmin,ymin,xmax,ymax);
-
-  return 0;
-}
-
-static Standard_Integer OCC70 (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;
-  }
-  if(argc < 7) {
-    di << "Usage : " << argv[0] << " x1 y1 x2 y2 x3 y3 [x y ...]; polygon of selection" << "\n";
-    return 1;
-  }
-  if (((argc - 1) % 2) != 0) {
-    di << "Usage : " << argv[0] << " x1 y1 x2 y2 x3 y3 [x y ...]; polygon of selection" << "\n";
-    return 1;
-  }
-
-  Standard_Integer i, j, np = (argc-1) / 2;
-  TColgp_Array1OfPnt2d Polyline(1,np);
-  j = 1;
-  for (i = 1; i <= np; i++) {
-    Polyline(i) = gp_Pnt2d(Draw::Atof(argv[j]), Draw::Atof(argv[j+1]));
-    j += 2;
-  }
-
-  Handle(V3d_View) V3dView = ViewerTest::CurrentView();
-
-  aContext->Select(Polyline,V3dView);
-  aContext->UpdateCurrentViewer();
-
-  return 0;
-}
-
 static Standard_Integer OCC261 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if(argc != 2) {
-    di << "Usage : " << argv[0] << " Doc" << "\n";
+    di << "Usage : " << argv[0] << " Doc\n";
     return 1;
   }
 
@@ -815,28 +653,29 @@ static Standard_Integer OCC261 (Draw_Interpretor& di, Standard_Integer argc, con
 static Standard_Integer OCC710 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if(argc != 2) {
-    di << "Usage : " << argv[0] << " path" << "\n";
+    di << "Usage : " << argv[0] << " path\n";
   }
 
   TCollection_AsciiString in(argv[1]);
   OSD_File* aFile = new OSD_File(in);
   Standard_Boolean anExists = aFile->Exists();
   if(anExists == Standard_True) 
-    di << "1" << "\n";
+    di << "1\n";
   else
-    di << "0" << "\n";
+    di << "0\n";
   return 0;
 }
 
 #include <ShapeFix_Shell.hxx>
+#include <AIS_InteractiveObject.hxx>
 static Standard_Integer OCC904 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
 {
   if(argc != 4) {
-    di << "Usage : " << argv[0] << " result shape nonmanifoldmode(0/1)" << "\n";
+    di << "Usage : " << argv[0] << " result shape nonmanifoldmode(0/1)\n";
   }
   TopoDS_Shape S = DBRep::Get(argv[2]);
   if (S.IsNull() || S.ShapeType() != TopAbs_SHELL) {
-    di << " Shape is null" << "\n";
+    di << " Shape is null\n";
     return 1;
   }
   Standard_Boolean nonmanifmode = (Draw::Atoi(argv[3]) != 0);
@@ -859,14 +698,9 @@ void QABugs::Commands_16(Draw_Interpretor& theCommands) {
   theCommands.Add ("OCC49", "OCC49 name", __FILE__, OCC49, group);
   theCommands.Add ("OCC132", "OCC132 DependentName", __FILE__, OCC132, group);
   theCommands.Add ("OCC405", "OCC405 edge_result edge1 edge2; merge two edges", __FILE__, OCC405, group);
-  theCommands.Add ("OCC252", "OCC252 result part tool [ModeOfLimitation=0/1/2]", __FILE__, OCC252, group);
-  theCommands.Add ("OCC307", "OCC307 result part tool [AllowCutting=0/1]", __FILE__, OCC307, group);
   theCommands.Add ("OCC395", "OCC395 edge_result edge1 edge2", __FILE__, OCC395, group);
   theCommands.Add ("OCC394", "OCC394 edge_result edge [tol [mode [tolang]]]", __FILE__, OCC394, group);
   theCommands.Add ("OCC301", "OCC301 ArcRadius ArrowSize", __FILE__, OCC301, group);
-  theCommands.Add ("OCC294", "OCC294 shape_result shape edge", __FILE__, OCC294, group);
-  theCommands.Add ("OCC60", "OCC60 xmin ymin xmax ymax; selection window", __FILE__, OCC60, group);
-  theCommands.Add ("OCC70", "OCC70 x1 y1 x2 y2 x3 y3 [x y ...]; polygon of selection", __FILE__, OCC70, group);
   theCommands.Add ("OCC261", "OCC261 Doc", __FILE__, OCC261, group);
   theCommands.Add ("OCC710", "OCC710 path", __FILE__, OCC710, group);
   theCommands.Add ("OCC904", "OCC904 result shape nonmanifoldmode(0/1)", __FILE__, OCC904, group);