X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMToolsGUI%2FGEOMToolsGUI_DeflectionDlg.cxx;h=bc9e9ea6329446958692ce19a2928f215a33adef;hb=882dc8f6ee23cedf50cf3c718fb864dec115b35e;hp=8f4137a4de468c88774ca6bdfe89bdfd5db1878c;hpb=207dcdd566eef37c71ea838b613eac2de139f129;p=modules%2Fgeom.git diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx index 8f4137a4d..bc9e9ea63 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx @@ -1,30 +1,29 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 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 +#include #include #include @@ -72,10 +71,23 @@ GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent) GroupC1Layout->addWidget(TextLabel1, 0, 0); SpinBox = new SalomeApp_DoubleSpinBox (GroupC1); + // 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 ); + // 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->setMinimum(0); - SpinBox->setValue(1); + SpinBox->setValue(1.0e-04); GroupC1Layout->addWidget(SpinBox, 0, 1); /***************************************************************/ @@ -131,12 +143,12 @@ GEOMToolsGUI_DeflectionDlg::~GEOMToolsGUI_DeflectionDlg() // 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); }