Beispiel #1
0
    def draw_sector_labels(self, track_graphics: TrackGraphics, colour: str):
        for name in self.get_all_sector_names():
            (start, finish) = self.get_sector_start_and_finish(name)
            label_waypoint = int((start + finish) / 2)
            point = self._drawing_points[label_waypoint].middle

            if self._is_vertical_at_waypoint(label_waypoint):
                track_graphics.plot_text(point, name, 20, colour, 14, 0)
            else:
                track_graphics.plot_text(point, name, 20, colour, 0, -14)
Beispiel #2
0
    def draw_waypoint_labels(self, track_graphics: TrackGraphics, colour: str,
                             font_size: int):
        last_label_position = None
        for (i, p) in enumerate(self._drawing_points[:-2]):
            if self._is_vertical_at_waypoint(i):
                label = track_graphics.plot_text(p.middle, str(i), font_size,
                                                 colour, -1.5 * font_size, 0.0)
            else:
                label = track_graphics.plot_text(p.middle, str(i), font_size,
                                                 colour, 0.0, 1.5 * font_size)

            label_position = track_graphics.get_widget_position(label)
            if last_label_position is None:
                last_label_position = label_position
            elif geometry.get_distance_between_points(
                    last_label_position, label_position) < 2.5 * font_size:
                track_graphics.delete_widget(label)
            else:
                last_label_position = label_position
Beispiel #3
0
 def OLD_plot_label(self, track_graphics: TrackGraphics, point, text, size):
     off_track_point = self.get_target_point(
         (self.mid_x, self.mid_y), point, -180, 1.5 * self.track_width)
     track_graphics.plot_text(off_track_point, text, size)