- //if (anObj->nSHPType != SHPT_ARC && anObj->nSHPType != SHPT_ARCM)
- // return false;
- Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( doc()->CreateObject( KIND_POLYLINEXY ) );
-
- int nParts = anObj->nParts;
- for ( int i = 0 ; i < nParts ; i++ )
- {
- int StartIndex = anObj->panPartStart[i];
- int EndIndex;
- if (i != nParts - 1)
- EndIndex = anObj->panPartStart[i + 1];
- else
- EndIndex = anObj->nVertices;
-
- bool IsClosed = false;
- HYDROData_PolylineXY::SectionType aSectType = HYDROData_PolylineXY::SECTION_POLYLINE;
- if (anObj->padfX[StartIndex] == anObj->padfX[EndIndex - 1] &&
- anObj->padfY[StartIndex] == anObj->padfY[EndIndex - 1] )
- {
- IsClosed = true;
- aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true);
- }
- else
- aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, false);
-
- if (IsClosed)
- EndIndex--;
- for ( int k = StartIndex; k < EndIndex ; k++ )
- {
- HYDROData_PolylineXY::Point aSectPoint;
- aSectPoint.SetX( anObj->padfX[k] );
- aSectPoint.SetY( anObj->padfY[k] );
- aPolylineXY->AddPoint( i, aSectPoint );
- }
-
- }
-
- aPolylineXY->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
- aPolylineXY->SetName( theFileName + "_PolyXY_" + QString::number(theInd) );
-
- aPolylineXY->Update();
-