| Trees | Indices | Help |
|
|---|
|
|
object --+
|
common.Primitive --+
|
TorusCore --+
|
MaestroTorus
Class to create a 3D torus in Maestro. This torus will be drawn
at the appropriate time in Maestro to interact properly with transparent
objects.
See doc string for __init__ for details on instantiation.
Toruses should be added to a Group and drawing done via the Group.
See Group documentation.
API Example
-----------
import schrodinger.maestro.maestro as maestro
import schrodinger.graphics3d.common as common
import schrodinger.graphics3d.torus as torus
torus_grp = common.Group()
st = maestro.workspace_get()
for bond in st.bond:
trs = torus.MaestroTorus(
x0=bond.atom1.x,
y0=bond.atom1.y,
z0=bond.atom1.z,
x1=bond.atom2.x,
y1=bond.atom2.y,
z1=bond.atom2.z,
radius=0.1,
tube_radius=0.5,
resolution_u=7,
resolution_v=5,
opacity=0.8,
color='red'
)
# Add the primative to the container.
torus_grp.add(trs)
# MaestroTorus needs to be drawn.
# No special callback like there is for Toruses is needed.
torus_grp.show()
# Hide the markers.
torus_grp.hide()
# Remove the markers and the callback.
torus_grp.clear()
maestro.workspace_draw_function_remove(torus_grp.draw)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
x0 X0 coordinate |
|||
|
y0 Y0 coordinate |
|||
|
z0 Z0 coordinate |
|||
|
x1 X1 coordinate |
|||
|
y1 Y1 coordinate |
|||
|
z1 Z1 coordinate |
|||
|
r Red value in RGB triplet |
|||
|
g Green value in RGB triplet |
|||
|
b Blue value in RGB triplet |
|||
|
radius Torus's radius |
|||
|
tube_radius Torus's tube_radius |
|||
|
opacity Torus's opacity |
|||
|
material Torus's material |
|||
|
pick_id Torus object's pick ID |
|||
|
pick_category Torus's picking category |
|||
|
|||
Constructor requires:
x0, y0, z0: coordinate specifying center of torus in Angstroms.
x1, y1, z1: coordinate specifying projected center of torus
in Angstroms.
color: One of:
Color object
Color name (string)
Tuble of (R, G, B) (each 0.0-1.0)
radius: radius of the torus in Angstroms
tube_radius: radius of the tube of the torus in Angstroms
Optional arguments:
opacity: 0.0 (transparent) through 1.0 (opaque)
Defaults to 1.0
resolution_u: 2 to 30, resolution in the U direction of the surface
Defaults to 5
resolution_v: 2 to 30, resolution in the V direction of the surface
Defaults to 3
|
When the OpenGL version changes we need to rebuild the Maestro-based objects. But we want to retain the instance of the python object that contains it. So we just recreate the object on the Maestro side. Note: This is a private function and should not be called by users. @return nothing |
|
|||
radiusTorus's radius
|
tube_radiusTorus's tube_radius
|
opacityTorus's opacity
|
materialTorus's material
|
pick_idTorus object's pick ID
|
pick_categoryTorus's picking category
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Wed Aug 3 07:59:54 2016 | http://epydoc.sourceforge.net |