From: apo Date: Fri, 3 Feb 2006 14:31:39 +0000 (+0000) Subject: To sinchronize scalar mode and scalar range X-Git-Tag: mergeto_trunk_07Feb06~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=75c780abb81d920c1ed58bcd1a849b679d5ff8bb;p=modules%2Fvisu.git To sinchronize scalar mode and scalar range --- diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index fa9da21b..ddc63e88 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -249,6 +249,7 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref): // signals and slots connections =========================================== connect( RangeGroup, SIGNAL( clicked( int ) ), this, SLOT( changeRange( int ) ) ); + connect( myModeCombo, SIGNAL( activated( int ) ), this, SLOT( changeScalarMode( int ) ) ); connect( OrientGroup, SIGNAL( clicked( int ) ), this, SLOT( changeDefaults( int ) ) ); connect( XSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) ); connect( YSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) ); @@ -887,6 +888,22 @@ void VisuGUI_ScalarBarPane::XYChanged( double ) updatePreview(); } +/*! + Called when scalar mode is changed +*/ +void VisuGUI_ScalarBarPane::changeScalarMode( int theMode ) +{ + if ( myScalarMap ) { + if ( RBFrange->isChecked() ) { + float aRange[2]; + myScalarMap->SetScalarMode(theMode); + myScalarMap->GetScalarMapPL()->GetSourceRange(aRange); + MinEdit->setText( QString::number( aRange[0] ) ); + MaxEdit->setText( QString::number( aRange[1] ) ); + } + } +} + /*! Sets default values and range mode */ diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.h b/src/VISUGUI/VisuGUI_ScalarBarDlg.h index cec542c6..4f53a39b 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.h @@ -157,6 +157,7 @@ class VisuGUI_ScalarBarPane : public QVBox void changeDefaults( int ); void changeRange( int ); void XYChanged( double ); + void changeScalarMode( int ); void onTextPref(); void onPreviewCheck(bool thePreview); void updatePreview();