+ aResult = processApply( anUpdateFlags, anErrorMsg );
+ }
+ catch ( Standard_Failure )
+ {
+ Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
+ anErrorMsg = aFailure->GetMessageString();
+ aResult = false;
+ }
+ catch ( ... )
+ {
+ aResult = false;
+ }
+
+ QApplication::restoreOverrideCursor();
+
+ if ( aResult )
+ {
+ module()->update( anUpdateFlags );
+ commit();
+ }
+ else
+ {
+ abort();
+ QString aMsg = tr( "INPUT_VALID_DATA" );
+ if( !anErrorMsg.isEmpty() )
+ aMsg.prepend( anErrorMsg + "\n" );
+ SUIT_MessageBox::critical( module()->getApp()->desktop(),
+ tr( "INSUFFICIENT_INPUT_DATA" ),
+ aMsg );
+ }
+}
+
+void HYDROGUI_CalculationOp::onSplitZones()
+{
+ //myRegionsList.clear();
+
+ HYDROGUI_CalculationDlg* aPanel =
+ ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
+ if ( !aPanel )
+ return;
+
+ QApplication::setOverrideCursor( Qt::WaitCursor );
+
+ //QStringList aGeomObjectNames = aPanel->getSelectedGeomObjects();
+ //HYDROData_SequenceOfObjects aGeomObjects =
+ // HYDROGUI_Tool::FindObjectsByNames( module(), aGeomObjectNames );
+
+ //QStringList aResSplittedZones;
+
+ //HYDROData_SplitToZonesTool::SplitDataList aSplittedZones =
+ // HYDROData_SplitToZonesTool::SplitToZones( aGeomObjects );
+
+ //QStringList aUsedNames;
+
+ //HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplittedZones );
+ //while( anIter.hasNext() )
+ //{
+ // Region aRegion;
+ // aRegion.SplitData = anIter.next();
+
+ // aRegion.FillingColor = HYDROGUI_Tool::GenerateFillingColor( module(), aRegion.SplitData.ObjectNames );
+ // aRegion.BorderColor = QColor( HYDROData_ImmersibleZone::DefaultBorderColor() );
+
+ // aRegion.RegionName = HYDROGUI_Tool::GenerateObjectName( module(), "Region", aUsedNames );
+
+ // aUsedNames.append( aRegion.RegionName );
+
+ // aResSplittedZones.append( aRegion.RegionName );
+
+ // myRegionsList.append( aRegion );
+ //}
+ //
+
+ myEditedObject->SplitGeometryObjects();
+ aPanel->setEditedObject( myEditedObject );
+ createPreview();
+
+ QApplication::restoreOverrideCursor();
+}
+
+void HYDROGUI_CalculationOp::createPreview()
+{
+ LightApp_Application* anApp = module()->getApp();
+
+ if ( !myActiveViewManager )
+ {
+ if ( myRegionsList.isEmpty() )
+ return;
+
+ myActiveViewManager = anApp->activeViewManager();