Exemplo n.º 1
0
        public void _createEnd(Point2I nPoint)
        {
            if (null == mRectShape)
            {
                mSideBar._resetActiveTab();
                this._pushUp();
                return;
            }
            SideItem sideItem_ = mSideBar._getChooseSideItem();
            LineCreater lineCreater_ = sideItem_._getTag() as LineCreater;
            string endId_ = lineCreater_._getEndId();
            RectShape rectShape_ = null;
            foreach (IShape i in mNormals)
            {
                RectShape temp_ = i._getRectShape(nPoint, endId_);
                if (null != temp_)
                {
                    rectShape_ = temp_;
                    break;
                }
            }
            if (rectShape_ == mRectShape || null == rectShape_)
            {
                mRectShape = null;
                mSideBar._resetActiveTab();
                this._pushUp();
                return;
            }
            Point2I beg_ = mRectShape._rectJoinPoint(mMouseDown, nPoint);
            Point2I end_ = rectShape_._rectJoinPoint(nPoint, mMouseDown);

            lineCreater_._setObject(mObject);
            lineCreater_._setBeg(mRectShape._rectGetIRect());
            lineCreater_._setEnd(rectShape_._rectGetIRect());
            ILine line_ = lineCreater_._runCreate() as ILine;
            line_._setBegPoint(beg_);
            line_._setEndPoint(end_);
            LineShape lineshape_ = new LineShape();
            lineshape_._initLine(line_);
            mSelects.Add(lineshape_);

            mSideBar._resetActiveTab();
            this._pushUp();
        }
Exemplo n.º 2
0
 public void _regLine(ILine nLine)
 {
     LineShape lineshape_ = new LineShape();
     lineshape_._initLine(nLine);
     mNormals.Add(lineshape_);
 }