X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Polyline.cxx;h=3f561c5d302f3a090a7e2aebb6c8c4a17b36453d;hb=5809b0812bc9e9b2e34ba6d5a0c3842d97df6ca0;hp=8e6b3d766f00ac112d036f6670709b591bf367bc;hpb=2bf0132396b27e6bb9e1af570b1aa3b2b04d0509;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Polyline.cxx b/src/HYDROData/HYDROData_Polyline.cxx index 8e6b3d76..3f561c5d 100755 --- a/src/HYDROData/HYDROData_Polyline.cxx +++ b/src/HYDROData/HYDROData_Polyline.cxx @@ -23,12 +23,11 @@ #include #include #include +#include +#include #include -// tage of the child of my label that contains information about the operator -static const Standard_GUID GUID_MUST_BE_UPDATED("6647e1f7-1971-4c5a-86c7-11ff0291452d"); - #define PYTHON_POLYLINE_ID "KIND_POLYLINE" IMPLEMENT_STANDARD_HANDLE(HYDROData_Polyline, HYDROData_Object) @@ -397,6 +396,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 +445,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 ); }