Ejemplo n.º 1
0
    def draw_die_center(self):
        """ Plots the die centers as a small dot """
        for die in self.xyd:
            # Determine the die's lower-left coordinate
            lower_left_coord = wm_utils.grid_to_rect_coord(
                die[:2], self.die_size, self.grid_center)

            # then adjust back to the die center
            lower_left_coord = (lower_left_coord[0] + self.die_size[0] / 2,
                                lower_left_coord[1] + self.die_size[1] / 2)

            circ = FloatCanvas.Circle(
                lower_left_coord,
                0.5,
                FillColor=wm_const.wm_DIE_CENTER_DOT_COLOR,
            )
            self.canvas.AddObject(circ)
Ejemplo n.º 2
0
    def draw_die_center(self):
        """ Plots the die centers as a small dot """
        for die in self.xyd:
            # Determine the die's lower-left coordinate
            lower_left_coord = wm_utils.grid_to_rect_coord(die[:2],
                                                           self.die_size,
                                                           self.grid_center)

            # then adjust back to the die center
            lower_left_coord = (lower_left_coord[0] + self.die_size[0] / 2,
                                lower_left_coord[1] + self.die_size[1] / 2)

            circ = FloatCanvas.Circle(lower_left_coord,
                                      0.5,
                                      FillColor=wm_const.wm_DIE_CENTER_DOT_COLOR,
                                      )
            self.canvas.AddObject(circ)
Ejemplo n.º 3
0
    def draw_die(self):
        """ Draws and add the die on the canvas """
        color_dict = None
        for die in self.xyd:
            # define the die color
            if self.data_type == 'discrete':
                color_dict = self.legend.color_dict
                color = color_dict[die[2]]
            else:
                color = self.legend.get_color(die[2])

            # Determine the die's lower-left coordinate
            lower_left_coord = wm_utils.grid_to_rect_coord(
                die[:2], self.die_size, self.grid_center)

            # Draw the die on the canvas
            self.canvas.AddRectangle(
                lower_left_coord,
                self.die_size,
                LineWidth=1,
                FillColor=color,
            )
Ejemplo n.º 4
0
    def draw_die(self):
        """ Draws and add the die on the canvas """
        color_dict = None
        for die in self.xyd:
            # define the die color
            if self.data_type == 'discrete':
                color_dict = self.legend.color_dict
                color = color_dict[die[2]]
            else:
                color = self.legend.get_color(die[2])

            # Determine the die's lower-left coordinate
            lower_left_coord = wm_utils.grid_to_rect_coord(die[:2],
                                                           self.die_size,
                                                           self.grid_center)

            # Draw the die on the canvas
            self.canvas.AddRectangle(lower_left_coord,
                                     self.die_size,
                                     LineWidth=1,
                                     FillColor=color,
                                     )