| Trees | Indices | Help |
|
|---|
|
|
object --+
|
common.Primitive --+
|
Box
Class to draw a 3D box 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.
Boxes should be added to a graphics3d.common.Group, or BoxGroup,
and drawing done via the Group. See the graphics3d.common.Group
documentation.
See note on transparency in the module level docstring.
API Example
-----------
import schrodinger.maestro.maestro as maestro
import schrodinger.graphics3d.common as common
import schrodinger.graphics3d.box as box
box_grp = common.Group()
st = maestro.workspace_get() # Here, st is methane.
methane_vertices = [
# plane-1, defined in clockwise order.
st.atom[1].x + 0,
st.atom[1].y + 1,
st.atom[1].z + 1,
st.atom[1].x + 1,
st.atom[1].y + 0,
st.atom[1].z + 1,
st.atom[1].x + 0,
st.atom[1].y - 1,
st.atom[1].z + 1,
st.atom[1].x - 1,
st.atom[1].y + 0,
st.atom[1].z + 1,
# plane-2, defined in clockwise order.
st.atom[1].x + 0,
st.atom[1].y + 1,
st.atom[1].z - 1,
st.atom[1].x + 1,
st.atom[1].y + 0,
st.atom[1].z - 1,
st.atom[1].x + 0,
st.atom[1].y - 1,
st.atom[1].z - 1,
st.atom[1].x - 1,
st.atom[1].y + 0,
st.atom[1].z - 1,
]
bx = box.Box(
vertices=methane_vertices,
color='red',
opacity=1.0,
style=box.LINE
)
# Add the primitive to the container.
box_grp.add(bx)
# Add the draw callback.
maestro.workspace_draw_function_add(box_grp.draw)
# Hide the markers.
box_grp.hide()
# Remove the markers and the callback.
box_grp.clear()
maestro.workspace_draw_function_remove(box_grp.draw)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
|||
|
|||
|
|||
|
line_width This attribute controls the width of the lines used to draw the box. |
|||
|
|||
Constructor requires:
You may specify vertices OR extents and a center. These
are in Angstroms
vertices: List of 24 values: x1, y1, z1 ... x8, y8, z8 OR
list of 8 vertex lists [x, y, z], ..., [x, y, z]
Specify 4 vertices from one face first, then
the corresponding 4 vertices from the parallel opposite
side. Do these in the same clockwise ordering
as viewed from the same location. For
example, if the first vertex in the front face is top-left,
then start 2nd rear face with top-left vertex as viewed
from the same direction/location.
center: List of 3 Angstrom values indicating the center coordinate
of the box. If specified, extents must also be specified
and vertices will be ignored.
extents: List of 3 float values in Angstroms -
x length, y length, z length.
If this is specifiied, center must also be specified
/zone1/adzhigir/trunk/mmshare/python/modules/schrodinger/protein/membrane.pybb
color: One of:
Color object
Color name (string)
Tuble of (R, G, B) (each 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 BoxGroup instances. |
Private method. See docstring for line_width property. |
Private method. See docstring for line_width property. |
|
|||
line_widthThis attribute controls the width of the lines used to draw the box. Width is a float and subject to the limitations of glLineWidth, meaning that (among other things) not all widths are supported. If an unsupported width is chosen, the nearest supported width is used. See the glLineWidth documentation for details on this and other behaviors.
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Wed Aug 3 07:59:54 2016 | http://epydoc.sourceforge.net |