Inherits from
- GraphicsContextBase: enthought.kiva.basecore2d.GraphicsContextBase
Method summary
- __init__(self, size = (500, 500), dc = None)
- affine_to_gl(self, mat, load = 0)
- begin_page(self)
- clear(self, *args)
- device_destroy_clipping_path(self)
- device_draw_glyphs(self, glyphs, tx, ty)
- device_draw_rect(self, x, y, sx, sy, mode = FILL)
- device_fill_points(self, pts, mode)
- device_prepare_device_ctm(self)
- device_set_clipping_path(self, x, y, width, height)
- device_stroke_points(self, pts, mode)
- device_transform_device_ctm(self, func, args)
- device_update_fill_state(self)
- device_update_font_state(self)
- device_update_line_state(self)
- flush(self)
- get_ctm(self)
- gl_ctm(self)
- gl_render_points(self, pts, color, polygon = 0, fill = 0, mode = FILL, convex = 0)
- gl_render_points_set(self, pts_set, fill_color, stroke_color, polygon = 0, fill = 1, stroke = 1)
- gl_tesselate_polygon(self, pts, mode)
- init_gl_viewport(self)
- line_dash_to_gl(self)
- restore_state(self)
- save_state(self)
- setup_glu_tess(self)
- synchronize(self)
- x_device_show_text(self, text)
Methods
- __init__(self, size = (500, 500), dc = None)
- affine_to_gl(self, mat, load = 0)
- begin_page(self)
- clear(self, *args)
Clears the screen to the given RGB or RGBA colors:
clear(r, g, b) clear(r, g, b, a) clear( (r,g,b) ) clear( (r,g,b,a) )
If no color is given, then clears to the current graphics state's fill_color.
- device_destroy_clipping_path(self)
- device_draw_glyphs(self, glyphs, tx, ty)
- device_draw_rect(self, x, y, sx, sy, mode = FILL)
Not often used -- calls generally go through draw_points. Is mode needed?
Dead code -- at least for now.
- device_fill_points(self, pts, mode)
Needs much work for handling WINDING and ODD EVEN fill rules.
- mode
Specifies how the subpaths are drawn. The default is FILL_STROKE. The following are valid values.
- FILL
- Paint the path using the nonzero winding rule to determine the regions for painting.
- EOF_FILL
- Paint the path using the even-odd fill rule.
- STROKE
- Draw the outline of the path with the current width, end caps, etc settings.
- FILL_STROKE
- First fill the path using the nonzero winding rule, then stroke the path.
- EOF_FILL_STROKE
- First fill the path using the even-odd fill method, then stroke the path.
- device_prepare_device_ctm(self)
- device_set_clipping_path(self, x, y, width, height)
- device_stroke_points(self, pts, mode)
Draw a set of connected points using the current stroke settings.
- mode
Specifies how the subpaths are drawn. The default is FILL_STROKE. The following are valid values.
- FILL
- Paint the path using the nonzero winding rule to determine the regions for painting.
- EOF_FILL
- Paint the path using the even-odd fill rule.
- STROKE
- Draw the outline of the path with the current width, end caps, etc settings.
- FILL_STROKE
- First fill the path using the nonzero winding rule, then stroke the path.
- EOF_FILL_STROKE
- First fill the path using the even-odd fill method, then stroke the path.
- device_transform_device_ctm(self, func, args)
Default implementation for handling scaling matrices.
Many implementations will just use this function. Others, like OpenGL, can benefit from overriding the method and using hardware acceleration.
- device_update_fill_state(self)
Set the shape filling properties for the graphics context.
This only needs to be drawn before filling a path. See update_line_state for comments.
This uses wxBrush for wxPython.
- device_update_font_state(self)
- device_update_line_state(self)
Set the line drawing properties for the graphics context.
- flush(self)
- get_ctm(self)
Return the current coordinate transform matrix.
Note: untested
- gl_ctm(self)
- gl_render_points(self, pts, color, polygon = 0, fill = 0, mode = FILL, convex = 0)
- gl_render_points_set(self, pts_set, fill_color, stroke_color, polygon = 0, fill = 1, stroke = 1)
- gl_tesselate_polygon(self, pts, mode)
- init_gl_viewport(self)
Sets up the viewport and projection matrices.
- line_dash_to_gl(self)
- restore_state(self)
- save_state(self)
- setup_glu_tess(self)
- synchronize(self)
- x_device_show_text(self, text)
Insert text at the current text position