- TopGroupLayout->addWidget( MaxIso, 1, 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 );
+ LabelMax->setBuddy(MaxIso);
+ TopGroupLayout->addWidget( MaxIso, 2, 1 );
+
+ 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() ) );
+}
+
+void VisuGUI_IsoSurfPane::initFromPrsObject (VISU::IsoSurfaces_i* thePrs)
+{
+ NbrIso->setValue(thePrs->GetNbSurfaces());
+ MinIso->setText(QString::number(thePrs->GetSubMin()));
+ MaxIso->setText(QString::number(thePrs->GetSubMax()));
+}
+
+int VisuGUI_IsoSurfPane::storeToPrsObject (VISU::IsoSurfaces_i* thePrs)
+{
+ thePrs->SetNbSurfaces(NbrIso->value());
+ thePrs->SetSubRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
+ return 1;
+}
+
+void VisuGUI_IsoSurfPane::onCBUpdate()
+{
+ myScalarPane->setRange(MinIso->text().toDouble(), MaxIso->text().toDouble(), 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;
+ }
+ return true;
+}
+
+
+
+
+
+/*!
+ Constructor
+*/
+VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule)
+{
+ setCaption(tr("DEFINE_ISOSURFACES"));
+ setSizeGripEnabled( TRUE );
+
+ QVBoxLayout* TopLayout = new QVBoxLayout(this);
+ TopLayout->setSpacing( 6 );
+ TopLayout->setMargin(11);
+
+ myTabBox = new QTabWidget(this);
+ myIsoPane = new VisuGUI_IsoSurfPane(this, GetScalarPane());
+ myIsoPane->setMargin( 5 );
+ myTabBox->addTab(myIsoPane, "Iso Surface");
+ myInputPane = new VisuGUI_InputPane(VISU::TISOSURFACES, theModule, this);
+ myTabBox->addTab(GetScalarPane(), "Scalar Bar");
+ myTabBox->addTab(myInputPane, "Input");
+
+ TopLayout->addWidget(myTabBox);