/// <summary>
        /// 選択を行う
        /// </summary>
        /// <param name="rc"></param>
        /// <param name="layerMask"></param>
        /// <param name="pointMode"></param>
        /// <returns>選択対象だったときにtrueを返す</returns>
        /// <remarks>
        /// 選択対象だった場合には選択フラグがセットされる。
        /// </remarks>
        public override bool SelectIt(MbeRect rc, ulong layerMask, bool pointMode)
        {
            //if ((layerMask & (ulong)layer) == 0) return false;
            if (DeleteCount >= 0)
            {
                return(false);
            }

            // Test selection of the REFERENCE-NUMBER.
            //21 May 2011. Version 0.51.01
            // Moved priority to top.
            if (refNum.SelectIt(rc, layerMask, false))
            {
                if (pointMode)
                {
                    return(true);
                }
            }

            // Test selection by the ORIGIN-POINT-of-COMPONENT.
            if ((layerMask & (ulong)layer) != 0 && rc.Contains(posArray[0]))
            {
                SetAllSelectFlag();
                return(true);
            }

            // Test selection if it contains the MbeObjects(PTH, PAD, LINE and etc).
            if (contentsObj != null)
            {
                foreach (MbeObj obj in contentsObj)
                {
                    if (obj.Id() == MbeObjID.MbePTH ||
                        obj.Id() == MbeObjID.MbePinSMD ||
                        obj.Id() == MbeObjID.MbeHole)
                    {
                        if (obj.SelectIt(rc, layerMask, pointMode))
                        {
                            SetAllSelectFlag();
                            return(true);
                        }
                    }
                }
            }

            return(false);

            //return refNum.SelectIt(rc,layerMask,false);
        }
Example #2
0
        /// <summary>
        /// 選択を行う
        /// </summary>
        /// <param name="rc"></param>
        /// <param name="layerMask"></param>
        /// <param name="pointMode"></param>
        /// <returns>選択対象だったときにtrueを返す</returns>
        /// <remarks>
        /// 選択対象だった場合には選択フラグがセットされる。
        /// </remarks>
        public virtual bool SelectIt(MbeRect rc, ulong layerMask, bool pointMode)
        {
            if ((layerMask & (ulong)layer) == 0)
            {
                return(false);
            }
            if (DeleteCount >= 0)
            {
                return(false);
            }

            bool result = false;

            for (int i = 0; i < posCount; i++)
            {
                if (rc.Contains(posArray[i]))
                {
                    selectFlag[i] = true;
                    result        = true;
                }
            }
            return(result);
        }