Package mmLib :: Module GLViewer :: Class GLDrawList
[show private | hide private]
[frames | no frames]

Class GLDrawList

         object --+    
                  |    
           GLObject --+
                      |
         object --+   |
                  |   |
OpenGLRenderMethods --+
                      |
                     GLDrawList

Known Subclasses:
GLAtomList, GLAxes, GLStructure, GLUnitCell

Fundamental OpenGL rigid entity.
Method Summary
  __init__(self, **args)
  gldl_delete_list(self)
Delete the currently compiled glList for this object.
  gldl_draw(self)
Implement in subclass to draw somthing.
  gldl_draw_method_check_visible(self, draw_method)
Returns True if the draw method is visible, False if not.
  gldl_draw_method_get(self, draw_method_name)
Returns the draw metod of the given name or None if not found.
  gldl_draw_method_gl_draw_list_compile(self, draw_method)
Performs a OpenGL Compile of the draw method if needed.
  gldl_draw_method_gl_draw_list_delete(self, draw_method)
Deletes the compiled OpenGL draw list for the draw method.
  gldl_draw_method_install(self, draw_method)
Installs a draw method to compile and render a OpenGL draw listlist.
  gldl_draw_method_recompile(self, draw_method_name)
Deletes the current compiloed OpenGL draw list for the draw method
  gldl_draw_method_recompile_all(self)
Deletes all currently compiled OpenGL compiled draw lists.
  gldl_draw_method_remove(self, draw_method_name)
Removes a draw method by name.
  gldl_draw_method_set_transparent(self, draw_method_name, transparent)
Sets the transparent flag for a draw_method.
  gldl_draw_transparent(self)
Implement in subclass to draw transparent objects.
  gldl_get_glviewer(self)
Returns the root GLViewer object.
  gldl_install_draw_methods(self)
Override in children to install draw methods for a GLDrawList.
  gldl_iter_multidraw_all(self)
When implemented as a iterator in a subclass, each time yield is invoked the GLDrawList and all its decendants will be rendered from whatever OpenGL coordinate system is set in the iterator.
  gldl_iter_multidraw_self(self)
Similar to gldl_iter_multidraw_all, but only this GLDrawList is rendered.
  gldl_pop_matrix(self)
Pop the roatated/translated position.
  gldl_property_color_rgbf(self, prop_name)
Returns the property value as a RGBF triplet.
  gldl_push_matrix(self)
Rotate and translate to the correct position for drawing.
  gldl_redraw(self)
Triggers a redraw of the GLViewer
  gldl_render(self, transparent)
Compile or force a recompile of this object's gl_draw list, and render the scene.
  gldl_render_draw_methods(self, transparent)
Render all draw methods.
  gldl_update_cb(self, updates, actions)
Properties update callback.
  glo_install_properties(self)
Called by GLObject.__init__ to install properties.
  glo_remove(self)
Override GLObject's remove to also delete the compiled OpenGL draw lists.
  glo_remove_child(self, child)
Override GLObject's remove to also delete the compiled OpenGL draw lists.
    Inherited from GLObject
  glo_add_child(self, child)
  glo_add_property(self, prop_desc)
Adds a new property to the GLObject.
  glo_add_update_callback(self, func)
Adds a function which is called whenever property values change.
  glo_append_child(self, child)
Adds a child GLObject to the end of the GLObject's child list.
  glo_count_descendants(self)
Counts all decendant GLObjects.
  glo_get_child(self, gl_object_id)
Returns the child GLObject matching the given gl_object_id.
  glo_get_degree(self)
Returns the number of children (degree).
  glo_get_depth(self)
Returns the depth, the root composite is depth 0.
  glo_get_glstructure(self)
Returns the parent GLStructure object, or None if the GLObject is not a child of a GLStructure.
  glo_get_index_path(self)
Returns the tree-path to the GLObject as a list of its integer indexes.
  glo_get_lowest_common_ancestor(self, gl_object)
Returns the lowest common ancesotry of self and argument composite.
  glo_get_parent(self)
Returns the parent GLObject.
  glo_get_parent_list(self)
Returns a list of the parent GLObjects back to the root.
  glo_get_path(self)
Returns the tree-path to the composite as a list of its parent composites.
  glo_get_properties_id(self)
  glo_get_property_desc(self, name)
Return the property description dictionary for the given property name.
  glo_get_root(self)
Returns the root GLObject.
  glo_init_properties(self, **args)
This is a special form of update which propagates all linked values, not just the changed ones.
  glo_is_descendant_of(self, gl_object)
Returns true if self composite is a decent of argument GLObject.
  glo_iter_children(self)
Iterate immediate children.
  glo_iter_preorder_traversal(self)
Preorder Traversal for GLObject composite.
  glo_iter_property_desc(self)
Iterates over all property descriptions.
  glo_link_child_property(self, name, child_gl_object_id, child_name)
Link the value of the GLObject's property to the value of a child property.
  glo_name(self)
Returns the GLObject name.
  glo_prepend_child(self, child)
Adds a child GLObject to the beginning of the GLObject's child list.
  glo_remove_update_callback(self, func)
Removes the update callback.
  glo_set_name(self, name)
Sets the GLObject name.
  glo_set_properties_id(self, gl_object_id)
Set the property name for this GLObject.
  glo_update_properties(self, **args)
Update property values and trigger update callbacks.
    Inherited from OpenGLRenderMethods
  glr_axis(self, position, axis, radius)
Draw a vector axis using the current set material at position with the given radius.
  glr_cross(self, position, color, line_width)
Draws atom with a cross of lines.
  glr_mult_matrix(self, R, t)
Multiplies the current matrix by rotation matrix R and translates by t
  glr_set_material_rgb(self, r, g, b, a)
Creates a stock rendering material colored according to the given RGB values.
  glr_sphere(self, position, radius, quality)
Draw a atom as a CPK sphere.
  glr_text(self, text, scale)
Renders a text string.
  glr_translate(self, t)
Translates the scene by vector t.
  glr_tube(self, pos1, pos2, radius)
Draws a hollow tube beginning at pos1, and ending at pos2.
  glr_Uaxes(self, position, U, prob, color, line_width)
Draw the anisotropic axies of the atom at the given probability.
  glr_Uellipse(self, position, U, prob)
Renders the ellipsoid enclosing the given fractional probability given the gaussian variance-covariance matrix U at the given position.
  glr_Urms(self, position, U)
Renders the root mean square (one standard deviation) surface of the gaussian variance-covariance matrix U at the given position.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T

Class Variable Summary
list gldl_color_list = ['White', 'Black', 'Blue', 'Green', 'M...
    Inherited from GLObject
GLPropertyDefault PropertyDefault = <mmLib.GLViewer.GLPropertyDefault obje...

Method Details

gldl_delete_list(self)

Delete the currently compiled glList for this object. This forces a recompile of the OpenGL draw list next time gl_call_list_render() is invoked. It also should be called before a GLDrawList is dereferenced so that unused compiled glLists are not left in the OpenGL libraries. This method also deletes the draw lists for all children of the GLDrawList.

gldl_draw(self)

Implement in subclass to draw somthing.

gldl_draw_method_check_visible(self, draw_method)

Returns True if the draw method is visible, False if not.

gldl_draw_method_get(self, draw_method_name)

Returns the draw metod of the given name or None if not found.

gldl_draw_method_gl_draw_list_compile(self, draw_method)

Performs a OpenGL Compile of the draw method if needed.

gldl_draw_method_gl_draw_list_delete(self, draw_method)

Deletes the compiled OpenGL draw list for the draw method.

gldl_draw_method_install(self, draw_method)

Installs a draw method to compile and render a OpenGL draw listlist.
keys:
   name:       text description of the method
   func:       the method to invoke to render the draw list
   tranparent: True if the draw list is drawing transparent

private values:
   gl_draw_list_id: OpenGL Drawlist ID

gldl_draw_method_recompile(self, draw_method_name)

Deletes the current compiloed OpenGL draw list for the draw method

gldl_draw_method_recompile_all(self)

Deletes all currently compiled OpenGL compiled draw lists.

gldl_draw_method_remove(self, draw_method_name)

Removes a draw method by name.

gldl_draw_method_set_transparent(self, draw_method_name, transparent)

Sets the transparent flag for a draw_method.

gldl_draw_transparent(self)

Implement in subclass to draw transparent objects.

gldl_get_glviewer(self)

Returns the root GLViewer object.

gldl_install_draw_methods(self)

Override in children to install draw methods for a GLDrawList.

gldl_iter_multidraw_all(self)

When implemented as a iterator in a subclass, each time yield is invoked the GLDrawList and all its decendants will be rendered from whatever OpenGL coordinate system is set in the iterator.

gldl_iter_multidraw_self(self)

Similar to gldl_iter_multidraw_all, but only this GLDrawList is rendered. The decendant GLDrawLists are rendered normally.

gldl_pop_matrix(self)

Pop the roatated/translated position.

gldl_property_color_rgbf(self, prop_name)

Returns the property value as a RGBF triplet.

gldl_push_matrix(self)

Rotate and translate to the correct position for drawing.

gldl_redraw(self)

Triggers a redraw of the GLViewer

gldl_render(self, transparent=False)

Compile or force a recompile of this object's gl_draw list, and render the scene. Rendering the scene can be bypassed if this method is called with render = False.

gldl_render_draw_methods(self, transparent)

Render all draw methods.

gldl_update_cb(self, updates, actions)

Properties update callback.

glo_install_properties(self)

Called by GLObject.__init__ to install properties.
Overrides:
mmLib.GLViewer.GLObject.glo_install_properties (inherited documentation)

glo_remove(self)

Override GLObject's remove to also delete the compiled OpenGL draw lists.
Overrides:
mmLib.GLViewer.GLObject.glo_remove

glo_remove_child(self, child)

Override GLObject's remove to also delete the compiled OpenGL draw lists.
Overrides:
mmLib.GLViewer.GLObject.glo_remove_child

Class Variable Details

gldl_color_list

Type:
list
Value:
['White',
 'Black',
 'Blue',
 'Green',
 'Magenta',
 'Red',
 'Cyan',
 'Yellow',
...                                                                    

Generated by Epydoc 2.0 on Wed Nov 24 17:34:57 2004 http://epydoc.sf.net