#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>
+#include <BRep_Builder.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <QStringList>
-// 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)
{
QStringList aResList;
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
if ( aDocument.IsNull() )
return aResList;
aResList << QString( "" );
int aDim = GetDimension();
- aResList << QString( "%1.setDimension( %2 );" )
+ aResList << QString( "%1.SetDimension( %2 );" )
.arg( aPolylineName ).arg( aDim );
// Set polilyne data
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 );
}
double aZValue = ZValue();
+ TopTools_ListOfShape aSectionWiresList;
+
int aSectionCount = theSections.size();
for( int aSectionId = 0; aSectionId < aSectionCount; aSectionId++ )
{
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 );
}