From: dmv Date: Tue, 27 Oct 2009 13:43:20 +0000 (+0000) Subject: 0017002: EDF 578 GEOM : Problem when trying to import some ACIS and IGES files X-Git-Tag: RELIQUAT_5x_30102009~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e59444bf0e160160843b05d6db738de430cb7c31;p=modules%2Fgeom.git 0017002: EDF 578 GEOM : Problem when trying to import some ACIS and IGES files --- diff --git a/src/IGESImport/IGESImport.cxx b/src/IGESImport/IGESImport.cxx index 3b28d2009..3b272ac56 100644 --- a/src/IGESImport/IGESImport.cxx +++ b/src/IGESImport/IGESImport.cxx @@ -71,6 +71,10 @@ IGESIMPORT_EXPORT TCollection_AsciiString& theError, const TDF_Label&) { + // Set "C" numeric locale to save numbers correctly + std::string aCurLocale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, "C"); + IGESControl_Reader aReader; TopoDS_Shape aResShape; Interface_Static::SetCVal("xstep.cascade.unit","M"); @@ -99,6 +103,8 @@ IGESIMPORT_EXPORT TopoDS_Vertex V; B.MakeVertex(V,P,1.e-7); aResShape = V; + // Return previous locale before return from import + setlocale(LC_NUMERIC, aCurLocale.data()); return aResShape; } if( theFormatName == "IGES_SCALE" ) { @@ -149,6 +155,8 @@ IGESIMPORT_EXPORT theError = aFail->GetMessageString(); aResShape.Nullify(); } + // Return previous locale + setlocale(LC_NUMERIC, aCurLocale.data()); return aResShape; } } diff --git a/src/STEPImport/STEPImport.cxx b/src/STEPImport/STEPImport.cxx index f021d3a79..dc91b95eb 100644 --- a/src/STEPImport/STEPImport.cxx +++ b/src/STEPImport/STEPImport.cxx @@ -74,6 +74,9 @@ STEPIMPORT_EXPORT const TDF_Label&) { MESSAGE("Import STEP model from file " << theFileName.ToCString()); + // Set "C" numeric locale to save numbers correctly + std::string aCurLocale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, "C"); TopoDS_Shape aResShape; //VRV: OCC 4.0 migration STEPControl_Reader aReader; @@ -152,6 +155,8 @@ STEPIMPORT_EXPORT theError = aFail->GetMessageString(); aResShape.Nullify(); } + // Return previous locale + setlocale(LC_NUMERIC, aCurLocale.data()); return aResShape; } }