#include <TDF_Tool.hxx>
#include "GEOM_Function.hxx"
+#include "GEOM_PythonDump.hxx"
#include "GEOMImpl_CopyDriver.hxx"
#include "GEOMImpl_ExportDriver.hxx"
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(aCopy->GetEntry(), anEntry);
- aDescr += (anEntry+" = IInsertOperations.MakeCopy(");
- TDF_Tool::Entry(theOriginal->GetEntry(), anEntry);
- aDescr += (anEntry+")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeCopy(" << theOriginal << ")";
SetErrorCode(OK);
return aCopy;
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- aDescr = "IInsertOperations.Export(";
- TDF_Tool::Entry(theOriginal->GetEntry(), anEntry);
- aDescr += (anEntry + ", ");
- aDescr += (TCollection_AsciiString(aFileName) + ", ");
- aDescr += (TCollection_AsciiString(aFormatName) + ")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << "geompy.Export(" << theOriginal
+ << ", \"" << theFileName << "\", \"" << theFormatName << "\")";
SetErrorCode(OK);
}
}
//Make a Python command
- TCollection_AsciiString anEntry, aDescr;
- TDF_Tool::Entry(result->GetEntry(), anEntry);
- aDescr += (anEntry + " = IInsertOperations.Import(");
- aDescr += (TCollection_AsciiString(aFileName) + ", ");
- aDescr += (TCollection_AsciiString(aFormatName) + ")");
-
- aFunction->SetDescription(aDescr);
+ GEOM::TPythonDump(aFunction) << result << " = geompy.Import(\""
+ << theFileName << "\", \"" << theFormatName << "\")";
SetErrorCode(OK);
return result;
#else
aUserResDir += "/.salome/resources";
#endif
- myResMgr = new Resource_Manager ("ImportExport", aResDir, aUserResDir, Standard_True);
- }
+ myResMgr = new Resource_Manager ("ImportExport", aResDir, aUserResDir, Standard_False);
- if (myResMgr->Find("Import") || myResMgr->Find("Export"))
- return Standard_True;
+ if (!myResMgr->Find("Import") && !myResMgr->Find("Export")) {
+ // instead of complains in Resource_Manager
+ INFOS("No valid file \"ImportExport\" found in " << aResDir.ToCString() <<
+ " and in " << aUserResDir.ToCString() );
+ }
+ }
- return Standard_False;
+ return ( myResMgr->Find("Import") || myResMgr->Find("Export") );
}