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