Пример #1
0
 def draw_klein(self, ctx, dont_map=False):
     if dont_map:
         p = self
     else:
         p = ctx.isom.map(self)
     #ctx.cairo.arc(p.x, p.y, get_actual_dimension(ctx.cairo, POINT_RADIUS), 0, 2*math.pi)
     #ctx.cairo.fill()
     actual_radius = get_actual_dimension(ctx.cairo, POINT_RADIUS)
     p1 = tuple(map(int, ctx.cairo.user_to_device(p.x - actual_radius, p.y + actual_radius)))
     p2 = tuple(map(int, ctx.cairo.user_to_device(p.x + actual_radius, p.y - actual_radius)))
     ctx.image_draw.arc([p1[0], p1[1], p2[0], p2[1]], 0, 360, fill=(0, 255, 0))
Пример #2
0
 def draw_poincare(self, ctx, dont_map=False):
     if dont_map:
         p = self
     else:
         p = ctx.isom.map(self)
     #print p.x, p.y
     x, y = p.get_poincare_coords()
     #print x, y
     # ctx.cairo.arc(x, y, get_actual_dimension(ctx.cairo, POINT_RADIUS), 0, 2*math.pi)
     # ctx.cairo.fill()
     actual_radius = get_actual_dimension(ctx.cairo, POINT_RADIUS)
     p1 = tuple(map(int, ctx.cairo.user_to_device(x - actual_radius, y + actual_radius)))
     p2 = tuple(map(int, ctx.cairo.user_to_device(x + actual_radius, y - actual_radius)))
     ctx.image_draw.arc([p1[0], p1[1], p2[0], p2[1]], 0, 360, fill=(0, 255, 0))
Пример #3
0
 def draw_klein(self, ctx, dont_map=False):
     if dont_map:
         p = self
     else:
         p = ctx.isom.map(self)
     #ctx.cairo.arc(p.x, p.y, get_actual_dimension(ctx.cairo, POINT_RADIUS), 0, 2*math.pi)
     #ctx.cairo.fill()
     actual_radius = get_actual_dimension(ctx.cairo, POINT_RADIUS)
     p1 = tuple(
         map(
             int,
             ctx.cairo.user_to_device(p.x - actual_radius,
                                      p.y + actual_radius)))
     p2 = tuple(
         map(
             int,
             ctx.cairo.user_to_device(p.x + actual_radius,
                                      p.y - actual_radius)))
     ctx.image_draw.arc([p1[0], p1[1], p2[0], p2[1]],
                        0,
                        360,
                        fill=(0, 255, 0))
Пример #4
0
 def draw_poincare(self, ctx, dont_map=False):
     if dont_map:
         p = self
     else:
         p = ctx.isom.map(self)
     #print p.x, p.y
     x, y = p.get_poincare_coords()
     #print x, y
     # ctx.cairo.arc(x, y, get_actual_dimension(ctx.cairo, POINT_RADIUS), 0, 2*math.pi)
     # ctx.cairo.fill()
     actual_radius = get_actual_dimension(ctx.cairo, POINT_RADIUS)
     p1 = tuple(
         map(int,
             ctx.cairo.user_to_device(x - actual_radius,
                                      y + actual_radius)))
     p2 = tuple(
         map(int,
             ctx.cairo.user_to_device(x + actual_radius,
                                      y - actual_radius)))
     ctx.image_draw.arc([p1[0], p1[1], p2[0], p2[1]],
                        0,
                        360,
                        fill=(0, 255, 0))
Пример #5
0
 def draw_klein(self, ctx):
     x, y = ctx.isom.map(self.to_point()).get_coords()
     ctx.cairo.arc(x, y, get_actual_dimension(ctx.cairo, POINT_RADIUS), 0,
                   2 * math.pi)
     ctx.cairo.fill()
Пример #6
0
 def draw_klein(self, ctx):
     x, y = ctx.isom.map(self.to_point()).get_coords()
     ctx.cairo.arc(x, y, get_actual_dimension(ctx.cairo, POINT_RADIUS), 0, 2*math.pi)
     ctx.cairo.fill()