]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Import of curves corrected.
authoradv <adv@opencascade.com>
Fri, 20 Dec 2013 05:59:55 +0000 (05:59 +0000)
committeradv <adv@opencascade.com>
Fri, 20 Dec 2013 05:59:55 +0000 (05:59 +0000)
src/HYDROData/HYDROData_PolylineXY.cxx

index 4d8179d2763810a622a1d60a43370673737accd0..46e5205e0f1c764b730123f4abeacb7d64b20401 100755 (executable)
@@ -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 );