From 27020905ebd98d8e0d6bd084a43aebeb2fd6851e Mon Sep 17 00:00:00 2001 From: adv Date: Fri, 20 Dec 2013 05:59:55 +0000 Subject: [PATCH] Import of curves corrected. --- src/HYDROData/HYDROData_PolylineXY.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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 ); -- 2.39.2