Salome HOME
Merge branch 'BR_LAND_COVER' of ssh://git.salome-platform.org/modules/hydro into...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationOp.cxx
index a63a43542a29895c315cec94d3be7bbb6ceae889..e00d3a44acbb29fafcf7050786eb0a17c078ecf7 100644 (file)
@@ -223,8 +223,9 @@ HYDROGUI_InputPanel* HYDROGUI_CalculationOp::createInputPanel() const
   connect( aPanel, SIGNAL( Back( const int ) ), SLOT( onHideZones( const int ) ) );
   //connect( aPanel, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
   connect( aPanel, SIGNAL( setMergeType( int, QString& ) ), SLOT( onSetMergeType( int, QString& ) ) );
-  connect( aPanel, SIGNAL( moveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>& ) ),
-    SLOT( onMoveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>& ) ) );
+  connect( aPanel, SIGNAL( setMergeStricklerType( int, QString& ) ), SLOT( onSetMergeStricklerType( int, QString& ) ) );
+  connect( aPanel, SIGNAL( moveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>&, bool ) ),
+    SLOT( onMoveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>&, bool ) ) );
   connect( aPanel, SIGNAL( createRegion( const QList<SUIT_DataObject*>& ) ),
     SLOT( onCreateRegion( const QList<SUIT_DataObject*>& ) ) );
   connect( aPanel, SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ),
@@ -460,7 +461,9 @@ void HYDROGUI_CalculationOp::onClickedInZonesBrowser( SUIT_DataObject* theItem )
   }
 }
 
-void HYDROGUI_CalculationOp::onMoveZones( SUIT_DataObject* theRegionItem, const QList<SUIT_DataObject*>& theZonesList )
+void HYDROGUI_CalculationOp::onMoveZones( SUIT_DataObject* theRegionItem,
+                                          const QList<SUIT_DataObject*>& theZonesList,
+                                          bool theLandCover )
 {
   HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theRegionItem);
   if ( aRegion )
@@ -483,9 +486,9 @@ void HYDROGUI_CalculationOp::onMoveZones( SUIT_DataObject* theRegionItem, const
         ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
       if ( aPanel )
       {
-        aPanel->refreshZonesBrowser();
+        theLandCover ? aPanel->refreshLandCoverZonesBrowser(): aPanel->refreshZonesBrowser();
       }
-      createPreview( false );
+      createPreview( theLandCover );
     }
   }
 }
@@ -538,6 +541,26 @@ void HYDROGUI_CalculationOp::onSetMergeType( int theMergeType, QString& theMerge
   }
 }
 
+void HYDROGUI_CalculationOp::onSetMergeStricklerType( int theMergeType, QString& theStricklerTypeName )
+{
+  HYDROGUI_CalculationDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
+  if ( aPanel )
+  {
+    HYDROGUI_Zone* aZone = aPanel->getCurrentZone();
+    if ( aZone )
+    {
+      aZone->setMergeType( theMergeType, theStricklerTypeName );
+      HYDROGUI_Shape* aShape = module()->getObjectShape( HYDROGUI_Module::VMR_PreviewCaseZones, aZone->modelObject() );
+      if ( aShape )
+      {
+        aShape->update( true, false );
+      }
+    }
+    aPanel->refreshLandCoverZonesBrowser();
+  }
+}
+
 void HYDROGUI_CalculationOp::onAddObjects()
 {
   HYDROGUI_CalculationDlg* aPanel = 
@@ -1040,7 +1063,7 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
         }
       }
     }
-    aPanel->setEditLandCoversEnabled( aMode == HYDROData_CalculationCase::MANUAL );
+    aPanel->setEditLandCoverZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL );
 
     bool anIsToUpdateOb = false;
     if ( myEditedObject->IsMustBeUpdated() )