Esempio n. 1
0
        protected override bool OnQualify(SelectContext selectCtx, Matrix44 parentTrans)
        {
            if (selectCtx == null) return false;

            GePoint worldPoint = MathUtil.GetTransformedPoint(m_Point, parentTrans);

            double dDiff = worldPoint.DistanceTo(selectCtx.WorldPoint);

            if (dDiff < selectCtx.SelectTolerance)
            {
                selectCtx.AddItem(dDiff, this);
                return true;
            }

            return false;
        }
Esempio n. 2
0
        protected override bool OnQualify(SelectContext selectCtx, Matrix44 parentTrans)
        {
            if (selectCtx == null) return false;

            GePoint worldCenterPoint = MathUtil.GetTransformedPoint(m_CenterPoint, parentTrans);

            double dist = worldCenterPoint.DistanceTo(selectCtx.WorldPoint);

            // Get the plus distance
            double dDiff = dist - m_dRadius;
            if (dDiff < 0) dDiff = -dDiff;

            if (dDiff < selectCtx.SelectTolerance)
            {
                selectCtx.AddItem(dDiff, this);
                return true;
            }

            return false;
        }
Esempio n. 3
0
        protected override bool OnQualify(SelectContext selectCtx, Matrix44 parentTrans)
        {
            if (selectCtx == null) return false;

            GeRectangle Rec = Range;

            GePoint worldPosition = MathUtil.GetTransformedPoint(m_Position, parentTrans);

            Rec.MoveTo(worldPosition);

            if (selectCtx.WorldPoint.X > (Rec.MinPoint.X - selectCtx.SelectTolerance)
                && selectCtx.WorldPoint.X < (Rec.MaxPoint.X + selectCtx.SelectTolerance)
                && selectCtx.WorldPoint.Y > (Rec.MinPoint.Y - selectCtx.SelectTolerance)
                && selectCtx.WorldPoint.Y < (Rec.MaxPoint.Y + selectCtx.SelectTolerance))
            {
                selectCtx.AddItem(0, this);
                return true;
            }

            return false;
        }