128 lines
2.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace IronIntel.Contractor.Shape
{
public sealed class MapPoint
{
public double Longitude = 0;
public double Latitude = 0;
}
public sealed class MapPoints
{
private List<MapPoint> _Points = new List<MapPoint>();
public List<MapPoint> Points
{
get { return _Points; }
}
}
public sealed class Polyline
{
private List<MapPoints> _Parts = new List<MapPoints>();
public List<MapPoints> Parts
{
get { return _Parts; }
}
/// <summary>
/// 表示extent的左上角
/// </summary>
public MapPoint TopLeft = null;
/// <summary>
/// 表示extent的右下角
/// </summary>
public MapPoint BottomRight = null;
}
public sealed class Polygon
{
private List<MapPoints> _Rings = new List<MapPoints>();
public List<MapPoints> Rings
{
get { return _Rings; }
}
/// <summary>
/// 表示extent的左上角
/// </summary>
public MapPoint TopLeft = null;
/// <summary>
/// 表示extent的右下角
/// </summary>
public MapPoint BottomRight = null;
}
public sealed class Shape
{
private List<MapPoints> _Points = new List<MapPoints>();
private List<Polyline> _Polylines = new List<Polyline>();
private List<Polygon> _Polygones = new List<Polygon>();
public List<MapPoints> Points
{
get { return _Points; }
}
public List<Polyline> Polylines
{
get { return _Polylines; }
}
public List<Polygon> Polygons
{
get { return _Polygones; }
}
}
public sealed class SimpleShape
{
private List<MapPoint> _Points = new List<MapPoint>();
private List<MapPoints> _Polylines = new List<MapPoints>();
private List<MapPoints> _Polygones = new List<MapPoints>();
public List<MapPoint> Points
{
get { return _Points; }
}
public List<MapPoints> Polylines
{
get { return _Polylines; }
}
public List<MapPoints> Polygons
{
get { return _Polygones; }
}
public void FromShapeObj(Shape s)
{
if (s != null)
{
foreach (var p in s.Points)
{
Points.AddRange(p.Points);
}
foreach (var p in s.Polylines)
{
Polylines.AddRange(p.Parts);
}
foreach (var p in s.Polygons)
{
Polygons.AddRange(p.Rings);
}
}
}
}
}