public static EdgePointCollection ConvertFromRelativeEdgePoints(EdgePointCollection col, PointD relativeTo) { EdgePointCollection retCol = new EdgePointCollection(); foreach (EdgePoint p in col) { PointD ret = new PointD(); ret.X = p.X + relativeTo.X; ret.Y = p.Y + relativeTo.Y; EdgePoint point = new EdgePoint(ret, p.PointType); retCol.Add(point); } return(retCol); }
/// <summary> /// Update anchor placement. /// </summary> internal void UpdateAnchorPlacement() { if (this.EdgePoints.Count > 0) { EdgePoint start = this.EdgePoints[0]; if (this.StartPoint != start.Point) { this.SetStartPoint(start.Point); } EdgePoint end = this.EdgePoints[this.EdgePoints.Count - 1]; if (this.EndPoint != end.Point) { this.SetEndPoint(end.Point); } } }
public static EdgePointCollection ConvertFromRelativeEdgePoints(EdgePointCollection col, PointD relativeTo) { EdgePointCollection retCol = new EdgePointCollection(); foreach (EdgePoint p in col) { PointD ret = new PointD(); ret.X = p.X + relativeTo.X; ret.Y = p.Y + relativeTo.Y; EdgePoint point = new EdgePoint(ret, p.PointType); retCol.Add(point); } return retCol; }
/// <summary> /// Constuctor. /// </summary> /// <param name="viewModelStore">The store this view model belongs to.</param> /// <param name="edgePoint">Edge point.</param> /// <param name="edgePointType">EdgePointVMType.</param> public EdgePointViewModel(ViewModelStore viewModelStore, EdgePoint edgePoint, EdgePointVMType edgePointType) : base(viewModelStore) { this.EdgePoint = edgePoint; this.EdgePointType = edgePointType; this.EdgePointSide = EdgePointVMSide.None; this.EdgePointOperation = EdgePointVMOperation.Move; this.TranslateX = 0; this.TranslateY = 0; UpdateTranslateCoordinates(); }