X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Polyline.cxx;h=c88500016d63b6b7988316f23ba52ef6bbdd3042;hb=deed826b2d6c39ba2ed410108cdf54d64cded321;hp=8e6b3d766f00ac112d036f6670709b591bf367bc;hpb=2bf0132396b27e6bb9e1af570b1aa3b2b04d0509;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Polyline.cxx b/src/HYDROData/HYDROData_Polyline.cxx index 8e6b3d76..c8850001 100755 --- a/src/HYDROData/HYDROData_Polyline.cxx +++ b/src/HYDROData/HYDROData_Polyline.cxx @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include @@ -397,6 +399,8 @@ void HYDROData_Polyline::UpdateWire( const PolylineData& theSections ) double aZValue = ZValue(); + TopTools_ListOfShape aSectionWiresList; + int aSectionCount = theSections.size(); for( int aSectionId = 0; aSectionId < aSectionCount; aSectionId++ ) { @@ -444,10 +448,25 @@ void HYDROData_Polyline::UpdateWire( const PolylineData& theSections ) aMakeSectionWire.Add( anEdge ); } TopoDS_Wire aSectionWire = aMakeSectionWire.Wire(); + aSectionWiresList.Append( aSectionWire ); aMakeWire.Add( aSectionWire ); } } - TopoDS_Shape aShape = aMakeWire.Shape(); + TopoDS_Shape aShape; + if ( aMakeWire.IsDone() ) { + aShape = aMakeWire.Shape(); + } else { + // build compound + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + aBuilder.MakeCompound( aCompound ); + TopTools_ListIteratorOfListOfShape anIter( aSectionWiresList ); + for ( ; anIter.More(); anIter.Next() ) { + aBuilder.Add( aCompound, anIter.Value() ); + } + aShape = aCompound; + } + SetTopShape( aShape ); }