+ SUIT_DataObject* aRoot = myBrowser->root();
+ module()->getDataModel()->updateObjectTree( myEditedObject );
+ module()->getDataModel()->buildCaseTree( aRoot, myEditedObject );
+ myBrowser->updateTree( aRoot );
+}
+
+void HYDROGUI_CalculationDlg::onDataChanged()
+{
+ SUIT_DataObject* aRoot = myBrowser->root();
+ module()->getDataModel()->buildCaseTree( aRoot, myEditedObject );
+ myBrowser->updateTree( aRoot );
+}
+
+void HYDROGUI_CalculationDlg::setAvailableGroups( const QStringList& theGroups )
+{
+ myAvailableGroups->clear();
+ myGroups->clear();
+ foreach( QString aGroup, theGroups )
+ myAvailableGroups->addItem( aGroup );
+}
+
+QStringList HYDROGUI_CalculationDlg::getSelectedGroups() const
+{
+ return getSelected( myGroups );
+}
+
+QStringList HYDROGUI_CalculationDlg::getSelectedAvailableGroups() const
+{
+ return getSelected( myAvailableGroups );
+}
+
+void HYDROGUI_CalculationDlg::includeGroups( const QStringList& theObjects )
+{
+ moveItems( myAvailableGroups, myGroups, theObjects );
+}
+
+void HYDROGUI_CalculationDlg::excludeGroups( const QStringList& theObjects )
+{
+ moveItems( myGroups, myAvailableGroups, theObjects );
+}
+
+/**
+ Get creation mode.
+ @param theMode the mode
+*/
+int HYDROGUI_CalculationDlg::getMode() const
+{
+ return myModeButtons->checkedId();
+}
+
+/**
+ Set creation mode.
+ @param theMode the mode
+*/
+void HYDROGUI_CalculationDlg::setMode( int theMode )
+{
+ bool isBlocked = myModeButtons->blockSignals( true );
+ myModeButtons->button( theMode )->setChecked( true );
+ myModeButtons->blockSignals( isBlocked );
+
+ bool isAuto = ( theMode == HYDROData_CalculationCase::AUTOMATIC );
+
+ myGeomObjects->setOrderingEnabled( isAuto );
+ QWidget* aWidget = mySplitter->widget( 1 );
+ if ( aWidget ) {
+ aWidget->setVisible( isAuto );
+ }
+}
+
+/**
+ Enable/disable zones drag'n'drop and renaming.
+ @param theIsEnabled if true - zones drag'n'drop and renaming will be enabled
+*/
+void HYDROGUI_CalculationDlg::setEditZonesEnabled( const bool theIsEnabled )
+{
+ myBrowser->setReadOnly( !theIsEnabled );
+}
+
+/**
+ Get included geometry objects.
+ @return the list of geometry objects
+ */
+QList<Handle(HYDROData_Entity)> HYDROGUI_CalculationDlg::getGeometryObjects()
+{
+ QList<Handle(HYDROData_Entity)> anEntities = myGeomObjects->getObjects();
+ QList<Handle(HYDROData_Entity)> anObjects;
+
+ foreach ( Handle(HYDROData_Entity) anEntity, anEntities ) {
+ Handle(HYDROData_Object) anObj = Handle(HYDROData_Object)::DownCast( anEntity );
+ if ( anObj.IsNull() ) {
+ continue;
+ }
+
+ anObjects << anObj;
+ }
+
+ return anObjects;
+}
+
+/**
+ Get rules.
+ @return the list of rules
+ */
+HYDROData_ListOfRules HYDROGUI_CalculationDlg::getRules() const
+{
+ return myPriorityWidget->getRules();
+}
+
+/**
+ Set rules.
+ @param theRules the list of rules
+ */
+void HYDROGUI_CalculationDlg::setRules( const HYDROData_ListOfRules& theRules ) const
+{
+ myPriorityWidget->setRules( theRules );
+}
+
+/**
+ Slot called when objects order is changed.
+ */
+void HYDROGUI_CalculationDlg::onOrderChanged()
+{
+ bool isConfirmed = true;
+ emit orderChanged( isConfirmed );
+ if( isConfirmed )
+ myPriorityWidget->setObjects( getGeometryObjects() );
+ else
+ myGeomObjects->undoLastMove();
+}
+
+/**
+ Slot called when priority rule for geometry objects is changed.
+ */
+void HYDROGUI_CalculationDlg::onRuleChanged()
+{
+ bool isConfirmed = true;
+ emit ruleChanged( isConfirmed );
+ if( !isConfirmed )
+ myPriorityWidget->undoLastChange();
+}
+
+void HYDROGUI_CalculationDlg::setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals )
+{
+ bool isBlocked;
+ if ( theBlockSignals )
+ isBlocked = myStricklerTableName->blockSignals( true );
+
+ myStricklerTableName->setCurrentIndex( myStricklerTableName->findText( theStricklerTableName ) );
+
+ if ( theBlockSignals )
+ myStricklerTableName->blockSignals( isBlocked );
+ else
+ emit StricklerTableSelected( theStricklerTableName );
+}
+
+void HYDROGUI_CalculationDlg::setLandCoverMap( const QString& theLandCoverMapName, bool theBlockSignals )
+{
+ bool isBlocked;
+ if ( theBlockSignals )
+ isBlocked = myLandCoverMapName->blockSignals( true );
+
+ myLandCoverMapName->setCurrentIndex( myLandCoverMapName->findText( theLandCoverMapName ) );
+
+ if ( theBlockSignals )
+ myLandCoverMapName->blockSignals( isBlocked );
+ else
+ emit landCoverMapSelected( theLandCoverMapName );
+}