Exemple #1
0
    def _get_empty_cells(self, dc, grid, key, text_pos, text_extent):
        """Generator of empty cells from key in direction

        Parameters
        ----------
        key: 3-tuple of Integer
        \tCurrent cell
        text_pos: 3-tuple
        \tPosition and direction of text

        """

        row, col, tab = key

        blocking_distance = None

        textbox = self.get_text_rotorect(text_pos, text_extent)

        for distance, __row, __col in grid.colliding_cells(row, col, textbox):

            if blocking_distance is None or distance == blocking_distance:
                if self.data_array[__row, __col, tab] is not None and \
                   self.data_array[__row, __col, tab] != "":
                    blocking_distance = distance
                else:
                    yield __row, __col, tab
Exemple #2
0
    def _get_full_cells(self, dc, grid, key, text_pos, text_extent):
        """Generator of full cells from key in direction

        Parameters
        ----------
        key: 3-tuple of Integer
        \tCurrent cell
        text_pos: 3-tuple
        \tPosition and direction of text

        """

        row, col, tab = key

        blocking_distance = None

        textbox = self.get_text_rotorect(text_pos, text_extent)

        for distance, __row, __col in grid.colliding_cells(row, col, textbox):
            # Draw blocking arrows if locking cell is not empty

            if not(
               (blocking_distance is None or distance == blocking_distance)
               and not self.data_array[__row, __col, tab]):

                yield __row, __col, tab