public virtual void Copy(MultiLine multiLine) { base.Copy(multiLine); this.MultiLinePoints = new List <UnitPoint>(multiLine.MultiLinePoints); this.IsSelected = multiLine.IsSelected; this.drawStatus = multiLine.drawStatus; this.SN = multiLine.SN; }
public virtual void Copy(Line line) { base.Copy(line); this.P1 = line.P1; this.P2 = line.P2; this.LayerId = line.LayerId; this.drawStatus = line.drawStatus; this.IsSelected = line.IsSelected; this.SN = line.SN; }
public DrawObjectMouseDown OnMouseDown(ICanvas canvas, UnitPoint point, ISnapPoint snapPoint, MouseEventArgs e) { OnMouseMove(canvas, point); if (this.DrawPoint == CurrentDrawPoint.First) { this.DrawPoint = CurrentDrawPoint.Second; return(DrawObjectMouseDown.Continue); } else { this.IsSelected = false; this.SN = ++GlobalModel.TotalDrawObjectCount; this.drawStatus = DrawObjectMouseDown.Done; return(DrawObjectMouseDown.Done); } }
public virtual void Copy(Hexagon hexagon) { base.Copy(hexagon); this.SideCount = hexagon.SideCount; this.centerPoint = hexagon.centerPoint; this.hexagonPoints = new UnitPoint[this.SideCount]; Array.Copy(hexagon.hexagonPoints, this.hexagonPoints, this.hexagonPoints.Length); this.centerPoint = hexagon.centerPoint; this.IsSelected = hexagon.IsSelected; this.startMovePoint = hexagon.startMovePoint; hexagon.StartMovePointIndex = hexagon.StartMovePointIndex; this.OverCuttingLength = hexagon.OverCuttingLength; this.OverCuttingPoints = hexagon.OverCuttingPoints; this.LayerId = hexagon.LayerId; this.drawStatus = hexagon.drawStatus; this.SN = hexagon.SN; }
public virtual void Copy(SingleRectangle singleRectangle) { base.Copy(singleRectangle); this.FirstPoint = singleRectangle.FirstPoint; this.SecondPoint = singleRectangle.SecondPoint; this.LeftTopPoint = singleRectangle.LeftTopPoint; this.LeftBottomPoint = singleRectangle.LeftBottomPoint; this.RightTopPoint = singleRectangle.RightTopPoint; this.RightBottomPoint = singleRectangle.RightBottomPoint; this.IsSelected = singleRectangle.IsSelected; this.StartMovePoint = singleRectangle.StartMovePoint; this.IsClockWiseDirection = singleRectangle.IsClockWiseDirection; this.OverCuttingLength = singleRectangle.OverCuttingLength; this.OverCuttingPoints = singleRectangle.OverCuttingPoints; this.StartMovePosition = singleRectangle.StartMovePosition; this.drawStatus = singleRectangle.drawStatus; this.SN = singleRectangle.SN; }
public DrawObjectMouseDown OnMouseDown(ICanvas canvas, UnitPoint point, ISnapPoint snapPoint, MouseEventArgs e) { OnMouseMove(canvas, point); if (this.currentPoint == CurrentPoint.CenterPoint) { this.currentPoint = CurrentPoint.StartPoint; return(DrawObjectMouseDown.Continue); } if (this.currentPoint == CurrentPoint.StartPoint) { //OnMouseMove(canvas, point); this.IsSelected = false; this.startMovePoint = this.hexagonPoints[0]; this.drawStatus = DrawObjectMouseDown.Done; this.SN = ++GlobalModel.TotalDrawObjectCount; return(DrawObjectMouseDown.Done); } return(DrawObjectMouseDown.Done); }
public virtual DrawObjectMouseDown OnMouseDown(ICanvas canvas, UnitPoint point, ISnapPoint snapPoint, MouseEventArgs e) { this.IsSelected = false; this.drawStatus = DrawObjectMouseDown.DoneRepeat; this.SN = ++GlobalModel.TotalDrawObjectCount; if (snapPoint is PerpendicularSnapPoint && snapPoint.Owner is Line) { Line source = snapPoint.Owner as Line; this.P2 = HitUtil.NearestPointOnLine(source.P1, source.P2, this.P1, true); return(DrawObjectMouseDown.DoneRepeat); } //if(snapPoint is PerpendicularSnapPoint && snapPoint.Owner is Arc) //{ // Arc source = snapPoint.Owner as Arc; // this.P2 = HitUtil.NearestPointOnCircle(source.Center, source.Radius, this.P1, 0); // return DrawObjectMouseDown.DoneRepeat; //} if (Control.ModifierKeys == Keys.Control) { point = HitUtil.OrthoPointD(this.P1, point, 45); } this.P2 = point; return(DrawObjectMouseDown.DoneRepeat); }
private void MouseDownSetStartMovePoint(MouseEventArgs e) { UnitPoint mousePoint = this.ToUnit(this.mouseDownPoint); IDrawObject hitObject = this.Model.GetHitObject(mousePoint); if (hitObject != null && leadLineDone && hitObject.IsCloseFigure) { LineInOutParamsModel leadInOutParamsModel = CopyUtil.DeepCopy(hitObject.LeadInOutParams); leadInOutParamsModel.LinePosition = LinePositions.FigureTotalLength; leadInOutParamsModel.FigureTotalLength = this.CalPercentByPoint(hitObject, mousePoint); this.Model.DoSetLeadwire(new List <IDrawObject>() { hitObject }, new List <LineInOutParamsModel>() { leadInOutParamsModel }); this.DoInvalidate(true); } else//绘制引入线 { if (this.leadLine == null) { this.leadLine = new LeadLine(mousePoint); this.leadLineDone = false; } else { if (hitObject != null) { LineInOutParamsModel leadInOutParamsModel = CopyUtil.DeepCopy(hitObject.LeadInOutParams); leadInOutParamsModel.LinePosition = LinePositions.FigureTotalLength; leadInOutParamsModel.LineInType = CommomModel.DrawModel.LeadLine.LeadLineType.Line; if (hitObject.IsCloseFigure) { DrawObjectMouseDown result = this.leadLine.OnMouseDown(mousePoint); this.leadLine.CalLeadLineParams(hitObject, leadInOutParamsModel); this.Model.DoSetLeadwire(new List <IDrawObject>() { hitObject }, new List <LineInOutParamsModel>() { leadInOutParamsModel }); } else if (HitUtil.PointInPoint(mousePoint, hitObject.FirstDrawPoint, GetThresholdWidth())) { DrawObjectMouseDown result = this.leadLine.OnMouseDown(hitObject.FirstDrawPoint); this.leadLine.CalLeadLineParams(hitObject, leadInOutParamsModel); this.Model.DoSetLeadwire(new List <IDrawObject>() { hitObject }, new List <LineInOutParamsModel>() { leadInOutParamsModel }); } this.leadLine = null; this.leadLineDone = true; } else { this.leadLine = new LeadLine(mousePoint); } this.DoInvalidate(true); } } }