コード例 #1
0
ファイル: CanvasCore.cs プロジェクト: zyouhua/weilai
 public CanvasCore()
 {
     mSelects = new List<IShape>();
     mNormals = new List<IShape>();
     mPull = null;
     mMouseDown = new Point2I();
     mRectShape = null;
     mSideBar = null;
     mObject = null;
 }
コード例 #2
0
ファイル: CanvasCore.cs プロジェクト: zyouhua/nvwa
        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;
            }
            lineCreater_._setObject(mObject);
            lineCreater_._setBeg(mRectShape._rectGetIRect());
            lineCreater_._setEnd(rectShape_._rectGetIRect());

            ILine line_ = lineCreater_._runCreate() as ILine;

            LineShape lineshape_ = new LineShape();
            lineshape_._initLine(line_);
            Point2I beg_ = mRectShape._rectJoinPoint(mMouseDown, nPoint);
            Point2I end_ = rectShape_._rectJoinPoint(nPoint, mMouseDown);
            lineshape_._setBegPoint(beg_);
            lineshape_._setEndPoint(end_);
            mSelects.Add(lineshape_);

            mSideBar._resetActiveTab();
            this._pushUp();
        }
コード例 #3
0
ファイル: CanvasCore.cs プロジェクト: zyouhua/weilai
        public void _createBeg(Point2I nPoint)
        {
            this._pushDown(nPoint);
            this._resetShape();

            SideItem sideItem_ = mSideBar._getChooseSideItem();
            LineCreater lineCreater_ = sideItem_._getTag() as LineCreater;
            string begId_ = lineCreater_._getBegId();
            foreach (IShape i in mNormals)
            {
                RectShape rectShape_ = i._getRectShape(nPoint, begId_);
                if (null != rectShape_)
                {
                    mRectShape = rectShape_;
                    break;
                }
            }
        }
コード例 #4
0
ファイル: LabelShape.cs プロジェクト: zyouhua/nvwa
 public void _initLabel(ILabel nlabel)
 {
     base._initRect(nlabel);
     base._setLabelShape(this);
     mLabel = nlabel;
     ShapeDescriptorSingleton shapeDescriptorSingleton_ = __singleton<ShapeDescriptorSingleton>._instance();
     mLabelStream = shapeDescriptorSingleton_._labelDescriptor(nlabel._styleName());
     List<IRect> rects_ = nlabel._getRects();
     if (null == rects_)
     {
         return;
     }
     int index_ = 0;
     foreach (IRect i in rects_)
     {
         RectShape rect_ = new RectShape();
         rect_._initRect(i);
         rect_._setLabelShape(this);
         rect_._setIndex(index_);
         mRectShapes.Add(rect_);
         index_++;
     }
 }