Trees | Indices | Help |
|
---|
|
object --+ | common.Primitive --+ | Polygon
Class to draw a flat polygon in OpenGL. Will be drawn in the current OpenGL drawable. This includes the ability to draw into Maestro's Workspace. It just needs to be the current drawable. See doc string for __init__ for details on instantiation. API Example ----------- import schrodinger.maestro.maestro as maestro import schrodinger.graphics3d.common as common import schrodinger.graphics3d.polygon as polygon import math poly_grp = common.Group() st = maestro.workspace_get() at = st.atom[1] vertices = [] for theta in range(0, 360, 80): theta_rad = theta * math.pi/180 x = math.cos(theta_rad) y = math.sin(theta_rad) vertices.append( (at.x + x, at.y + y, at.z) ) pgon = polygon.Polygon( vertices=vertices, color='red', opacity=0.8, ) # Add the primative to the container. poly_grp.add(pgon) # Hide the markers. poly_grp.hide() # Remove the markers and the callback. poly_grp.clear() maestro.workspace_draw_function_remove(poly_grp.draw)
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
|
|||
|
|
|||
Inherited from |
|
Constructor requires: vertices: List of vertex coordinates (x, y, z). Specify at least 3 vertices in consecutive order. All vertices must be in the same plane. color: One of: Color object (Color class) Color name (string) Tuple of (R, G, B) (each a float in range 0.0-1.0) Optional arguments: opacity: 0.0 (invisible) through 1.0 (opaque) Defaults to 1.0 style: LINE or FILL. Default is FILL.
|
Private method to draw out the box with the current settings. This should only be called by Group instances. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Aug 6 04:50:43 2015 | http://epydoc.sourceforge.net |