]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx
Salome HOME
0021672: [CEA 565] Dump Study from script
[modules/geom.git] / src / RepairGUI / RepairGUI_ShapeProcessDlg.cxx
index 1d29ecb299304de021e2597031facc29407175e7..81321e9e0dc758793e0803734b0c384345d11c7d 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -23,7 +23,7 @@
 // GEOM GEOMGUI : GUI for Geometry component
 // File   : RepairGUI_ShapeProcessDlg.cxx
 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
-//
+
 #include "RepairGUI_ShapeProcessDlg.h"
 
 #include <DlgRef.h>
@@ -41,6 +41,8 @@
 #include <SALOME_ListIteratorOfListIO.hxx>
 #include <SALOME_ListIO.hxx>
 
+#include <Basics_Utils.hxx>
+
 #include <TCollection_AsciiString.hxx>
 #include <TColStd_MapOfInteger.hxx>
 
@@ -450,7 +452,7 @@ void RepairGUI_ShapeProcessDlg::reset()
 const char* get_convert( const char* theParam, const QString& theValue )
 {
   if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
-    double doubleValue = theValue.toDouble() * PI / 180;
+    double doubleValue = theValue.toDouble() * M_PI / 180.;
     return CORBA::string_dup( QString::number( doubleValue ).toLatin1().constData() );
   }
   return CORBA::string_dup( theValue.toLatin1().constData() );
@@ -460,14 +462,14 @@ const char* get_convert( const char* theParam, const QString& theValue )
 // function : set_convert
 // purpose  : conversion of angle values to degrees (non-angle values are not converted)
 //=================================================================================
-const char* set_convert( const char* theParam, const char* theValue )
+QString set_convert( const char* theParam, const char* theValue )
 {
   if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
-    double doubleValue = atof( theValue ) * 180 / PI;
-    TCollection_AsciiString str( doubleValue );
-    return CORBA::string_dup( str.ToCString() );
+    Kernel_Utils::Localizer loc;
+    double doubleValue = atof( theValue ) * 180. / M_PI;
+    return QString::number( doubleValue );
   }
-  return CORBA::string_dup( theValue );
+  return QString( theValue );
 }
 
 //=================================================================================
@@ -499,8 +501,7 @@ void RepairGUI_ShapeProcessDlg::loadDefaults()
 
     for ( int j = 0; j < aParams->length(); j++ ) {
       QWidget* aCtrl = getControl( (const char*)aParams[j] );
-      const char* aValue = set_convert( (const char*)aParams[j], aValues[j] );
-      setValue( aCtrl, aValue );
+      setValue( aCtrl, set_convert( (const char*)aParams[j], aValues[j] ) );
     }
   }
 }