Salome HOME
updated copyright message
[modules/geom.git] / src / DlgRef / DlgRef.cxx
index a7a551f602bb42750e1b5d7d06ecf46d8b9f64ae..8a19c0b29d13d0d60ca2a57258bb95325a912538 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 // File   : DlgRef.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 
 #include "DlgRef.h"
 
+//////////////////////////////////////////
+// DlgRef_1Check1Spin1Check
+//////////////////////////////////////////
+
+DlgRef_1Check1Spin1Check::DlgRef_1Check1Spin1Check( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+  setupUi( this );
+}
+
+DlgRef_1Check1Spin1Check::~DlgRef_1Check1Spin1Check()
+{
+}
+
 //////////////////////////////////////////
 // DlgRef_1List1Spin1Btn
 //////////////////////////////////////////
@@ -455,6 +470,20 @@ DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push()
 {
 }
 
+//////////////////////////////////////////
+// DlgRef_2Sel3Spin1Check
+//////////////////////////////////////////
+
+DlgRef_2Sel3Spin1Check::DlgRef_2Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+  setupUi( this );
+}
+
+DlgRef_2Sel3Spin1Check::~DlgRef_2Sel3Spin1Check()
+{
+}
+
 //////////////////////////////////////////
 // DlgRef_2Sel3Spin2Rb
 //////////////////////////////////////////
@@ -741,6 +770,20 @@ DlgRef_3Spin1Check::~DlgRef_3Spin1Check()
 {
 }
 
+//////////////////////////////////////////
+// DlgRef_3Spin1CheckCyl
+//////////////////////////////////////////
+
+DlgRef_3Spin1CheckCyl::DlgRef_3Spin1CheckCyl( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+  setupUi( this );
+}
+
+DlgRef_3Spin1CheckCyl::~DlgRef_3Spin1CheckCyl()
+{
+}
+
 //////////////////////////////////////////
 // DlgRef_3Spin
 //////////////////////////////////////////
@@ -855,20 +898,6 @@ DlgRef_6Sel::~DlgRef_6Sel()
 {
 }
 
-//////////////////////////////////////////
-// DlgRef_Skeleton
-//////////////////////////////////////////
-
-DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f )
-: QWidget( parent, f )
-{
-  setupUi( this );
-}
-
-DlgRef_Skeleton::~DlgRef_Skeleton()
-{
-}
-
 //////////////////////////////////////////
 // Utility functions
 //////////////////////////////////////////
@@ -880,12 +909,14 @@ QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
   if ( qAbs(theValue) < prec )
     return "0";
 
-  QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) );
+  QLocale loc = QLocale(); // default locale
+  if ( loc.name() == "C" ) loc.setNumberOptions( QLocale::OmitGroupSeparator );
+  QString aRes = loc.toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) );
 
   if ( prec > 0 ) {
     int p = 0;
     while ( p < thePrecision ) {
-      QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) );
+      QString aRes = loc.toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) );
       double v = aRes.toDouble();
       double err = qAbs( theValue - v );
       if ( err > 0 && err <= prec )
@@ -895,8 +926,8 @@ QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
 
   // remove trailing zeroes
 
-  QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( QLocale().exponential().toLower(), 
-                                                      QLocale().exponential().toUpper() ) );
+  QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( loc.exponential().toLower(), 
+                                                       loc.exponential().toUpper() ) );
 
   int idx = aRes.indexOf( expre );
   QString aResExp = "";
@@ -905,7 +936,7 @@ QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
     aRes = aRes.left( idx );
   }
 
-  if ( aRes.contains( QLocale().decimalPoint() ) )
+  if ( aRes.contains( loc.decimalPoint() ) )
     aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) );
 
   return aRes == "-0" ? QString( "0" ) : aRes + aResExp;