From f703fdfc739725d99d2c865b1b30fcfd1b03c47d Mon Sep 17 00:00:00 2001 From: san Date: Mon, 5 Apr 2010 11:48:21 +0000 Subject: [PATCH] Issue 0020580: improved validation in integer and double spin boxes, possibility to adjust input field precision through preferences --- resources/SalomeApp.xml | 9 ++- src/GUITOOLS/Makefile.am | 9 ++- src/GUITOOLS/VisuGUI_GUITools.cxx | 70 +++++++++++++++++++ src/GUITOOLS/VisuGUI_GUITools.h | 37 ++++++++++ src/Makefile.am | 2 +- src/OBJECT/VISU_Actor.cxx | 4 +- src/PIPELINE/VISU_Extractor.cxx | 4 +- src/VISUGUI/VISU_msg_en.ts | 42 ++++++++++- src/VISUGUI/VisuGUI.cxx | 46 +++++++++--- src/VISUGUI/VisuGUI_CacheDlg.cxx | 8 ++- src/VISUGUI/VisuGUI_CacheDlg.h | 4 +- src/VISUGUI/VisuGUI_ClippingDlg.cxx | 30 ++++---- src/VISUGUI/VisuGUI_ClippingDlg.h | 15 ++-- src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx | 22 ++++-- src/VISUGUI/VisuGUI_ClippingPlaneDlg.h | 14 ++-- src/VISUGUI/VisuGUI_CursorDlg.cxx | 6 +- src/VISUGUI/VisuGUI_CursorDlg.h | 4 +- src/VISUGUI/VisuGUI_CutLinesDlg.cxx | 23 ++++-- src/VISUGUI/VisuGUI_CutLinesDlg.h | 15 ++-- src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 23 +++--- src/VISUGUI/VisuGUI_CutPlanesDlg.h | 15 ++-- src/VISUGUI/VisuGUI_CutSegmentDlg.cxx | 14 ++-- src/VISUGUI/VisuGUI_CutSegmentDlg.h | 5 +- .../VisuGUI_DeformedShapeAndScalarMapDlg.cxx | 10 ++- .../VisuGUI_DeformedShapeAndScalarMapDlg.h | 4 +- src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx | 13 ++-- src/VISUGUI/VisuGUI_DeformedShapeDlg.h | 9 +-- src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx | 8 ++- src/VISUGUI/VisuGUI_FeatureEdgesPanel.h | 4 +- src/VISUGUI/VisuGUI_GaussPointsDlg.cxx | 48 +++++++------ src/VISUGUI/VisuGUI_GaussPointsDlg.h | 19 ++--- src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx | 13 ++-- src/VISUGUI/VisuGUI_IsoSurfacesDlg.h | 18 ++--- src/VISUGUI/VisuGUI_OffsetDlg.cxx | 15 ++-- src/VISUGUI/VisuGUI_OffsetDlg.h | 8 +-- src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 23 +++--- src/VISUGUI/VisuGUI_Plot3DDlg.h | 14 ++-- src/VISUGUI/VisuGUI_Prs3dDlg.cxx | 57 ++++++++------- src/VISUGUI/VisuGUI_Prs3dDlg.h | 26 +++---- src/VISUGUI/VisuGUI_SelectionPanel.cxx | 3 - src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx | 27 ++++--- src/VISUGUI/VisuGUI_SelectionPrefDlg.h | 16 ++--- src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx | 24 +++---- src/VISUGUI/VisuGUI_SetupPlot2dDlg.h | 4 +- src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx | 6 +- src/VISUGUI/VisuGUI_ShrinkFactorDlg.h | 4 +- src/VISUGUI/VisuGUI_Slider.cxx | 8 ++- src/VISUGUI/VisuGUI_Slider.h | 5 +- src/VISUGUI/VisuGUI_StreamLinesDlg.cxx | 36 ++++++---- src/VISUGUI/VisuGUI_StreamLinesDlg.h | 10 +-- src/VISUGUI/VisuGUI_Sweep.cxx | 13 ++-- src/VISUGUI/VisuGUI_Sweep.h | 9 ++- src/VISUGUI/VisuGUI_Table3dDlg.cxx | 29 +++++--- src/VISUGUI/VisuGUI_Table3dDlg.h | 20 +++--- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 24 ++++--- src/VISUGUI/VisuGUI_TimeAnimation.h | 18 +++-- src/VISUGUI/VisuGUI_Tools.cxx | 16 ----- src/VISUGUI/VisuGUI_Tools.h | 2 - src/VISUGUI/VisuGUI_VectorsDlg.cxx | 16 ++--- src/VISUGUI/VisuGUI_VectorsDlg.h | 7 +- src/VVTK/Makefile.am | 4 +- src/VVTK/VVTK_PickingDlg.cxx | 23 +++--- src/VVTK/VVTK_PickingDlg.h | 16 ++--- src/VVTK/VVTK_PrimitiveBox.cxx | 17 +++-- src/VVTK/VVTK_PrimitiveBox.h | 12 ++-- src/VVTK/VVTK_RecorderDlg.cxx | 11 +-- src/VVTK/VVTK_RecorderDlg.h | 8 +-- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 38 ++++++---- src/VVTK/VVTK_SegmentationCursorDlg.h | 26 +++---- src/VVTK/VVTK_SizeBox.cxx | 24 ++++--- src/VVTK/VVTK_SizeBox.h | 16 ++--- 71 files changed, 746 insertions(+), 456 deletions(-) create mode 100644 src/GUITOOLS/VisuGUI_GUITools.cxx create mode 100644 src/GUITOOLS/VisuGUI_GUITools.h diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 2e79ca19..12a3641d 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -51,7 +51,14 @@ - + + + + + + + + diff --git a/src/GUITOOLS/Makefile.am b/src/GUITOOLS/Makefile.am index 3182f1a8..7a30dd9b 100644 --- a/src/GUITOOLS/Makefile.am +++ b/src/GUITOOLS/Makefile.am @@ -31,9 +31,12 @@ lib_LTLIBRARIES= libVISUGUITOOLS.la salomeinclude_HEADERS= \ VisuGUI_TableDlg.h \ - VisuGUITools.h + VisuGUITools.h \ + VisuGUI_GUITools.h -dist_libVISUGUITOOLS_la_SOURCES= VisuGUI_TableDlg.cxx +dist_libVISUGUITOOLS_la_SOURCES= \ + VisuGUI_TableDlg.cxx \ + VisuGUI_GUITools.cxx MOC_FILES= VisuGUI_TableDlg_moc.cxx nodist_libVISUGUITOOLS_la_SOURCES=$(MOC_FILES) @@ -46,4 +49,4 @@ libVISUGUITOOLS_la_CPPFLAGS= -ftemplate-depth-32 \ libVISUGUITOOLS_la_LDFLAGS= \ $(KERNEL_LDFLAGS) -lSALOMELocalTrace \ - $(GUI_LDFLAGS) -lCAM -lsuit -lqtx + $(GUI_LDFLAGS) -lCAM -lsuit -lqtx -lSalomeApp diff --git a/src/GUITOOLS/VisuGUI_GUITools.cxx b/src/GUITOOLS/VisuGUI_GUITools.cxx new file mode 100644 index 00000000..c5162d71 --- /dev/null +++ b/src/GUITOOLS/VisuGUI_GUITools.cxx @@ -0,0 +1,70 @@ +// Copyright (C) 2007-2008 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 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : VisuGUI_GUITools.cxx +// Author : Sergey ANIKIN, Open CASCADE S.A.S. +// Module : VISU +// + +#include "VisuGUI_GUITools.h" + +#include +#include + +#include +#include + +#include + +namespace VISU{ + void initSpinBox( SalomeApp_IntSpinBox* sb, + const int bottom, + const int top, + const int step ) + { + sb->setAcceptNames( false ); + sb->setRange( bottom, top ); + sb->setSingleStep( step ); + } + + void initSpinBox( SalomeApp_DoubleSpinBox* sb, + const double& bottom, + const double& top, + const double& step, + const char* quantity ) + { + // Obtain precision from preferences + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int precision = resMgr->integerValue( "VISU", quantity, 3 ); + + sb->setPrecision ( precision ); + sb->setDecimals ( qAbs(precision) ); + sb->setRange ( bottom, top ); + sb->setSingleStep ( step ); + sb->setDefaultValue( bottom ); + sb->setAcceptNames ( false ); + + // Add a hint for the user saying how to tune precision + QString userPropName = QObject::tr( QString( "VISU_PREF_%1" ).arg( quantity ).toLatin1().constData() ); + sb->setProperty( "validity_tune_hint", + QVariant( QObject::tr( "VISU_PRECISION_HINT" ).arg( userPropName ) ) ); + } +} diff --git a/src/GUITOOLS/VisuGUI_GUITools.h b/src/GUITOOLS/VisuGUI_GUITools.h new file mode 100644 index 00000000..ce22e182 --- /dev/null +++ b/src/GUITOOLS/VisuGUI_GUITools.h @@ -0,0 +1,37 @@ +// Copyright (C) 2007-2008 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 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : VisuGUI_GUITools.h +// Author : Sergey ANIKIN, Open CASCADE S.A.S. +// Module : VISU +// +#ifndef VISUGUI_GUITOOLS_H +#define VISUGUI_GUITOOLS_H + +class SalomeApp_IntSpinBox; +class SalomeApp_DoubleSpinBox; + +namespace VISU{ + void initSpinBox( SalomeApp_IntSpinBox*, const int, const int, const int ); + void initSpinBox( SalomeApp_DoubleSpinBox*, const double&, const double&, const double&, const char* ); +} + +#endif diff --git a/src/Makefile.am b/src/Makefile.am index 356548cd..7e23c911 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,4 +21,4 @@ # # $Header$ # -SUBDIRS = CONVERTOR PIPELINE OBJECT VVTK GUITOOLS VISU_I VISUGUI VISU_SWIG ENGINE +SUBDIRS = CONVERTOR PIPELINE OBJECT GUITOOLS VVTK VISU_I VISUGUI VISU_SWIG ENGINE diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index 20a5a842..e3721d8c 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -47,6 +47,7 @@ #include #include +#include // to use std::abs( int ) // VTK Includes #include @@ -174,7 +175,8 @@ VISU_Actor char aFormat[16] = "%g"; SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); if (aResourceMgr) { - int aFloatingPrec = aResourceMgr->integerValue("VISU", "floating_point_precision", 6); + // san: precision can be negative - this is used by double spin boxes + int aFloatingPrec = std::abs( aResourceMgr->integerValue("VISU", "visual_data_precision", 6) ); sprintf(aFormat, "%%.%dg", aFloatingPrec); //cout << "$$$ aFormat = " << aFormat << endl; } diff --git a/src/PIPELINE/VISU_Extractor.cxx b/src/PIPELINE/VISU_Extractor.cxx index 52831311..f900ab37 100644 --- a/src/PIPELINE/VISU_Extractor.cxx +++ b/src/PIPELINE/VISU_Extractor.cxx @@ -32,6 +32,7 @@ #include #include +#include // to use std::abs( int ) #include #include @@ -314,7 +315,8 @@ CutScalars(vtkIdType theNbOfTuples, void *aPtr = aScalars->GetVoidPointer(0); SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - int aDecimals = aResourceMgr->integerValue("VISU", "floating_point_precision", 6); + // san: precision can be negative - this is used by double spin boxes + int aDecimals = std::abs( aResourceMgr->integerValue("VISU", "visual_data_precision", 6) ); switch(aDataType) { vtkTemplateMacro3(CutScalarsTempl, diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index f863f8b5..3fcd3a9b 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -519,8 +519,42 @@ Do you want to enlarge the cache? Def. Shape and Scalar Map - VISU_FLOATING_POINT_PRECISION - Floating Point Precision + VISU_PREF_GENERAL + General + + + VISU_PREF_GROUP_PRECISION + Input Fields Precision + + + VISU_PREF_visual_data_precision + Visual Data Precision + + + VISU_PREF_length_precision + Length Precision + + + VISU_PREF_angle_precision + Angular Precision + + + VISU_PREF_len_tol_precision + Length Tolerance Precision + + + VISU_PREF_parametric_precision + Parametric Precision + + + VISU_PREF_memory_precision + Memory Size Precision + + + VISU_PRECISION_HINT + +Input value precision can be adjusted using +'%1' parameter in Post-Pro module preferences. VISU_REALLY_DELETE @@ -1133,6 +1167,10 @@ Please, refer to the documentation. MEN_EXPORT_TABLE Export Table + + VISU_MEN_EXPORT_MED + Export to MED file + MEN_FEATURE_EDGES Feature Edges diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index febb52c1..6229236e 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2941,8 +2941,8 @@ VisuGUI tr("MEN_FILE_INFO"), "", 0, aParent, false, this, SLOT(OnFileInfo())); - createAction( VISU_EXPORT_MED, tr("MEN_EXPORT_MED"), QIcon(), - tr("MEN_EXPORT_MED"), "", 0, aParent, false, + createAction( VISU_EXPORT_MED, tr("VISU_MEN_EXPORT_MED"), QIcon(), + tr("VISU_MEN_EXPORT_MED"), "", 0, aParent, false, this, SLOT(OnExportMED())); createAction( VISU_FILTERSCALARS, tr("MEN_FILTER_SCALARS"), QIcon(), @@ -3717,6 +3717,41 @@ extern "C" { void VisuGUI::createPreferences() { + // TAB: General + int genTab = addPreference( tr( "VISU_PREF_GENERAL" ) ); + // Quantities with individual precision settings + int precGroup = addPreference( tr( "VISU_PREF_GROUP_PRECISION" ), genTab ); + setPreferenceProperty( precGroup, "columns", 2 ); + + // Default precision used by some input fieklds and data visualization code + // Moved here from "Representation" tab to have all precisions in the same place + int point_precision = addPreference( tr( "VISU_PREF_visual_data_precision" ), precGroup, + LightApp_Preferences::IntSpin, "VISU", "visual_data_precision" ); + setPreferenceProperty( point_precision, "min", -16 ); + setPreferenceProperty( point_precision, "max", 16 ); + setPreferenceProperty( point_precision, "step", 1 ); + + const int nbQuantities = 5; + int precs[nbQuantities], ii = 0; + precs[ii++] = addPreference( tr( "VISU_PREF_length_precision" ), precGroup, + LightApp_Preferences::IntSpin, "VISU", "length_precision" ); + precs[ii++] = addPreference( tr( "VISU_PREF_angle_precision" ), precGroup, + LightApp_Preferences::IntSpin, "VISU", "angle_precision" ); + precs[ii++] = addPreference( tr( "VISU_PREF_len_tol_precision" ), precGroup, + LightApp_Preferences::IntSpin, "VISU", "len_tol_precision" ); + precs[ii++] = addPreference( tr( "VISU_PREF_parametric_precision" ), precGroup, + LightApp_Preferences::IntSpin, "VISU", "parametric_precision" ); + precs[ii ] = addPreference( tr( "VISU_PREF_memory_precision" ), precGroup, + LightApp_Preferences::IntSpin, "VISU", "memory_precision" ); + + // Set property for precision value for spinboxes + for ( ii = 0; ii < nbQuantities; ii++ ){ + setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -10 ); + setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 10 ); + setPreferenceProperty( precs[ii], "precision", 2 ); + } + + // TAB: "MED import" int importTab = addPreference( tr( "MED import" ) ); //printf( "++++++++++++++++++ Tab index %d\n", importTab ); @@ -4159,11 +4194,6 @@ void VisuGUI::createPreferences() setPreferenceProperty( scalar_def_represent, "indexes", indices1 ); addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" ); - int point_precision = addPreference( tr( "VISU_FLOATING_POINT_PRECISION" ), representGr, - LightApp_Preferences::IntSpin, "VISU", "floating_point_precision" ); - setPreferenceProperty( point_precision, "min", 1 ); - setPreferenceProperty( point_precision, "max", 16 ); - setPreferenceProperty( point_precision, "step", 1 ); addPreference( "", representGr, LightApp_Preferences::Space ); @@ -4596,7 +4626,7 @@ void VisuGUI::OnExportMED() SUIT_FileDlg::getFileName(GetDesktop(this), aPath, aFilter, - tr("MEN_EXPORT_MED"), // "Export To Med File" + tr("VISU_MEN_EXPORT_MED"), // "Export To Med File" false); QString aFile = aFileInfo.filePath(); diff --git a/src/VISUGUI/VisuGUI_CacheDlg.cxx b/src/VISUGUI/VisuGUI_CacheDlg.cxx index e4b5748f..1bdcc4eb 100644 --- a/src/VISUGUI/VisuGUI_CacheDlg.cxx +++ b/src/VISUGUI/VisuGUI_CacheDlg.cxx @@ -28,6 +28,8 @@ #include "VisuGUI_Tools.h" +#include + #include "VISU_PipeLine.hxx" #include "SUIT_Desktop.h" @@ -36,11 +38,10 @@ #include "SUIT_ResourceMgr.h" #include "SalomeApp_Module.h" +#include #include "LightApp_Application.h" -#include "QtxDoubleSpinBox.h" - #include #include #include @@ -93,7 +94,8 @@ VisuGUI_CacheDlg::VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var theCache, myMimimalMemoryButton->setChecked( !isLimitedMemory ); aGridLay->addWidget( myMimimalMemoryButton, 1, 0 ); - myLimitedMemory = new QtxDoubleSpinBox( 1.0, aLimitedMemoryMax, 10.0, aGB ); + myLimitedMemory = new SalomeApp_DoubleSpinBox( aGB ); + VISU::initSpinBox( myLimitedMemory, 1.0, aLimitedMemoryMax, 10.0, "memory_precision" ); myLimitedMemory->setSuffix( " Mb" ); myLimitedMemory->setValue( aLimitedMemory ); myLimitedMemory->setEnabled( isLimitedMemory ); diff --git a/src/VISUGUI/VisuGUI_CacheDlg.h b/src/VISUGUI/VisuGUI_CacheDlg.h index 2413f59f..421a0962 100644 --- a/src/VISUGUI/VisuGUI_CacheDlg.h +++ b/src/VISUGUI/VisuGUI_CacheDlg.h @@ -34,7 +34,7 @@ class QLineEdit; class QRadioButton; -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class SalomeApp_Module; @@ -61,7 +61,7 @@ private: QRadioButton* myMimimalMemoryButton; QRadioButton* myLimitedMemoryButton; - QtxDoubleSpinBox* myLimitedMemory; + SalomeApp_DoubleSpinBox* myLimitedMemory; QLineEdit* myUsedMemory; QLineEdit* myFreeMemory; diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.cxx b/src/VISUGUI/VisuGUI_ClippingDlg.cxx index 31bf08c8..60e9f253 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingDlg.cxx @@ -25,6 +25,8 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" +#include + #include "VISU_Prs3d_i.hh" #include "VISU_Result_i.hh" #include "VISU_ColoredPrs3dHolder_i.hh" @@ -32,6 +34,9 @@ #include "VISU_PipeLine.hxx" #include "VISU_DataSetActor.h" +#include +#include + #include "LightApp_SelectionMgr.h" #include "LightApp_Application.h" @@ -57,7 +62,6 @@ #include #include #include -#include #include #include #include @@ -100,15 +104,6 @@ namespace VISU { vw->Repaint(); } } - - void RangeStepAndValidator (QtxDoubleSpinBox* theSpinBox, double min, double max, - double step, unsigned short decimals) - { - theSpinBox->setRange(min, max); - theSpinBox->setSingleStep(step); - theSpinBox->setRange(min, max ); - theSpinBox->setDecimals( decimals); - } }; //================================================================================= @@ -362,9 +357,9 @@ VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule, GroupButtonsLayout->addWidget(buttonOk, 0, 0); // Initial state - VISU::RangeStepAndValidator(SpinBoxDistance, 0.0, 1.0, 0.01, 3); - VISU::RangeStepAndValidator(SpinBoxRot1, -180.0, 180.0, 1, 3); - VISU::RangeStepAndValidator(SpinBoxRot2, -180.0, 180.0, 1, 3); + VISU::initSpinBox( SpinBoxDistance, 0., 1., .01, "length_precision" ); + VISU::initSpinBox( SpinBoxRot1, -180., 180., 1., "angle_precision" ); + VISU::initSpinBox( SpinBoxRot2, -180., 180., 1., "angle_precision" ); ComboBoxOrientation->addItem(tr("PARALLEL_XOY_COMBO_ITEM")); ComboBoxOrientation->addItem(tr("PARALLEL_YOZ_COMBO_ITEM")); @@ -435,21 +430,21 @@ QWidget* VisuGUI_ClippingDlg::createParamsTab() TextLabelDistance->setText(tr("LBL_DISTANCE")); GroupParametersLayout->addWidget(TextLabelDistance, 1, 0); - SpinBoxDistance = new QtxDoubleSpinBox(GroupParameters); + SpinBoxDistance = new SalomeApp_DoubleSpinBox(GroupParameters); GroupParametersLayout->addWidget(SpinBoxDistance, 1, 1); TextLabelRot1 = new QLabel(GroupParameters); TextLabelRot1->setText(tr("LBL_ROTATION_YZ")); GroupParametersLayout->addWidget(TextLabelRot1, 2, 0); - SpinBoxRot1 = new QtxDoubleSpinBox(GroupParameters); + SpinBoxRot1 = new SalomeApp_DoubleSpinBox(GroupParameters); GroupParametersLayout->addWidget(SpinBoxRot1, 2, 1); TextLabelRot2 = new QLabel(GroupParameters); TextLabelRot2->setText(tr("LBL_ROTATION_XZ")); GroupParametersLayout->addWidget(TextLabelRot2, 3, 0); - SpinBoxRot2 = new QtxDoubleSpinBox(GroupParameters); + SpinBoxRot2 = new SalomeApp_DoubleSpinBox(GroupParameters); GroupParametersLayout->addWidget(SpinBoxRot2, 3, 1); return GroupParameters; @@ -484,7 +479,8 @@ QWidget* VisuGUI_ClippingDlg::createIJKParamsTab() // Index TextLabelIJKIndex = new QLabel(WidgetIJKTab); TextLabelIJKIndex->setText(tr("LBL_IJK_INDEX")); - SpinBoxIJKIndex = new QSpinBox(WidgetIJKTab); + SpinBoxIJKIndex = new SalomeApp_IntSpinBox(WidgetIJKTab); + SpinBoxIJKIndex->setAcceptNames( false ); // Orientation CheckBoxIJKPlaneReverse = new QCheckBox (tr("REVERSE_NORMAL_CHK"), WidgetIJKTab); diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.h b/src/VISUGUI/VisuGUI_ClippingDlg.h index aabea300..074f0b11 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.h +++ b/src/VISUGUI/VisuGUI_ClippingDlg.h @@ -24,7 +24,7 @@ #include "SALOME_InteractiveObject.hxx" -#include "QtxDoubleSpinBox.h" +#include "SalomeApp_DoubleSpinBox.h" // QT Includes #include @@ -43,18 +43,17 @@ class QCheckBox; class QGroupBox; class QComboBox; class QButtonGroup; -class QSpinBox; class QTabWidget; class QListWidget; class SALOME_Actor; -class QtxDoubleSpinBox; - class SVTK_ViewWindow; class LightApp_SelectionMgr; +class SalomeApp_IntSpinBox; + class VisuGUI; class vtkPlaneSource; class vtkDataSetMapper; @@ -165,15 +164,15 @@ private: QTabWidget* TabPane; QComboBox* ComboBoxOrientation; - QtxDoubleSpinBox* SpinBoxDistance; - QtxDoubleSpinBox* SpinBoxRot1; - QtxDoubleSpinBox* SpinBoxRot2; + SalomeApp_DoubleSpinBox* SpinBoxDistance; + SalomeApp_DoubleSpinBox* SpinBoxRot1; + SalomeApp_DoubleSpinBox* SpinBoxRot2; QWidget* WidgetIJKTab; QButtonGroup* ButtonGroupIJKAxis; QGroupBox* GroupBoxIJKAxis; QLabel* TextLabelIJKIndex; - QSpinBox* SpinBoxIJKIndex; + SalomeApp_IntSpinBox* SpinBoxIJKIndex; QCheckBox* CheckBoxIJKPlaneReverse; QCheckBox* PreviewCheckBox; diff --git a/src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx b/src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx index b3a4f662..0f798a04 100644 --- a/src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx @@ -24,6 +24,8 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" +#include + #include #include @@ -32,9 +34,9 @@ #include #include #include -#include #include #include +#include #include #include @@ -104,19 +106,22 @@ VisuGUI_ClippingPlaneDlg::VisuGUI_ClippingPlaneDlg(VisuGUI* theModule) QHBoxLayout* aOriginLayout = new QHBoxLayout(aOriginGroup); aOriginLayout->addWidget( new QLabel("X", aOriginGroup) ); - myXOrigin = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aOriginGroup ); + myXOrigin = new SalomeApp_DoubleSpinBox( aOriginGroup ); + VISU::initSpinBox( myXOrigin, -1000.0, 1000.0, 0.1, "length_precision" ); myXOrigin->setValue( 0.0 ); connect(myXOrigin, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged())); aOriginLayout->addWidget( myXOrigin ); aOriginLayout->addWidget( new QLabel("Y", aOriginGroup) ); - myYOrigin = new QtxDoubleSpinBox( -1000.0, 1000, 0.1, aOriginGroup ); + myYOrigin = new SalomeApp_DoubleSpinBox( aOriginGroup ); + VISU::initSpinBox( myYOrigin, -1000.0, 1000.0, 0.1, "length_precision" ); myYOrigin->setValue( 0.0 ); connect(myYOrigin, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged())); aOriginLayout->addWidget( myYOrigin ); aOriginLayout->addWidget( new QLabel("Z", aOriginGroup) ); - myZOrigin = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aOriginGroup ); + myZOrigin = new SalomeApp_DoubleSpinBox( aOriginGroup ); + VISU::initSpinBox( myZOrigin, -1000.0, 1000.0, 0.1, "length_precision" ); myZOrigin->setValue( 0.0 ); connect(myZOrigin, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged())); aOriginLayout->addWidget( myZOrigin ); @@ -126,19 +131,22 @@ VisuGUI_ClippingPlaneDlg::VisuGUI_ClippingPlaneDlg(VisuGUI* theModule) QHBoxLayout* aDirLayout = new QHBoxLayout(aDirGroup); aDirLayout->addWidget( new QLabel("dX", aDirGroup) ); - myXDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup ); + myXDir = new SalomeApp_DoubleSpinBox( aDirGroup ); + VISU::initSpinBox( myXDir, -1000.0, 1000.0, 0.1, "length_precision" ); myXDir->setValue( 0.0 ); connect(myXDir, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged())); aDirLayout->addWidget( myXDir ); aDirLayout->addWidget( new QLabel("dY", aDirGroup) ); - myYDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup ); + myYDir = new SalomeApp_DoubleSpinBox( aDirGroup ); + VISU::initSpinBox( myYDir, -1000.0, 1000.0, 0.1, "length_precision" ); myYDir->setValue( 0.0 ); connect(myYDir, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged())); aDirLayout->addWidget( myYDir ); aDirLayout->addWidget( new QLabel("dZ", aDirGroup) ); - myZDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup ); + myZDir = new SalomeApp_DoubleSpinBox( aDirGroup ); + VISU::initSpinBox( myZDir, -1000.0, 1000.0, 0.1, "length_precision" ); myZDir->setValue( 1.0 ); connect(myZDir, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged())); aDirLayout->addWidget( myZDir ); diff --git a/src/VISUGUI/VisuGUI_ClippingPlaneDlg.h b/src/VISUGUI/VisuGUI_ClippingPlaneDlg.h index 91aa434c..ab858c2e 100644 --- a/src/VISUGUI/VisuGUI_ClippingPlaneDlg.h +++ b/src/VISUGUI/VisuGUI_ClippingPlaneDlg.h @@ -26,7 +26,7 @@ class VisuGUI; class QLineEdit; class QCheckBox; -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class vtkImplicitPlaneWidget; class vtkCallbackCommand; class vtkObject; @@ -73,13 +73,13 @@ private slots: QLineEdit* myNameEdt; - QtxDoubleSpinBox* myXOrigin; - QtxDoubleSpinBox* myYOrigin; - QtxDoubleSpinBox* myZOrigin; + SalomeApp_DoubleSpinBox* myXOrigin; + SalomeApp_DoubleSpinBox* myYOrigin; + SalomeApp_DoubleSpinBox* myZOrigin; - QtxDoubleSpinBox* myXDir; - QtxDoubleSpinBox* myYDir; - QtxDoubleSpinBox* myZDir; + SalomeApp_DoubleSpinBox* myXDir; + SalomeApp_DoubleSpinBox* myYDir; + SalomeApp_DoubleSpinBox* myZDir; QCheckBox* myAutoApply; diff --git a/src/VISUGUI/VisuGUI_CursorDlg.cxx b/src/VISUGUI/VisuGUI_CursorDlg.cxx index a3d1b0d6..cb2e4e74 100644 --- a/src/VISUGUI/VisuGUI_CursorDlg.cxx +++ b/src/VISUGUI/VisuGUI_CursorDlg.cxx @@ -37,10 +37,11 @@ using namespace std; #include "LightApp_Application.h" +#include + #include #include #include -#include #include #include @@ -75,7 +76,8 @@ VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent, const char* name, bool m Comment2->setAlignment( Qt::AlignCenter ); TopGroupBoxLayout->addWidget( Comment2, 1, 0 ); - SpinBox1 = new QSpinBox( TopGroupBox ); + SpinBox1 = new SalomeApp_IntSpinBox( TopGroupBox ); + SpinBox1->setAcceptNames( false ); SpinBox1->setMinimum( 0 ); SpinBox1->setMaximum(100 ); SpinBox1->setSingleStep( 1 ); diff --git a/src/VISUGUI/VisuGUI_CursorDlg.h b/src/VISUGUI/VisuGUI_CursorDlg.h index 54538d74..7a08d061 100644 --- a/src/VISUGUI/VisuGUI_CursorDlg.h +++ b/src/VISUGUI/VisuGUI_CursorDlg.h @@ -31,7 +31,7 @@ #include class QLabel; class QPushButton; -class QSpinBox; +class SalomeApp_IntSpinBox; class QGroupBox; class VisuGUI_CursorDlg : public QDialog @@ -45,7 +45,7 @@ public: QGroupBox* TopGroupBox; QLabel* Comment1; QLabel* Comment2; - QSpinBox* SpinBox1; + SalomeApp_IntSpinBox* SpinBox1; QGroupBox* GroupButtons; QPushButton* buttonOk; QPushButton* buttonCancel; diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index 365f4e0b..10fc0ea7 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -31,6 +31,7 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" #include "VisuGUI_InputPane.h" +#include #include "VISU_Gen_i.hh" #include "VISU_CutLines_i.hh" @@ -44,6 +45,7 @@ #include "LightApp_Application.h" #include "SalomeApp_Study.h" +#include #include "SUIT_Desktop.h" #include "SUIT_Session.h" @@ -131,12 +133,14 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) myRotXLbl = new QLabel( tr( "LBL_ROT_X" ), aRotBox); aGridLay->addWidget( myRotXLbl, 0, 0 ); - myRotXSpn = new QtxDoubleSpinBox( -45, 45, 5, aRotBox ); + myRotXSpn = new SalomeApp_DoubleSpinBox( aRotBox ); + VISU::initSpinBox( myRotXSpn, -45., 45., 5., "angle_precision" ); aGridLay->addWidget( myRotXSpn, 0, 1 ); myRotXSpn->setValue( 0 ); myRotYLbl = new QLabel( tr( "LBL_ROT_Y" ), aRotBox ); aGridLay->addWidget( myRotYLbl, 1, 0 ); - myRotYSpn = new QtxDoubleSpinBox( -45, 45, 5, aRotBox ); + myRotYSpn = new SalomeApp_DoubleSpinBox( aRotBox ); + VISU::initSpinBox( myRotYSpn, -45., 45., 5., "angle_precision" ); aGridLay->addWidget( myRotYSpn, 1, 1 ); myRotYSpn->setValue( 0 ); @@ -160,7 +164,8 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) aHBLay->setSpacing(5); aHBLay->addWidget( new QLabel (tr("LBL_POS"), aPosBox) ); - myPosSpn = new QtxDoubleSpinBox (0, 1, 0.1, aPosBox); + myPosSpn = new SalomeApp_DoubleSpinBox (aPosBox); + VISU::initSpinBox( myPosSpn, 0., 1., .1, "parametric_precision" ); myPosSpn->setValue(0.5); aHBLay->addWidget( myPosSpn ); aPlaneLayout->addWidget(aPosBox); @@ -230,12 +235,14 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) myRotXLbl2 = new QLabel( tr( "LBL_ROT_X" ), aRotBox2); aGridLay->addWidget( myRotXLbl2, 0, 0 ); - myRotXSpn2 = new QtxDoubleSpinBox( -45, 45, 5, aRotBox2 ); + myRotXSpn2 = new SalomeApp_DoubleSpinBox( aRotBox2 ); + VISU::initSpinBox( myRotXSpn2, -45., 45., 5., "angle_precision" ); aGridLay->addWidget( myRotXSpn2, 0, 1 ); myRotXSpn2->setValue( 0 ); myRotYLbl2 = new QLabel( tr( "LBL_ROT_Y" ), aRotBox2 ); aGridLay->addWidget( myRotYLbl2, 1, 0 ); - myRotYSpn2 = new QtxDoubleSpinBox( -45, 45, 5, aRotBox2 ); + myRotYSpn2 = new SalomeApp_DoubleSpinBox( aRotBox2 ); + VISU::initSpinBox( myRotYSpn2, -45., 45., 5., "angle_precision" ); aGridLay->addWidget( myRotYSpn2, 1, 1 ); myRotYSpn2->setValue( 0 ); aLinesLayout->addWidget( aRotBox2 ); @@ -244,7 +251,8 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) aHBLay = new QHBoxLayout( aNbBox ); aHBLay->setSpacing(5); aHBLay->addWidget( new QLabel( tr( "LBL_NB_PLANS" ), aNbBox ) ); - myNbSpn = new QtxDoubleSpinBox( 1, 100, 1, aNbBox ); + myNbSpn = new SalomeApp_DoubleSpinBox( aNbBox ); + VISU::initSpinBox( myNbSpn, 1., 100., 1., "parametric_precision" ); myNbSpn->setValue( 10 ); aHBLay->addWidget( myNbSpn ); @@ -272,7 +280,8 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) aHBLay = new QHBoxLayout( aPosBox2 ); aHBLay->setSpacing(5); aHBLay->addWidget( new QLabel( tr( "LBL_POS" ), aPosBox2 ) ); - myPosSpn2 = new QtxDoubleSpinBox( 0, 1, 0.1, aPosBox2 ); + myPosSpn2 = new SalomeApp_DoubleSpinBox( aPosBox2 ); + VISU::initSpinBox( myPosSpn2, 0., 1., .1, "parametric_precision" ); myPosSpn2->setValue( 0.5 ); aHBLay->addWidget( myPosSpn2 ); diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.h b/src/VISUGUI/VisuGUI_CutLinesDlg.h index 647381e0..f803bd30 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.h +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.h @@ -36,6 +36,7 @@ class QTabWidget; class SUIT_ViewManager; class SalomeApp_Module; class VisuGUI_InputPane; +class SalomeApp_DoubleSpinBox; namespace VISU { @@ -83,23 +84,23 @@ private: void updateGlyphs(bool update); QButtonGroup* mySelPlane; - QtxDoubleSpinBox* myRotXSpn; - QtxDoubleSpinBox* myRotYSpn; + SalomeApp_DoubleSpinBox* myRotXSpn; + SalomeApp_DoubleSpinBox* myRotYSpn; QLabel* myRotXLbl; QLabel* myRotYLbl; - QtxDoubleSpinBox* myPosSpn; + SalomeApp_DoubleSpinBox* myPosSpn; QLineEdit* myBasePlanePos; QCheckBox* myCBSetDef; QCheckBox* myCreateTable; QCheckBox* myCurvesCheck; QButtonGroup* mySelPlane2; - QtxDoubleSpinBox* myNbSpn; - QtxDoubleSpinBox* myRotXSpn2; - QtxDoubleSpinBox* myRotYSpn2; + SalomeApp_DoubleSpinBox* myNbSpn; + SalomeApp_DoubleSpinBox* myRotXSpn2; + SalomeApp_DoubleSpinBox* myRotYSpn2; QLabel* myRotXLbl2; QLabel* myRotYLbl2; - QtxDoubleSpinBox* myPosSpn2; + SalomeApp_DoubleSpinBox* myPosSpn2; QTableWidget* myPosTable; bool hasInit; diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index 5b48ab40..412e8918 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -33,6 +33,7 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" #include "VisuGUI_InputPane.h" +#include #include "VISU_ColoredPrs3dFactory.hh" #include "VISU_CutPlanes_i.hh" @@ -47,6 +48,9 @@ #include "LightApp_Application.h" +#include +#include + #include "SUIT_Application.h" #include "SUIT_Desktop.h" #include "SUIT_ViewWindow.h" @@ -64,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -114,7 +117,8 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent) QLabel* LabelPosi_3 = new QLabel (tr("LBL_NB_PLANS"), this); - nbPlan = new QSpinBox( this ); + nbPlan = new SalomeApp_IntSpinBox( this ); + nbPlan->setAcceptNames( false ); nbPlan->setMinimum( 1 ); nbPlan->setMaximum(100); nbPlan->setSingleStep( 1 ); @@ -152,7 +156,8 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent) LabelRot1 = new QLabel (tr("LBL_ROT_X"), GBrot ); GBrotLayout->addWidget( LabelRot1, 0, 0 ); - Rot1 = new QtxDoubleSpinBox( -180, 180, 10, GBrot ); + Rot1 = new SalomeApp_DoubleSpinBox( GBrot ); + VISU::initSpinBox( Rot1, -180., 180., 10., "angle_precision" ); Rot1->setValue( 0 ); Rot1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); connect( Rot1, SIGNAL( valueChanged( double )), this, SLOT( onRotation( double ) ) ); @@ -161,14 +166,16 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent) LabelRot2 = new QLabel (tr("LBL_ROT_Y"), GBrot ); GBrotLayout->addWidget( LabelRot2, 1, 0 ); - Rot2 = new QtxDoubleSpinBox( -180, 180, 10, GBrot ); + Rot2 = new SalomeApp_DoubleSpinBox( GBrot ); + VISU::initSpinBox( Rot2, -180., 180., 10., "angle_precision" ); Rot2->setValue( 0 ); Rot2->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); connect( Rot2, SIGNAL( valueChanged( double )), this, SLOT( onRotation( double ) ) ); GBrotLayout->addWidget( Rot2, 1, 1 ); QLabel* aPosLbl = new QLabel(tr( "LBL_POS" ), this); - myPosSpn = new QtxDoubleSpinBox( 0, 1, 0.1, this ); + myPosSpn = new SalomeApp_DoubleSpinBox( this ); + VISU::initSpinBox( myPosSpn, 0., 1., .1, "parametric_precision" ); GDeformation = new QGroupBox(tr("LBL_DEFORMATION"), this); GDeformation->setCheckable(true); @@ -184,12 +191,10 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent) myVectorialFieldCombo = new QComboBox (GDeformation); GDeformationLayout->addWidget( myVectorialFieldCombo, 0, 1 ); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - QLabel* LabelDeformation2 = new QLabel (tr("LBL_DEFROMATION_SCALE"), GDeformation); GDeformationLayout->addWidget( LabelDeformation2, 1, 0 ); - myScaleSpn = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, GDeformation); + myScaleSpn = new SalomeApp_DoubleSpinBox (GDeformation); + VISU::initSpinBox( myScaleSpn, 0., 1.0E+38, 0.1, "visual_data_precision" ); myScaleSpn->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); GDeformationLayout->addWidget( myScaleSpn, 1, 1 ); connect(myVectorialFieldCombo, SIGNAL(activated(int)), this, SLOT(onVectorialFieldChanged(int))); diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.h b/src/VISUGUI/VisuGUI_CutPlanesDlg.h index dd668ec8..803958c2 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.h +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.h @@ -31,12 +31,11 @@ #include "VisuGUI_Prs3dDlg.h" #include - -#include +#include +#include #include -class QSpinBox; class QRadioButton; class QTabWidget; class QTableWidget; @@ -98,18 +97,18 @@ private: QLabel* LabelRot1; QLabel* LabelRot2; QGroupBox* GDeformation; - QSpinBox* nbPlan; - QtxDoubleSpinBox* Rot1; - QtxDoubleSpinBox* Rot2; + SalomeApp_IntSpinBox* nbPlan; + SalomeApp_DoubleSpinBox* Rot1; + SalomeApp_DoubleSpinBox* Rot2; QRadioButton* RBzx; QRadioButton* RByz; QRadioButton* RBxy; - QtxDoubleSpinBox* myPosSpn; + SalomeApp_DoubleSpinBox* myPosSpn; QTableWidget* myPosTable; SALOME::GenericObjPtr myCutPlanes; QCheckBox* myPreviewCheck; QComboBox* myVectorialFieldCombo; - QtxDoubleSpinBox* myScaleSpn; + SalomeApp_DoubleSpinBox* myScaleSpn; double X1, X2; double Y1, Y2; double Z1, Z2; diff --git a/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx b/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx index 56ba80ce..e10b0284 100644 --- a/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx @@ -30,6 +30,8 @@ #include "VisuGUI_ViewTools.h" #include "VisuGUI_InputPane.h" +#include + #include "VISU_Gen_i.hh" #include "VISU_CutSegment_i.hh" #include "VISU_ColoredPrs3dFactory.hh" @@ -41,6 +43,7 @@ #include "LightApp_Application.h" #include "SalomeApp_Study.h" +#include #include "SUIT_ResourceMgr.h" @@ -95,14 +98,15 @@ VisuGUI_CutSegmentDlg::VisuGUI_CutSegmentDlg (SalomeApp_Module* theModule) QLabel* aPoint2YLabel = new QLabel( tr( "LBL_Y" ), aSegmentBox ); QLabel* aPoint2ZLabel = new QLabel( tr( "LBL_Z" ), aSegmentBox ); for( int i = 0; i < 3; i++ ) { - myPoint1.append( new QtxDoubleSpinBox( aSegmentBox ) ); - myPoint2.append( new QtxDoubleSpinBox( aSegmentBox ) ); + myPoint1.append( new SalomeApp_DoubleSpinBox( aSegmentBox ) ); + myPoint2.append( new SalomeApp_DoubleSpinBox( aSegmentBox ) ); } - QListIterator anIter( myPoint1 + myPoint2 ); + QListIterator anIter( myPoint1 + myPoint2 ); while( anIter.hasNext() ) { - QtxDoubleSpinBox* aSpinBox = anIter.next(); - aSpinBox->setDecimals( 6 ); + SalomeApp_DoubleSpinBox* aSpinBox = anIter.next(); + // Use default range - see QDoubleSpinBox minimum/maximum properties + VISU::initSpinBox( aSpinBox, 0., 99.99, 1., "length_precision" ); aSpinBox->setMinimumWidth( 100 ); } diff --git a/src/VISUGUI/VisuGUI_CutSegmentDlg.h b/src/VISUGUI/VisuGUI_CutSegmentDlg.h index 439e62da..8c380f15 100644 --- a/src/VISUGUI/VisuGUI_CutSegmentDlg.h +++ b/src/VISUGUI/VisuGUI_CutSegmentDlg.h @@ -35,6 +35,7 @@ class QTabWidget; class SalomeApp_Module; class VisuGUI_InputPane; +class SalomeApp_DoubleSpinBox; namespace VISU { @@ -80,8 +81,8 @@ private: bool hasInit; - QList myPoint1; - QList myPoint2; + QList myPoint1; + QList myPoint2; SALOME::GenericObjPtr myCutSegment; diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx index 9f778170..40475de9 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx @@ -28,6 +28,7 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_InputPane.h" +#include #include "VISU_Result_i.hh" #include "VISU_DeformedShapeAndScalarMap_i.hh" @@ -38,12 +39,11 @@ #include "VISU_Convertor.hxx" -#include +#include #include #include #include #include -#include #include #include @@ -99,10 +99,8 @@ VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (Salo QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup); TopGroupLayout->addWidget(ScaleLabel, 0, 0); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - - ScalFact = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup); + ScalFact = new SalomeApp_DoubleSpinBox (TopGroup); + VISU::initSpinBox( ScalFact, 0., 1.0E+38, .1, "visual_data_precision" ); ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); ScalFact->setValue(0.1); TopGroupLayout->addWidget(ScalFact, 0, 1); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h index f26b1ef4..956174c6 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h @@ -38,7 +38,7 @@ class SalomeApp_Module; class VisuGUI_InputPane; -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class QComboBox; class QTabWidget; @@ -83,7 +83,7 @@ private slots: void onTimeStampChanged(int i=0); private: - QtxDoubleSpinBox* ScalFact; + SalomeApp_DoubleSpinBox* ScalFact; QTabWidget* myTabBox; VisuGUI_ScalarBarPane* myScalarPane; VisuGUI_InputPane* myInputPane; diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index 92b6ba8a..052b90dd 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -30,14 +30,19 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_InputPane.h" #include "VisuGUI.h" +#include "VisuGUI_Prs3dTools.h" + +#include + #include "VISU_ColoredPrs3dFactory.hh" #include "VISU_DeformedShape_i.hh" #include "VisuGUI_ViewTools.h" #include "VISU_Gen_i.hh" #include "VISU_Result_i.hh" -#include "VisuGUI_Prs3dTools.h" + #include "SVTK_ViewWindow.h" #include "SalomeApp_Module.h" +#include #include "LightApp_Application.h" #include "SUIT_Desktop.h" #include "SUIT_Session.h" @@ -91,10 +96,8 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup ); TopGroupLayout->addWidget(ScaleLabel, 0, 0); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - - ScalFact = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, TopGroup); + ScalFact = new SalomeApp_DoubleSpinBox (TopGroup); + VISU::initSpinBox( ScalFact, 0., 1.0E+38, .1, "visual_data_precision" ); ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); ScalFact->setValue(0.1); TopGroupLayout->addWidget(ScalFact, 0, 1); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h index c66a84b5..ea27c624 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h @@ -30,16 +30,13 @@ #include "VisuGUI_Prs3dDlg.h" -#include "QtxDoubleSpinBox.h" +#include #include class QTabWidget; - - -class QtxDoubleSpinBox; class SalomeApp_Module; class VisuGUI_InputPane; class VisuGUI; @@ -76,14 +73,14 @@ public: protected: virtual QString GetContextHelpFilePath(); - int isValid(); + int isValid(); protected slots: void accept(); bool onApply(); void reject(); private: - QtxDoubleSpinBox* ScalFact; + SalomeApp_DoubleSpinBox* ScalFact; QCheckBox* UseMagn; QTabWidget* myTabBox; VisuGUI_InputPane* myInputPane; diff --git a/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx index 9e0c33c8..291c412f 100644 --- a/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx +++ b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx @@ -30,6 +30,8 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" +#include + #include #include #include @@ -37,13 +39,12 @@ #include #include -#include - #include #include #include #include +#include #include @@ -61,7 +62,8 @@ VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( VisuGUI* theModule, QWidge aLayout->setAlignment( Qt::AlignTop ); QLabel* anAngleLbl = new QLabel( tr( "FEATURE_EDGES_ANGLE" ), myGrp ); - myAngleSpinBox = new QtxDoubleSpinBox( 0.0, 90.0, 10.0, myGrp ); + myAngleSpinBox = new SalomeApp_DoubleSpinBox( myGrp ); + VISU::initSpinBox( myAngleSpinBox, 0.0, 90.0, 10.0, "angle_precision" ); myFeatureEdgesCB = new QCheckBox( tr( "SHOW_FEATURE_EDGES" ), myGrp ); myBoundaryEdgesCB = new QCheckBox( tr( "SHOW_BOUNDARY_EDGES" ), myGrp ); diff --git a/src/VISUGUI/VisuGUI_FeatureEdgesPanel.h b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.h index 504d24eb..282bd676 100644 --- a/src/VISUGUI/VisuGUI_FeatureEdgesPanel.h +++ b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.h @@ -32,7 +32,7 @@ class QCheckBox; class QGroupBox; -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class VISU_Actor; @@ -65,7 +65,7 @@ private: private: QGroupBox* myGrp; - QtxDoubleSpinBox* myAngleSpinBox; + SalomeApp_DoubleSpinBox* myAngleSpinBox; QCheckBox* myFeatureEdgesCB; QCheckBox* myBoundaryEdgesCB; QCheckBox* myManifoldEdgesCB; diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index 89ddfa56..ab9baad0 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -31,6 +31,8 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_InputPane.h" +#include + #include "VISU_ColoredPrs3dFactory.hh" #include "VISU_GaussPoints_i.hh" #include "VISU_Prs3dUtils.hh" @@ -43,6 +45,8 @@ #include "LightApp_Application.h" #include "SalomeApp_Module.h" +#include "SalomeApp_IntSpinBox.h" +#include #include "LightApp_SelectionMgr.h" #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" @@ -50,8 +54,6 @@ #include "SUIT_MessageBox.h" #include "SVTK_FontWidget.h" -#include "QtxDoubleSpinBox.h" - #include #include #include @@ -64,7 +66,6 @@ #include #include #include -#include #include #include #include @@ -143,7 +144,7 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent): RangeGroup->addButton( RBImposedRange ); SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); + int aPrecision = qAbs(aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 )); QDoubleValidator* dv = new QDoubleValidator(this); dv->setDecimals(aPrecision); @@ -199,7 +200,8 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent): TypeGroup->addButton( RainbowButton ); ColorLabel = new QLabel (tr("LBL_NB_COLORS"), ColLabGroup ); - ColorSpin = new QSpinBox( ColLabGroup ); + ColorSpin = new SalomeApp_IntSpinBox( ColLabGroup ); + ColorSpin->setAcceptNames( false ); ColorSpin->setMinimum( 2 ); ColorSpin->setMaximum( 256 ); ColorSpin->setSingleStep( 1 ); @@ -208,7 +210,8 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent): ColorSpin->setValue( 64 ); LabelLabel = new QLabel (tr("LBL_NB_LABELS"), ColLabGroup); - LabelSpin = new QSpinBox( ColLabGroup ); + LabelSpin = new SalomeApp_IntSpinBox( ColLabGroup ); + LabelSpin->setAcceptNames( false ); LabelSpin->setMinimum( 2 ); LabelSpin->setMaximum( 65 ); LabelSpin->setSingleStep( 1 ); @@ -259,13 +262,15 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent): OriginGroupLayout->setMargin( 11 ); QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup ); - XSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup ); + XSpin = new SalomeApp_DoubleSpinBox( OriginGroup ); + VISU::initSpinBox( XSpin, 0.0, 1.0, 0.1, "parametric_precision" ); XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); XSpin->setMinimumWidth( 70 ); XSpin->setValue( 0.01 ); QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup ); - YSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup ); + YSpin = new SalomeApp_DoubleSpinBox( OriginGroup ); + VISU::initSpinBox( YSpin, 0.0, 1.0, 0.1, "parametric_precision" ); YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); YSpin->setMinimumWidth( 70 ); YSpin->setValue( 0.01 ); @@ -289,19 +294,22 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent): DimGroupLayout->setMargin( 11 ); QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup ); - WidthSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup ); + WidthSpin = new SalomeApp_DoubleSpinBox( DimGroup ); + VISU::initSpinBox( WidthSpin, 0.0, 1.0, 0.1, "parametric_precision" ); WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); WidthSpin->setMinimumWidth( 70 ); WidthSpin->setValue( 0.1 ); QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup ); - HeightSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup ); + HeightSpin = new SalomeApp_DoubleSpinBox( DimGroup ); + VISU::initSpinBox( HeightSpin, 0.0, 1.0, 0.1, "parametric_precision" ); HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); HeightSpin->setMinimumWidth( 70 ); HeightSpin->setValue( 0.8 ); QLabel* SpacingLabel = new QLabel (tr("LBL_SPACING"), DimGroup ); - SpacingSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.01, DimGroup ); + SpacingSpin = new SalomeApp_DoubleSpinBox( DimGroup ); + VISU::initSpinBox( SpacingSpin, 0.0, 1.0, 0.01, "parametric_precision" ); SpacingSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SpacingSpin->setMinimumWidth( 70 ); SpacingSpin->setValue( 0.01 ); @@ -387,7 +395,7 @@ void VisuGUI_GaussScalarBarPane::onGlobalScalarBar() MaxEdit->setEnabled( false ); SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0); + int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0)); MinEdit->setText(QString::number(myPrsCopy->GetMin(), 'g', aPrecision)); MaxEdit->setText(QString::number(myPrsCopy->GetMax(), 'g', aPrecision)); @@ -411,7 +419,7 @@ void VisuGUI_GaussScalarBarPane::onLocalScalarBar() MaxEdit->setEnabled( RBImposedRange->isChecked() ); SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0); + int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0)); MinEdit->setText(QString::number(myPrsCopy->GetMin(), 'g', aPrecision)); MaxEdit->setText(QString::number(myPrsCopy->GetMax(), 'g', aPrecision)); @@ -432,7 +440,7 @@ void VisuGUI_GaussScalarBarPane::fieldRangeClicked() MaxEdit->setEnabled( false ); SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0); + int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0)); MinEdit->setText(QString::number(myPrsCopy->GetMin(), 'g', aPrecision)); MaxEdit->setText(QString::number(myPrsCopy->GetMax(), 'g', aPrecision)); @@ -462,7 +470,7 @@ void VisuGUI_GaussScalarBarPane::changeScalarMode( int theMode ) myPrsCopy->SetScalarMode( theMode ); if ( UseFieldRange() ) { SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0); + int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0)); MinEdit->setText(QString::number(myPrsCopy->GetSourceMin(), 'g', aPrecision)); MaxEdit->setText(QString::number(myPrsCopy->GetSourceMax(), 'g', aPrecision)); @@ -493,7 +501,7 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs, } SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0); + int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0)); MinEdit->setText(QString::number(thePrs->GetMin(), 'g', aPrecision)); MaxEdit->setText(QString::number(thePrs->GetMax(), 'g', aPrecision)); @@ -703,7 +711,7 @@ void VisuGUI_GaussScalarBarPane::changeDefaults( int ) */ void VisuGUI_GaussScalarBarPane::XYChanged( double ) { - QtxDoubleSpinBox* snd = (QtxDoubleSpinBox*)sender(); + SalomeApp_DoubleSpinBox* snd = (SalomeApp_DoubleSpinBox*)sender(); if ( snd == XSpin ) { WidthSpin->setMaximum( 1.0 - XSpin->value() ); } @@ -864,11 +872,9 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule): aDefShapeLayout->setSpacing(6); aDefShapeLayout->setMargin(11); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - QLabel* aScaleLabel = new QLabel( tr( "SCALE_FACTOR" ), myDefShapeBox ); - myScaleSpinBox = new QtxDoubleSpinBox( 0.0, 10.0, 0.1, aPrecision*(-1), 32, myDefShapeBox ); + myScaleSpinBox = new SalomeApp_DoubleSpinBox( myDefShapeBox ); + VISU::initSpinBox( myScaleSpinBox, 0.0, 10.0, 0.1, "visual_data_precision" ); aDefShapeLayout->addWidget( aScaleLabel, 0, 0 ); aDefShapeLayout->addWidget( myScaleSpinBox, 0, 1 ); diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h index 1222f148..5f3d4ba2 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.h +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -30,9 +30,10 @@ #include "VisuGUI_Prs3dDlg.h" #include "VISU_GaussPoints_i.hh" -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class SalomeApp_Module; +class SalomeApp_IntSpinBox; class VVTK_PrimitiveBox; class VVTK_SizeBox; class VisuGUI_TextPrefDlg; @@ -73,19 +74,19 @@ class VisuGUI_GaussScalarBarPane : public QWidget//QVBox QRadioButton* RBhori; QRadioButton* RBvert; - QtxDoubleSpinBox* XSpin; - QtxDoubleSpinBox* YSpin; + SalomeApp_DoubleSpinBox* XSpin; + SalomeApp_DoubleSpinBox* YSpin; - QtxDoubleSpinBox* WidthSpin; - QtxDoubleSpinBox* HeightSpin; - QtxDoubleSpinBox* SpacingSpin; + SalomeApp_DoubleSpinBox* WidthSpin; + SalomeApp_DoubleSpinBox* HeightSpin; + SalomeApp_DoubleSpinBox* SpacingSpin; QRadioButton* BicolorButton; QRadioButton* RainbowButton; QLabel* ColorLabel; - QSpinBox* ColorSpin; + SalomeApp_IntSpinBox* ColorSpin; QLabel* LabelLabel; - QSpinBox* LabelSpin; + SalomeApp_IntSpinBox* LabelSpin; QLabel* myModeLbl; QComboBox* myModeCombo; @@ -162,7 +163,7 @@ private: VVTK_SizeBox* mySizeBox; QGroupBox* myDefShapeBox; - QtxDoubleSpinBox* myScaleSpinBox; + SalomeApp_DoubleSpinBox* myScaleSpinBox; SALOME::GenericObjPtr myPrsCopy; SalomeApp_Module* myModule; diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx index 7ab8e93a..415913ca 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx @@ -35,19 +35,20 @@ #include +#include + #include #include #include #include #include -#include +#include #include #include #include #include -#include #include #include #include @@ -57,8 +58,6 @@ #include #include -using namespace std; - VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent, VisuGUI_ScalarBarPane* theScalarPane) : QWidget(parent), @@ -121,7 +120,8 @@ VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent, QLabel* LabelNbr = new QLabel (tr("NB_SURFACES"), TopGroup); TopGroupLayout->addWidget( LabelNbr, 1, 0 ); - NbrIso = new QSpinBox( TopGroup ); + NbrIso = new SalomeApp_IntSpinBox( TopGroup ); + NbrIso->setAcceptNames( false ); NbrIso->setMaximum( 100 ); NbrIso->setMinimum( 1 ); NbrIso->setSingleStep( 1 ); @@ -141,7 +141,8 @@ VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent, myUseLabels = new QCheckBox(tr("SHOW_VALUES_CHK"), TopGroup); myUseLabels->setChecked(false); TopGroupLayout->addWidget( myUseLabels, 3, 0 ); - myNbLabels = new QSpinBox( TopGroup ); + myNbLabels = new SalomeApp_IntSpinBox( TopGroup ); + myNbLabels->setAcceptNames( false ); myNbLabels->setMinimum(1); myNbLabels->setMaximum(100); myNbLabels->setSingleStep(1); diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h index e7bb0245..3472ad82 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h @@ -32,7 +32,7 @@ class QTabWidget; class QLineEdit; -class QSpinBox; +class SalomeApp_IntSpinBox; class QButtonGroup; class QtxColorButton; @@ -70,14 +70,14 @@ protected slots: void setColor(); private: - QButtonGroup* myRangeGrp; - QLineEdit* MinIso; - QLineEdit* MaxIso; - QSpinBox* NbrIso; - QCheckBox* myUseMagnitude; - QtxColorButton* mySelColor; - QCheckBox* myUseLabels; - QSpinBox* myNbLabels; + QButtonGroup* myRangeGrp; + QLineEdit* MinIso; + QLineEdit* MaxIso; + SalomeApp_IntSpinBox* NbrIso; + QCheckBox* myUseMagnitude; + QtxColorButton* mySelColor; + QCheckBox* myUseLabels; + SalomeApp_IntSpinBox* myNbLabels; VisuGUI_ScalarBarPane* myScalarPane; }; diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.cxx b/src/VISUGUI/VisuGUI_OffsetDlg.cxx index 1049e4c5..9c65f507 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.cxx +++ b/src/VISUGUI/VisuGUI_OffsetDlg.cxx @@ -31,6 +31,7 @@ #include "LightApp_SelectionMgr.h" #include "SALOME_ListIteratorOfListIO.hxx" #include "SalomeApp_Application.h" +#include #include "SVTK_ViewWindow.h" #include "SVTK_ViewModel.h" #include "SUIT_ViewManager.h" @@ -39,7 +40,7 @@ #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" -#include "QtxDoubleSpinBox.h" +#include // VTK Includes #include "vtkRenderer.h" @@ -76,16 +77,16 @@ VisuGUI_OffsetDlg::VisuGUI_OffsetDlg (VisuGUI* theModule) aHBLay->setSpacing(6); aHBLay->addWidget( new QLabel ("dX:", anOffsetsPane) ); - aHBLay->addWidget( myDxEdt = new QtxDoubleSpinBox (anOffsetsPane) ); - myDxEdt->setRange(-MAXVAL, MAXVAL); + aHBLay->addWidget( myDxEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) ); + VISU::initSpinBox( myDxEdt, -MAXVAL, MAXVAL, 1., "length_precision" ); aHBLay->addWidget( new QLabel("dY:", anOffsetsPane) );; - aHBLay->addWidget( myDyEdt = new QtxDoubleSpinBox (anOffsetsPane) ); - myDyEdt->setRange(-MAXVAL, MAXVAL); + aHBLay->addWidget( myDyEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) ); + VISU::initSpinBox( myDyEdt, -MAXVAL, MAXVAL, 1., "length_precision" ); aHBLay->addWidget( new QLabel("dZ:", anOffsetsPane) ); - aHBLay->addWidget( myDzEdt = new QtxDoubleSpinBox (anOffsetsPane) ); - myDzEdt->setRange(-MAXVAL, MAXVAL); + aHBLay->addWidget( myDzEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) ); + VISU::initSpinBox( myDzEdt, -MAXVAL, MAXVAL, 1., "length_precision" ); QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane); aHBLay->addWidget( aResetBtn ); diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.h b/src/VISUGUI/VisuGUI_OffsetDlg.h index 71e034d0..5efcce42 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.h +++ b/src/VISUGUI/VisuGUI_OffsetDlg.h @@ -31,7 +31,7 @@ #include class QCheckBox; -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class VisuGUI; class LightApp_SelectionMgr; @@ -92,9 +92,9 @@ class VisuGUI_OffsetDlg: public QDialog VisuGUI * myModule; LightApp_SelectionMgr* mySelectionMgr; - QtxDoubleSpinBox * myDxEdt; - QtxDoubleSpinBox * myDyEdt; - QtxDoubleSpinBox * myDzEdt; + SalomeApp_DoubleSpinBox * myDxEdt; + SalomeApp_DoubleSpinBox * myDyEdt; + SalomeApp_DoubleSpinBox * myDzEdt; QCheckBox * mySaveChk; QList myPrsList; diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index 98954c00..d0b9a6ba 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -31,6 +31,7 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" #include "VisuGUI_InputPane.h" +#include #include "VISU_ColoredPrs3dFactory.hh" #include "VISU_ViewManager_i.hh" @@ -44,14 +45,13 @@ #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "LightApp_Application.h" - -#include "QtxDoubleSpinBox.h" +#include +#include #include #include #include #include -#include #include #include #include @@ -194,14 +194,16 @@ VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent) LabelRot1 = new QLabel (tr("ROTATION_X"), GBrot ); GBrotLayout->addWidget(LabelRot1, 0, 0); // spin 1 - Rot1 = new QtxDoubleSpinBox (-180, 180, 5, GBrot); + Rot1 = new SalomeApp_DoubleSpinBox (GBrot); + VISU::initSpinBox( Rot1, -180, 180, 5, "angle_precision" ); Rot1->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); GBrotLayout->addWidget(Rot1, 0, 1); // label 2 LabelRot2 = new QLabel (tr("ROTATION_Y"), GBrot); GBrotLayout->addWidget(LabelRot2, 1, 0); // spin 2 - Rot2 = new QtxDoubleSpinBox (-180, 180, 5, GBrot); + Rot2 = new SalomeApp_DoubleSpinBox (GBrot); + VISU::initSpinBox( Rot2, -180, 180, 5, "angle_precision" ); Rot2->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); GBrotLayout->addWidget(Rot2, 1, 1); @@ -220,7 +222,8 @@ VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent) QLabel * valueLabel = new QLabel (tr("POSITION_VALUE"), GBpos); GBposLayout->addWidget(valueLabel, 0, 0); // value spin - PositionSpn = new QtxDoubleSpinBox (0, 1, 0.1, GBpos); + PositionSpn = new SalomeApp_DoubleSpinBox (GBpos); + VISU::initSpinBox( PositionSpn, 0, 1, 0.1, "parametric_precision" ); GBposLayout->addWidget(PositionSpn, 0, 1); // Relative CheckBox RelativeChkB = new QCheckBox (tr("RELATIVE"), GBpos); @@ -237,9 +240,8 @@ VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent) bottomLayout->setMargin(0); // scale QLabel* scaleLabel = new QLabel (tr("SCALE"), bottomFrame); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - ScaleSpn = new QtxDoubleSpinBox (-1.e38, 1.e38, 0.1, aPrecision*(-1), 38, bottomFrame); + ScaleSpn = new SalomeApp_DoubleSpinBox (bottomFrame); + VISU::initSpinBox( ScaleSpn, -1.e38, 1.e38, 0.1, "visual_data_precision" ); // Presentation type GBPrsType = new QButtonGroup ( bottomFrame); QGroupBox* aGB = new QGroupBox (tr("PRESENTATION_TYPE"), bottomFrame); @@ -253,7 +255,8 @@ VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent) GBPrsType->addButton( aRB, 1 ); // nb Contours QLabel* nbContLabel = new QLabel (tr("NUMBER_CONTOURS"), bottomFrame); - NbContoursSpn = new QSpinBox ( bottomFrame ); + NbContoursSpn = new SalomeApp_IntSpinBox ( bottomFrame ); + NbContoursSpn->setAcceptNames( false ); NbContoursSpn->setMinimum( 1 ); NbContoursSpn->setMaximum( 999 ); NbContoursSpn->setSingleStep( 1 ); diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.h b/src/VISUGUI/VisuGUI_Plot3DDlg.h index c4823ef7..f7ad94ce 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.h +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.h @@ -36,7 +36,10 @@ class QTabWidget; class QGroupBox; class SalomeApp_Module; +class SalomeApp_IntSpinBox; + class VisuGUI_InputPane; +class SalomeApp_DoubleSpinBox; namespace VISU { @@ -46,7 +49,6 @@ namespace VISU class VISU_Plot3DPL; class SVTK_ViewWindow; class SALOME_Actor; -class QtxDoubleSpinBox; class VisuGUI_Plot3DPane : public QWidget//QVBox { @@ -79,13 +81,13 @@ class VisuGUI_Plot3DPane : public QWidget//QVBox QGroupBox * GBoxOrient; QLabel * LabelRot1; QLabel * LabelRot2; - QtxDoubleSpinBox * Rot1; - QtxDoubleSpinBox * Rot2; - QtxDoubleSpinBox * PositionSpn; + SalomeApp_DoubleSpinBox * Rot1; + SalomeApp_DoubleSpinBox * Rot2; + SalomeApp_DoubleSpinBox * PositionSpn; QCheckBox * RelativeChkB; - QtxDoubleSpinBox * ScaleSpn; + SalomeApp_DoubleSpinBox * ScaleSpn; QButtonGroup * GBPrsType; - QSpinBox * NbContoursSpn; + SalomeApp_IntSpinBox * NbContoursSpn; QCheckBox * PreviewChkB; private slots: diff --git a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx index d0cb296d..abc73bf7 100644 --- a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx +++ b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx @@ -31,6 +31,8 @@ #include "VisuGUI_ViewTools.h" #include "VisuGUI_InputPane.h" +#include + #include "SVTK_ViewWindow.h" #include "SVTK_FontWidget.h" @@ -45,6 +47,8 @@ #include "VISU_Result_i.hh" #include "VISU_Prs3dUtils.hh" +#include +#include #include "LightApp_Application.h" #include "SUIT_Session.h" @@ -68,13 +72,9 @@ #include #include -#include "QtxDoubleSpinBox.h" - #include -#include - -using namespace std; +#include //----------------------------------------------------------------------- // Text Preferences Dialog @@ -287,7 +287,8 @@ VisuGUI_BarPrefDlg::VisuGUI_BarPrefDlg( QWidget* parent ) aDimGrpLay->setSpacing( 5 ); aDimGrpLay->setMargin( 5 ); - myTitleSizeSpin = new QSpinBox( aDimGrp ); + myTitleSizeSpin = new SalomeApp_IntSpinBox( aDimGrp ); + myTitleSizeSpin->setAcceptNames( false ); myTitleSizeSpin->setRange( 0, 100 ); myTitleSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myTitleSizeSpin->setMinimumWidth( 70 ); @@ -295,7 +296,8 @@ VisuGUI_BarPrefDlg::VisuGUI_BarPrefDlg( QWidget* parent ) myTitleSizeSpin->setSpecialValueText( tr( "AUTO" ) ); QLabel* aTitleSizeLbl = new QLabel( tr( "LBL_TITLE_W" ), aDimGrp ); - myLabelSizeSpin = new QSpinBox( aDimGrp ); + myLabelSizeSpin = new SalomeApp_IntSpinBox( aDimGrp ); + myLabelSizeSpin->setAcceptNames( false ); myLabelSizeSpin->setRange( 0, 100 ); myLabelSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myLabelSizeSpin->setMinimumWidth( 70 ); @@ -303,7 +305,8 @@ VisuGUI_BarPrefDlg::VisuGUI_BarPrefDlg( QWidget* parent ) myLabelSizeSpin->setSpecialValueText( tr( "AUTO" ) ); QLabel* aLabelSizeLbl = new QLabel( tr( "LBL_LABEL_W" ), aDimGrp ); - myBarWidthSpin = new QSpinBox( aDimGrp ); + myBarWidthSpin = new SalomeApp_IntSpinBox( aDimGrp ); + myBarWidthSpin->setAcceptNames( false ); myBarWidthSpin->setRange( 0, 100 ); myBarWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myBarWidthSpin->setMinimumWidth( 70 ); @@ -311,7 +314,8 @@ VisuGUI_BarPrefDlg::VisuGUI_BarPrefDlg( QWidget* parent ) myBarWidthSpin->setSpecialValueText( tr( "AUTO" ) ); QLabel* aBarWidthLbl = new QLabel( tr( "LBL_BAR_W" ), aDimGrp ); - myBarHeightSpin = new QSpinBox( aDimGrp ); + myBarHeightSpin = new SalomeApp_IntSpinBox( aDimGrp ); + myBarHeightSpin->setAcceptNames( false ); myBarHeightSpin->setRange( 0, 100 ); myBarHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myBarHeightSpin->setMinimumWidth( 70 ); @@ -322,7 +326,8 @@ VisuGUI_BarPrefDlg::VisuGUI_BarPrefDlg( QWidget* parent ) // format and units QLabel* aPrecLbl = new QLabel( tr( "PRECISION" ), aDimGrp ); - myPrecisionSpin = new QSpinBox( aDimGrp ); + myPrecisionSpin = new SalomeApp_IntSpinBox( aDimGrp ); + myPrecisionSpin->setAcceptNames( false ); myPrecisionSpin->setRange( 1, 100 ); myUnitsChk = new QCheckBox( tr( "LBL_SHOW_UNITS" ), aDimGrp ); @@ -597,7 +602,7 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool theIsDisplay RangeGroup->addButton( RBIrange, 1 ); RBFrange->setChecked( true ); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); + int aPrecision = qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ); QDoubleValidator* dv = new QDoubleValidator(this); dv->setDecimals(aPrecision); @@ -640,7 +645,8 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool theIsDisplay //ColLabGroupLayout->setMargin( 11 ); QLabel* ColorLabel = new QLabel (tr("LBL_NB_COLORS"), ColLabGroup); - ColorSpin = new QSpinBox( ColLabGroup ); + ColorSpin = new SalomeApp_IntSpinBox( ColLabGroup ); + ColorSpin->setAcceptNames( false ); ColorSpin->setMinimum( 2 ); ColorSpin->setMaximum( 256 ); ColorSpin->setSingleStep( 1 ); @@ -649,7 +655,8 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool theIsDisplay ColorSpin->setValue( 64 ); QLabel* LabelLabel = new QLabel (tr("LBL_NB_LABELS"), ColLabGroup); - LabelSpin = new QSpinBox( ColLabGroup ); + LabelSpin = new SalomeApp_IntSpinBox( ColLabGroup ); + LabelSpin->setAcceptNames( false ); LabelSpin->setMinimum( 2 ); LabelSpin->setMaximum( 65 ); LabelSpin->setSingleStep( 1 ); @@ -689,15 +696,15 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool theIsDisplay //OriginGroupLayout->setMargin( 11 ); QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup); - XSpin = new QtxDoubleSpinBox( OriginGroup ); - VISU::initSpinBox(XSpin, 0.0, +1.0); + XSpin = new SalomeApp_DoubleSpinBox( OriginGroup ); + VISU::initSpinBox( XSpin, 0.0, +1.0, .1, "parametric_precision" ); XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); //XSpin->setMinimumWidth( 70 ); XSpin->setValue( 0.01 ); QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup); - YSpin = new QtxDoubleSpinBox( OriginGroup ); - VISU::initSpinBox(YSpin, 0.0, +1.0); + YSpin = new SalomeApp_DoubleSpinBox( OriginGroup ); + VISU::initSpinBox( YSpin, 0.0, +1.0, .1, "parametric_precision" ); YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); //YSpin->setMinimumWidth( 70 ); YSpin->setValue( 0.1 ); @@ -716,15 +723,15 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool theIsDisplay //DimGroupLayout->setMargin( 11 ); QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup); - WidthSpin = new QtxDoubleSpinBox( DimGroup ); - VISU::initSpinBox(WidthSpin, 0.0, +1.0); + WidthSpin = new SalomeApp_DoubleSpinBox( DimGroup ); + VISU::initSpinBox( WidthSpin, 0.0, +1.0, .1, "parametric_precision" ); WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); //WidthSpin->setMinimumWidth( 70 ); WidthSpin->setValue( 0.1 ); QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup); - HeightSpin = new QtxDoubleSpinBox( DimGroup ); - VISU::initSpinBox(HeightSpin, 0.0, +1.0); + HeightSpin = new SalomeApp_DoubleSpinBox( DimGroup ); + VISU::initSpinBox( HeightSpin, 0.0, +1.0, .1, "parametric_precision" ); HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); //HeightSpin->setMinimumWidth( 70 ); HeightSpin->setValue( 0.8 ); @@ -1425,7 +1432,7 @@ void VisuGUI_ScalarBarPane::changeRange( int ) */ void VisuGUI_ScalarBarPane::XYChanged( double ) { - QtxDoubleSpinBox* snd = (QtxDoubleSpinBox*)sender(); + SalomeApp_DoubleSpinBox* snd = (SalomeApp_DoubleSpinBox*)sender(); if ( snd == XSpin ) { WidthSpin->setMaximum( 1.0 - XSpin->value() ); } @@ -1446,7 +1453,7 @@ void VisuGUI_ScalarBarPane::changeScalarMode( int theMode ) if ( RBFrange->isChecked() ) { SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0); + int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) ); MinEdit->setText(QString::number(myScalarMap->GetSourceMin(), 'g', aPrecision)); MaxEdit->setText(QString::number(myScalarMap->GetSourceMax(), 'g', aPrecision)); @@ -1466,7 +1473,7 @@ void VisuGUI_ScalarBarPane::changeGaussMetric( int theGaussMetric ) if ( RBFrange->isChecked() ) { SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0); + int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) ); MinEdit->setText(QString::number(myScalarMap->GetSourceMin(), 'g', aPrecision)); MaxEdit->setText(QString::number(myScalarMap->GetSourceMax(), 'g', aPrecision)); @@ -1483,7 +1490,7 @@ void VisuGUI_ScalarBarPane::changeGaussMetric( int theGaussMetric ) void VisuGUI_ScalarBarPane::setRange( double imin, double imax, bool sbRange ) { SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0); + int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) ); MinEdit->setText(QString::number(imin, 'g', aPrecision)); MaxEdit->setText(QString::number(imax, 'g', aPrecision)); diff --git a/src/VISUGUI/VisuGUI_Prs3dDlg.h b/src/VISUGUI/VisuGUI_Prs3dDlg.h index a0939bcf..060c436b 100644 --- a/src/VISUGUI/VisuGUI_Prs3dDlg.h +++ b/src/VISUGUI/VisuGUI_Prs3dDlg.h @@ -38,15 +38,15 @@ class QLabel; class QCheckBox; class QPushButton; class QRadioButton; -class QSpinBox; class QLineEdit; class QComboBox; class QToolButton; class QTabWidget; -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class SalomeApp_Module; +class SalomeApp_IntSpinBox; class SVTK_FontWidget; class VISU_ScalarMapAct; class VISU_ScalarMapPL; @@ -131,12 +131,12 @@ class VisuGUI_BarPrefDlg: public QDialog void onHelp(); protected: - QSpinBox* myTitleSizeSpin; - QSpinBox* myLabelSizeSpin; - QSpinBox* myBarWidthSpin; - QSpinBox* myBarHeightSpin; + SalomeApp_IntSpinBox* myTitleSizeSpin; + SalomeApp_IntSpinBox* myLabelSizeSpin; + SalomeApp_IntSpinBox* myBarWidthSpin; + SalomeApp_IntSpinBox* myBarHeightSpin; QCheckBox* myUnitsChk; - QSpinBox* myPrecisionSpin; + SalomeApp_IntSpinBox* myPrecisionSpin; int myTitleSize; int myLabelSize; @@ -194,14 +194,14 @@ class VisuGUI_ScalarBarPane : public QWidget//QVBox QRadioButton* RBhori; QRadioButton* RBvert; - QtxDoubleSpinBox* XSpin; - QtxDoubleSpinBox* YSpin; + SalomeApp_DoubleSpinBox* XSpin; + SalomeApp_DoubleSpinBox* YSpin; - QtxDoubleSpinBox* WidthSpin; - QtxDoubleSpinBox* HeightSpin; + SalomeApp_DoubleSpinBox* WidthSpin; + SalomeApp_DoubleSpinBox* HeightSpin; - QSpinBox* ColorSpin; - QSpinBox* LabelSpin; + SalomeApp_IntSpinBox* ColorSpin; + SalomeApp_IntSpinBox* LabelSpin; QCheckBox* CBSave; QCheckBox* CBLog; diff --git a/src/VISUGUI/VisuGUI_SelectionPanel.cxx b/src/VISUGUI/VisuGUI_SelectionPanel.cxx index 943acf03..0405e510 100644 --- a/src/VISUGUI/VisuGUI_SelectionPanel.cxx +++ b/src/VISUGUI/VisuGUI_SelectionPanel.cxx @@ -74,7 +74,6 @@ // QT Includes #include -#include #include #include #include @@ -104,8 +103,6 @@ // STL Includes #include -using namespace std; - class CustomIntValidator: public QIntValidator { public: diff --git a/src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx b/src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx index 9615a047..1d71d17a 100644 --- a/src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx +++ b/src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx @@ -26,6 +26,8 @@ #include "VisuGUI_SelectionPrefDlg.h" #include "VisuGUI.h" +#include + #include "VISU_PickingSettings.h" #include @@ -37,9 +39,10 @@ #include +#include +#include + #include -#include -#include #include #include @@ -49,8 +52,6 @@ #include #include -using namespace std; - /*! Constructor */ @@ -73,14 +74,16 @@ VisuGUI_SelectionPrefDlg::VisuGUI_SelectionPrefDlg( QWidget* parent ) CursorGroupLayout->setMargin(11); QLabel* CursorSizeLabel = new QLabel( tr( "CURSOR_SIZE" ), CursorGroup ); - myCursorSizeSpinBox = new QtxDoubleSpinBox( 0, 1, 0.1, CursorGroup ); + myCursorSizeSpinBox = new SalomeApp_DoubleSpinBox( CursorGroup ); + VISU::initSpinBox( myCursorSizeSpinBox, 0, 1, 0.1, "parametric_precision" ); myCursorSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); QLabel* PyramidHeightLabel = new QLabel( tr( "PYRAMID_HEIGHT" ), CursorGroup ); double aHeightMin=1.e-7; double aHeightMax=10.; double aHeightStep=0.1; - myPyramidHeightSpinBox = new QtxDoubleSpinBox(aHeightMin, aHeightMax, aHeightStep, CursorGroup ); + myPyramidHeightSpinBox = new SalomeApp_DoubleSpinBox(CursorGroup ); + VISU::initSpinBox( myPyramidHeightSpinBox, aHeightMin, aHeightMax, aHeightStep, "length_precision" ); myPyramidHeightSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); QLabel* SelectionColorLabel = new QLabel( tr( "SELECTION_COLOR" ), CursorGroup ); @@ -104,7 +107,8 @@ VisuGUI_SelectionPrefDlg::VisuGUI_SelectionPrefDlg( QWidget* parent ) ToleranceGroupLayout->setMargin(11); QLabel* PointToleranceLabel = new QLabel( tr( "POINT_TOLERANCE" ), ToleranceGroup ); - myPointToleranceSpinBox = new QtxDoubleSpinBox( 0.001, 10.0, 0.01, ToleranceGroup ); + myPointToleranceSpinBox = new SalomeApp_DoubleSpinBox(ToleranceGroup ); + VISU::initSpinBox( myPointToleranceSpinBox, 0.001, 10.0, 0.01, "len_tol_precision" ); myPointToleranceSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); ToleranceGroupLayout->addWidget( PointToleranceLabel, 0, 0 ); @@ -120,7 +124,8 @@ VisuGUI_SelectionPrefDlg::VisuGUI_SelectionPrefDlg( QWidget* parent ) InfoWindowGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); QLabel* TransparencyLabel = new QLabel( tr( "TRANSPARENCY" ), myInfoWindowGroup ); - myTransparencySpinBox = new QtxIntSpinBox( 0, 100, 10, myInfoWindowGroup ); + myTransparencySpinBox = new SalomeApp_IntSpinBox( 0, 100, 10, myInfoWindowGroup ); + myTransparencySpinBox->setAcceptNames( false ); myTransparencySpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); InfoWindowGroupLayout->addWidget( TransparencyLabel, 0, 0 ); @@ -148,12 +153,14 @@ VisuGUI_SelectionPrefDlg::VisuGUI_SelectionPrefDlg( QWidget* parent ) CameraGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); QLabel* ZoomFactorLabel = new QLabel( tr( "ZOOM_FACTOR" ), myCameraGroup ); - myZoomFactorSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1, myCameraGroup ); + myZoomFactorSpinBox = new SalomeApp_DoubleSpinBox( myCameraGroup ); + VISU::initSpinBox( myZoomFactorSpinBox, 0.1, 10.0, 0.1, "parametric_precision" ); myZoomFactorSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); QLabel* StepNumberLabel = new QLabel( tr( "STEP_NUMBER" ), myCameraGroup ); StepNumberLabel->setToolTip( tr( "STEP_NUMBER_TIP" ) ); - myStepNumberSpinBox = new QtxIntSpinBox( 1, 100, 1, myCameraGroup ); + myStepNumberSpinBox = new SalomeApp_IntSpinBox( 1, 100, 1, myCameraGroup ); + myStepNumberSpinBox->setAcceptNames( false ); myStepNumberSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); CameraGroupLayout->addWidget( ZoomFactorLabel, 0, 0 ); diff --git a/src/VISUGUI/VisuGUI_SelectionPrefDlg.h b/src/VISUGUI/VisuGUI_SelectionPrefDlg.h index fcae10cc..ca4c4f4f 100644 --- a/src/VISUGUI/VisuGUI_SelectionPrefDlg.h +++ b/src/VISUGUI/VisuGUI_SelectionPrefDlg.h @@ -33,8 +33,8 @@ class QGroupBox; class QPushButton; class QtxColorButton; -class QtxDoubleSpinBox; -class QtxIntSpinBox; +class SalomeApp_DoubleSpinBox; +class SalomeApp_IntSpinBox; class VisuGUI_SelectionPrefDlg : public QDialog { @@ -57,18 +57,18 @@ protected slots: void onHelp(); private: - QtxDoubleSpinBox* myCursorSizeSpinBox; - QtxDoubleSpinBox* myPyramidHeightSpinBox; + SalomeApp_DoubleSpinBox* myCursorSizeSpinBox; + SalomeApp_DoubleSpinBox* myPyramidHeightSpinBox; QtxColorButton* mySelectionColorButton; - QtxDoubleSpinBox* myPointToleranceSpinBox; + SalomeApp_DoubleSpinBox* myPointToleranceSpinBox; QGroupBox* myInfoWindowGroup; - QtxIntSpinBox* myTransparencySpinBox; + SalomeApp_IntSpinBox* myTransparencySpinBox; QComboBox* myPositionComboBox; QGroupBox* myCameraGroup; - QtxDoubleSpinBox* myZoomFactorSpinBox; - QtxIntSpinBox* myStepNumberSpinBox; + SalomeApp_DoubleSpinBox* myZoomFactorSpinBox; + SalomeApp_IntSpinBox* myStepNumberSpinBox; QPushButton* myButtonOk; QPushButton* myButtonApply; diff --git a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx index 2ac7f567..c8c073d3 100644 --- a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx +++ b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx @@ -35,6 +35,8 @@ #include "LightApp_Application.h" +#include + #include #include @@ -48,7 +50,6 @@ #include #include #include -#include #include #include @@ -57,8 +58,6 @@ #include "utilities.h" -using namespace std; - #define DLG_SIZE_WIDTH 500 #define DLG_SIZE_HEIGHT 400 #define MAX_LINE_WIDTH 100 @@ -138,8 +137,8 @@ VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* p if ( tblIntAttr ) { try { int nbRows = tblIntAttr->GetNbRows() ; - vector rowTitles = tblIntAttr->GetRowTitles(); - vector rowUnits = tblIntAttr->GetRowUnits(); + std::vector rowTitles = tblIntAttr->GetRowTitles(); + std::vector rowUnits = tblIntAttr->GetRowUnits(); QStringList rows; for ( int i = 0; i < nbRows; i++ ) rows.append( rowTitles[i].c_str() ); @@ -181,8 +180,8 @@ VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* p if ( tblRealAttr ) { try { int nbRows = tblRealAttr->GetNbRows() ; - vector rowTitles = tblRealAttr->GetRowTitles(); - vector rowUnits = tblRealAttr->GetRowUnits(); + std::vector rowTitles = tblRealAttr->GetRowTitles(); + std::vector rowUnits = tblRealAttr->GetRowUnits(); QStringList rows; for ( int i = 0; i < nbRows; i++ ) rows.append( rowTitles[i].c_str() ); @@ -333,8 +332,8 @@ void VisuGUI_SetupPlot2dDlg::getCurves( QList& container ) if ( tblIntAttr ) { try { int nbCols = tblIntAttr->GetNbColumns() ; - vector rowTitles = tblIntAttr->GetRowTitles(); - vector rowUnits = tblIntAttr->GetRowUnits(); + std::vector rowTitles = tblIntAttr->GetRowTitles(); + std::vector rowUnits = tblIntAttr->GetRowUnits(); for ( i = 0; i < verIndex.count(); i++ ) { SPlot2d_Curve* curve = new SPlot2d_Curve(); @@ -387,8 +386,8 @@ void VisuGUI_SetupPlot2dDlg::getCurves( QList& container ) if ( tblRealAttr ) { try { int nbCols = tblRealAttr->GetNbColumns() ; - vector rowTitles = tblRealAttr->GetRowTitles(); - vector rowUnits = tblRealAttr->GetRowUnits(); + std::vector rowTitles = tblRealAttr->GetRowTitles(); + std::vector rowUnits = tblRealAttr->GetRowUnits(); for ( i = 0; i < verIndex.count(); i++ ) { SPlot2d_Curve* curve = new SPlot2d_Curve(); @@ -641,7 +640,8 @@ void VisuGUI_ItemContainer::createWidgets( QWidget* parentWidget, const QStringL myLineCombo->addItem( tr( "DAHSDOTDOT_LINE_LBL" ) ); myLineCombo->setCurrentIndex( 1 ); // SOLID by default - myLineSpin = new QSpinBox( parentWidget ); + myLineSpin = new SalomeApp_IntSpinBox( parentWidget ); + myLineSpin->setAcceptNames( false ); myLineSpin->setMinimum( 0 ); myLineSpin->setMaximum( MAX_LINE_WIDTH ); myLineSpin->setSingleStep( 1 ); diff --git a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h index d530402e..476bdb93 100644 --- a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h +++ b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h @@ -43,7 +43,7 @@ class QPushButton; class QLabel; class QCheckBox; class QComboBox; -class QSpinBox; +class SalomeApp_IntSpinBox; class QToolButton; class VisuGUI_ItemContainer; class QtxColorButton; @@ -130,7 +130,7 @@ public: QLabel* myUnitLab; QCheckBox* myAutoCheck; QComboBox* myLineCombo; - QSpinBox* myLineSpin; + SalomeApp_IntSpinBox* myLineSpin; QComboBox* myMarkerCombo, *myAssigned; QtxColorButton* myColorBtn; }; diff --git a/src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx b/src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx index 1037bb3a..4b473719 100644 --- a/src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx +++ b/src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx @@ -40,6 +40,8 @@ #include "SALOME_ListIteratorOfListIO.hxx" #include "SALOME_InteractiveObject.hxx" +#include + #include "LightApp_Study.h" #include "LightApp_SelectionMgr.h" #include "LightApp_Application.h" @@ -49,7 +51,6 @@ // QT Includes #include #include -#include #include #include #include @@ -83,7 +84,8 @@ VisuGUI_ShrinkFactorDlg::VisuGUI_ShrinkFactorDlg( VisuGUI* theModule, bool modal GroupC1Layout->setMargin( 11 ); ValueLab = new QLabel( tr( "SHRINKFACTOR_VALUE" ), GroupC1 ); - ValueSpin = new QSpinBox( GroupC1 ); + ValueSpin = new SalomeApp_IntSpinBox( GroupC1 ); + ValueSpin->setAcceptNames( false ); ValueSpin->setRange( 20, 100 ); ValueSpin->setSingleStep( 10 ); ValueSpin->setMinimumWidth( 70 ); diff --git a/src/VISUGUI/VisuGUI_ShrinkFactorDlg.h b/src/VISUGUI/VisuGUI_ShrinkFactorDlg.h index b221a81e..90568d13 100644 --- a/src/VISUGUI/VisuGUI_ShrinkFactorDlg.h +++ b/src/VISUGUI/VisuGUI_ShrinkFactorDlg.h @@ -31,7 +31,7 @@ class QLabel; class QPushButton; -class QSpinBox; +class SalomeApp_IntSpinBox; class QGroupBox; class LightApp_SelectionMgr; class SalomeApp_Module; @@ -65,7 +65,7 @@ private : QPushButton* buttonOk; QPushButton* buttonHelp; QLabel* ValueLab; - QSpinBox* ValueSpin; + SalomeApp_IntSpinBox* ValueSpin; public slots: void help(); diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index e32654e7..ac2eedc0 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -26,11 +26,14 @@ // #include "VisuGUI_Slider.h" +#include + #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "SalomeApp_Study.h" +#include #include "LightApp_SelectionMgr.h" @@ -49,7 +52,6 @@ #include "SVTK_Functor.h" #include "QtxDockWidget.h" -#include "QtxDoubleSpinBox.h" #include #include @@ -186,8 +188,8 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule, myLimitedMemoryButton->setChecked( true ); aHBoxLayout->addWidget( myLimitedMemoryButton ); - myLimitedMemory = new QtxDoubleSpinBox( aParent ); - myLimitedMemory->setMaximum( 10000 ); + myLimitedMemory = new SalomeApp_DoubleSpinBox( aParent ); + VISU::initSpinBox( myLimitedMemory, 0., 10000., 1., "memory_precision" ); myLimitedMemory->setValue( 512 ); aHBoxLayout->addWidget( myLimitedMemory ); diff --git a/src/VISUGUI/VisuGUI_Slider.h b/src/VISUGUI/VisuGUI_Slider.h index 40c69bc5..54d5e615 100644 --- a/src/VISUGUI/VisuGUI_Slider.h +++ b/src/VISUGUI/VisuGUI_Slider.h @@ -45,14 +45,13 @@ class QLabel; class QLineEdit; class QToolButton; class QSlider; -class QSpinBox; class QCheckBox; class QRadioButton; class QMainWindow; class QTimer; class QAction; -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class LightApp_SelectionMgr; class VisuGUI; @@ -125,7 +124,7 @@ private: QRadioButton* myMinimalMemoryButton; QRadioButton* myLimitedMemoryButton; - QtxDoubleSpinBox* myLimitedMemory; + SalomeApp_DoubleSpinBox* myLimitedMemory; QLineEdit* myUsedMemory; QLineEdit* myFreeMemory; diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index 55d9c652..e828a891 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -29,6 +29,8 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_InputPane.h" +#include + #include "VISU_Mesh_i.hh" #include "VISU_Gen_i.hh" #include "VISU_StreamLines_i.hh" @@ -36,6 +38,7 @@ #include "VISU_StreamLinesPL.hxx" #include "VISU_Actor.h" +#include #include "SalomeApp_Application.h" #include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" @@ -51,10 +54,9 @@ #include -#include #include -#include +#include #include #include @@ -70,8 +72,6 @@ #include -using namespace std; - VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) : VisuGUI_ScalarBarBaseDlg(theModule), myVisuGUI(theModule) @@ -218,32 +218,44 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) QLabel* aPercentLbl = new QLabel (tr("LBL_USED_POINTS"), aSourceBox); aSrcLayout->addWidget(aPercentLbl, 2, 0); - myPntPercent = new QtxDoubleSpinBox( aSourceBox ); - VISU::initSpinBox(myPntPercent, 0, 1); + myPntPercent = new SalomeApp_DoubleSpinBox( aSourceBox ); + VISU::initSpinBox( myPntPercent, 0., 1., .1, "parametric_precision" ); aSrcLayout->addWidget(myPntPercent, 2, 1); TopLayout->addWidget(aSourceBox, 0, 0, 1, 2); QLabel* aStepLenLbl = new QLabel (tr("LBL_STEP_LENGTH"), aTopBox); TopLayout->addWidget(aStepLenLbl, 1, 0); - myStepLen = new QtxDoubleSpinBox( aTopBox ); - VISU::initSpinBox(myStepLen, DBL_MIN, DBL_MAX); + myStepLen = new SalomeApp_DoubleSpinBox( aTopBox ); + VISU::initSpinBox( myStepLen, + std::numeric_limits::min(), + std::numeric_limits::max(), + .1, + "parametrc_precision" ); myStepLen->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); TopLayout->addWidget(myStepLen, 1, 1); connect(myStepLen, SIGNAL(valueChanged(double)), this, SLOT(StepLengthChanged(double))); QLabel* aIntegStepLenLbl = new QLabel (tr("LBL_INTEGRATION_STEP"), aTopBox); TopLayout->addWidget(aIntegStepLenLbl, 2, 0); - myIntegStepLen = new QtxDoubleSpinBox( aTopBox ); - VISU::initSpinBox(myIntegStepLen, DBL_MIN, DBL_MAX); + myIntegStepLen = new SalomeApp_DoubleSpinBox( aTopBox ); + VISU::initSpinBox( myIntegStepLen, + std::numeric_limits::min(), + std::numeric_limits::max(), + .1, + "parametrc_precision" ); myIntegStepLen->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); TopLayout->addWidget(myIntegStepLen, 2, 1); connect(myIntegStepLen, SIGNAL(valueChanged(double)), this, SLOT(IntegrationStepChanged(double))); QLabel* aPropagationLbl = new QLabel (tr("LBL_PROPAGATION_TIME"), aTopBox); TopLayout->addWidget(aPropagationLbl, 3, 0); - myPropTime = new QtxDoubleSpinBox( aTopBox ); - VISU::initSpinBox(myPropTime, DBL_MIN, DBL_MAX); + myPropTime = new SalomeApp_DoubleSpinBox( aTopBox ); + VISU::initSpinBox( myPropTime, + std::numeric_limits::min(), + std::numeric_limits::max(), + .1, + "parametrc_precision" ); myPropTime->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); TopLayout->addWidget(myPropTime, 3, 1); connect(myPropTime, SIGNAL(valueChanged(double)), this, SLOT(PropagationTimeChanged(double))); diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.h b/src/VISUGUI/VisuGUI_StreamLinesDlg.h index 1242475f..5ccdee11 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.h +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.h @@ -37,7 +37,7 @@ class QComboBox; class SalomeApp_Module; class VisuGUI_InputPane; -class QtxDoubleSpinBox; +class SalomeApp_DoubleSpinBox; class QtxColorButton; namespace VISU @@ -76,15 +76,15 @@ private slots: private: VISU::Mesh_ptr createMesh(VISU::VISUType theType, QString theName); - QtxDoubleSpinBox* myStepLen; - QtxDoubleSpinBox* myIntegStepLen; - QtxDoubleSpinBox* myPropTime; + SalomeApp_DoubleSpinBox* myStepLen; + SalomeApp_DoubleSpinBox* myIntegStepLen; + SalomeApp_DoubleSpinBox* myPropTime; QComboBox* myDirCombo; QCheckBox* myUseScalar; QtxColorButton* SelColor; //QCheckBox* myUseSrcChk; QComboBox* myUseSrcCombo; - QtxDoubleSpinBox* myPntPercent; + SalomeApp_DoubleSpinBox* myPntPercent; QComboBox* mySrcCombo; QTabWidget* myTabBox; diff --git a/src/VISUGUI/VisuGUI_Sweep.cxx b/src/VISUGUI/VisuGUI_Sweep.cxx index d5f5a904..bcbbf9bf 100644 --- a/src/VISUGUI/VisuGUI_Sweep.cxx +++ b/src/VISUGUI/VisuGUI_Sweep.cxx @@ -26,10 +26,15 @@ // #include "VisuGUI_Sweep.h" +#include + #include "SUIT_ResourceMgr.h" #include "LightApp_SelectionMgr.h" +#include +#include + #include "VISU_Actor.h" #include "VisuGUI.h" @@ -39,8 +44,6 @@ #include "VISU_Actor.h" #include "QtxDockWidget.h" -#include "QtxIntSpinBox.h" -#include "QtxDoubleSpinBox.h" #include #include @@ -194,7 +197,8 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule, aNumberOfStepsAnnotation->setText( tr( "NUMBER_OF_STEPS" ) ); aGridLayout->addWidget( aNumberOfStepsAnnotation, 1, 0, 1, 1 ); - myNumberOfSteps = new QtxIntSpinBox( aPropertiesTab ); + myNumberOfSteps = new SalomeApp_IntSpinBox( aPropertiesTab ); + myNumberOfSteps->setAcceptNames( false ); connect( myNumberOfSteps, SIGNAL( valueChanged( int ) ), SLOT( onNumberOfStepsChanged( int ) ) ); myNumberOfSteps->setValue( aResourceMgr->integerValue( "VISU", "sweeping_number_steps", 40 ) ); aGridLayout->addWidget( myNumberOfSteps, 1, 1, 1, 1 ); @@ -204,7 +208,8 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule, aStepDelayAnnotation->setText( tr( "DELAY_BETWEEN_STEPS" ) ); aGridLayout->addWidget( aStepDelayAnnotation, 2, 0, 1, 1 ); - myStepDelay = new QtxDoubleSpinBox( aPropertiesTab ); + myStepDelay = new SalomeApp_DoubleSpinBox( aPropertiesTab ); + VISU::initSpinBox( myStepDelay, 0., 99.99, .1, "parametric_precision" ); myStepDelay->setValue( aResourceMgr->doubleValue("VISU", "sweeping_time_step", 0.1) ); aGridLayout->addWidget( myStepDelay, 2, 1, 1, 1 ); } diff --git a/src/VISUGUI/VisuGUI_Sweep.h b/src/VISUGUI/VisuGUI_Sweep.h index 5b1c1539..5426e3ea 100644 --- a/src/VISUGUI/VisuGUI_Sweep.h +++ b/src/VISUGUI/VisuGUI_Sweep.h @@ -37,14 +37,13 @@ class QComboBox; class QToolButton; class QSlider; -class QSpinBox; class QCheckBox; class QMainWindow; class QTimer; class QAction; -class QtxIntSpinBox; -class QtxDoubleSpinBox; +class SalomeApp_IntSpinBox; +class SalomeApp_DoubleSpinBox; class LightApp_SelectionMgr; class SVTK_ViewWindow; @@ -117,10 +116,10 @@ private: QCheckBox* myIsCycled; QComboBox* mySweepMode; - QtxIntSpinBox* myNumberOfSteps; + SalomeApp_IntSpinBox* myNumberOfSteps; QComboBox* myIntervals; - QtxDoubleSpinBox* myStepDelay; + SalomeApp_DoubleSpinBox* myStepDelay; QTimer* myTimer; QPixmap myPlayPixmap; diff --git a/src/VISUGUI/VisuGUI_Table3dDlg.cxx b/src/VISUGUI/VisuGUI_Table3dDlg.cxx index a90fccc5..f5e2f2b6 100644 --- a/src/VISUGUI/VisuGUI_Table3dDlg.cxx +++ b/src/VISUGUI/VisuGUI_Table3dDlg.cxx @@ -30,6 +30,8 @@ #include "VisuGUI_ViewTools.h" #include "VisuGUI_InputPane.h" +#include + #include "VISU_ColoredPrs3dFactory.hh" #include "VISU_ViewManager_i.hh" #include "VISU_Prs3dUtils.hh" @@ -41,15 +43,15 @@ #include #include #include +#include +#include #include -#include #include #include #include #include #include -#include #include #include #include @@ -76,7 +78,8 @@ VisuGUI_Table3DPane::VisuGUI_Table3DPane( QWidget* parent ) // scale QLabel* scaleLabel = new QLabel( tr( "SCALE" ), this ); - ScaleSpn = new QtxDoubleSpinBox( -1.e6, 1.e6, 0.1, this ); + ScaleSpn = new SalomeApp_DoubleSpinBox( this ); + VISU::initSpinBox( ScaleSpn, -1.e6, 1.e6, 0.1, "parametric_precision" ); // Presentation type GBPrsTypeBox = new QGroupBox( tr( "PRESENTATION_TYPE" ), this ); GBPrsType = new QButtonGroup( GBPrsTypeBox ); @@ -92,7 +95,7 @@ VisuGUI_Table3DPane::VisuGUI_Table3DPane( QWidget* parent ) // nb Contours QLabel* nbContLabel = new QLabel( tr( "NUMBER_CONTOURS" ), this ); - NbContoursSpn = new QSpinBox( this ); + NbContoursSpn = new SalomeApp_IntSpinBox( this ); NbContoursSpn->setMinimum( 1 ); NbContoursSpn->setMaximum( 999 ); NbContoursSpn->setSingleStep( 1 ); @@ -256,7 +259,7 @@ VisuGUI_TableScalarBarPane::VisuGUI_TableScalarBarPane( QWidget* parent ) ColLabGroupLayout->setMargin( 11 ); QLabel* ColorLabel = new QLabel( tr( "LBL_NB_COLORS" ), ColLabGroup ); - ColorSpin = new QSpinBox( ColLabGroup ); + ColorSpin = new SalomeApp_IntSpinBox( ColLabGroup ); ColorSpin->setMinimum( 2 ); ColorSpin->setMaximum( 256 ); ColorSpin->setSingleStep( 1 ); @@ -264,7 +267,7 @@ VisuGUI_TableScalarBarPane::VisuGUI_TableScalarBarPane( QWidget* parent ) ColorSpin->setValue( 64 ); QLabel* LabelLabel = new QLabel( tr( "LBL_NB_LABELS" ), ColLabGroup ); - LabelSpin = new QSpinBox( ColLabGroup ); + LabelSpin = new SalomeApp_IntSpinBox( ColLabGroup ); LabelSpin->setMinimum( 2 ); LabelSpin->setMaximum( 65 ); LabelSpin->setSingleStep( 1 ); @@ -298,12 +301,14 @@ VisuGUI_TableScalarBarPane::VisuGUI_TableScalarBarPane( QWidget* parent ) OriginGroupLayout->setMargin( 11 ); QLabel* XLabel = new QLabel( tr( "LBL_X" ), OriginGroup ); - XSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup ); + XSpin = new SalomeApp_DoubleSpinBox( OriginGroup ); + VISU::initSpinBox( XSpin, 0.0, 1.0, 0.1, "parametric_precision" ); XSpin->setMinimumWidth( 70 ); XSpin->setValue( 0.01 ); QLabel* YLabel = new QLabel( tr( "LBL_Y" ), OriginGroup ); - YSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup ); + YSpin = new SalomeApp_DoubleSpinBox( OriginGroup ); + VISU::initSpinBox( YSpin, 0.0, 1.0, 0.1, "parametric_precision" ); YSpin->setMinimumWidth( 70 ); YSpin->setValue( 0.1 ); @@ -319,12 +324,14 @@ VisuGUI_TableScalarBarPane::VisuGUI_TableScalarBarPane( QWidget* parent ) DimGroupLayout->setMargin( 11 ); QLabel* WidthLabel = new QLabel( tr( "LBL_WIDTH" ), DimGroup ); - WidthSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup ); + WidthSpin = new SalomeApp_DoubleSpinBox( DimGroup ); + VISU::initSpinBox( WidthSpin, 0.0, 1.0, 0.1, "parametric_precision" ); WidthSpin->setMinimumWidth( 70 ); WidthSpin->setValue( 0.1 ); QLabel* HeightLabel = new QLabel( tr( "LBL_HEIGHT" ), DimGroup ); - HeightSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup ); + HeightSpin = new SalomeApp_DoubleSpinBox( DimGroup ); + VISU::initSpinBox( HeightSpin, 0.0, 1.0, 0.1, "parametric_precision" ); HeightSpin->setMinimumWidth( 70 ); HeightSpin->setValue( 0.8 ); @@ -573,7 +580,7 @@ void VisuGUI_TableScalarBarPane::changeRange( int ) */ void VisuGUI_TableScalarBarPane::XYChanged( double ) { - QtxDoubleSpinBox* snd = (QtxDoubleSpinBox*)sender(); + SalomeApp_DoubleSpinBox* snd = (SalomeApp_DoubleSpinBox*)sender(); if ( snd == XSpin ) { WidthSpin->setMaximum( 1.0 - XSpin->value() ); } diff --git a/src/VISUGUI/VisuGUI_Table3dDlg.h b/src/VISUGUI/VisuGUI_Table3dDlg.h index 867e4267..5ee3dd15 100644 --- a/src/VISUGUI/VisuGUI_Table3dDlg.h +++ b/src/VISUGUI/VisuGUI_Table3dDlg.h @@ -39,8 +39,8 @@ class QCheckBox; class QLineEdit; class QRadioButton; class QPushButton; -class QSpinBox; -class QtxDoubleSpinBox; +class SalomeApp_IntSpinBox; +class SalomeApp_DoubleSpinBox; class VisuGUI_TextPrefDlg; class VisuGUI_BarPrefDlg; class SVTK_ViewWindow; @@ -73,10 +73,10 @@ private: SVTK_ViewWindow* myViewWindow; VISU::PointMap3d_i* myPrs; - QtxDoubleSpinBox* ScaleSpn; + SalomeApp_DoubleSpinBox* ScaleSpn; QGroupBox* GBPrsTypeBox; QButtonGroup* GBPrsType; - QSpinBox* NbContoursSpn; + SalomeApp_IntSpinBox* NbContoursSpn; }; class VisuGUI_TableScalarBarPane : public QWidget @@ -130,14 +130,14 @@ private: QRadioButton* RBhori; QRadioButton* RBvert; - QtxDoubleSpinBox* XSpin; - QtxDoubleSpinBox* YSpin; + SalomeApp_DoubleSpinBox* XSpin; + SalomeApp_DoubleSpinBox* YSpin; - QtxDoubleSpinBox* WidthSpin; - QtxDoubleSpinBox* HeightSpin; + SalomeApp_DoubleSpinBox* WidthSpin; + SalomeApp_DoubleSpinBox* HeightSpin; - QSpinBox* ColorSpin; - QSpinBox* LabelSpin; + SalomeApp_IntSpinBox* ColorSpin; + SalomeApp_IntSpinBox* LabelSpin; QCheckBox* CBSave; QCheckBox* CBLog; diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 00192d5a..c768f973 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -40,6 +40,8 @@ #include "VisuGUI_DeformedShapeAndScalarMapDlg.h" #include "VisuGUI_GaussPointsDlg.h" +#include + #include "VISU_TimeAnimation.h" #include "VISU_ScalarMap_i.hh" @@ -59,6 +61,7 @@ #include "VISU_ScalarBarActor.hxx" #include "VISU_Actor.h" +#include #include "SalomeApp_Study.h" #include "LightApp_Application.h" @@ -291,7 +294,8 @@ void ArrangeDlg::init() QHBoxLayout* aHLay = new QHBoxLayout( aDistPane ); aHLay->setSpacing(5); aHLay->addWidget( new QLabel("Relative Distance", aDistPane) ); - myDistVal = new QtxDoubleSpinBox (-10,10, 0.5, aDistPane); + myDistVal = new SalomeApp_DoubleSpinBox( aDistPane ); + VISU::initSpinBox( myDistVal, -10., 10., 0.5, "length_precision" ); myDistVal->setValue(1); aHLay->addWidget( myDistVal ); @@ -315,18 +319,18 @@ void ArrangeDlg::init() aCoordLayout->setSpacing(5); aCoordLayout->addWidget( new QLabel("X", aCoordPane), 0, 0 ); - myCoord[0] = new QtxDoubleSpinBox(aCoordPane); - myCoord[0]->setRange(-MAXVAL, MAXVAL); + myCoord[0] = new SalomeApp_DoubleSpinBox(aCoordPane); + VISU::initSpinBox( myCoord[0], -MAXVAL, MAXVAL, 1., "length_precision" ); aCoordLayout->addWidget( myCoord[0], 0, 1 ); aCoordLayout->addWidget( new QLabel("Y", aCoordPane), 1, 0 ); - myCoord[1] = new QtxDoubleSpinBox(aCoordPane); - myCoord[1]->setRange(-MAXVAL, MAXVAL); + myCoord[1] = new SalomeApp_DoubleSpinBox(aCoordPane); + VISU::initSpinBox( myCoord[1], -MAXVAL, MAXVAL, 1., "length_precision" ); aCoordLayout->addWidget( myCoord[1], 1, 1 ); aCoordLayout->addWidget( new QLabel("Z", aCoordPane), 2, 0 ); - myCoord[2] = new QtxDoubleSpinBox(aCoordPane); - myCoord[2]->setRange(-MAXVAL, MAXVAL); + myCoord[2] = new SalomeApp_DoubleSpinBox(aCoordPane); + VISU::initSpinBox( myCoord[2], -MAXVAL, MAXVAL, 1., "length_precision" ); aCoordLayout->addWidget( myCoord[2], 2, 1 ); myStackWgt->insertWidget(ManualMode, aManualPane ); @@ -710,7 +714,8 @@ SetupDlg::SetupDlg (QWidget* theParent, QLabel* aMinLbl = new QLabel("From", myUseRangeBox); aRangeLayout->addWidget(aMinLbl); - //myMinVal = new QtxDoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox ); + //myMinVal = new SalomeApp_DoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox ); + //VISU::initSpinBox( myMinVal, aMinTime, aMaxTime, aStep, "visual_data_precision" ); myMinVal = new LineEdit( myUseRangeBox ); myMinVal->setValidator( new QDoubleValidator( myMinVal ) ); if ( myUseRangeBox->isChecked() ) @@ -728,7 +733,8 @@ SetupDlg::SetupDlg (QWidget* theParent, QLabel* aMaxLbl = new QLabel("To", myUseRangeBox); aRangeLayout->addWidget(aMaxLbl); - //myMaxVal = new QtxDoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox ); + //myMaxVal = new SalomeApp_DoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox ); + //VISU::initSpinBox( myMaxVal, aMinTime, aMaxTime, aStep, "visual_data_precision" ); myMaxVal = new LineEdit( myUseRangeBox ); myMaxVal->setValidator( new QDoubleValidator( myMaxVal ) ); if ( myUseRangeBox->isChecked() ) diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h index 40f40f67..16216afa 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -26,7 +26,7 @@ #ifndef VISUGUI_TIMEANIMATION_H #define VISUGUI_TIMEANIMATION_H -#include "QtxDoubleSpinBox.h" +#include #include "SALOMEDSClient_Study.hxx" #include "VTKViewer.h" @@ -55,8 +55,6 @@ namespace VISU class SVTK_ViewWindow; -//class QtxDoubleSpinBox; - class QLabel; class QSlider; class QListWidget; @@ -106,12 +104,12 @@ class ArrangeDlg: public QDialog VISU_TimeAnimation* myAnimator; SVTK_ViewWindow * myViewWindow; - QStackedWidget* myStackWgt; + QStackedWidget* myStackWgt; QButtonGroup* myAxisGrp; - QtxDoubleSpinBox* myDistVal; - QListWidget* myFieldLst; - QtxDoubleSpinBox* myCoord[3]; - QList myOffsets; + SalomeApp_DoubleSpinBox* myDistVal; + QListWidget* myFieldLst; + SalomeApp_DoubleSpinBox* myCoord[3]; + QList myOffsets; QCheckBox* mySaveChk; @@ -170,8 +168,8 @@ class SetupDlg : public QDialog QPushButton* myPropBtn; QPushButton* myArrangeBtn; QGroupBox* myUseRangeBox; - // QtxDoubleSpinBox* myMinVal; - // QtxDoubleSpinBox* myMaxVal; + // SalomeApp_DoubleSpinBox* myMinVal; + // SalomeApp_DoubleSpinBox* myMaxVal; QLineEdit* myMinVal; QLineEdit* myMaxVal; diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 665c0450..40215a7a 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -1325,22 +1325,6 @@ namespace VISU } } //------------------------------------------------------------ - void initSpinBox( QSpinBox* spinBox, - int min, int max, int step ) - { - spinBox->setRange( min, max ); - spinBox->setSingleStep( step ); - } - //------------------------------------------------------------ - void initSpinBox( QDoubleSpinBox* spinBox, - double min, double max, - double step, int decimals ) - { - spinBox->setRange( min, max ); - spinBox->setSingleStep( step ); - spinBox->setDecimals( decimals ); - } - //------------------------------------------------------------ bool getClippingPlanesFolder(_PTR(Study) theStudy, _PTR(SObject)& theSObject) { _PTR(SComponent) aVisuSO = theStudy->FindComponent("VISU"); diff --git a/src/VISUGUI/VisuGUI_Tools.h b/src/VISUGUI/VisuGUI_Tools.h index 33c55c7b..c953076c 100644 --- a/src/VISUGUI/VisuGUI_Tools.h +++ b/src/VISUGUI/VisuGUI_Tools.h @@ -239,8 +239,6 @@ namespace VISU VISU::Prs3d_i* thePrs3d, int pos); void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow, VISU::Prs3d_i* thePrs3d); - void initSpinBox( QSpinBox*, int, int, int = 1 ); - void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 6 ); #define CLIP_PLANES_FOLDER "Clipping Planes" diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.cxx b/src/VISUGUI/VisuGUI_VectorsDlg.cxx index 640c6f13..a4310d8e 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.cxx +++ b/src/VISUGUI/VisuGUI_VectorsDlg.cxx @@ -31,15 +31,17 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_InputPane.h" +#include + #include "VISU_ColoredPrs3dFactory.hh" #include "VISU_Vectors_i.hh" #include "LightApp_Application.h" #include "SalomeApp_Module.h" +#include +#include #include "SUIT_Desktop.h" #include "SUIT_MessageBox.h" -#include "SUIT_ResourceMgr.h" -#include "SUIT_Session.h" #include @@ -51,7 +53,6 @@ #include #include #include -#include #include #include @@ -91,10 +92,8 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) // Scale factor ScaleLabel = new QLabel (tr("LBL_SCALE_FACTOR"), TopGroup ); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - - ScalFact = new QtxDoubleSpinBox( 0, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup ); + ScalFact = new SalomeApp_DoubleSpinBox( TopGroup ); + VISU::initSpinBox( ScalFact, 0., 1.0E+38, .1, "visual_data_precision" ); ScalFact->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); ScalFact->setValue( 0.1 ); @@ -104,7 +103,8 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) // Line width LineWidLabel = new QLabel (tr("LBL_LINE_WIDTH"), TopGroup ); - LinWid = new QSpinBox( TopGroup ); + LinWid = new SalomeApp_IntSpinBox( TopGroup ); + LinWid->setAcceptNames( false ); LinWid->setMinimum( 1 ); LinWid->setMaximum( 10 ); LinWid->setSingleStep( 1 ); diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.h b/src/VISUGUI/VisuGUI_VectorsDlg.h index 6e0562d3..2353fcee 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.h +++ b/src/VISUGUI/VisuGUI_VectorsDlg.h @@ -29,7 +29,6 @@ #define VISUGUI_VECTORSDLG_H #include "VisuGUI_Prs3dDlg.h" -#include "QtxDoubleSpinBox.h" class QGroupBox; class QTabWidget; @@ -43,7 +42,9 @@ class QtxColorButton; #include CORBA_CLIENT_HEADER(VISU_Gen) class SalomeApp_Module; +class SalomeApp_IntSpinBox; class VisuGUI_InputPane; +class SalomeApp_DoubleSpinBox; namespace VISU { @@ -89,9 +90,9 @@ private: QCheckBox* UseMagn; QtxColorButton* SelColor; QLabel* LineWidLabel; - QSpinBox* LinWid; + SalomeApp_IntSpinBox* LinWid; QLabel* ScaleLabel; - QtxDoubleSpinBox* ScalFact; + SalomeApp_DoubleSpinBox* ScalFact; QCheckBox* UseGlyph; QButtonGroup* TypeGlyph; QGroupBox* TypeGB; diff --git a/src/VVTK/Makefile.am b/src/VVTK/Makefile.am index ace532c0..c739d489 100755 --- a/src/VVTK/Makefile.am +++ b/src/VVTK/Makefile.am @@ -52,12 +52,14 @@ libVVTK_la_CPPFLAGS= \ $(KERNEL_CXXFLAGS) \ $(GUI_CXXFLAGS) \ $(MED_CXXFLAGS) \ - -I$(srcdir)/../OBJECT -I$(srcdir)/../PIPELINE -I$(srcdir)/../CONVERTOR + -I$(srcdir)/../OBJECT -I$(srcdir)/../PIPELINE -I$(srcdir)/../CONVERTOR \ + -I$(srcdir)/../GUITOOLS libVVTK_la_LDFLAGS= \ ../OBJECT/libVisuObject.la \ ../PIPELINE/libVisuPipeLine.la \ ../CONVERTOR/libVisuConvertor.la \ + ../GUITOOLS/libVISUGUITOOLS.la \ $(KERNEL_LDFLAGS) -lOpUtil \ $(GUI_LDFLAGS) -lsuit -lCAM -lSalomeObject -lSVTK \ $(QT_MT_LIBS) \ diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx index 37730f7f..68a5141c 100644 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ b/src/VVTK/VVTK_PickingDlg.cxx @@ -24,6 +24,7 @@ // Module : VISU // #include "VVTK_PickingDlg.h" +#include #include "VISU_GaussPtsAct.h" #include "VISU_PickingSettings.h" @@ -63,8 +64,8 @@ #include #include "QtxAction.h" -#include "QtxDoubleSpinBox.h" -#include "QtxIntSpinBox.h" +#include +#include #include "QtxColorButton.h" #include "LightApp_Application.h" @@ -281,14 +282,16 @@ VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction, CursorGroupLayout->setMargin(11); QLabel* CursorSizeLabel = new QLabel( tr( "CURSOR_SIZE" ), CursorGroup ); - myCursorSizeSpinBox = new QtxDoubleSpinBox( 0, 1, 0.1, CursorGroup ); + myCursorSizeSpinBox = new SalomeApp_DoubleSpinBox( CursorGroup ); + VISU::initSpinBox( myCursorSizeSpinBox, 0, 1, 0.1, "parametric_precision" ); myCursorSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); QLabel* PyramidHeightLabel = new QLabel( tr( "PYRAMID_HEIGHT" ), CursorGroup ); double aHeightMin=1.e-7; double aHeightMax=10.; double aHeightStep=0.1; - myPyramidHeightSpinBox = new QtxDoubleSpinBox(aHeightMin, aHeightMax, aHeightStep, CursorGroup ); + myPyramidHeightSpinBox = new SalomeApp_DoubleSpinBox( CursorGroup ); + VISU::initSpinBox( myPyramidHeightSpinBox, aHeightMin, aHeightMax, aHeightStep, "length_precision" ); myPyramidHeightSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); QLabel* SelectionColorLabel = new QLabel( tr( "SELECTION_COLOR" ), CursorGroup ); @@ -320,7 +323,8 @@ VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction, ToleranceGroupLayout->setMargin(11); QLabel* PointToleranceLabel = new QLabel( tr( "POINT_TOLERANCE" ), ToleranceGroup ); - myPointToleranceSpinBox = new QtxDoubleSpinBox( 0.001, 10.0, 0.01, ToleranceGroup ); + myPointToleranceSpinBox = new SalomeApp_DoubleSpinBox( ToleranceGroup ); + VISU::initSpinBox( myPointToleranceSpinBox, 0.001, 10.0, 0.01, "len_tol_precision" ); myPointToleranceSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); ToleranceGroupLayout->addWidget( PointToleranceLabel, 0, 0 ); @@ -340,7 +344,8 @@ VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction, InfoWindowGroupLayout->setMargin(11); QLabel* TransparencyLabel = new QLabel( tr( "TRANSPARENCY" ), InfoWindowGroup ); - myTransparencySpinBox = new QtxIntSpinBox( 0, 100, 10, InfoWindowGroup ); + myTransparencySpinBox = new SalomeApp_IntSpinBox( InfoWindowGroup ); + VISU::initSpinBox( myTransparencySpinBox, 0, 100, 10 ); myTransparencySpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); InfoWindowGroupLayout->addWidget( TransparencyLabel, 0, 0 ); @@ -372,11 +377,13 @@ VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction, CameraGroupLayout->setMargin(11); QLabel* ZoomFactorLabel = new QLabel( tr( "ZOOM_FACTOR" ), CameraGroup ); - myZoomFactorSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1, CameraGroup ); + myZoomFactorSpinBox = new SalomeApp_DoubleSpinBox( CameraGroup ); + VISU::initSpinBox( myZoomFactorSpinBox, 0.1, 10.0, 0.1, "parametric_precision" ); myZoomFactorSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); QLabel* StepNumberLabel = new QLabel( tr( "STEP_NUMBER" ), CameraGroup ); - myStepNumberSpinBox = new QtxIntSpinBox( 1, 100, 1, CameraGroup ); + myStepNumberSpinBox = new SalomeApp_IntSpinBox( CameraGroup ); + VISU::initSpinBox( myStepNumberSpinBox, 1, 100, 1 ); myStepNumberSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); CameraGroupLayout->addWidget( ZoomFactorLabel, 0, 0 ); diff --git a/src/VVTK/VVTK_PickingDlg.h b/src/VVTK/VVTK_PickingDlg.h index 0b06abae..cd77197b 100644 --- a/src/VVTK/VVTK_PickingDlg.h +++ b/src/VVTK/VVTK_PickingDlg.h @@ -43,8 +43,8 @@ class QCheckBox; class QPushButton; class QtxAction; -class QtxDoubleSpinBox; -class QtxIntSpinBox; +class SalomeApp_DoubleSpinBox; +class SalomeApp_IntSpinBox; class QtxColorButton; class VISU_GaussPtsAct; @@ -100,14 +100,14 @@ private: void keyPressEvent( QKeyEvent* e ); private: - QtxDoubleSpinBox* myCursorSizeSpinBox; - QtxDoubleSpinBox* myPyramidHeightSpinBox; + SalomeApp_DoubleSpinBox* myCursorSizeSpinBox; + SalomeApp_DoubleSpinBox* myPyramidHeightSpinBox; QtxColorButton* mySelectionColorButton; - QtxDoubleSpinBox* myPointToleranceSpinBox; - QtxIntSpinBox* myTransparencySpinBox; + SalomeApp_DoubleSpinBox* myPointToleranceSpinBox; + SalomeApp_IntSpinBox* myTransparencySpinBox; QComboBox* myPositionComboBox; - QtxDoubleSpinBox* myZoomFactorSpinBox; - QtxIntSpinBox* myStepNumberSpinBox; + SalomeApp_DoubleSpinBox* myZoomFactorSpinBox; + SalomeApp_IntSpinBox* myStepNumberSpinBox; QCheckBox* myDisplayParentMeshCheckBox; QtxAction* myAction; diff --git a/src/VVTK/VVTK_PrimitiveBox.cxx b/src/VVTK/VVTK_PrimitiveBox.cxx index 67023c5c..c51539b3 100644 --- a/src/VVTK/VVTK_PrimitiveBox.cxx +++ b/src/VVTK/VVTK_PrimitiveBox.cxx @@ -25,14 +25,15 @@ // Module : VISU // #include "VVTK_PrimitiveBox.h" +#include #include "VISU_OpenGLPointSpriteMapper.hxx" #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" -#include "QtxDoubleSpinBox.h" -#include "QtxIntSpinBox.h" +#include +#include #include #include @@ -91,7 +92,8 @@ VVTK_PrimitiveBox::VVTK_PrimitiveBox( QWidget* parent ) : // Clamp ( Point Sprite & OpenGL Point ) myClampLabel = new QLabel( tr( "CLAMP" ), this ); - myClampSpinBox = new QtxDoubleSpinBox( 1.0, 512.0, 1.0, this ); + myClampSpinBox = new SalomeApp_DoubleSpinBox( this ); + VISU::initSpinBox( myClampSpinBox, 1.0, 512.0, 1.0, "parametric_precision" ); myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); aLayout->addWidget( myClampLabel, 1, 0 ); @@ -123,7 +125,8 @@ VVTK_PrimitiveBox::VVTK_PrimitiveBox( QWidget* parent ) : // Alpha Threshold ( Point Sprite ) myAlphaThresholdLabel = new QLabel( tr( "ALPHA_THRESHOLD" ), this ); - myAlphaThresholdSpinBox = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, this ); + myAlphaThresholdSpinBox = new SalomeApp_DoubleSpinBox( this ); + VISU::initSpinBox( myAlphaThresholdSpinBox, 0.0, 1.0, 0.1, "parametric_precision" ); myAlphaThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); aLayout->addWidget( myAlphaThresholdLabel, 4, 0 ); @@ -131,7 +134,8 @@ VVTK_PrimitiveBox::VVTK_PrimitiveBox( QWidget* parent ) : // Resolution ( Geometrical Sphere ) myResolutionLabel = new QLabel( tr( "RESOLUTION" ), this ); - myResolutionSpinBox = new QtxIntSpinBox( 3, 100, 1, this ); + myResolutionSpinBox = new SalomeApp_IntSpinBox( this ); + VISU::initSpinBox( myResolutionSpinBox, 3, 100, 1 ); myResolutionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); connect( myResolutionSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( onResolutionChanged( int ) ) ); @@ -150,7 +154,8 @@ VVTK_PrimitiveBox::VVTK_PrimitiveBox( QWidget* parent ) : // Notification ( Geometrical Sphere ) myFaceLimitLabel = new QLabel( tr( "FACE_LIMIT" ), this ); - myFaceLimitSpinBox = new QtxIntSpinBox( 10, 1000000, 10, this ); + myFaceLimitSpinBox = new SalomeApp_IntSpinBox( this ); + VISU::initSpinBox( myFaceLimitSpinBox, 10, 1000000, 10 ); myFaceLimitSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); aLayout->addWidget( myFaceLimitLabel, 7, 0 ); diff --git a/src/VVTK/VVTK_PrimitiveBox.h b/src/VVTK/VVTK_PrimitiveBox.h index c0ea8c4d..ed4ff5a0 100644 --- a/src/VVTK/VVTK_PrimitiveBox.h +++ b/src/VVTK/VVTK_PrimitiveBox.h @@ -36,8 +36,8 @@ class QLineEdit; class QPushButton; class QRadioButton; -class QtxDoubleSpinBox; -class QtxIntSpinBox; +class SalomeApp_DoubleSpinBox; +class SalomeApp_IntSpinBox; class VVTK_EXPORT VVTK_PrimitiveBox : public QGroupBox { @@ -94,7 +94,7 @@ private: QString myAlphaTexture; QLabel* myClampLabel; - QtxDoubleSpinBox* myClampSpinBox; + SalomeApp_DoubleSpinBox* myClampSpinBox; QLabel* myMainTextureLabel; QLineEdit* myMainTextureLineEdit; @@ -105,16 +105,16 @@ private: QPushButton* myAlphaTextureButton; QLabel* myAlphaThresholdLabel; - QtxDoubleSpinBox* myAlphaThresholdSpinBox; + SalomeApp_DoubleSpinBox* myAlphaThresholdSpinBox; QLabel* myResolutionLabel; - QtxIntSpinBox* myResolutionSpinBox; + SalomeApp_IntSpinBox* myResolutionSpinBox; QLabel* myFaceNumberLabel; QLineEdit* myFaceNumberLineEdit; QLabel* myFaceLimitLabel; - QtxIntSpinBox* myFaceLimitSpinBox; + SalomeApp_IntSpinBox* myFaceLimitSpinBox; }; diff --git a/src/VVTK/VVTK_RecorderDlg.cxx b/src/VVTK/VVTK_RecorderDlg.cxx index 5b68652d..0904de52 100644 --- a/src/VVTK/VVTK_RecorderDlg.cxx +++ b/src/VVTK/VVTK_RecorderDlg.cxx @@ -26,14 +26,15 @@ // #include "VVTK_RecorderDlg.h" #include "VVTK_Recorder.h" +#include #include "SUIT_FileDlg.h" #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" -#include "QtxDoubleSpinBox.h" -#include "QtxIntSpinBox.h" +#include +#include #include "LightApp_Application.h" @@ -86,11 +87,13 @@ VVTK_RecorderDlg::VVTK_RecorderDlg( QWidget* theParent, VVTK_Recorder* theRecord myRecordingModeComboBox->setCurrentIndex( aResourceMgr->integerValue( "VISU", "recorder_mode", 1 ) ); QLabel* aFPSLabel = new QLabel( tr( "FPS" ), mySettingsBox ); - myFPSSpinBox = new QtxDoubleSpinBox( 0.1, 100.0, 1.0, mySettingsBox ); + myFPSSpinBox = new SalomeApp_DoubleSpinBox( mySettingsBox ); + VISU::initSpinBox( myFPSSpinBox, 0.1, 100.0, 1.0, "parametric_precision" ); myFPSSpinBox->setValue( aResourceMgr->doubleValue( "VISU", "recorder_fps", 10.0 ) ); QLabel* aQualityLabel = new QLabel( tr( "QUALITY" ), mySettingsBox ); - myQualitySpinBox = new QtxIntSpinBox( 1, 100, 1, mySettingsBox ); + myQualitySpinBox = new SalomeApp_IntSpinBox( mySettingsBox ); + VISU::initSpinBox( myQualitySpinBox, 1, 100, 1 ); myQualitySpinBox->setValue( aResourceMgr->integerValue( "VISU", "recorder_quality", 80 ) ); myProgressiveCheckBox = new QCheckBox( tr( "PROGRESSIVE" ), mySettingsBox ); diff --git a/src/VVTK/VVTK_RecorderDlg.h b/src/VVTK/VVTK_RecorderDlg.h index f6b8bac4..7bdf6197 100644 --- a/src/VVTK/VVTK_RecorderDlg.h +++ b/src/VVTK/VVTK_RecorderDlg.h @@ -39,8 +39,8 @@ class QLineEdit; class QPushButton; class QTimer; -class QtxDoubleSpinBox; -class QtxIntSpinBox; +class SalomeApp_DoubleSpinBox; +class SalomeApp_IntSpinBox; class VVTK_Recorder; @@ -74,8 +74,8 @@ private: QLineEdit* myFileNameLineEdit; QComboBox* myRecordingModeComboBox; - QtxDoubleSpinBox* myFPSSpinBox; - QtxIntSpinBox* myQualitySpinBox; + SalomeApp_DoubleSpinBox* myFPSSpinBox; + SalomeApp_IntSpinBox* myQualitySpinBox; QCheckBox* myProgressiveCheckBox; }; diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index 5b927c7e..8190bb3c 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -26,6 +26,7 @@ #include "VVTK_SegmentationCursorDlg.h" #include "VVTK_PrimitiveBox.h" #include "VVTK_SizeBox.h" +#include #include "VISU_GaussPtsAct.h" #include "VISU_GaussPtsSettings.h" @@ -68,8 +69,8 @@ #include #include -#include -#include +#include +#include #include //---------------------------------------------------------------- @@ -122,19 +123,22 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c OriginGroupLayout->setMargin(11); QLabel* XOriginLabel = new QLabel( tr( "ORIGIN_X" ), myOriginGroup ); - myXOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup ); + myXOriginSpinBox = new SalomeApp_DoubleSpinBox( myOriginGroup ); + VISU::initSpinBox( myXOriginSpinBox, -1000.0, 1000.0, 0.1, "length_precision" ); myXOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myXOriginSpinBox->setMinimumWidth( 100 ); myXOriginSpinBox->setValue( 0.0 ); QLabel* YOriginLabel = new QLabel( tr( "ORIGIN_Y" ), myOriginGroup ); - myYOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup ); + myYOriginSpinBox = new SalomeApp_DoubleSpinBox( myOriginGroup ); + VISU::initSpinBox( myYOriginSpinBox, -1000.0, 1000.0, 0.1, "length_precision" ); myYOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myYOriginSpinBox->setMinimumWidth( 100 ); myYOriginSpinBox->setValue( 0.0 ); QLabel* ZOriginLabel = new QLabel( tr( "ORIGIN_Z" ), myOriginGroup ); - myZOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup ); + myZOriginSpinBox = new SalomeApp_DoubleSpinBox( myOriginGroup ); + VISU::initSpinBox( myZOriginSpinBox, -1000.0, 1000.0, 0.1, "length_precision" ); //myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myZOriginSpinBox->setMinimumWidth( 100 ); myZOriginSpinBox->setValue( 1.0 ); @@ -160,19 +164,22 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c DirectionGroupLayout->setMargin(11); QLabel* DXDirectionLabel = new QLabel( tr( "DIRECTION_DX" ), myDirectionGroup ); - myDXDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup ); + myDXDirectionSpinBox = new SalomeApp_DoubleSpinBox( myDirectionGroup ); + VISU::initSpinBox( myDXDirectionSpinBox, -1.0, 1.0, 0.1, "length_precision" ); myDXDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myDXDirectionSpinBox->setMinimumWidth( 100 ); myDXDirectionSpinBox->setValue( 0.0 ); QLabel* DYDirectionLabel = new QLabel( tr( "DIRECTION_DY" ), myDirectionGroup ); - myDYDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup ); + myDYDirectionSpinBox = new SalomeApp_DoubleSpinBox( myDirectionGroup ); + VISU::initSpinBox( myDYDirectionSpinBox, -1.0, 1.0, 0.1, "length_precision" ); myDYDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myDYDirectionSpinBox->setMinimumWidth( 100 ); myDYDirectionSpinBox->setValue( 0.0 ); QLabel* DZDirectionLabel = new QLabel( tr( "DIRECTION_DZ" ), myDirectionGroup ); - myDZDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup ); + myDZDirectionSpinBox = new SalomeApp_DoubleSpinBox( myDirectionGroup ); + VISU::initSpinBox( myDZDirectionSpinBox, -1.0, 1.0, 0.1, "length_precision" ); myDZDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myDZDirectionSpinBox->setMinimumWidth( 100 ); myDZDirectionSpinBox->setValue( 1.0 ); @@ -198,7 +205,8 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c DepthGroupLayout->setMargin(11); QLabel* DepthLabel = new QLabel( tr( "DEPTH" ), myDepthGroup ); - myDepthSpinBox = new QtxDoubleSpinBox( 0.0, VTK_LARGE_FLOAT, 0.1, myDepthGroup ); + myDepthSpinBox = new SalomeApp_DoubleSpinBox( myDepthGroup ); + VISU::initSpinBox( myDepthSpinBox, 0.0, VTK_LARGE_FLOAT, 0.1, "length_precision" ); myDepthSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myDepthSpinBox->setMinimumWidth( 100 ); myDepthSpinBox->setValue( 1.0 ); @@ -220,13 +228,15 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c RadiusGroupLayout->setMargin(11); QLabel* RadiusLabel = new QLabel( tr( "RADIUS" ),myRadiusGroup ); - myRadiusSpinBox = new QtxDoubleSpinBox( 0.0, 1000.0, 1.0,myRadiusGroup ); + myRadiusSpinBox = new SalomeApp_DoubleSpinBox( myRadiusGroup ); + VISU::initSpinBox( myRadiusSpinBox, 0.0, 1000.0, 1.0, "length_precision" ); myRadiusSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myRadiusSpinBox->setMinimumWidth( 100 ); myRadiusSpinBox->setValue( 100.0 ); QLabel* RatioLabel = new QLabel( tr( "RATIO" ), myRadiusGroup ); - myRatioSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1,myRadiusGroup ); + myRatioSpinBox = new SalomeApp_DoubleSpinBox( myRadiusGroup ); + VISU::initSpinBox( myRatioSpinBox, 0.1, 10.0, 0.1, "parametric_precision" ); myRatioSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myRatioSpinBox->setMinimumWidth( 100 ); myRatioSpinBox->setValue( 2.0 ); @@ -304,7 +314,8 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c MagnificationGroupLayout->setMargin(11); myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), MagnificationGroup ); - myMagnificationSpinBox = new QtxIntSpinBox( 1, 10000, 10, MagnificationGroup ); + myMagnificationSpinBox = new SalomeApp_IntSpinBox( MagnificationGroup ); + VISU::initSpinBox( myMagnificationSpinBox, 1, 10000, 10 ); myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); MagnificationGroupLayout->addWidget( myMagnificationLabel, 0, 0 ); @@ -312,7 +323,8 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c // Increment myIncrementLabel = new QLabel( tr( "INCREMENT" ), MagnificationGroup ); - myIncrementSpinBox = new QtxDoubleSpinBox( 0.01, 10, 0.1, MagnificationGroup ); + myIncrementSpinBox = new SalomeApp_DoubleSpinBox( MagnificationGroup ); + VISU::initSpinBox( myIncrementSpinBox, 0.01, 10, 0.1, "parametric_precision" ); myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); MagnificationGroupLayout->addWidget( myIncrementLabel, 0, 2 ); diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.h b/src/VVTK/VVTK_SegmentationCursorDlg.h index 960d0218..54750222 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.h +++ b/src/VVTK/VVTK_SegmentationCursorDlg.h @@ -49,8 +49,8 @@ class QWidget; //class QVBox; class QtxAction; -class QtxDoubleSpinBox; -class QtxIntSpinBox; +class SalomeApp_DoubleSpinBox; +class SalomeApp_IntSpinBox; class VISU_GaussPtsAct1; class VISU_InsideCursorSettings; @@ -146,21 +146,21 @@ private: QWidget* mySegmentationCursorBox; QGroupBox* myOriginGroup; - QtxDoubleSpinBox* myXOriginSpinBox; - QtxDoubleSpinBox* myYOriginSpinBox; - QtxDoubleSpinBox* myZOriginSpinBox; + SalomeApp_DoubleSpinBox* myXOriginSpinBox; + SalomeApp_DoubleSpinBox* myYOriginSpinBox; + SalomeApp_DoubleSpinBox* myZOriginSpinBox; QGroupBox* myDirectionGroup; - QtxDoubleSpinBox* myDXDirectionSpinBox; - QtxDoubleSpinBox* myDYDirectionSpinBox; - QtxDoubleSpinBox* myDZDirectionSpinBox; + SalomeApp_DoubleSpinBox* myDXDirectionSpinBox; + SalomeApp_DoubleSpinBox* myDYDirectionSpinBox; + SalomeApp_DoubleSpinBox* myDZDirectionSpinBox; QGroupBox* myDepthGroup; - QtxDoubleSpinBox* myDepthSpinBox; + SalomeApp_DoubleSpinBox* myDepthSpinBox; QGroupBox* myRadiusGroup; - QtxDoubleSpinBox* myRadiusSpinBox; - QtxDoubleSpinBox* myRatioSpinBox; + SalomeApp_DoubleSpinBox* myRadiusSpinBox; + SalomeApp_DoubleSpinBox* myRatioSpinBox; bool myIsPlaneSegmentation; @@ -191,9 +191,9 @@ private: vtkSmartPointer myOutsideCursorSettings; QLabel* myMagnificationLabel; - QtxIntSpinBox* myMagnificationSpinBox; + SalomeApp_IntSpinBox* myMagnificationSpinBox; QLabel* myIncrementLabel; - QtxDoubleSpinBox* myIncrementSpinBox; + SalomeApp_DoubleSpinBox* myIncrementSpinBox; }; #endif diff --git a/src/VVTK/VVTK_SizeBox.cxx b/src/VVTK/VVTK_SizeBox.cxx index 7d040131..d12c3c9e 100644 --- a/src/VVTK/VVTK_SizeBox.cxx +++ b/src/VVTK/VVTK_SizeBox.cxx @@ -26,11 +26,13 @@ // #include "VVTK_SizeBox.h" +#include + #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" -#include -#include +#include +#include #include #include @@ -65,7 +67,8 @@ VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : // Outside Size myOutsideSizeLabel = new QLabel( tr( "OUTSIDE_SIZE" ), SizeGroup ); - myOutsideSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup ); + myOutsideSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup ); + VISU::initSpinBox( myOutsideSizeSpinBox, 0, 100, 1 ); myOutsideSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SizeGroupLayout->addWidget( myOutsideSizeLabel, 0, 0 ); @@ -73,7 +76,8 @@ VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : // Geometry Size myGeomSizeLabel = new QLabel( tr( "GEOM_SIZE" ), SizeGroup ); - myGeomSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup ); + myGeomSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup ); + VISU::initSpinBox( myGeomSizeSpinBox, 0, 100, 1 ); myGeomSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SizeGroupLayout->addWidget( myGeomSizeLabel, 0, 0 ); @@ -81,7 +85,8 @@ VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : // Min Size myMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), SizeGroup ); - myMinSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup ); + myMinSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup ); + VISU::initSpinBox( myMinSizeSpinBox, 0, 100, 1 ); myMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SizeGroupLayout->addWidget( myMinSizeLabel, 1, 0 ); @@ -89,7 +94,8 @@ VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : // Max Size myMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), SizeGroup ); - myMaxSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup ); + myMaxSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup ); + VISU::initSpinBox( myMaxSizeSpinBox, 0, 100, 1 ); myMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SizeGroupLayout->addWidget( myMaxSizeLabel, 1, 2 ); @@ -97,7 +103,8 @@ VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : // Magnification myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup ); - myMagnificationSpinBox = new QtxIntSpinBox( 1, 10000, 10, SizeGroup ); + myMagnificationSpinBox = new SalomeApp_IntSpinBox( SizeGroup ); + VISU::initSpinBox( myMagnificationSpinBox, 1, 10000, 10 ); myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SizeGroupLayout->addWidget( myMagnificationLabel, 2, 0 ); @@ -105,7 +112,8 @@ VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : // Increment myIncrementLabel = new QLabel( tr( "INCREMENT" ), SizeGroup ); - myIncrementSpinBox = new QtxDoubleSpinBox( 0.01, 10, 0.1, SizeGroup ); + myIncrementSpinBox = new SalomeApp_DoubleSpinBox( SizeGroup ); + VISU::initSpinBox( myIncrementSpinBox, 0.01, 10, 0.1, "parametric_precision" ); myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SizeGroupLayout->addWidget( myIncrementLabel, 2, 2 ); diff --git a/src/VVTK/VVTK_SizeBox.h b/src/VVTK/VVTK_SizeBox.h index 296ff51d..6322c125 100644 --- a/src/VVTK/VVTK_SizeBox.h +++ b/src/VVTK/VVTK_SizeBox.h @@ -37,8 +37,8 @@ class QPushButton; class QCheckBox; class QGroupBox; -class QtxDoubleSpinBox; -class QtxIntSpinBox; +class SalomeApp_DoubleSpinBox; +class SalomeApp_IntSpinBox; class QtxColorButton; class VVTK_EXPORT VVTK_SizeBox : public QWidget @@ -94,22 +94,22 @@ private: int myType; QLabel* myOutsideSizeLabel; - QtxIntSpinBox* myOutsideSizeSpinBox; + SalomeApp_IntSpinBox* myOutsideSizeSpinBox; QLabel* myGeomSizeLabel; - QtxIntSpinBox* myGeomSizeSpinBox; + SalomeApp_IntSpinBox* myGeomSizeSpinBox; QLabel* myMinSizeLabel; - QtxIntSpinBox* myMinSizeSpinBox; + SalomeApp_IntSpinBox* myMinSizeSpinBox; QLabel* myMaxSizeLabel; - QtxIntSpinBox* myMaxSizeSpinBox; + SalomeApp_IntSpinBox* myMaxSizeSpinBox; QLabel* myMagnificationLabel; - QtxIntSpinBox* myMagnificationSpinBox; + SalomeApp_IntSpinBox* myMagnificationSpinBox; QLabel* myIncrementLabel; - QtxDoubleSpinBox* myIncrementSpinBox; + SalomeApp_DoubleSpinBox* myIncrementSpinBox; QCheckBox* myUniformCheckBox; -- 2.39.2