From 494cd1fe59d9054461e04a02eacd4a9bcd8d1f66 Mon Sep 17 00:00:00 2001 From: dmv Date: Thu, 4 Dec 2008 09:51:47 +0000 Subject: [PATCH] IPAL20737 Magnitude coloring option is incorrect for Deformed Shape and view differs for Iso Surfaces --- src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx | 35 +++++++++++++------------- src/VISUGUI/VisuGUI_IsoSurfacesDlg.h | 3 ++- src/VISUGUI/VisuGUI_StreamLinesDlg.cxx | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx index fe3d30ba..49d5539d 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx @@ -32,14 +32,15 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_InputPane.h" -#include "VISU_ColoredPrs3dFactory.hh" +#include -#include "LightApp_Application.h" +#include -#include "SUIT_Desktop.h" -#include "SUIT_Session.h" -#include "SUIT_MessageBox.h" -#include "SUIT_ResourceMgr.h" +#include +#include +#include +#include +#include #include @@ -106,14 +107,11 @@ VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent, myUseMagnitude = new QCheckBox(tr("MAGNITUDE_COLORING_CHK"), TopGroup); myUseMagnitude->setChecked(true); TopGroupLayout->addWidget( myUseMagnitude, 3, 0 ); - mySelColor = new QPushButton(tr("SEL_COLOR_BTN"), TopGroup); - QPalette pal = mySelColor->palette(); - pal.setColor(mySelColor->backgroundRole(), Qt::black); - pal.setColor(mySelColor->foregroundRole(), Qt::gray); - mySelColor->setPalette(pal); - mySelColor->setDisabled(true); + + mySelColor = new QtxColorButton( TopGroup ); + mySelColor->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); TopGroupLayout->addWidget( mySelColor, 3, 1 ); - connect( mySelColor, SIGNAL( clicked() ), this, SLOT( setColor() ) ); + //connect( mySelColor, SIGNAL( clicked() ), this, SLOT( setColor() ) ); connect( myUseMagnitude, SIGNAL( toggled(bool) ), mySelColor, SLOT( setDisabled(bool) ) ); myUseLabels = new QCheckBox(tr("SHOW_VALUES_CHK"), TopGroup); @@ -130,6 +128,7 @@ VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent, QPushButton* aUpdateBtn = new QPushButton( "Update scalar bar range with these values", TopGroup); TopGroupLayout->addWidget( aUpdateBtn, 5, 0, 1, 2); connect( aUpdateBtn, SIGNAL( clicked() ), this, SLOT(onCBUpdate() ) ); + mySelColor->setEnabled( !myUseMagnitude->isChecked() ); } void VisuGUI_IsoSurfPane::initFromPrsObject (VISU::IsoSurfaces_i* thePrs) @@ -144,6 +143,7 @@ void VisuGUI_IsoSurfPane::initFromPrsObject (VISU::IsoSurfaces_i* thePrs) myUseLabels->setChecked(thePrs->IsLabeled()); myNbLabels->setValue(thePrs->GetNbLabels()); + mySelColor->setEnabled( !myUseMagnitude->isChecked() ); } int VisuGUI_IsoSurfPane::storeToPrsObject (VISU::IsoSurfaces_i* thePrs) @@ -187,16 +187,17 @@ void VisuGUI_IsoSurfPane::setColor() setColor(cnew); } -void VisuGUI_IsoSurfPane::setColor(const QColor& theColor) +void VisuGUI_IsoSurfPane::setColor( const QColor& theColor) { - QPalette pal = mySelColor->palette(); + /* QPalette pal = mySelColor->palette(); pal.setColor(mySelColor->backgroundRole(), theColor); - mySelColor->setPalette(pal); + mySelColor->setPalette(pal);*/ + mySelColor->setColor( theColor ); } QColor VisuGUI_IsoSurfPane::color() const { - return mySelColor->palette().color(mySelColor->backgroundRole()); + return mySelColor->color(); } diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h index 4410e819..75dbf86e 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h @@ -34,6 +34,7 @@ class QTabWidget; class QLineEdit; class QSpinBox; +class QtxColorButton; namespace VISU { @@ -69,7 +70,7 @@ private: QLineEdit* MaxIso; QSpinBox* NbrIso; QCheckBox* myUseMagnitude; - QPushButton* mySelColor; + QtxColorButton* mySelColor; QCheckBox* myUseLabels; QSpinBox* myNbLabels; VisuGUI_ScalarBarPane* myScalarPane; diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index 1283305e..88605249 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -259,7 +259,7 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) TopLayout->addWidget(myUseScalar, 5, 0); SelColor = new QtxColorButton( aTopBox ); - SelColor->setText( tr("USE_COLOR_BTN") ); + SelColor->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); //connect( SelColor, SIGNAL( clicked() ), this, SLOT( setVColor() ) ); TopLayout->addWidget( SelColor, 5, 1); -- 2.39.2