From: adv Date: Fri, 20 Dec 2013 05:59:55 +0000 (+0000) Subject: Import of curves corrected. X-Git-Tag: BR_hydro_v_0_6~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=27020905ebd98d8e0d6bd084a43aebeb2fd6851e;p=modules%2Fhydro.git Import of curves corrected. --- diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 4d8179d2..46e5205e 100755 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -287,7 +287,20 @@ bool HYDROData_PolylineXY::ImportShape( const TopoDS_Shape& theShape ) } else { - setPolylineShape( theShape ); + TopoDS_Shape aShape = theShape; + + if ( theShape.ShapeType() == TopAbs_EDGE ) + { + // We make the wire from incoming edge because of other algorithms + // are waiting at least the wire from polyline + TopoDS_Edge anEdge = TopoDS::Edge( theShape ); + BRepBuilderAPI_MakeWire aMakeWire( anEdge ); + aMakeWire.Build(); + if ( aMakeWire.IsDone() ) + aShape = aMakeWire.Wire(); + } + + setPolylineShape( aShape ); } setEditable( anIsCanBeImported ); @@ -486,13 +499,6 @@ bool HYDROData_PolylineXY::IsClosed( const bool theIsSimpleCheck ) const if ( aShape.IsNull() ) return anIsClosed; - if ( aShape.ShapeType() == TopAbs_EDGE ) - { - //For unrecognized curves from GEOM module - anIsClosed = BRep_Tool::IsClosed( aShape ); - return anIsClosed; - } - TopTools_SequenceOfShape aWires; HYDROData_ShapesTool::ExploreShapeToShapes( aShape, TopAbs_WIRE, aWires );