0023047: Behaviour of XDE sample is non-stable
[occt.git] / src / XDEDRAW / XDEDRAW_Shapes.cxx
index 06c2427..9a547f7 100755 (executable)
@@ -143,8 +143,9 @@ static Standard_Integer getShape (Draw_Interpretor& di, Standard_Integer argc, c
 
 static Standard_Integer removeShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
 {
-  if (argc!=3) {
-    di<<"Use: "<<argv[0]<<" DocName Label"<<"\n";
+  if (argc != 3 && argc != 4)
+  {
+    di<<"Use: "<<argv[0]<<" DocName Label [int removeCompletely (1/0)]"<<"\n";
     return 1;
   }
   Handle(TDocStd_Document) Doc;   
@@ -158,7 +159,10 @@ static Standard_Integer removeShape (Draw_Interpretor& di, Standard_Integer argc
 //  XCAFDoc_ShapeTool myAssembly;
 //  myAssembly.Init(Doc);
   Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
-  myAssembly->RemoveShape(aLabel);
+  Standard_Boolean removeCompletely = Standard_True;
+  if ( argc == 4 && atoi(argv[3]) == 0 ) 
+    removeCompletely = Standard_False;
+  myAssembly->RemoveShape(aLabel, removeCompletely);
   
   return 0;
 }