#include <TCollection_AsciiString.hxx>
#endif
-#define PYTHON_STREAM_ID "KIND_STREAM"
-
typedef NCollection_DataMap<Standard_Real, Handle(HYDROData_Profile)> HYDROData_DataMapOfRealOfHDProfile;
IMPLEMENT_STANDARD_HANDLE(HYDROData_Stream,HYDROData_NaturalObject)
QStringList HYDROData_Stream::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
- QStringList aResList;
+ QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetObjPyName();
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
- if ( aDocument.IsNull() )
- return aResList;
+ Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis();
+ setPythonReferenceObject( theTreatedObjects, aResList, aHydAxis, "SetHydraulicAxis" );
- QString aDocName = aDocument->GetDocPyName();
- QString aStreamName = GetName();
+ HYDROData_SequenceOfObjects aSeqOfProfiles = GetProfiles();
+ for ( int i = 1, aNb = aSeqOfProfiles.Size(); i <= aNb; ++i )
+ {
+ const Handle(HYDROData_Entity) aProfile = aSeqOfProfiles.Value( i );
+ setPythonReferenceObject( theTreatedObjects, aResList, aProfile, "AddProfile" );
+ }
- aResList << QString( "%1 = %2.CreateObject( %3 );" )
- .arg( aStreamName ).arg( aDocName ).arg( PYTHON_STREAM_ID );
- aResList << QString( "%1.SetName( \"%2\" );" )
- .arg( aStreamName ).arg( aStreamName );
aResList << QString( "" );
-
- // TODO
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
return aResList;
}
if(aMakeEdge3.IsDone())
aTopEdge = aMakeEdge3.Edge();
- BRepBuilderAPI_MakeWire aMakeWire( aBotEdge, anEdgLeft, aTopEdge,anEdgRight);
+ // Make wire for 2D presentation with updating of corresponding edges
+ BRepBuilderAPI_MakeWire aMakeWire;
+
+ aMakeWire.Add( aBotEdge );
+ aBotEdge = aMakeWire.Edge();
+
+ aMakeWire.Add( anEdgLeft );
+ anEdgLeft = aMakeWire.Edge();
+
+ aMakeWire.Add( aTopEdge );
+ aTopEdge = aMakeWire.Edge();
+
+ aMakeWire.Add( anEdgRight );
+ anEdgRight = aMakeWire.Edge();
+
TopoDS_Wire aSectProfileWire;
if(aMakeWire.IsDone())
aSectProfileWire = aMakeWire.Wire();
+
BRepBuilderAPI_MakeFace aMakeFace( aSectProfileWire, Standard_True );
TopoDS_Face aFace;
aMakeFace.Build();
if( aMakeFace.IsDone() )
aFace = aMakeFace.Face();
+
aCmp.Nullify();
aBB.MakeCompound(aCmp);
aBB.Add(aCmp,aFace);