return 0;
}
+static Standard_Integer XAutoNaming (Draw_Interpretor& theDI,
+ Standard_Integer theNbArgs,
+ const char** theArgVec)
+{
+ if (theNbArgs != 2 && theNbArgs != 3)
+ {
+ theDI << "Syntax error: wrong number of arguments";
+ return 1;
+ }
+
+ Handle(TDocStd_Document) aDoc;
+ DDocStd::GetDocument (theArgVec[1], aDoc);
+ if (aDoc.IsNull())
+ {
+ theDI << "Syntax error: '" << theArgVec[1] << "' is not a document";
+ return 1;
+ }
+
+ Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main());
+ if (theNbArgs == 2)
+ {
+ theDI << (aShapeTool->AutoNaming() ? "1" : "0");
+ return 0;
+ }
+
+ bool toEnable = true;
+ if (!Draw::ParseOnOff (theArgVec[2], toEnable))
+ {
+ theDI << "Syntax error at '" << theArgVec[2] << "'";
+ return 1;
+ }
+
+ aShapeTool->SetAutoNaming (toEnable);
+ return 0;
+}
+
//=======================================================================
//function : InitCommands
//purpose :
di.Add("XGetProperties", "Doc Label \t: prints named properties assigned to the Label",
__FILE__, XGetProperties, g);
+
+ di.Add ("XAutoNaming","Doc [0|1]\t: Disable/enable autonaming to Document",
+ __FILE__, XAutoNaming, g);
}