+void Prettify(TCollection_AsciiString& theScript)
+{
+ TCollection_AsciiString output;
+ static std::list<TCollection_AsciiString> ToRemove;
+ if (ToRemove.empty()) {
+ ToRemove.push_back("geompy.SubShapeAllIDs");
+ ToRemove.push_back("geompy.SubShapeAllSortedCentresIDs");
+ ToRemove.push_back("geompy.SubShapeAllSortedIDs");
+ ToRemove.push_back("geompy.GetFreeFacesIDs");
+ ToRemove.push_back("geompy.GetShapesOnBoxIDs");
+ ToRemove.push_back("geompy.GetShapesOnShapeIDs");
+ ToRemove.push_back("geompy.GetShapesOnPlaneIDs");
+ ToRemove.push_back("geompy.GetShapesOnPlaneWithLocationIDs");
+ ToRemove.push_back("geompy.GetShapesOnCylinderIDs");
+ ToRemove.push_back("geompy.GetShapesOnCylinderWithLocationIDs");
+ ToRemove.push_back("geompy.GetShapesOnSphereIDs");
+ ToRemove.push_back("geompy.GetShapesOnQuadrangleIDs");
+ ToRemove.push_back("geompy.GetSameIDs");
+ }
+
+ int start = 1;
+ while (start <= theScript.Length()) {
+ int end = theScript.Location("\n", start, theScript.Length());
+ if (end == -1) end = theScript.Length();
+ TCollection_AsciiString line = theScript.SubString(start, end);
+ bool found = false;
+ for (std::list<TCollection_AsciiString>::const_iterator it = ToRemove.begin(); it != ToRemove.end() && !found; ++it)
+ found = line.Search( *it ) != -1;
+ if (!found)
+ output += line;
+ start = end + 1;
+ }
+ theScript = output;
+
+ //OK @@@@@@@@@@@@@@@@@@@@@@@@@@@
+}
+