SpaceComputerManager.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*-------------------------------------------------------------------------
  2. * 功能描述:SpaceComputerManager
  3. * 作者:xulisong
  4. * 创建时间: 2018/12/12 15:24:16
  5. * 版本号:v1.0
  6. * -------------------------------------------------------------------------*/
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using SAGA.Models;
  13. namespace SAGA.GplotRelationComputerManage
  14. {
  15. /*
  16. * 记录一些在控件计算和显示中,一些配置类的问题
  17. */
  18. /// <summary>
  19. /// 空间计算管理
  20. /// </summary>
  21. public class SpaceComputerManager
  22. {
  23. private readonly static List<string> m_UpSpaceFunTypes = new List<string>() {"140"};// new List<string>() { "140","150","1A0","1B0" };
  24. /// <summary>
  25. /// 获取计算上下关系的空间类型
  26. /// </summary>
  27. /// <returns></returns>
  28. public static List<string> GetUpSpaceFunTypes()
  29. {
  30. return m_UpSpaceFunTypes;
  31. }
  32. /// <summary>
  33. /// 是否是交通类型空间类型
  34. /// </summary>
  35. /// <param name="funType"></param>
  36. /// <returns></returns>
  37. public static bool IsCrossFunType(string funType)
  38. {
  39. return m_UpSpaceFunTypes.Contains(funType);
  40. }
  41. /// <summary>
  42. /// 获取空间关系分类枚举
  43. /// </summary>
  44. /// <param name="type"></param>
  45. /// <returns></returns>
  46. public static SpaceRelatedEnum GetRelationEnum(AdjanceElementType type)
  47. {
  48. SpaceRelatedEnum result= SpaceRelatedEnum.Adjacent;//暂时先这么写,不会出现Type为None的关系
  49. if (type == AdjanceElementType.None)
  50. return result;
  51. if (type.HasFlag(AdjanceElementType.Wall))
  52. {
  53. }
  54. if (type.HasFlag(AdjanceElementType.VirtualWall))
  55. {
  56. result = result | SpaceRelatedEnum.All;
  57. }
  58. if (type.HasFlag(AdjanceElementType.Door))
  59. {
  60. result = result | SpaceRelatedEnum.Crossing| SpaceRelatedEnum.Ventilation;
  61. }
  62. if (type.HasFlag(AdjanceElementType.Window))
  63. {
  64. result = result | SpaceRelatedEnum.Radiation | SpaceRelatedEnum.Ventilation;
  65. }
  66. if (type.HasFlag(AdjanceElementType.Vertical))
  67. {
  68. }
  69. if (type.HasFlag(AdjanceElementType.VerticalOpening))
  70. {
  71. result = result | SpaceRelatedEnum.Crossing;
  72. }
  73. return result;
  74. }
  75. }
  76. }