void SwitchCoordSystem() { int curr = (int)coordType; curr++; curr = curr % 3; if (Enum.IsDefined(typeof(CoordSystemType), curr)) { coordType = (CoordSystemType)curr; } switch (coordType) { case CoordSystemType.CARTESIAN: cartesian.SetActive(true); spherical.SetActive(false); cylindrical.SetActive(false); break; case CoordSystemType.CYLINDRICAL: cartesian.SetActive(false); spherical.SetActive(false); cylindrical.SetActive(true); break; case CoordSystemType.SPHERICAL: cartesian.SetActive(false); spherical.SetActive(true); cylindrical.SetActive(false); break; } }
/// <summary> /// 构造函数(消息,颜色,位置X,位置Y,绑定方位,同等位要求,是否显示边框) /// </summary> public MessageConfig(string name, string msg, Color color, int x, int y, AnchorType anchorType, CoordSystemType coordType, bool isBox) { this.Name = name; this.Message = msg; this.Color = color; this.ColorStr = HalconConfig.ColorToStr(color); this.X = x; this.Y = y; this.AnchorType = anchorType; this.CoordSystemType = coordType; this.IsBox = isBox; }
/// <summary> /// 添加消息显示(消息,颜色,位置X,位置Y,绑定方位,同等位要求,是否显示边框) /// </summary> public void AddMessage(string name, string str, Color color, int x, int y, AnchorType anchor, CoordSystemType coord, bool isBox) { MessageList.Add(new MessageConfig(name, str, color, x, y, anchor, coord, isBox)); }
/// <summary> /// 添加消息显示(消息,颜色,位置X,位置Y,绑定方位,同等位要求,是否显示边框) /// </summary> public void AddMessage(string str, Color color, int x, int y, AnchorType anchor, CoordSystemType coord, bool isBox) { AddMessage(str, str, color, x, y, anchor, coord, isBox); }