Exemplo n.º 1
0
 private static IEnumerable <Boundary <T> > CrossBoundaries(IIntervalSet <T> one, IIntervalSet <T> other)
 {
     foreach (Boundary <T> otherBoundary in other.Boundaries)
     {
         BoundaryKind cross = one.Cross(otherBoundary.Location)?.Cross(otherBoundary.Kind);
         if (cross != null)
         {
             yield return(new Boundary <T>(otherBoundary.Location, cross));
         }
     }
 }
Exemplo n.º 2
0
 private static IEnumerable <Boundary <T> > PlusBoundaries(IIntervalSet <T> one, IIntervalSet <T> other)
 {
     foreach (Boundary <T> otherBoundary in other.Boundaries)
     {
         BoundaryKind cross = one.Cross(otherBoundary.Location);
         if (cross == null)
         {
             yield return(otherBoundary);
         }
         else
         {
             BoundaryKind plusKind = cross.Plus(otherBoundary.Kind);
             yield return(new Boundary <T>(otherBoundary.Location, plusKind));
         }
     }
 }
Exemplo n.º 3
0
 /// <inheritdoc />
 public bool Intersects(IIntervalSet <T> other)
 {
     return(!other.Cross(this).IsEmpty);
 }