GeometryLocation.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*-------------------------------------------------------------------------
  2. * 功能描述:GeometryLocation
  3. * 作者:xulisong
  4. * 创建时间: 2019/6/19 16:43:58
  5. * 版本号:v1.0
  6. * -------------------------------------------------------------------------*/
  7. using System.Collections.Generic;
  8. namespace JBIM.Definition
  9. {
  10. /// <summary>
  11. /// 定位类型
  12. /// </summary>
  13. public enum LocationType
  14. {
  15. Point=0,
  16. Line,
  17. Arc,
  18. Common
  19. }
  20. public class GeometryLocation
  21. {
  22. public GeometryLocation(LocationType type)
  23. {
  24. Type = type;
  25. Points = new List<XYZ>();
  26. }
  27. public LocationType Type { get; set; }
  28. public List<XYZ> Points { get;private set; }
  29. public static GeometryLocation CreatePointLocation(XYZ xyz)
  30. {
  31. var result = new GeometryLocation(LocationType.Point);
  32. result.Points.Add(xyz);
  33. return result;
  34. }
  35. public static GeometryLocation CreateLineLocation(List<XYZ> xyzes)
  36. {
  37. var result = new GeometryLocation(LocationType.Line);
  38. result.Points.AddRange(xyzes);
  39. return result;
  40. }
  41. }
  42. }