From: nds Date: Thu, 26 Dec 2013 10:30:18 +0000 (+0000) Subject: Refs #289 - Spline profile is represented in OCC view as polyline profile X-Git-Tag: BR_hydro_v_0_7~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5a250a4946c626b9f3b549ff5c2bdca4a7d438a2;p=modules%2Fhydro.git Refs #289 - Spline profile is represented in OCC view as polyline profile --- diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 226cf65e..f55f42b8 100755 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -338,7 +338,7 @@ TopoDS_Wire HYDROData_PolylineXY::BuildWire( const SectionType& aMakeWire.Add( aPnt ); } if( theIsClosed ) - aMakeWire.Close();//.Add( thePoints.Value( 1 ) ); + aMakeWire.Close(); if ( aMakeWire.IsDone() ) aWire = aMakeWire.Wire(); diff --git a/src/HYDROData/HYDROData_Profile.cxx b/src/HYDROData/HYDROData_Profile.cxx index f970509e..a3cbe730 100755 --- a/src/HYDROData/HYDROData_Profile.cxx +++ b/src/HYDROData/HYDROData_Profile.cxx @@ -4,6 +4,7 @@ #include "HYDROData_Document.h" #include "HYDROData_Iterator.h" #include "HYDROData_Tool.h" +#include "HYDROData_PolylineXY.h" #include #include @@ -86,41 +87,15 @@ void HYDROData_Profile::Update() { 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 ); }