-// Copyright (C) 2007-2010 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
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// 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
+// 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
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// 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>
#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_ListIO.hxx>
+#include <Basics_Utils.hxx>
+
#include <TCollection_AsciiString.hxx>
#include <TColStd_MapOfInteger.hxx>
myBSpline2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );
myBSplineTol3D = new SalomeApp_DoubleSpinBox( w );
- initSpinBox( mySplitContTol3D, 0., 100., 1e-7, "len_tol_precision" );
+ initSpinBox( myBSplineTol3D, 0., 100., 1e-7, "len_tol_precision" );
myBSplineTol2D = new SalomeApp_DoubleSpinBox( w );
initSpinBox( myBSplineTol2D, 0., 100., 1e-7, "param_tol_precision" );
reset();
initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ) );
+ selectionChanged();
}
//=================================================================================
//=================================================================================
void RepairGUI_ShapeProcessDlg::onOk()
{
+ setIsApplyAndClose( true );
if ( onApply() )
ClickOnCancel();
}
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
- Standard_Boolean aRes = Standard_False;
int i = 0;
myObjects->length(aSelList.Extent());
for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes );
- if ( !CORBA::is_nil( aSelectedObject ) && aRes )
- myObjects[i++] = aSelectedObject;
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value() );
+ if ( !CORBA::is_nil( aSelectedObject ) )
+ myObjects[i++] = aSelectedObject;
}
myObjects->length( i );
if ( i == 1 )
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() );
// 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 );
}
//=================================================================================
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] ) );
}
}
}