From: asl Date: Fri, 23 Oct 2015 15:34:14 +0000 (+0300) Subject: code revision X-Git-Tag: v1.5~70 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ea24c0c5ef94a08fff17e9d2cde931250bc0677e;p=modules%2Fhydro.git code revision --- diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index d77a212d..7c619b90 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -710,29 +710,38 @@ bool HYDROData_LandCoverMap::LocalPartition( const TopoDS_Shape& theNewShape, co */ void HYDROData_LandCoverMap::StoreLandCovers( const HYDROData_MapOfFaceToStricklerType& theMap ) { - TopoDS_Shell aShell; - BRep_Builder aShellBuilder; - aShellBuilder.MakeShell( aShell ); - aShell.Closed( Standard_False ); TopTools_ListOfShape aListOfFaces; int n = theMap.Size(); + Handle( TDataStd_ExtStringArray ) aTypes = TDataStd_ExtStringArray::Set( myLab.FindChild( DataTag_Types ), 0, n-1, Standard_True ); + HYDROData_MapOfFaceToStricklerType::Iterator aNFIt( theMap ); for( int i=0; aNFIt.More(); aNFIt.Next(), i++ ) { TopoDS_Face aFace = aNFIt.Key(); - if (aFace.IsNull()) + if( aFace.IsNull() ) continue; QString aType = aNFIt.Value(); - aShellBuilder.Add( aShell, aFace ); aListOfFaces.Append(aFace); aTypes->SetValue( i, HYDROData_Tool::toExtString( aType ) ); } - TopoDS_Shape aMF = MergeFaces(aListOfFaces, false); - SetShape( aListOfFaces.Extent() < 2 ? aShell : MergeFaces(aListOfFaces, false)); + TopoDS_Shape aResult; + if( aListOfFaces.Extent() == 1 ) + { + TopoDS_Shell aShell; + BRep_Builder aShellBuilder; + aShellBuilder.MakeShell( aShell ); + aShell.Closed( Standard_False ); + aShellBuilder.Add( aShell, aListOfFaces.First() ); + aResult = aShell; + } + else if( aListOfFaces.Extent() > 1 ) + aResult = MergeFaces( aListOfFaces, false ); + + SetShape( aResult ); } /**