예제 #1
0
    def findintersects(self, region: Region) -> Iterator[RegionPair]:
        """
    Return an iterator over all the pairs of overlaps between the
    given Region and the currently active Regions, as RegionPairs.

    Args:
      region:   The Region to find pairs of overlaps with
                currently active Regions, as RegionPairs.

    Returns:
      An iterator over all the pairs of overlaps between
      the Region and currently active Regions.
    """
        for _, active in self.actives.items():
            assert active[self.dimension].lower <= region[self.dimension].lower
            if region.overlaps(active):
                yield (active, region)
예제 #2
0
 def check_event_context(context):
     assert isinstance(context, Tuple) and len(context) == 2
     assert all([isinstance(r, Region) for r in context])
     assert Region.overlaps(*context)
     return context