コード例 #1
0
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Polyline polyline = entity as Polyline;

            if (polyline == null)
            {
                return(false);
            }

            Bounding pkBounding = pkbox.reservedBounding;

            for (int i = 1; i < polyline.NumberOfVertices; ++i)
            {
                LitMath.Line2 line = new LitMath.Line2(
                    polyline.GetPointAt(i - 1),
                    polyline.GetPointAt(i));

                if (LineHitter.BoundingIntersectWithLine(pkBounding, line))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #2
0
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Circle circle = entity as Circle;

            if (circle == null)
            {
                return(false);
            }

            return(MathUtils.BoundingCross(pkbox.reservedBounding, circle));
        }
コード例 #3
0
ファイル: EllipseHitter.cs プロジェクト: zhudaijie/SharpCAD
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Ellipse ellipse = entity as Ellipse;

            if (ellipse == null)
            {
                return(false);
            }

            return(MathUtils.BoundingCross(pkbox.reservedBounding, ellipse));
        }
コード例 #4
0
ファイル: XlineHitter.cs プロジェクト: zhudaijie/SharpCAD
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Xline xline = entity as Xline;

            if (xline == null)
            {
                return(false);
            }

            Bounding bounding = pkbox.reservedBounding;

            return(BoundingIntersectWithXline(bounding, xline));
        }
コード例 #5
0
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            XPoint xPoint = entity as XPoint;

            if (xPoint == null)
            {
                return(false);
            }

            XPointRS xPointRS = new XPointRS();

            return(xPointRS.Cross(pkbox.reservedBounding, xPoint));
        }
コード例 #6
0
ファイル: ArcHitter.cs プロジェクト: zhudaijie/SharpCAD
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Arc arc = entity as Arc;

            if (arc == null)
            {
                return(false);
            }

            ArcRS arcRS = new ArcRS();

            return(arcRS.Cross(pkbox.reservedBounding, arc));
        }
コード例 #7
0
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Ray ray = entity as Ray;

            if (ray == null)
            {
                return(false);
            }

            Bounding bounding = pkbox.reservedBounding;

            return(BoundingIntersectWithRay(bounding, ray));
        }
コード例 #8
0
ファイル: TextHitter.cs プロジェクト: zhudaijie/SharpCAD
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Text text = entity as Text;

            if (text == null)
            {
                return(false);
            }

            TextRS textRS = new TextRS();

            return(textRS.Cross(pkbox.reservedBounding, text));
        }
コード例 #9
0
ファイル: Pointer.cs プロジェクト: zhudaijie/SharpCAD
        /// <summary>
        /// 构造函数
        /// </summary>
        internal Pointer(Presenter presenter)
        {
            _presenter = presenter;

            _pickupBox      = new PickupBox(_presenter);
            _pickupBox.side = 10;

            _locateCross        = new LocateCross(_presenter);
            _locateCross.length = 70;

            _snapNodesMgr = new SnapNodesMgr(_presenter);
            _anchorMgr    = new AnchorsMgr(_presenter);

            UpdateBitmap();
        }
コード例 #10
0
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Line line = entity as Line;

            if (line == null)
            {
                return(false);
            }

            Bounding pkBounding = pkbox.reservedBounding;

            return(LineHitter.BoundingIntersectWithLine(
                       pkBounding,
                       new LitMath.Line2(line.startPoint, line.endPoint)));
        }
コード例 #11
0
 internal abstract bool Hit(PickupBox pkbox, Entity entity);