-// Copyright (C) 2007-2008 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
+// 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 : GEOMToolsGUI_DeflectionDlg.cxx
// Author : OCC Team
-
+//
#include "GEOMToolsGUI_DeflectionDlg.h"
#include <GeometryGUI.h>
+#include <GEOM_Constants.h>
#include <LightApp_Application.h>
#include <SalomeApp_DoubleSpinBox.h>
TextLabel1->setText(tr("GEOM_DEFLECTION"));
GroupC1Layout->addWidget(TextLabel1, 0, 0);
- //SpinBox = new SalomeApp_DoubleSpinBox (/*min*/1.0e-07, /*max*/1.0, /*step*/1.0e-04, GroupC1);
SpinBox = new SalomeApp_DoubleSpinBox (GroupC1);
- SpinBox->setPrecision( 10 );
- SpinBox->setDecimals( 10 );
- SpinBox->setRange( 1.0e-07, 1.0 );
+ // Obtain precision from preferences
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ const char* quantity = "parametric_precision";
+ int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 );
+ SpinBox->setAcceptNames( false );
+ SpinBox->setPrecision( aPrecision );
+ SpinBox->setDecimals( aPrecision );
+ SpinBox->setRange( DEFLECTION_MIN, 1.0 );
SpinBox->setSingleStep( 1.0e-04 );
- //SpinBox->setMinimum(1.0e-07);
- //SpinBox->setMaximum(1.0);
- //SpinBox->setStep(1.0e-04);
+ // Add a hint for the user saying how to tune precision
+ QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() );
+ SpinBox->setProperty( "validity_tune_hint",
+ QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) );
+
SpinBox->setObjectName("SpinBoxU");
SpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
SpinBox->setValue(1.0e-04);
// no need to delete child widgets, Qt does it all for us
}
-double GEOMToolsGUI_DeflectionDlg::getDC() const
+double GEOMToolsGUI_DeflectionDlg::getTheDC() const
{
return SpinBox->text().toDouble();
}
-void GEOMToolsGUI_DeflectionDlg::setDC (const double v)
+void GEOMToolsGUI_DeflectionDlg::setTheDC (const double v)
{
SpinBox->setValue(v);
}