Пример #1
0
 def _draw(self):
     # Update ticks prior to drawing if required
     if self._ticks_need_updating:
         self._update_xticks()
         self._update_yticks()
         self._ticks_need_updating = False
     # Prepare for plotting
     gl.glMatrixMode(gl.GL_MODELVIEW)
     gl.glPushMatrix()
     gl.glLoadMatrixd(self._gl_mview_xylims)
     # Clip everything in the pane
     gl.glScissor(*self._gl_scissor_xylims)
     gl.glEnable(gl.GL_SCISSOR_TEST)
     # Clear region defined by scissor-clipping
     gl.glClearColor(*self._bgcolour)
     gl.glClear(gl.GL_COLOR_BUFFER_BIT)
     for line in self.lines:
         line.draw()
     # Unclip to draw borders (all settings should be restored)
     gl.glDisable(gl.GL_SCISSOR_TEST)
     # Draw border in figure space (line never needs updating)
     gl.glLoadMatrixd(self._figure._gl_mview_xylims)
     self._edge_line.draw()
     # Draw tick text in pixel space
     gl.glPopMatrix()
     for t in self._gl_xticks.values() + self._gl_yticks.values():
         t['glt'].draw()
Пример #2
0
    def _DrawGL(self):
        """
        Default _DrawGL. This should be overridden by subclasses of GLPanel

        This function should not be called explicitly.
        To initiate a redraw call Repaint().
        """
        gl.glClearColor(0,0,0,0)
        gl.glClear(gl.GL_COLOR_BUFFER_BIT)
Пример #3
0
 def _draw(self):
     """Draw the OpenGL scene (only called by event handlers)"""
     ## Clear figure area
     gl.glClearColor(*self._bgcolour)
     gl.glClear(gl.GL_COLOR_BUFFER_BIT)
     ## Delegate drawing to the axes
     for ax in self._axes:
         ax._draw()
     ## Clear draw flag, until changed again
     self._needs_draw = False