+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
+ Handle(HYDROData_Object) anObject;
+ Handle(HYDROData_Entity) anEntity;
+ QStringList aList;
+ HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() );
+ for( Standard_Integer anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
+ {
+ anEntity = aSeq.Value( anIndex );
+ if ( !anEntity.IsNull() )
+ {
+ anObject = Handle(HYDROData_Object)::DownCast( anEntity );
+ if( !anObject.IsNull() )
+ {
+ if (myEditedObject->AddGeometryObject( anObject ))
+ {
+ aList.append( anObject->GetName() );
+ }
+ }
+ }
+ }
+ HYDROGUI_CalculationDlg* aPanel =
+ ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
+ if ( aPanel )
+ {
+ updateGeomObjectsList( aPanel );
+ }
+}
+
+void HYDROGUI_CalculationOp::onRemoveObjects()
+{
+ // Remove selected objects from the calculation case
+ HYDROGUI_CalculationDlg* aPanel =
+ ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
+ if ( aPanel )
+ {
+ QStringList aList = aPanel->getSelectedGeomObjects();
+ Handle(HYDROData_Object) anObject;
+ Handle(HYDROData_Entity) anEntity;
+ for (int i = 0; i < aList.length(); i++)
+ {
+ anEntity = HYDROGUI_Tool::FindObjectByName( module(), aList.at(i) );
+ if ( !anEntity.IsNull() )
+ {
+ anObject = Handle(HYDROData_Object)::DownCast( anEntity );
+ if ( !anObject.IsNull() )
+ {
+ myEditedObject->RemoveGeometryObject( anObject );
+ }
+ }
+ }
+ updateGeomObjectsList( aPanel );
+ }
+}
+