X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_STEPExport.cpp;h=c9e9830c1829b293d7b67beac4db593e9b902fa8;hb=3d28bcbab2f3ed0e40295e64f4e836caebc19fca;hp=6ec05e477e284da9903293730fdf84a2bf3b97c1;hpb=015aa771f0bb34d556efcf94ae51e6cdef5c8047;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp index 6ec05e477..c9e9830c1 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp @@ -8,22 +8,27 @@ #include "GeomAlgoAPI_Tools.h" +#include + // OOCT includes #include #include #include -namespace STEPExport { - -bool Export(const std::string& theFileName, - const std::string& theFormatName, - const TopoDS_Shape& theShape, - std::string& theError) +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 << std::endl; #endif + if (!theShape.get()) { + theError = "STEP Export failed: An invalid argument"; + return false; + } + try { // Set "C" numeric locale to save numbers correctly @@ -35,10 +40,10 @@ bool Export(const std::string& 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.c_str() ); + status = aWriter.Write(theFileName.c_str()); // Return previous locale if( status == IFSelect_RetDone ) @@ -50,5 +55,3 @@ bool Export(const std::string& theFileName, } return false; } - -} // namespace STEPExport