/// <summary> /// Performs actions when the operation that uses this observation is marked /// for deletion as part of its rollback function. This cuts any reference from any /// previously existing feature that was cross-referenced to the operation (see /// calls made to <c>AddOp</c>). /// </summary> /// <param name="oper">The operation that makes use of this observation.</param> internal override void OnRollback(Operation oper) { Debug.Assert(oper != null); if (m_Point != null) { m_Point.CutOp(oper); } }
/// <summary> /// Rollback this operation (occurs when a user undoes the last edit). /// </summary> internal override void Undo() { base.OnRollback(); // Get rid of the observation m_Direction.OnRollback(this); // Cut direct refs made by this operation. if (m_Line != null) { m_Line.CutOp(this); } if (m_CloseTo != null) { m_CloseTo.CutOp(this); } // Undo the intersect point and any lines Rollback(m_Intersection); Rollback(m_DirLine); Rollback(m_LineA); Rollback(m_LineB); // If we actually did a split, re-activate the original line. if (m_LineA != null || m_LineB != null) { m_LineA = null; m_LineB = null; m_Line.Restore(); } }
/// <summary> /// Cuts references to an operation that are made by the features this /// direction refers to. /// </summary> /// <param name="op">The operation that should no longer be referred to.</param> internal override void CutReferences(Operation op) { if (m_From != null) { m_From.CutOp(op); } }
/// <summary> /// Rollback this operation (occurs when a user undoes the last edit). /// </summary> internal override void Undo() { // Delete observed radius. m_Radius.OnRollback(this); // Cut direct refs made by this operation. if (m_Center != null) { m_Center.CutOp(this); } // Rollback the base class (mark the circle for undo). base.Undo(); }
/// <summary> /// Rollback this operation (occurs when a user undoes the last edit). /// </summary> internal override void Undo() { base.OnRollback(); // Get rid of the observations. m_Direction.OnRollback(this); m_Distance.OnRollback(this); // Cut direct refs made by this operation. if (m_From != null) { m_From.CutOp(this); } // Undo the intersect point and any connecting lines Rollback(m_To); Rollback(m_DirLine); Rollback(m_DistLine); }
/// <summary> /// Rollback this operation (occurs when a user undoes the last edit). /// </summary> internal override void Undo() { base.OnRollback(); // Cut direct refs made by this operation. if (m_Line1 != null) { m_Line1.CutOp(this); } if (m_Line2 != null) { m_Line2.CutOp(this); } if (m_CloseTo != null) { m_CloseTo.CutOp(this); } // Undo the intersect point and any lines Rollback(m_Intersection); Rollback(m_Line1a); Rollback(m_Line1b); Rollback(m_Line2a); Rollback(m_Line2b); // If we actually did splits, re-activate the original line. if (m_Line1a != null || m_Line1b != null) { m_Line1a = null; m_Line1b = null; m_Line1.Restore(); } if (m_Line2a != null || m_Line2b != null) { m_Line2a = null; m_Line2b = null; m_Line2.Restore(); } }
/// <summary> /// Rollback this operation (occurs when a user undoes the last edit). /// </summary> internal override void Undo() { base.OnRollback(); // Cut references that features make to this operation. if (m_From != null) { m_From.CutOp(this); } if (m_To != null) { m_To.CutOp(this); } // Mark all created features Feature[] features = this.Features; foreach (Feature f in features) { f.Undo(); } }