X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Polyline.cxx;h=3f561c5d302f3a090a7e2aebb6c8c4a17b36453d;hb=5809b0812bc9e9b2e34ba6d5a0c3842d97df6ca0;hp=abac653b3d138eecfc95ddddebfaf99e4d32bf60;hpb=84f8b4a57d3cdad820bc1333a5066699cd1c8ae3;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Polyline.cxx b/src/HYDROData/HYDROData_Polyline.cxx index abac653b..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) @@ -62,7 +61,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; @@ -78,7 +77,7 @@ QStringList HYDROData_Polyline::DumpToPython( MapOfTreatedObjects& theTreatedObj aResList << QString( "" ); int aDim = GetDimension(); - aResList << QString( "%1.setDimension( %2 );" ) + aResList << QString( "%1.SetDimension( %2 );" ) .arg( aPolylineName ).arg( aDim ); // Set polilyne data @@ -121,8 +120,9 @@ QStringList HYDROData_Polyline::DumpToPython( MapOfTreatedObjects& theTreatedObj aResList << QString( "%1.append( %2 );" ) .arg( aPolylineDataName ).arg( aPolylineSectName ); } + aResList << QString( "" ); - aResList << QString( "%1.setPolylineData( %2 );" ) + aResList << QString( "%1.SetPolylineData( %2 );" ) .arg( aPolylineName ).arg( aPolylineDataName ); } @@ -396,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++ ) { @@ -443,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_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 ); }