示例#1
0
    def draw_track_edges(self, track_graphics: TrackGraphics, colour: str):
        previous_left = self._drawing_points[-1].left
        previous_right = self._drawing_points[-1].right

        for p in self._drawing_points:
            track_graphics.plot_line(previous_left, p.left, 3, colour)
            previous_left = p.left
            track_graphics.plot_line(previous_right, p.right, 3, colour)
            previous_right = p.right
示例#2
0
    def draw_grid(self, track_graphics: TrackGraphics, colour: str):
        x = self._min_x
        while x < self._max_x:
            track_graphics.plot_line((x, self._min_y), (x, self._max_y), 1,
                                     colour)
            x += 1

        y = self._min_y
        while y < self._max_y:
            track_graphics.plot_line((self._min_x, y), (self._max_x, y), 1,
                                     colour)
            y += 1
示例#3
0
    def draw_section_highlight(self, track_graphics: TrackGraphics,
                               colour: str, start: int, finish: int):
        previous_left = self._drawing_points[start].left_outer
        previous_right = self._drawing_points[start].right_outer

        if finish >= start:
            highlight_points = self._drawing_points[start + 1:finish + 1]
        else:
            highlight_points = self._drawing_points[
                start:] + self._drawing_points[:finish + 1]

        for p in highlight_points:
            track_graphics.plot_line(previous_left, p.left_outer, 5, colour)
            previous_left = p.left_outer
            track_graphics.plot_line(previous_right, p.right_outer, 5, colour)
            previous_right = p.right_outer
示例#4
0
    def OLD_draw_for_route_plotting(self, track_graphics: TrackGraphics,
                                    colour):
        track_graphics.plot_line(self.drawing_points[0].left,
                                 self.drawing_points[0].right, 3, colour)
        self.draw_track_edges(track_graphics, colour)

        for (i, p) in enumerate(self.drawing_points):
            if i % 10 == 0:
                size = 4
            else:
                size = 2
            track_graphics.plot_dot(p.middle, size, colour)

            if p.is_divider:
                track_graphics.plot_line(p.left, p.right, 3, colour)

            if p.is_center:
                # self._plot_label(track_graphics, p.middle, p.section, 30)
                pass  # NOT WORKING VERY WELL AT CHOOSING GOOD POSITION
示例#5
0
 def draw_sector_dividers(self, track_graphics: TrackGraphics, colour: str):
     for p in self._drawing_points:
         if p.is_divider:
             track_graphics.plot_line(p.left, p.right, 3, colour, (4, 2))
示例#6
0
 def draw_starting_line(self, track_graphics: TrackGraphics, colour: str):
     track_graphics.plot_line(self._drawing_points[0].left,
                              self._drawing_points[0].right, 3, colour)