From 272fe04d70fa64f4fe1a271ef46614f71432502b Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 23 Dec 2013 09:10:58 +0000 Subject: [PATCH] bug #274: now the imported polyline is projected always on the plane XY --- src/HYDROData/HYDROData_PolylineXY.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 46e5205e..06ea1bbc 100755 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include @@ -21,6 +23,7 @@ #include #include +#include #include @@ -45,6 +48,7 @@ #include #include #include + #include #include #include @@ -300,7 +304,17 @@ bool HYDROData_PolylineXY::ImportShape( const TopoDS_Shape& theShape ) aShape = aMakeWire.Wire(); } - setPolylineShape( aShape ); + gp_Pln aPlane( gp_Pnt( 0, 0, 0 ), gp_Dir( 0, 0, 1 ) ); + BRepBuilderAPI_MakeFace aMakeFace( aPlane ); + aMakeFace.Build(); + BRepOffsetAPI_NormalProjection aProj( aMakeFace.Face() ); + aProj.Add( aShape ); + aProj.Build(); + TopoDS_Shape aResult; + if( aProj.IsDone() ) + aResult = aProj.Shape(); + + setPolylineShape( aResult ); } setEditable( anIsCanBeImported ); -- 2.39.2