X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Polyline.cxx;h=80bd0f4b2a7e1ad27850d141f0b3c50b78adb513;hb=f7c005b67e48ec7bac99c566fb4f34215ec1a4b1;hp=fc6d72ceb7f3f1951185c7ba519b2f168d309f41;hpb=0d9decc8762a829f1bdc69048fab08122e441ec0;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Polyline.cxx b/src/HYDROData/HYDROData_Polyline.cxx index fc6d72ce..80bd0f4b 100755 --- a/src/HYDROData/HYDROData_Polyline.cxx +++ b/src/HYDROData/HYDROData_Polyline.cxx @@ -1,3 +1,25 @@ +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #include #include @@ -23,12 +45,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) @@ -62,7 +83,7 @@ QStringList HYDROData_Polyline::DumpToPython( MapOfTreatedObjects& theTreatedObj { QStringList aResList; - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab ); if ( aDocument.IsNull() ) return aResList; @@ -397,6 +418,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 +467,25 @@ void HYDROData_Polyline::UpdateWire( const PolylineData& theSections ) aMakeSectionWire.Add( anEdge ); } TopoDS_Wire aSectionWire = aMakeSectionWire.Wire(); + aSectionWiresList.Append( aSectionWire ); aMakeWire.Add( aSectionWire ); } } - TopoDS_Wire aWire = aMakeWire.Wire(); - SetTopShape( aWire ); + 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 ); }