Salome HOME
updated copyright message
[modules/geom.git] / src / DlgRef / DlgRef.cxx
index 164f483b4e52237c9feebcf1dd4ce424461527b6..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
 
 #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
 //////////////////////////////////////////
@@ -218,34 +232,6 @@ DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
 {
 }
 
-//////////////////////////////////////////
-// DlgRef_1Sel4Spin2Check
-//////////////////////////////////////////
-
-DlgRef_1Sel4Spin2Check::DlgRef_1Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
-: QWidget( parent, f )
-{
-  setupUi( this );
-}
-
-DlgRef_1Sel4Spin2Check::~DlgRef_1Sel4Spin2Check()
-{
-}
-
-//////////////////////////////////////////
-// DlgRef_1Sel4Spin
-//////////////////////////////////////////
-
-DlgRef_1Sel4Spin::DlgRef_1Sel4Spin( QWidget* parent, Qt::WindowFlags f )
-: QWidget( parent, f )
-{
-  setupUi( this );
-}
-
-DlgRef_1Sel4Spin::~DlgRef_1Sel4Spin()
-{
-}
-
 //////////////////////////////////////////
 // DlgRef_1Sel5Spin1Check
 //////////////////////////////////////////
@@ -260,20 +246,6 @@ DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
 {
 }
 
-//////////////////////////////////////////
-// DlgRef_1Sel5Spin
-//////////////////////////////////////////
-
-DlgRef_1Sel5Spin::DlgRef_1Sel5Spin( QWidget* parent, Qt::WindowFlags f )
-: QWidget( parent, f )
-{
-  setupUi( this );
-}
-
-DlgRef_1Sel5Spin::~DlgRef_1Sel5Spin()
-{
-}
-
 //////////////////////////////////////////
 // DlgRef_1Spin
 //////////////////////////////////////////
@@ -499,44 +471,44 @@ DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push()
 }
 
 //////////////////////////////////////////
-// DlgRef_2Sel3Spin2Rb
+// DlgRef_2Sel3Spin1Check
 //////////////////////////////////////////
 
-DlgRef_2Sel3Spin2Rb::DlgRef_2Sel3Spin2Rb( QWidget* parent, Qt::WindowFlags f )
+DlgRef_2Sel3Spin1Check::DlgRef_2Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
 : QWidget( parent, f )
 {
   setupUi( this );
 }
 
-DlgRef_2Sel3Spin2Rb::~DlgRef_2Sel3Spin2Rb()
+DlgRef_2Sel3Spin1Check::~DlgRef_2Sel3Spin1Check()
 {
 }
 
 //////////////////////////////////////////
-// DlgRef_2Sel3Spin
+// DlgRef_2Sel3Spin2Rb
 //////////////////////////////////////////
 
-DlgRef_2Sel3Spin::DlgRef_2Sel3Spin( QWidget* parent, Qt::WindowFlags f )
+DlgRef_2Sel3Spin2Rb::DlgRef_2Sel3Spin2Rb( QWidget* parent, Qt::WindowFlags f )
 : QWidget( parent, f )
 {
   setupUi( this );
 }
 
-DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
+DlgRef_2Sel3Spin2Rb::~DlgRef_2Sel3Spin2Rb()
 {
 }
 
 //////////////////////////////////////////
-// DlgRef_2Sel4Spin1Check
+// DlgRef_2Sel3Spin
 //////////////////////////////////////////
 
-DlgRef_2Sel4Spin1Check::DlgRef_2Sel4Spin1Check( QWidget* parent, Qt::WindowFlags f )
+DlgRef_2Sel3Spin::DlgRef_2Sel3Spin( QWidget* parent, Qt::WindowFlags f )
 : QWidget( parent, f )
 {
   setupUi( this );
 }
 
-DlgRef_2Sel4Spin1Check::~DlgRef_2Sel4Spin1Check()
+DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
 {
 }
 
@@ -798,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
 //////////////////////////////////////////
@@ -912,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
 //////////////////////////////////////////
@@ -937,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 )
@@ -952,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 = "";
@@ -962,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;