Пример #1
0
        ///// <summary>
        ///// 设置原点
        ///// </summary>
        ///// <param name="IRect"></param>
        ///// <param name="Yuan_dian_col_x"></param>
        ///// <param name="Yuan_dian_row_y"></param>
        ///// <param name="Yuan_dian_angle_a"></param>
        ///// <returns></returns>
        //public bool Set_Orgin(IRectShuJu IRect, double Yuan_dian_col_x, double Yuan_dian_row_y, double Yuan_dian_angle_a)
        //{
        //    bool ok = false;
        //    IRect.Yuan_dian_col_x = Yuan_dian_col_x;
        //    IRect.Yuan_dian_row_y = Yuan_dian_row_y;
        //    IRect.Yuan_dian_angle_a = Yuan_dian_angle_a;
        //    ok = true;
        //    return ok;
        //}
        #endregion

        /// <summary>
        /// 设置原点
        /// </summary>
        /// <param name="IRect_"></param>
        /// <param name="IRectShuJuPianYi_"></param>
        /// <returns></returns>
        public bool Set_Orgin(IRectShuJu IRect_, IRectShuJuPianYi IRectShuJuPianYi_)
        {
            bool ok = false;

            IRect_.Yuan_dian_col_x    = IRectShuJuPianYi_.Column;
            IRect_.Yuan_dian_row_y    = IRectShuJuPianYi_.Row;
            IRect_.Yuan_dian_angle_a  = IRectShuJuPianYi_.Angle;
            IRect_.IRect_shuju_pianyi = IRectShuJuPianYi_;

            ok = true;
            return(ok);
        }
Пример #2
0
        /// <summary>
        /// 取出定位点
        /// </summary>
        void get_lotation()
        {
            #region  判断是否已经有定位
            if (listBox_DingWeiGongJu.Items.Count > 0)
            {
                MessageBox.Show("已经存在定位,请先移除");
            }
            #endregion

            #region   取出节点数据
            var Irect = _tool_treeview_struct.Current_MultTreeNode.Obj as ToolDateFather;
            #endregion

            #region   算法
            if (Irect != null)
            {
                IRectShuJuPianYi Irectshujupianyi_ = (IRectShuJuPianYi)Irect;
                //_SerRectShuJu.Set_Orgin(IRect_, (double)ITemplate_.Column, (double)ITemplate_.Row, (double)ITemplate_.Angle);
                _SerRectShuJu.Set_Orgin(_IRect, Irectshujupianyi_);
                Invoke(new Action(delegate
                {
                    message.Text = "原点x:" + Irectshujupianyi_.Column.ToString() + "  y:" + Irectshujupianyi_.Row.ToString() + "  angle:" + Irectshujupianyi_.Angle.ToString();
                }));
            }
            #endregion

            #region   保存,把被跟随定位的工具同步到listBox_DingWeiGongJu中

            this._IRect.BeiGenSuiDingWeiGongJu = _tool_treeview_struct.Current_Node_lujing;
            listBox_DingWeiGongJu.Items.Clear();
            listBox_DingWeiGongJu.Items.Add(_tool_treeview_struct.Current_Node_lujing);
            listBox_DingWeiGongJu.SelectedIndex = listBox_DingWeiGongJu.Items.IndexOf(_tool_treeview_struct.Current_Node_lujing);

            #endregion

            #region  无用代码
            //string str1 = _tool_treeview_struct.Current_Nodes_Name;
            //switch (str1.Substring(0, str1.IndexOf("_")))
            //{
            //    #region   定位工具
            //    case "Template":

            //        #region   取出节点数据
            //        var ITemplate_ = _tool_treeview_struct.Current_MultTreeNode.Obj as ToolDateFather;
            //        #endregion

            //        #region   写入原点
            //        if (ITemplate_.Column != null)
            //        {
            //            IRectShuJuPianYi Irectshujupianyi_ = (IRectShuJuPianYi)ITemplate_;
            //            //_SerRectShuJu.Set_Orgin(IRect_, (double)ITemplate_.Column, (double)ITemplate_.Row, (double)ITemplate_.Angle);
            //            _SerRectShuJu.Set_Orgin(_IRect, Irectshujupianyi_);
            //            Invoke(new Action(delegate
            //            {
            //                message.Text = "原点x:" + Irectshujupianyi_.Column.ToString() + "__y:" + Irectshujupianyi_.Row.ToString() + "__angle:" + Irectshujupianyi_.Angle.ToString();
            //            }));
            //        }
            //        else
            //        {
            //            MessageBox.Show("数据定位出错");
            //        }
            //        #endregion

            //        #region   保存,把被跟随定位的工具同步到listBox_DingWeiGongJu中

            //        this._IRect.BeiGenSuiDingWeiGongJu = _tool_treeview_struct.Current_Node_lujing;
            //        listBox_DingWeiGongJu.Items.Clear();
            //        listBox_DingWeiGongJu.Items.Add(_tool_treeview_struct.Current_Node_lujing);
            //        listBox_DingWeiGongJu.SelectedIndex = listBox_DingWeiGongJu.Items.IndexOf(_tool_treeview_struct.Current_Node_lujing);

            //        #endregion

            //        break;
            //    #endregion

            //    #region  默认
            //    default:
            //        MessageBox.Show("当前控件不能用于定位");
            //        break;
            //    #endregion
            //}
            #endregion
        }
Пример #3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public RectShuJu()
 {
     //this._duiJieGenSuiDingWeiGongJu=new RectShuJuPianYi();
     this.IDuiJieGenSuiDingWeiGongJu = new RectShuJuPianYi();
     _tool_Path = new List <string>();
 }
Пример #4
0
 /// <summary>
 /// 释放资源
 /// </summary>
 public override void Dispose()
 {
     base.Dispose();
     this.IDuiJieGenSuiDingWeiGongJu = null;
 }
Пример #5
0
 /// <summary>
 /// 释放资源
 /// </summary>
 public virtual void Dispose()
 {
     this.ImageFather = null;
     irectShuJuPianYi = null;
     _iCalibration    = null;
 }