예제 #1
0
파일: Edge.cs 프로젝트: bethge/GalaticChaos
 /// <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;
 }
예제 #2
0
파일: Edge.cs 프로젝트: bethge/GalaticChaos
 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};
 }
예제 #3
0
파일: Edge.cs 프로젝트: bethge/GalaticChaos
 /// <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;
 }
예제 #4
0
 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);
 }