/// <summary> /// Checks if this == the reversed edge2 /// </summary> /// <param name="edge2"></param> /// <returns></returns> public bool RecursiveReverse(Edge edge2) { bool check = edge2.mEndNode == mStartNode && edge2.mStartNode == mEndNode; return check; }
public List<Edge> GetSplit(MeshNode node) { Debug.Assert(mStartNode != node && mEndNode != node); Debug.Assert(HelperMethods.PointOnLine(node.mVector, mStartNode.mVector, mEndNode.mVector, 0)); Edge e1 = new Edge(mStartNode, node); Edge e2 = new Edge(node, mEndNode); e1.ImposeOwnership(); e2.ImposeOwnership(); return new List<Edge>{e1, e2}; }
/// <summary> /// pure function /// </summary> /// <param name="edge2"></param> /// <returns></returns> public Edge GetUnion(Edge edge2) { Debug.Assert(mEndNode == edge2.mStartNode, "Edge union failed!"); Edge result = new Edge(mStartNode, edge2.mEndNode); result.ImposeOwnership(); return result; }
private void DrawSingleEdge(Edge edge) { Vector2 start = ToScreenCoords(edge.mStartNode.mVector); Vector2 end = ToScreenCoords(edge.mEndNode.mVector); if (start.Equals(new Vector2(120, 240)) && end.Equals(new Vector2(280, 240))) CodeTest.DrawLine(start, end, 3, Color.Black); else CodeTest.DrawLine(start, end, 1, mSingleEdgeColor); }