コード例 #1
0
 /// <summary>
 /// 设置当前的偏移起点
 /// </summary>
 /// <param name="p"></param>
 public void SetPoint(Albert.Geometry.Primitives.Vector2D p)
 {
     if (GeometryShape == null)
     {
         this.start    = p;
         GeometryShape = tagert.Copy(true);
         if (DrawStartEvent != null)
         {
             this.DrawStartEvent(new ActionEventArgs(GeometryShape));
             this.GeometryShape.IsActioning = true;
         }
     }
     else
     {
         this.end = p;
         //完成当前的移动
         this.Complete();
     }
 }
コード例 #2
0
ファイル: MoveCommand.cs プロジェクト: AlbertMin/AlbertCAD
        /// <summary>
        /// 移动的拖放
        /// </summary>
        /// <param name="p"></param>
        public void Erase(Albert.Geometry.Primitives.Vector2D p)
        {
            this.end = p;

            //已经移动的距离
            Vector2D totlemove = this.end - this.start;
            //增量的移动距离
            var incrementmove = totlemove - lastmove;

            //最终移动距离
            lastmove = totlemove;
            //移动当前图形
            this.GeometryShape.Move(incrementmove);
            //擦除效果
            if (this.DrawEraseEvent != null)
            {
                this.DrawEraseEvent(new ActionEventArgs(GeometryShape));
            }
        }
コード例 #3
0
        /// <summary>
        /// 开始进行转动
        /// </summary>
        /// <param name="p"></param>
        public void Erase(Albert.Geometry.Primitives.Vector2D p)
        {
            this.end = p;

            //已经移动的距离
            Vector2D direction = Line2D.Create(this.start, this.end).Direction;
            //增量的移动距离
            double a = Vector2D.BasisX.AngleFrom(direction);

            double incrementAngle = a - lastAngle;

            //最终移动距离
            lastAngle = a;
            //移动当前图形
            this.GeometryShape.Rolate(start, incrementAngle);
            //擦除效果
            if (this.DrawEraseEvent != null)
            {
                this.DrawEraseEvent(new ActionEventArgs(GeometryShape));
            }
        }
コード例 #4
0
ファイル: AlignCommand.cs プロジェクト: AlbertMin/AlbertCAD
 /// <summary>
 /// 对齐尝试
 /// </summary>
 /// <param name="p"></param>
 public void Erase(Albert.Geometry.Primitives.Vector2D p)
 {
     if (DrawEraseEvent != null)
     {
     }
 }
コード例 #5
0
ファイル: AlignCommand.cs プロジェクト: AlbertMin/AlbertCAD
 /// <summary>
 /// 指定当前的对齐点
 /// </summary>
 /// <param name="p"></param>
 public void SetPoint(Albert.Geometry.Primitives.Vector2D p)
 {
     if (DrawStartEvent != null)
     {
     }
 }