From: szy Date: Fri, 13 Dec 2013 14:59:06 +0000 (+0000) Subject: 13.12.2013. Redesigned Update method (returns compound of Wires). X-Git-Tag: BR_hydro_v_0_6~87 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=86bb78f9a20bd772dfa846009ce397120540caf1;p=modules%2Fhydro.git 13.12.2013. Redesigned Update method (returns compound of Wires). --- diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 2032ba0b..eaea172a 100755 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -33,8 +33,11 @@ #include #include +#include #include - +#include +#include +#include #include #include #include @@ -237,9 +240,32 @@ void HYDROData_PolylineXY::Update() aMakeWire.Add( aSectionWire ); } } +// all input wires in the + Handle(TopTools_HSequenceOfShape) aSeqWires = new TopTools_HSequenceOfShape; + Handle(TopTools_HSequenceOfShape) aSeqEdges = new TopTools_HSequenceOfShape; + TopTools_ListIteratorOfListOfShape it(aSectionWiresList); + for(;it.More();it.Next()) { + TopoDS_Iterator it2(it.Value()); + for(;it2.More();it2.Next()) + aSeqEdges->Append(it2.Value()); + } + BRep_Builder aBB; + TopoDS_Compound aCmp; + aBB.MakeCompound(aCmp); + if(aSeqEdges->Length() >1) { + ShapeAnalysis_FreeBounds::ConnectEdgesToWires(aSeqEdges,Precision::Confusion(),Standard_True,aSeqWires); + for (Standard_Integer i = 1; i <= aSeqWires->Length();i++) { + const TopoDS_Shape& aS1 = aSeqWires->Value(i); + aBB.Add(aCmp, aS1); + } + } else if (aSeqEdges->Length() == 1) { + BRepBuilderAPI_MakeWire mkWire (TopoDS::Edge(aSeqEdges->Value(1))); + if (mkWire.IsDone()) + aBB.Add(aCmp, mkWire.Wire()); + } - TopoDS_Shape aShape; - + +/* if ( aMakeWire.IsDone() ) { aShape = aMakeWire.Shape(); @@ -260,8 +286,8 @@ void HYDROData_PolylineXY::Update() aShape = aCompound; } - - setPolylineShape( aShape ); +*/ + setPolylineShape( aCmp ); } /**