From b7e3214ee58788f68c17e2552d3c4be3aff322bd Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 3 Feb 2010 11:05:16 +0000 Subject: [PATCH] Additional fix for issue 0020626: EDF 1200 GEOM: the discretisation of the circles in the OCC viewer is too rough --- src/GEOMGUI/GEOM_Displayer.cxx | 1 + src/GEOMGUI/GeometryGUI.cxx | 4 ++-- src/GEOMGUI/GeometryGUI.h | 3 +++ src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx | 11 +++++------ src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.h | 4 ++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 6e3be0c5a..dae3ea1d9 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -636,6 +636,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) // IMP 0020626 double aDC = aResMgr->doubleValue("Geometry", "deflection_coeff", 0.001); + aDC = std::max( aDC, DEFLECTION_MIN ); // to avoid to small values of the coefficient AISShape->SetOwnDeviationCoefficient(aDC); } } diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index fd461f03b..aa628f194 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -1600,10 +1600,10 @@ void GeometryGUI::createPreferences() setPreferenceProperty( step, "precision", 3 ); // Set property for deflection value for spinboxes - setPreferenceProperty( defl, "min", 1.0e-07 ); + setPreferenceProperty( defl, "min", DEFLECTION_MIN ); setPreferenceProperty( defl, "max", 1.0 ); setPreferenceProperty( defl, "step", 1.0e-04 ); - setPreferenceProperty( defl, "precision", 10 ); + setPreferenceProperty( defl, "precision", 6 ); // Set property vertex marker type QList aMarkerTypeIndicesList; diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h index 91728932b..249359762 100644 --- a/src/GEOMGUI/GeometryGUI.h +++ b/src/GEOMGUI/GeometryGUI.h @@ -47,6 +47,9 @@ #include "SALOMEconfig.h" #include CORBA_CLIENT_HEADER(SALOMEDS) +// minimum allowed value for deflection coefficient +#define DEFLECTION_MIN 1e-06 + typedef QMap GUIMap; class QDialog; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx index 8f240d26b..715c22dee 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx @@ -26,7 +26,7 @@ #include "GEOMToolsGUI_DeflectionDlg.h" #include #include -#include +#include #include #include @@ -71,11 +71,10 @@ GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent) 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 ); + SpinBox = new QtxDoubleSpinBox (GroupC1); + SpinBox->setPrecision( 6 ); + SpinBox->setDecimals( 6 ); + SpinBox->setRange( DEFLECTION_MIN, 1.0 ); SpinBox->setSingleStep( 1.0e-04 ); //SpinBox->setMinimum(1.0e-07); //SpinBox->setMaximum(1.0); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.h index 30c2821cb..39bb8cc7e 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.h @@ -30,7 +30,7 @@ #include -class SalomeApp_DoubleSpinBox; +class QtxDoubleSpinBox; //================================================================================= // class : GEOMToolsGUI_DeflectionDlg @@ -54,7 +54,7 @@ private: void keyPressEvent( QKeyEvent* ); private: - SalomeApp_DoubleSpinBox* SpinBox; + QtxDoubleSpinBox* SpinBox; QString myHelpFileName; }; -- 2.39.2