]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
IPAL20737 Magnitude coloring option is incorrect for Deformed Shape and view differs...
authordmv <dmv@opencascade.com>
Thu, 4 Dec 2008 09:51:47 +0000 (09:51 +0000)
committerdmv <dmv@opencascade.com>
Thu, 4 Dec 2008 09:51:47 +0000 (09:51 +0000)
src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx
src/VISUGUI/VisuGUI_IsoSurfacesDlg.h
src/VISUGUI/VisuGUI_StreamLinesDlg.cxx

index fe3d30ba3f4932b84aaf069b93446a554575cb56..49d5539d3bcc5349e94aa79a1b6481755bc73741 100644 (file)
 #include "VisuGUI_Tools.h"
 #include "VisuGUI_InputPane.h"
 
-#include "VISU_ColoredPrs3dFactory.hh"
+#include <VISU_ColoredPrs3dFactory.hh>
 
-#include "LightApp_Application.h"
+#include <LightApp_Application.h>
 
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ResourceMgr.h"
+#include <QtxColorButton.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
 
 #include <limits.h>
 
@@ -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();
 }
 
 
index 4410e819c96c34dbcd31dbf02df77ce27b6849be..75dbf86e2effd56b0ecf88d3cacf9bab85ed9877 100644 (file)
@@ -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;
index 1283305e475cbb271f21c1ae6b06442d07fc23e0..886052490a579da639a07ffebcddb650215967d4 100644 (file)
@@ -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);