X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_CalculationCase.cxx;h=9d6b58f460957305786c6056ca4d85439d3c886c;hb=424f8230c9003d00fb27499b2441c4b3a2a28292;hp=9d556eca30d79ac37b94d87906e76dcfd85d7ef8;hpb=34310fe4f26db0f23c2edfef1678e5b02f578204;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 9d556eca..9d6b58f4 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -132,12 +132,21 @@ QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTre HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetAllReferenceObjects() const { HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects(); - aResSeq.Append( GetRegions() ); + + Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline(); + if ( !aBoundaryPolyline.IsNull() ) + aResSeq.Append( aBoundaryPolyline ); + + HYDROData_SequenceOfObjects aSeqOfRegions = GetRegions(); + aResSeq.Append( aSeqOfRegions ); + return aResSeq; } -void HYDROData_CalculationCase::SplitGeometryObjects() +void HYDROData_CalculationCase::Update() { + HYDROData_Entity::Update(); + // At first we remove previously created regions RemoveRegions(); @@ -191,9 +200,6 @@ void HYDROData_CalculationCase::SplitGeometryObjects() aRegionZone->AddGeometryObject( aRefObject ); } } - - // The splitted data is up to date - SetToUpdate( false ); } bool HYDROData_CalculationCase::AddGeometryObject( const Handle(HYDROData_Object)& theObject ) @@ -423,29 +429,32 @@ TopoDS_Shell HYDROData_CalculationCase::GetShell() aSewing.Perform(); TopoDS_Shape aSewedShape = aSewing.SewedShape(); - if ( aSewedShape.ShapeType() == TopAbs_FACE && aCaseRegions.Length() ==1 ) { - // create shell from one face - BRep_Builder aBuilder; - aBuilder.MakeShell( aShell ); - aBuilder.Add( aShell, aSewedShape); - } else { - TopExp_Explorer anExpShells( aSewedShape, TopAbs_SHELL ); - Standard_Integer aNbOfShells = 0; - for ( ; anExpShells.More(); anExpShells.Next() ) { - aShell = TopoDS::Shell( anExpShells.Current() ); - aNbOfShells++; - } - - if ( aNbOfShells != 1 ) { - aShell.Nullify(); + if ( !aSewedShape.IsNull() ) + { + if ( aSewedShape.ShapeType() == TopAbs_FACE && aCaseRegions.Length() ==1 ) { + // create shell from one face BRep_Builder aBuilder; aBuilder.MakeShell( aShell ); + aBuilder.Add( aShell, aSewedShape); + } else { + TopExp_Explorer anExpShells( aSewedShape, TopAbs_SHELL ); + Standard_Integer aNbOfShells = 0; + for ( ; anExpShells.More(); anExpShells.Next() ) { + aShell = TopoDS::Shell( anExpShells.Current() ); + aNbOfShells++; + } - TopExp_Explorer anExpFaces( aSewedShape, TopAbs_FACE ); - for ( ; anExpFaces.More(); anExpFaces.Next() ) { - TopoDS_Face aFace = TopoDS::Face( anExpFaces.Current() ); - if ( !aFace.IsNull() ) { - aBuilder.Add( aShell, aFace ); + if ( aNbOfShells != 1 ) { + aShell.Nullify(); + BRep_Builder aBuilder; + aBuilder.MakeShell( aShell ); + + TopExp_Explorer anExpFaces( aSewedShape, TopAbs_FACE ); + for ( ; anExpFaces.More(); anExpFaces.Next() ) { + TopoDS_Face aFace = TopoDS::Face( anExpFaces.Current() ); + if ( !aFace.IsNull() ) { + aBuilder.Add( aShell, aFace ); + } } } }