-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2023 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "STEPPlugin_IImport.hxx"
// KERNEL includes
+#include <Basics_DirUtils.hxx>
#include <utilities.h>
// GEOM includes
* Constructor
*/
//=============================================================================
-STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "STEPPlugin_IOperations::STEPPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( STEPPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
}
//Make a Python command
+ std::string convFileName = Kernel_Utils::BackSlashToSlash(theFileName.ToCString());
GEOM::TPythonDump(aFunction) << "geompy.ExportSTEP(" << theOriginal << ", \""
- << theFileName.ToCString() << "\", " << theUnit << " )";
+ << convFileName.c_str() << "\", " << theUnit << " )";
SetErrorCode(OK);
}
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
}
aSeq->Append(anImported);
- // Greate material groups.
+ // Create material groups.
MakeMaterialGroups( anImported, aSeq );
}
catch( Standard_Failure& aFail ) {
//Make a Python command
GEOM::TPythonDump pd (aFunction);
- pd << aSeq << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\", ";
+ std::string convFileName = Kernel_Utils::BackSlashToSlash( theFileName.ToCString() );
+ pd << aSeq << " = geompy.ImportSTEP(\"" << convFileName.c_str() << "\", ";
pd << (theIsIgnoreUnits ? "True" : "False");
pd << ", " << (IsCreateAssemblies ? "True" : "False");
pd << ")";