Salome HOME
#Initial implementation of support of dump and save to hdf in case SHAPER module...
[modules/shaper.git] / src / InitializationPlugin / InitializationPlugin_EvalListener.cpp
index 79993dc4d6b651db0703a0e1ece76cb898ea46db..6e5e7d29c10a3589d4ba72945f7e90f75dcdca96 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <pyconfig.h>
 std::string toStdString(double theValue)
 {
   std::ostringstream sstream;
-  sstream << theValue;
-  size_t aPos = sstream.str().find(".");
-  std::string aPnt = "";
-  if (aPos == std::string::npos)
-    aPnt = ".";
-  return sstream.str() + aPnt;
+  // write value in scientific format with 16 digits,
+  // thus, not check the dot position
+  sstream.precision(16);
+  sstream << std::scientific << theValue;
+  return sstream.str();
 }
 
 std::set<std::string> toSet(const std::list<std::string>& theContainer)
@@ -221,3 +219,8 @@ void InitializationPlugin_EvalListener::processEvaluationEvent(
                                     aCalculatedValue[1]);
   }
 }
+
+void InitializationPlugin_EvalListener::initDataModel()
+{
+  myInterp->runString("salome_iapp.register_module_in_study(\"Shaper\")");
+}