X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_STEPExport.cpp;h=c9e9830c1829b293d7b67beac4db593e9b902fa8;hb=f0cec241aae9ca16d86e166f45cb5c4987d2c792;hp=5cc71b056557a402f0ce7a83d08e1ec0b5f060e1;hpb=f565325d5c15b590237ae70c1ac6e57b448579ad;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp index 5cc71b056..c9e9830c1 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp @@ -1,28 +1,38 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D +// File: GEOMALGOAPI_STEPExport.cpp +// Created: May 14, 2015 +// Author: Sergey POKHODENKO + #include +#include "GeomAlgoAPI_Tools.h" + +#include + // OOCT includes #include #include #include -namespace STEPExport { - -bool Export(const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName, - const TopoDS_Shape& theShape, - TCollection_AsciiString& theError, - const TDF_Label& theShapeLabel) +bool STEPExport(const std::string& theFileName, + const std::string& theFormatName, + const std::shared_ptr& theShape, + std::string& theError) { #ifdef _DEBUG - std::cout << "Export STEP into file " << theFileName.ToCString() << std::endl; + std::cout << "Export STEP into file " << theFileName << std::endl; #endif + if (!theShape.get()) { + theError = "STEP Export failed: An invalid argument"; + return false; + } + try { -// // Set "C" numeric locale to save numbers correctly -// Kernel_Utils::Localizer loc; + // Set "C" numeric locale to save numbers correctly + GeomAlgoAPI_Tools::Localizer loc; IFSelect_ReturnStatus status ; //VRV: OCC 4.0 migration @@ -30,10 +40,10 @@ bool Export(const TCollection_AsciiString& theFileName, Interface_Static::SetCVal("xstep.cascade.unit","M"); Interface_Static::SetCVal("write.step.unit", "M"); Interface_Static::SetIVal("write.step.nonmanifold", 1); - status = aWriter.Transfer( theShape, STEPControl_AsIs ); + status = aWriter.Transfer(theShape->impl(), STEPControl_AsIs); //VRV: OCC 4.0 migration if( status == IFSelect_RetDone ) - status = aWriter.Write( theFileName.ToCString() ); + status = aWriter.Write(theFileName.c_str()); // Return previous locale if( status == IFSelect_RetDone ) @@ -45,5 +55,3 @@ bool Export(const TCollection_AsciiString& theFileName, } return false; } - -} // namespace STEPExport