From: asl Date: Mon, 23 Dec 2013 09:10:58 +0000 (+0000) Subject: bug #274: now the imported polyline is projected always on the plane XY X-Git-Tag: BR_hydro_v_0_7~81 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=272fe04d70fa64f4fe1a271ef46614f71432502b;p=modules%2Fhydro.git bug #274: now the imported polyline is projected always on the plane XY --- 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 );