Salome HOME
Image positioning by two points.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationOp.cxx
index f36ac726fec8dc87146b20666bef95ce448cb879..3dab9422c0eb0fecebb2a2df68669719be3c1248 100644 (file)
@@ -27,6 +27,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
+#include "HYDROGUI_Zone.h"
 
 #include <HYDROData_Polyline.h>
 #include <HYDROData_Iterator.h>
@@ -149,10 +150,27 @@ HYDROGUI_InputPanel* HYDROGUI_CalculationOp::createInputPanel() const
   connect( aPanel, SIGNAL( addObjects() ), SLOT( onAddObjects() ) );
   connect( aPanel, SIGNAL( removeObjects() ), SLOT( onRemoveObjects() ) );
   connect( aPanel, SIGNAL( splitZones() ), SLOT( onSplitZones() ) );
+  connect( aPanel, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
+  connect( aPanel, SIGNAL( setMergeType( int, QString ) ), SLOT( onSetMergeType( int, QString ) ) );
 
   return aPanel;
 }
 
+void HYDROGUI_CalculationOp::onSetMergeType( int theMergeType, QString theBathymetryName )
+{
+  HYDROGUI_CalculationDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
+  if ( aPanel )
+  {
+    HYDROGUI_Zone* aZone = aPanel->getCurrentZone();
+    if ( aZone )
+    {
+      aZone->setMergeType( theMergeType, theBathymetryName );
+    }
+    aPanel->refreshZonesBrowser();
+  }
+}
+
 void HYDROGUI_CalculationOp::onAddObjects()
 {
   // Add geometry objects selected in the module browser to the calculation case