Esempio n. 1
0
        public bool HilightWaferPoint(System.Drawing.Point picPoint)
        {
            var  drawList = Layers.Where(it => it.Visible).Select(it => it.LayerName).ToList();
            bool hitTest  = false;


            DXFPolyline biggest  = null;
            int         maxWidth = 0;


            foreach (var obj in Shapes)
            {
                DXFPolyline temp = (DXFPolyline)obj;
                if (drawList.Contains(temp.LayerIndex))
                {
                    if (temp.HitTest(picPoint))
                    {
                        if (temp.ItemLineWidth > maxWidth)
                        {
                            maxWidth = temp.ItemLineWidth;
                            biggest  = temp;
                        }
                        hitTest |= true;
                        // break;
                    }
                }
            }
            biggest.Highlight(picPoint);

            return(hitTest);
        }
Esempio n. 2
0
        public bool Hilight(System.Drawing.Point picPoint, bool mirror, bool rotate90)
        {
            var x        = picPoint.X / mainScale + XMin;
            var y        = picPoint.Y / mainScale + YMin;
            var drawList = Layers.Where(it => it.Visible).Select(it => it.LayerName).ToList();

            var         hitPoint = new System.Drawing.Point((int)x, (int)y);
            bool        hitTest  = false;
            DXFPolyline biggest  = null;
            int         maxWidth = 0;

            foreach (var obj in Shapes)                     //iterates through the objects
            {
                DXFPolyline temp = (DXFPolyline)obj;
                if (drawList.Contains(temp.LayerIndex))
                {
                    if (temp.HitTest(hitPoint))
                    {
                        if (temp.ItemLineWidth > maxWidth)
                        {
                            maxWidth = temp.ItemLineWidth;
                            biggest  = temp;
                        }

                        hitTest |= true;
                    }
                }
            }
            if (biggest != null)
            {
                biggest.Highlight(hitPoint);
            }
            if (rotate90)
            {
                foreach (var obj in Shapes)                     //iterates through the objects
                {
                    DXFPolyline temp = (DXFPolyline)obj;
                    if (drawList.Contains(temp.LayerIndex))
                    {
                        if (temp.Highlight(new System.Drawing.Point(-1 * (int)y, (int)x)))
                        {
                            hitTest |= true;
                            break;
                        }
                    }
                }
            }

            if (mirror)
            {
                foreach (var obj in Shapes)                     //iterates through the objects
                {
                    DXFPolyline temp = (DXFPolyline)obj;
                    if (drawList.Contains(temp.LayerIndex))
                    {
                        if (temp.Highlight(new System.Drawing.Point(-1 * (int)x, -1 * (int)y)))
                        {
                            hitTest |= true;
                            break;
                        }
                    }
                }

                if (rotate90)
                {
                    foreach (var obj in Shapes)                     //iterates through the objects
                    {
                        DXFPolyline temp = (DXFPolyline)obj;
                        if (drawList.Contains(temp.LayerIndex))
                        {
                            if (temp.Highlight(new System.Drawing.Point((int)y, -1 * (int)x)))
                            {
                                hitTest |= true;
                                break;
                            }
                        }
                    }
                }
            }


            return(hitTest);
        }