+ if ( aPointsList.IsEmpty() )
+ return false;
+
+ theSectNames.Append( aSectName );
+ theSectTypes.Append( aSectionType );
+ theSectClosures.Append( anIsEdgeClosed );
+ theSectPoints.Append( aPointsList );
+
+ return true;
+}
+
+bool HYDROData_PolylineXY::ImportShape( const TopoDS_Shape& theShape )
+{
+ if ( theShape.IsNull() )
+ return false;
+
+ RemoveSections();
+
+ bool anIsCanBeImported = false;
+
+ NCollection_Sequence<TCollection_AsciiString> aSectNames;
+ NCollection_Sequence<SectionType> aSectTypes;
+ NCollection_Sequence<bool> aSectClosures;
+ NCollection_Sequence<PointsList> aSectPoints;
+
+ if ( theShape.ShapeType() == TopAbs_EDGE )
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge( theShape );
+ anIsCanBeImported = convertEdgeToSection( anEdge, aSectNames, aSectTypes, aSectClosures, aSectPoints, true );
+ }
+ else if ( theShape.ShapeType() == TopAbs_WIRE )
+ {
+ TopTools_SequenceOfShape anEdges;
+ HYDROData_ShapesTool::ExploreShapeToShapes( theShape, TopAbs_EDGE, anEdges );
+
+ anIsCanBeImported = !anEdges.IsEmpty();
+ for ( int i = 1, n = anEdges.Length(); i <= n && anIsCanBeImported; ++i )
+ {
+ TopoDS_Edge aWireEdge = TopoDS::Edge( anEdges.Value( i ) );
+ anIsCanBeImported = convertEdgeToSection( aWireEdge, aSectNames, aSectTypes, aSectClosures, aSectPoints, false );