コード例 #1
0
 private Locus <T> CombineIntersections(PointLocus <T> current, MultiPointLocus <T> addition)
 {
     if (!ContainsPoint(addition, current))
     {
         addition.Points.Add(current.IntersectionPoint);
     }
     return(addition);
 }
コード例 #2
0
 private Locus <T> CombineIntersections(MultiPointLocus <T> current, PointLocus <T> addition)
 {
     if (!ContainsPoint(current, addition))
     {
         current.Points.Add(addition.IntersectionPoint);
     }
     return(current);
 }
コード例 #3
0
 private Locus <T> CombineIntersections(PointLocus <T> current, PointLocus <T> addition)
 {
     if (current.Equals(addition))
     {
         return(current);
     }
     return(new MultiPointLocus <T>(current.IntersectionPoint, addition.IntersectionPoint));
 }
コード例 #4
0
 private Locus <T> CombineIntersections(PointLocus <T> current, LineSegmentLocus <T> addition)
 {
     if (ContainsPoint(addition, current))
     {
         return(addition);
     }
     addition.Segments.Add(new Line2D <T>(current.IntersectionPoint, current.IntersectionPoint));
     return(addition);
 }
コード例 #5
0
 private bool ContainsPoint(MultiPointLocus <T> multi, PointLocus <T> point)
 {
     foreach (Point2D <T> p2 in multi.Points)
     {
         if (p2.Equals(point.IntersectionPoint))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #6
0
 /// <summary>
 /// Determine if the point is contained in any of the segments of the line segment
 /// </summary>
 /// <param name="lineSegment"></param>
 /// <param name="point"></param>
 /// <returns>true if the point lands on a line segment</returns>
 private bool ContainsPoint(LineSegmentLocus <T> lineSegment, PointLocus <T> point)
 {
     foreach (Line2D <T> line in lineSegment.Segments)
     {
         if (line.Contains(point.IntersectionPoint))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #7
0
 private Locus <T> CombineIntersections(LineSegmentLocus <T> current, PointLocus <T> addition)
 {
     // If the point to be added already exists in one of the line
     // segments ignore it
     if (ContainsPoint(current, addition))
     {
         return(current);
     }
     current.Segments.Add(new Line2D <T>(addition.IntersectionPoint, addition.IntersectionPoint));
     return(current);
 }
コード例 #8
0
 private Locus <T> CombineIntersections(EmptyLocus <T> current, PointLocus <T> addition)
 {
     return(addition);
 }