Trees | Indices | Help |
|
---|
|
object --+ | common.Primitive --+ | Lines
Class to draw a set of lines 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. Lines with the same characteristics must be placed (color, width) into a single Lines instance. 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.lines as lines line_grp = common.Group() st = maestro.workspace_get() color='red' displacement = 1.0 for at in st.atom: vert = [ (at.x - displacement, at.y, at.z), (at.x + displacement, at.y, at.z), (at.x, at.y - displacement, at.z), (at.x, at.y + displacement, at.z), (at.x, at.y, at.z - displacement), (at.x, at.y, at.z + displacement), ] # Add the primatives to the container. line_grp.add(lines.Lines(vertices=vert, color=color)) # Add the draw callback. maestro.workspace_draw_function_add(line_grp.draw) # Hide the markers. line_grp.hide() # Remove the markers and the callback. line_grp.clear() maestro.workspace_draw_function_remove(line_grp.draw)
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
|
|||
|
|
|||
_blend = None hash(x) |
|||
_smooth_point = None hash(x) |
|||
_smooth_line = None hash(x) |
|
|||
|
Lines constructor requires: vertices: List of vertex coordinates (x, y, z). Each vertex coordinate is itself an xyz list: [[x1,y1,z1],[x2,y2,z2]...] Treats each pair of vertices as an independent line segment. Total number of vertices should be 2n. N/2 lines are drawn. It is an error to specify an odd number of vertices. 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: width (float): Defaults to 1.0. Lines are always drawn out anti-aliased. So the actual width is determined at rasterization time. Not all widths are supported and if an unsupported width is chosen, the nearest supported with is used. Only width 1 is guaranteed to be supported.
|
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 Tue Apr 26 05:42:13 2016 | http://epydoc.sourceforge.net |