+ Handle(TDataStd_AsciiString) anAsciiStr;
+ if ( aLabel.FindAttribute( TDataStd_AsciiString::GetID(), anAsciiStr ) )
+ aRes = anAsciiStr->Get();
+ }
+
+ return aRes;
+}
+
+bool convertEdgeToSection( const TopoDS_Edge& theEdge,
+ NCollection_Sequence<TCollection_AsciiString>& theSectNames,
+ NCollection_Sequence<HYDROData_PolylineXY::SectionType>& theSectTypes,
+ NCollection_Sequence<bool>& theSectClosures,
+ NCollection_Sequence<HYDROData_PolylineXY::PointsList>& theSectPoints,
+ bool IsCanBeClosed,
+ bool IsInterpolationAllowed,
+ double theDeflection )
+{
+ Standard_Real aFirst = 0.0, aLast = 0.0;
+ Handle(Geom_Curve) anEdgeGeomCurve = BRep_Tool::Curve( theEdge, aFirst, aLast );
+ if ( anEdgeGeomCurve.IsNull() )
+ return false;
+
+ TCollection_AsciiString aSectName = getUniqueSectionName( theSectNames );
+ bool anIsEdgeClosed = anEdgeGeomCurve->IsClosed();
+
+ HYDROData_PolylineXY::SectionType aSectionType = HYDROData_PolylineXY::SECTION_POLYLINE;
+ HYDROData_PolylineXY::PointsList aPointsList;
+
+ if( anEdgeGeomCurve->IsKind( STANDARD_TYPE(Geom_Line) ) )
+ {
+ Handle(Geom_Line) aGeomLine = Handle(Geom_Line)::DownCast( anEdgeGeomCurve );
+
+ gp_Pnt aFirstPoint, aLastPoint;
+ aGeomLine->D0( aFirst, aFirstPoint );
+ aGeomLine->D0( aLast, aLastPoint );
+
+ HYDROData_PolylineXY::Point aSectFirstPoint( aFirstPoint.X(), aFirstPoint.Y() );
+ aPointsList.Append( aSectFirstPoint );
+
+ HYDROData_PolylineXY::Point aSectLastPoint( aLastPoint.X(), aLastPoint.Y() );
+ aPointsList.Append( aSectLastPoint );
+ }
+ else if ( anEdgeGeomCurve->IsKind( STANDARD_TYPE(Geom_BSplineCurve) ) || IsInterpolationAllowed )
+ {
+ aSectionType = HYDROData_PolylineXY::SECTION_SPLINE;
+
+ BRepAdaptor_Curve anAdaptorCurve( theEdge );
+ GCPnts_QuasiUniformDeflection aDiscrete( anAdaptorCurve, theDeflection );
+
+ int aNbPoints = aDiscrete.NbPoints();
+
+ // Decrease the number of imported poles because of last one
+ // pole is the closing point which are the start point
+ if ( anIsEdgeClosed ) aNbPoints--;
+
+ for ( int i = 1; i <= aNbPoints; ++i )