SET(PROJECT_HEADERS
GeomAlgoAPI.h
+ GeomAlgoAPI_Tools.h
GeomAlgoAPI_CompoundBuilder.h
GeomAlgoAPI_FaceBuilder.h
GeomAlgoAPI_EdgeBuilder.h
)
SET(PROJECT_SOURCES
+ GeomAlgoAPI_Tools.cpp
GeomAlgoAPI_CompoundBuilder.cpp
GeomAlgoAPI_FaceBuilder.cpp
GeomAlgoAPI_EdgeBuilder.cpp
#include <GeomAlgoAPI_BREPExport.h>
+#include "GeomAlgoAPI_Tools.h"
+
#include <BRepTools.hxx>
#include <BRep_Builder.hxx>
#ifdef _DEBUG
std::cout << "Export BREP into file " << theFileName << std::endl;
#endif
+
+ // Set "C" numeric locale to save numbers correctly
+ GeomAlgoAPI_Tools::Localizer loc;
+
if ( !BRepTools::Write( theShape, theFileName.ToCString() ) ) {
theError = "BREP Export failed";
return false;
#include <GeomAlgoAPI_IGESExport.h>
-//// KERNEL includes
-//#include <utilities.h>
-//#include <Basics_Utils.hxx>
+#include "GeomAlgoAPI_Tools.h"
// OOCT includes
#include <IGESControl_Controller.hxx>
aBrepMode = aKind;
}
-// // Set "C" numeric locale to save numbers correctly
-// Kernel_Utils::Localizer loc;
+ // Set "C" numeric locale to save numbers correctly
+ GeomAlgoAPI_Tools::Localizer loc;
// initialize writer
IGESControl_Controller::Init();
#include <GeomAlgoAPI_STEPExport.h>
+#include "GeomAlgoAPI_Tools.h"
+
// OOCT includes
#include <IFSelect_ReturnStatus.hxx>
#include <STEPControl_Writer.hxx>
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
--- /dev/null
+/*
+ * GeomAlgoAPI_Tools.cpp
+ *
+ * Created on: May 18, 2015
+ * Author: spo
+ */
+
+#include "GeomAlgoAPI_Tools.h"
+
+#include <clocale>
+
+using namespace GeomAlgoAPI_Tools;
+
+Localizer::Localizer()
+{
+ myCurLocale = std::setlocale(LC_NUMERIC, 0);
+ std::setlocale(LC_NUMERIC, "C");
+}
+
+Localizer::~Localizer()
+{
+ std::setlocale(LC_NUMERIC, myCurLocale.c_str());
+}
--- /dev/null
+/*
+ * GeomAlgoAPI_Tools.h
+ *
+ * Created on: May 18, 2015
+ * Author: spo
+ */
+
+#ifndef GEOMALGOAPI_TOOLS_H_
+#define GEOMALGOAPI_TOOLS_H_
+
+#include <GeomAlgoAPI.h>
+
+#include <string>
+
+namespace GeomAlgoAPI_Tools {
+
+class GEOMALGOAPI_EXPORT Localizer
+{
+public:
+ Localizer();
+ ~Localizer();
+private:
+ std::string myCurLocale;
+};
+
+} // GeomAlgoAPI_Tools
+
+#endif /* GEOMALGOAPI_TOOLS_H_ */