+bool checkPythonDump(const checkDumpType theCheckType)
+{
+ static const std::string anErrorByNaming("checkPythonDump by naming");
+ static const std::string anErrorByGeometry("checkPythonDump by geometry");
+ static const std::string anErrorByWeak("checkPythonDump by weak naming");
+
+ static char aFileForNamingDump[] = "./check_dump.py";
+ static char aFileForGeometryDump[] = "./check_dump_geo.py";
+ static char aFileForWeakDump[] = "./check_dump_weak.py";
+
+ SessionPtr aSession = ModelAPI_Session::get();
+ // dump with the specified types
+ char* aFileName = theCheckType == CHECK_GEOMETRICAL ? aFileForGeometryDump :
+ (theCheckType == CHECK_WEAK ? aFileForWeakDump : aFileForNamingDump);
+ if (!dumpToPython(aSession, aFileName, theCheckType, anErrorByNaming))
+ return false;
+
+ // map from document name to feature name to feature data
+ std::map<std::string, std::map<std::string, ModelHighAPI_FeatureStore> > aStore;
+ std::string anError = storeFeatures(
+ aSession->moduleDocument()->kind(), aSession->moduleDocument(), aStore, false);
+ if (!anError.empty()) {
+ Events_InfoMessage anErrorMsg(std::string("checkPythonDump"), anError);
+ anErrorMsg.send();
+ return false;
+ }
+
+ bool isOk = true;
+ if (theCheckType & CHECK_NAMING) {
+ // check dump with the selection by names
+ isOk = checkDump(aSession, aFileForNamingDump, aStore, anErrorByNaming);
+ }
+ if (theCheckType & CHECK_GEOMETRICAL) {
+ // check dump with the selection by geometry
+ isOk = isOk && checkDump(aSession, aFileForGeometryDump, aStore, anErrorByGeometry);
+ }
+ if (theCheckType & CHECK_WEAK) {
+ isOk = isOk && checkDump(aSession, aFileForWeakDump, aStore, anErrorByWeak);
+ }
+
+ return isOk;
+}
+