- TopGroupLayout->addWidget( MaxIso, 1, 1 );
-
- CBUpdate = new QCheckBox ( tr( "Update scalar bar with these values" ), TopGroup);
- CBUpdate->setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed) );
- TopGroupLayout->addMultiCellWidget( CBUpdate, 4, 4, 0, 1);
- CBUpdate->setChecked(true);
-
- CBLog = new QCheckBox ( tr( "Logarithmic scaling" ), TopGroup);
- CBLog->setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed) );
- TopGroupLayout->addMultiCellWidget( CBLog, 3, 3, 0, 1);
-
- QLabel* LabelNbr = new QLabel( tr( "Number of surfaces:" ), TopGroup, "LabelNbr" );
- TopGroupLayout->addWidget( LabelNbr, 2, 0 );
- NbrIso = new QSpinBox( 1, 100, 1, TopGroup, "NbrIso" );
- NbrIso->setValue( 1 );
- TopGroupLayout->addWidget( NbrIso, 2, 1 );
-
+ TopGroupLayout->addWidget( MaxIso, 2, 1 );
+
+
+// CBUpdate = new QCheckBox ( tr( "Update scalar bar with these values" ), TopGroup);
+// CBUpdate->setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed) );
+// TopGroupLayout->addMultiCellWidget( CBUpdate, 4, 4, 0, 1);
+// CBUpdate->setChecked(false);
+ QPushButton* aUpdateBtn = new QPushButton( "Update scalar bar range with these values", TopGroup);
+ TopGroupLayout->addMultiCellWidget( aUpdateBtn, 3, 3, 0, 1);
+ connect( aUpdateBtn, SIGNAL( clicked() ), this, SLOT(onCBUpdate() ) );
+
+// CBLog = new QCheckBox ( tr( "Logarithmic scaling" ), TopGroup);
+// CBLog->setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed) );
+// TopGroupLayout->addMultiCellWidget( CBLog, 3, 3, 0, 1);
+}
+
+void VisuGUI_IsoSurfPane::initFromPrsObject (VISU::IsoSurfaces_i* thePrs)
+{
+ NbrIso->setValue(thePrs->GetNbSurfaces());
+ MinIso->setText(QString::number(thePrs->GetSubMin()));
+ MaxIso->setText(QString::number(thePrs->GetSubMax()));
+// switch(thePrs->GetScaling()){
+// case VISU::LOGARITHMIC :
+// CBLog->setChecked(true);
+// break;
+// default:
+// CBLog->setChecked(false);
+// }
+}
+
+int VisuGUI_IsoSurfPane::storeToPrsObject (VISU::IsoSurfaces_i* thePrs)
+{
+ thePrs->SetNbSurfaces(NbrIso->value());
+ thePrs->SetSubRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
+ return 1;
+// if (CBUpdate->isChecked())
+// {
+// thePrs->SetRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
+// if (CBLog->isChecked())
+// thePrs->SetScaling(VISU::LOGARITHMIC);
+// else
+// thePrs->SetScaling(VISU::LINEAR);
+// }
+}
+
+void VisuGUI_IsoSurfPane::onCBUpdate()
+{
+ // if (CBUpdate->isChecked()) {
+ myScalarPane->setRange(MinIso->text().toDouble(), MaxIso->text().toDouble(), true);
+ // }
+// CBLog->setDisabled(false);
+// else CBLog->setDisabled(true);
+}
+
+bool VisuGUI_IsoSurfPane::check()
+{
+ if (MinIso->text().toDouble() >= MaxIso->text().toDouble()) {
+ MESSAGE(tr("MSG_MINMAX_VALUES"));
+ SUIT_MessageBox::warn1( this,tr("WRN_VISU"),
+ tr("MSG_MINMAX_VALUES"),
+ tr("BUT_OK"));
+ return false;
+ } // else if (/* CBUpdate->isChecked() && CBLog->isChecked() && */
+// (MinIso->text().toDouble() <=0 || MaxIso->text().toDouble() <=0) ) {
+// SUIT_MessageBox::warn1( this,
+// tr("WRN_VISU"),
+// tr("WRN_LOGARITHMIC_RANGE_ISOSURF"),
+// tr("BUT_OK"));
+// return false;
+// }
+ return true;
+}
+
+
+
+
+
+/*!
+ Constructor
+*/
+VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule)
+ : QDialog(VISU::GetDesktop(theModule), "VisuGUI_IsoSurfacesDlg", true,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+{
+ setCaption(tr("DEFINE_ISOSURFACES"));
+ setSizeGripEnabled( TRUE );
+
+ QVBoxLayout* TopLayout = new QVBoxLayout(this);
+ TopLayout->setSpacing( 6 );
+ TopLayout->setMargin(11);
+
+ QTabWidget* aTabBox = new QTabWidget(this);
+ myIsoPane = new VisuGUI_IsoSurfPane(this);
+ myIsoPane->setMargin( 5 );
+ aTabBox->addTab(myIsoPane, "Iso Surface");
+ myScalarPane = new VisuGUI_ScalarBarPane(this, false);
+ myIsoPane->setScalarBarPane(myScalarPane);
+ myScalarPane->setMargin( 5 );
+ aTabBox->addTab(myScalarPane, "Scalar Bar");
+
+ TopLayout->addWidget(aTabBox);
+