예제 #1
0
        private void updateListFromSelected(Point pt, List <tagFEATURE> list, tagFEATURE feature)
        {
            List <PointD[]> listPds    = Calculate.CalcPolylineIntersect(feature.SG2D.Points, _locator.Rect);
            bool            isSelected = false;

            foreach (PointD[] pd in listPds)
            {
                if (isSelected)
                {
                    break;
                }
                for (int k = 0; k < pd.Length - 1; k++)
                {
                    Point start = _locator.Locator.MapToScreen(pd[k].X, pd[k].Y);
                    Point end   = _locator.Locator.MapToScreen(pd[k + 1].X, pd[k + 1].Y);
                    //TODO:是否要通过装配单配置 选中线误差为5像素
                    if (ScreenCalcUtil.CalcDisP2L(DrawingPoint(start), DrawingPoint(end), DrawingPoint(pt)) < 5)
                    {
                        isSelected = true;
                        break;
                    }
                }
            }
            if (isSelected)
            {
                list.Add(feature);
            }
        }