.. $Id$  -*- rst -*-
.. pyformex reference manual --- canvas
.. CREATED WITH py2rst.py: DO NOT EDIT

.. include:: ../defines.inc
.. include:: ../links.inc

.. _sec:ref-canvas:

:mod:`canvas` --- This implements an OpenGL drawing widget for painting 3D scenes.
==================================================================================

.. automodule:: canvas
   :synopsis: This implements an OpenGL drawing widget for painting 3D scenes.



   .. autoclass:: ActorList


      ActorList objects have the following methods:

      .. automethod:: add(actor)
      .. automethod:: delete(actor)
      .. automethod:: redraw()

   .. autoclass:: CanvasSettings


      CanvasSettings objects have the following methods:

      .. automethod:: checkDict(clas,dict)
      .. automethod:: reset(dict={})
      .. automethod:: update(dict)

   .. autoclass:: Light


      Light objects have the following methods:

      .. automethod:: set(ambient=0.5,diffuse=0.5,specular=0.5,position=(!!(319, (303, (304, (305, (306, (307, (309, (310, (311, (312, (313, (314, (315, (316, (317, (2, '0.'))))))))))))))), (12, ','), (303, (304, (305, (306, (307, (309, (310, (311, (312, (313, (314, (315, (316, (317, (2, '0.'))))))))))))))), (12, ','), (303, (304, (305, (306, (307, (309, (310, (311, (312, (313, (314, (315, (316, (317, (2, '1.'))))))))))))))), (12, ','), (303, (304, (305, (306, (307, (309, (310, (311, (312, (313, (314, (315, (316, (317, (2, '0.'))))))))))))))))!!))
      .. automethod:: enable()
      .. automethod:: disable()

   .. autoclass:: Canvas


      Canvas objects have the following methods:

      .. automethod:: Size()
      .. automethod:: glMatSpec()
      .. automethod:: glLightSpec()
      .. automethod:: glLight(onoff)
      .. automethod:: resetDefaults(dict={})
      .. automethod:: resetLighting()
      .. automethod:: resetLights()
      .. automethod:: setRenderMode(rm)
      .. automethod:: setTransparency(mode)
      .. automethod:: setLighting(mode)
      .. automethod:: setAveragedNormals(mode)
      .. automethod:: setLineWidth(lw)
      .. automethod:: setBgColor(color1,color2=None)
      .. automethod:: createBackground()
      .. automethod:: setFgColor(color)
      .. automethod:: setSlColor(color)
      .. automethod:: updateSettings(settings)
      .. automethod:: setLight(nr,ambient,diffuse,specular,position)
      .. automethod:: enableLight(nr)
      .. automethod:: disableLight(nr)
      .. automethod:: setTriade(on=None,size=1.0,pos=[0.0,0.0,0.0])
      .. automethod:: initCamera()
      .. automethod:: glinit(mode=None)
      .. automethod:: glupdate()
      .. automethod:: clear()
      .. automethod:: setDefaults()
      .. automethod:: setSize(w,h)
      .. automethod:: display()
      .. automethod:: zoom_2D(zoom=None)
      .. automethod:: begin_2D_drawing()
      .. automethod:: end_2D_drawing()
      .. automethod:: setBbox(bbox=None)
      .. automethod:: addActor(actor)
      .. automethod:: removeActor(actor)
      .. automethod:: addHighlight(actor)
      .. automethod:: removeHighlight(actor)
      .. automethod:: addAnnotation(actor)
      .. automethod:: removeAnnotation(actor)
      .. automethod:: addDecoration(actor)
      .. automethod:: removeDecoration(actor)
      .. automethod:: remove(itemlist)
      .. automethod:: removeActors(actorlist=None)
      .. automethod:: removeHighlights(actorlist=None)
      .. automethod:: removeAnnotations(actorlist=None)
      .. automethod:: removeDecorations(actorlist=None)
      .. automethod:: removeAll()
      .. automethod:: redrawAll()
      .. automethod:: setCamera(bbox=None,angles=None)
      .. automethod:: zoom(f,dolly=True)
      .. automethod:: zoomRectangle(x0,y0,x1,y1)
      .. automethod:: zoomAll()
      .. automethod:: saveBuffer()
      .. automethod:: showBuffer()
      .. automethod:: draw_focus_rectangle(width=2)
      .. automethod:: draw_cursor(x,y)
      .. automethod:: draw_rectangle(x,y)

**Functions defined in the module canvas**

   .. autofunction:: gl_pickbuffer()
   .. autofunction:: glFillMode(mode)
   .. autofunction:: glFrontFill()
   .. autofunction:: glBackFill()
   .. autofunction:: glBothFill()
   .. autofunction:: glFill()
   .. autofunction:: glLine()
   .. autofunction:: glSmooth()
   .. autofunction:: glFlat()
   .. autofunction:: glCulling()
   .. autofunction:: glNoCulling()

   
.. moduleauthor:: pyFormex project (http://pyformex.org)

.. End

