/*-------------------------------------------------------------------------
* 功能描述:GeometryLocation
* 作者:xulisong
* 创建时间: 2019/6/19 16:43:58
* 版本号:v1.0
* -------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
namespace JBIM.Definition
{
///
/// 定位类型
///
public enum LocationType
{
Point=0,
Line,
Arc,
Common
}
public class GeometryLocation
{
public GeometryLocation(LocationType type)
{
Type = type;
Points = new List();
}
public LocationType Type { get; set; }
public List Points { get;private set; }
public static GeometryLocation CreatePointLocation(XYZ xyz)
{
if (xyz == null) return null;
var result = new GeometryLocation(LocationType.Point);
try
{
result.Points.Add(xyz);
}
catch (Exception e)
{
Console.WriteLine(e);
}
return result;
}
public static GeometryLocation CreateLineLocation(List xyzes)
{
var result = new GeometryLocation(LocationType.Line);
result.Points.AddRange(xyzes);
return result;
}
public static GeometryLocation CreateArcLocation(List xyzes)
{
var result = new GeometryLocation(LocationType.Arc);
result.Points.AddRange(xyzes);
return result;
}
}
}