public IDrawObject Clone() { MultiLine multiLine = new MultiLine(); multiLine.Copy(this); return(multiLine); }
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 void Finish() { int points = this.owner.MultiLinePoints.Count; UnitPoint offset = new UnitPoint(this.clone.MultiLinePoints[0].X - this.owner.MultiLinePoints[0].X, this.clone.MultiLinePoints[0].Y - this.owner.MultiLinePoints[0].Y); for (int i = 0; i < this.owner.MultiLinePoints.Count; i++) { this.endPoints[i] = this.clone.MultiLinePoints[i]; } this.owner.Copy(this.clone); this.owner.IsSelected = true; this.owner.StartMovePoint = new UnitPoint(this.owner.StartMovePoint.X + offset.X, this.owner.StartMovePoint.Y + offset.Y); this.clone = null; }
public NodeMultiLine(MultiLine owner, int nodeIndex) { this.owner = owner; this.clone = this.owner.Clone() as MultiLine; this.clone.IsSelected = true; this.originalPoints = new UnitPoint[owner.MultiLinePoints.Count]; this.endPoints = new UnitPoint[owner.MultiLinePoints.Count]; for (int i = 0; i < owner.MultiLinePoints.Count; i++) { this.originalPoints[i] = owner.MultiLinePoints[i]; this.endPoints[i] = owner.MultiLinePoints[i]; } this.clone.currentNodeIndex = nodeIndex; this.nodeIndex = nodeIndex; }
private void SetPoint(MultiLine multiLine, UnitPoint unitPoint) { multiLine.MultiLinePoints[nodeIndex] = unitPoint; }