- // Restore shape from the stream and get the GEOM object
- GEOM::GEOM_IInsertOperations_var anInsOp = theGeomEngine->GetIInsertOperations( theStudy->StudyId() );
- aGeomObj = anInsOp->RestoreShape( aSeqFile );
-
- // Puplish the GEOM object
- if ( !aGeomObj->_is_nil() ) {
- QString aName = GEOMBase::GetDefaultName( theName );
-
- SALOMEDS::SObject_var aResultSO =
- theGeomEngine->PublishInStudy( theStudy, SALOMEDS::SObject::_nil(),
- aGeomObj, qPrintable( aName ) );
- if ( aResultSO->_is_nil() ) {
- aGeomObj = GEOM::GEOM_Object::_nil();
+QString HYDROData_CalculationCase::DumpRules() const
+{
+ TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
+ return HYDROData_PriorityQueue::DumpRules( aRulesLab );
+}
+
+void HYDROData_CalculationCase::SetAssignmentMode( AssignmentMode theMode )
+{
+ TDF_Label aModeLab = myLab.FindChild( DataTag_AssignmentMode );
+ TDataStd_Integer::Set( aModeLab, ( int ) theMode );
+
+ // Indicate model of the need to update splitting
+ Changed( Geom_2d );
+}
+
+HYDROData_CalculationCase::AssignmentMode HYDROData_CalculationCase::GetAssignmentMode() const
+{
+ Handle(TDataStd_Integer) aModeAttr;
+ bool isOK = myLab.FindChild( DataTag_AssignmentMode ).FindAttribute( TDataStd_Integer::GetID(), aModeAttr );
+ if( isOK )
+ return ( AssignmentMode ) aModeAttr->Get();
+ else
+ return MANUAL;
+}
+
+void HYDROData_CalculationCase::DumpRulesToPython( const QString& theCalcCaseName,
+ QStringList& theScript ) const
+{
+ TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
+ HYDROData_PriorityQueue::DumpRulesToPython( aRulesLab, theCalcCaseName, theScript );
+}
+
+HYDROData_Warning HYDROData_CalculationCase::GetLastWarning() const
+{
+ return myLastWarning;
+}
+
+void HYDROData_CalculationCase::SetWarning( HYDROData_WarningType theType, const QString& theData )
+{
+ myLastWarning.Type = theType;
+ myLastWarning.Data = theData;
+}
+
+void HYDROData_CalculationCase::UpdateRegionsNames( const HYDROData_SequenceOfObjects& theRegions,
+ const QString& theOldCaseName,
+ const QString& theName )
+{
+ HYDROData_SequenceOfObjects::Iterator anIter( theRegions );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Region) aRegion =
+ Handle(HYDROData_Region)::DownCast( anIter.Value() );
+ if ( aRegion.IsNull() )
+ continue;
+
+ HYDROData_Tool::UpdateChildObjectName( theOldCaseName, theName, aRegion );
+
+ HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
+ HYDROData_SequenceOfObjects::Iterator anIter( aZones );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Zone) aRegZone =
+ Handle(HYDROData_Zone)::DownCast( anIter.Value() );
+ if ( aRegZone.IsNull() )
+ continue;
+
+ HYDROData_Tool::UpdateChildObjectName( theOldCaseName, theName, aRegZone );