#include "HYDROData_Document.h"
#include "HYDROData_Iterator.h"
#include "HYDROData_Tool.h"
+#include "HYDROData_PolylineXY.h"
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_MakePolygon.hxx>
#include <gp_XY.hxx>
#include <gp_XYZ.hxx>
{
HYDROData_Object::Update();
- BRepBuilderAPI_MakeWire aMakeWire;
-
- ProfilePoints aProfilePoints = GetProfilePoints();
- for ( int i = 1, n = aProfilePoints.Length(); i < n ; ++i )
+ TopoDS_Wire aWire;
+ Handle(HYDROData_ProfileUZ) aProfile = GetProfileUZ( false );
+ if ( !aProfile.IsNull() )
{
- ProfilePoint aFirstPoint = aProfilePoints.Value( i );
- ProfilePoint aSecPoint = aProfilePoints.Value( i + 1 );
-
- gp_Pnt aPnt1( aFirstPoint.X(), aFirstPoint.Y(), aFirstPoint.Z() );
- gp_Pnt aPnt2( aSecPoint.X(), aSecPoint.Y(), aSecPoint.Z() );
-
- BRepBuilderAPI_MakeEdge aMakeEdge( aPnt1, aPnt2 );
- TopoDS_Edge anEdge = aMakeEdge;
+ ProfilePoints aProfilePoints = GetProfilePoints();
+ HYDROData_IPolyline::SectionType aSectionType = aProfile->GetSectionType( 0 );
- aMakeWire.Add( anEdge );
+ aWire = HYDROData_PolylineXY::BuildWire( aSectionType, false, aProfilePoints );
}
-
- TopoDS_Wire aWire;
- if ( aMakeWire.IsDone() )
- aWire = aMakeWire;
-
SetShape3D( aWire );
}