internal GeoLine ToGeoLine()
{
if (this.Parts != null)
{
List<Point2DCollection> pss = new List<Point2DCollection>();
Point2DCollection copy = new Point2DCollection();
foreach (Point2D item in this.Point2Ds)
{
copy.Add(item);
}
for (int i = 0; i < this.Parts.Count; i++)
{
Point2DCollection temp = new Point2DCollection();
for (int j = 0; j < this.Parts[i]; j++)
{
temp.Add(copy[j]);
}
pss.Add(temp);
copy.RemoveRange(0, this.Parts[i]);//把前面的删除
} //把Point2Ds根据Parts分成一段一段的
GeoLine line = new GeoLine();
foreach (Point2DCollection item in pss)
{
line.Parts.Add(item);
}
return line;
}
return null;
}