Exemplo n.º 1
0
 private Locus <T> CombineIntersections(MultiPointLocus <T> current, PointLocus <T> addition)
 {
     if (!ContainsPoint(current, addition))
     {
         current.Points.Add(addition.IntersectionPoint);
     }
     return(current);
 }
Exemplo n.º 2
0
 private Locus <T> CombineIntersections(PointLocus <T> current, MultiPointLocus <T> addition)
 {
     if (!ContainsPoint(addition, current))
     {
         addition.Points.Add(current.IntersectionPoint);
     }
     return(addition);
 }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            MultiPointLocus <T> rhs = obj as MultiPointLocus <T>;

            if (rhs == null)
            {
                return(false);
            }
            return(Points.SequenceEqual(rhs.Points));
        }
Exemplo n.º 4
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);
 }
Exemplo n.º 5
0
 private Locus <T> CombineIntersections(MultiPointLocus <T> current, MultiPointLocus <T> addition)
 {
     foreach (Point2D <T> point in addition.Points)
     {
         bool found = false;
         foreach (Point2D <T> p2 in current.Points)
         {
             if (p2.Equals(point))
             {
                 found = true;
             }
         }
         if (!found)
         {
             current.Points.Add(point);
         }
     }
     return(current);
 }
Exemplo n.º 6
0
 private Locus <T> CombineIntersections(MultiPointLocus <T> current, LineSegmentLocus <T> addition)
 {
     foreach (Point2D <T> point in current.Points)
     {
         bool found = false;
         foreach (Line2D <T> line in addition.Segments)
         {
             if (line.Contains(point))
             {
                 found = true;
             }
         }
         if (!found)
         {
             addition.Segments.Add(new Line2D <T>(point, point));
         }
     }
     return(addition);
 }
Exemplo n.º 7
0
        private Locus <T> CombineIntersections(LineSegmentLocus <T> current, MultiPointLocus <T> addition)
        {
            ICollection <Point2D <T> > additionalPoints = addition.Points;

            // If the points to be added already exists in one of the line
            // segments ignore it
            foreach (Line2D <T> line in current.Segments)
            {
                foreach (Point2D <T> point in addition.Points)
                {
                    if (line.Contains(point))
                    {
                        additionalPoints.Remove(point);
                    }
                }
            }
            additionalPoints.ForEach(p => current.Segments.Add(new Line2D <T>(p, p)));
            return(current);
        }
Exemplo n.º 8
0
 private Locus <T> CombineIntersections(EmptyLocus <T> current, MultiPointLocus <T> addition)
 {
     return(addition);
 }