12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /*-------------------------------------------------------------------------
- * 功能描述:SpaceComputerManager
- * 作者:xulisong
- * 创建时间: 2018/12/12 15:24:16
- * 版本号:v1.0
- * -------------------------------------------------------------------------*/
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using SAGA.Models;
- namespace SAGA.GplotRelationComputerManage
- {
- /*
- * 记录一些在控件计算和显示中,一些配置类的问题
- */
- /// <summary>
- /// 空间计算管理
- /// </summary>
- public class SpaceComputerManager
- {
- private readonly static List<string> m_UpSpaceFunTypes = new List<string>() {"140"};// new List<string>() { "140","150","1A0","1B0" };
- /// <summary>
- /// 获取计算上下关系的空间类型
- /// </summary>
- /// <returns></returns>
- public static List<string> GetUpSpaceFunTypes()
- {
- return m_UpSpaceFunTypes;
- }
- /// <summary>
- /// 是否是交通类型空间类型
- /// </summary>
- /// <param name="funType"></param>
- /// <returns></returns>
- public static bool IsCrossFunType(string funType)
- {
- return m_UpSpaceFunTypes.Contains(funType);
- }
- /// <summary>
- /// 获取空间关系分类枚举
- /// </summary>
- /// <param name="type"></param>
- /// <returns></returns>
- public static SpaceRelatedEnum GetRelationEnum(AdjanceElementType type)
- {
- SpaceRelatedEnum result= SpaceRelatedEnum.Adjacent;//暂时先这么写,不会出现Type为None的关系
- if (type == AdjanceElementType.None)
- return result;
- if (type.HasFlag(AdjanceElementType.Wall))
- {
- }
- if (type.HasFlag(AdjanceElementType.VirtualWall))
- {
- result = result | SpaceRelatedEnum.All;
- }
- if (type.HasFlag(AdjanceElementType.Door))
- {
- result = result | SpaceRelatedEnum.Crossing| SpaceRelatedEnum.Ventilation;
- }
- if (type.HasFlag(AdjanceElementType.Window))
- {
- result = result | SpaceRelatedEnum.Radiation | SpaceRelatedEnum.Ventilation;
- }
- if (type.HasFlag(AdjanceElementType.Vertical))
- {
- }
- if (type.HasFlag(AdjanceElementType.VerticalOpening))
- {
- result = result | SpaceRelatedEnum.Crossing;
- }
- return result;
- }
- }
- }
|