From 2cb4971640cc6aff73f3070566de30b224e9b262 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 21 Oct 2009 15:09:56 +0000 Subject: [PATCH] Issue 0020461: EDF 1102 GHS3DPLUGIN: Bad detection of volumes with Ghs3d mesh Additional fix for locale --- src/GHS3DPlugin_GHS3D.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin_GHS3D.cxx index aa92530..28f1022 100644 --- a/src/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin_GHS3D.cxx @@ -105,6 +105,22 @@ static void removeFile( const TCollection_AsciiString& fileName ) } } +class Localizer +{ +public: + Localizer() + { + myCurLocale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, "C"); + } + ~Localizer() + { + setlocale(LC_NUMERIC, myCurLocale.c_str()); + } +private: + std::string myCurLocale; +}; + //============================================================================= /*! * @@ -663,6 +679,7 @@ static bool readResultFile(const int fileOpen, map & theGhs3dIdToNodeMap, bool toMeshHoles) { + Localizer loc; struct stat status; size_t length; @@ -902,6 +919,7 @@ static bool readResultFile(const int fileOpen, TopoDS_Shape aSolid, vector & theNodeByGhs3dId) { + Localizer loc; struct stat status; size_t length; -- 2.39.2