schrodinger.graphics3d.arrow module

Maestro 3D arrows.

The arrow module allows creation and drawing of arrows. Clients draw using graphics3d.common.Group instances, aliased here as ArrowGroup, not through Arrow instances.

Control over the endpoints, radius, color, resolution and transparency of a arrow are provided. See the Arrow class for more info.

To draw any number of arrows create Arrow instances, add them to a Group instance.

Copyright Schrodinger LLC, All rights reserved.

class schrodinger.graphics3d.arrow.MaestroArrow(xhead=None, yhead=None, zhead=None, xtail=None, ytail=None, ztail=None, color=None, r=0.0, g=1.0, b=0.0, radius=0.15, transparency=None, opacity=1.0, resolution=16, body_percentage=0.75, remove_endcaps=False)

Bases: schrodinger.graphics3d.common._MaestroPrimitiveMixin, schrodinger.graphics3d.common.Primitive

Class for creating a 3D arrow in Maestro

Arrows should be added to a Group and drawing done via the Group. See the Group documentation.

API Example:

import schrodinger.maestro.maestro as maestro
import schrodinger.graphics3d.common as common
import schrodinger.graphics3d.arrow as arrow

arrow_grp = common.Group()
st = maestro.workspace_get()
for bond in st.bond:
    ar = arrow.MaestroArrow(
        xhead=bond.atom2.x, yhead=bond.atom2.y, zhead=bond.atom2.z,
        xtail=bond.atom1.x, ytail=bond.atom1.y, ztail=bond.atom1.z,
        color='red',
        radius=0.15,
        opacity=0.8,
        resolution=50
    )
    # Add the primative to the container.
    arrow_grp.add(ar)

# Unlike Arrow MaestroArrow simply needs to be shown to be drawn.
# No special callback like there is for Arrows is needed.
arrow_grp.show()

# Hide the markers.
arrow_grp.hide()

# Remove the markers and the callback.
arrow_grp.clear()
__init__(xhead=None, yhead=None, zhead=None, xtail=None, ytail=None, ztail=None, color=None, r=0.0, g=1.0, b=0.0, radius=0.15, transparency=None, opacity=1.0, resolution=16, body_percentage=0.75, remove_endcaps=False)

Constructor requires:

Parameters
  • xhead – x coordinate of head position

  • yhead – y coordinate of head position

  • zhead – z coordinate of head position

  • xtail – x coordinate of tail position

  • ytail – y coordinate of tail position

  • ztail – z coordinate of tail position

  • color – One of Color object (Color class) or Color name (string) or Tuple of (R, G, B) (each a float in range 0.0-1.0)

  • radius – radius of the arrow in Angstroms Default: .15

  • opacity – 0.0 (invisible) through 1.0 (opaque) Default: 0.0

  • resolution – Ranges from ?? to ??. Default: ??

  • remove_endcaps – Whether to remove cylinder endcaps on arrow body.

property opacity
property r
property g
property b
calculateCoords(body_percentage=0.75)

Calculate the intermediate coordinate between head and body

groupHidden()

Called when the group of this object is hidden. Hide the Maestro object(s).

groupShown()

Called when the group of this object is shown. Show the Maestro object, if we are being shown.

hide()

Hide the object. It will not be drawn when the group is drawn.

isGroupShown()

Returns True if this object’s group is shown. False otherwise.

isShown()

Returns True if this object shown. False otherwise.

property material
property persistent_name
property pick_category
property pick_id
setColors()
setEntryID(entry_id)

Sets entry ID for Maestro object (necessary to render in tile-by-entry mode.

Parameters

entry_id (str) – Object’s entry ID.

setGlowColor(r, g, b)

Sets glow color for the object.

Parameters
  • r (float) – Red component of glow color [0.0 .. 1.0]

  • g (float) – Green component of glow color [0.0 .. 1.0]

  • b (float) – Blue component of glow color [0.0 .. 1.0]

setIsGlowing(is_glowing)

Enables or disables glow effect for the object.

Parameters

is_glowing (bool) – Whether the object is glowing.

setRGBColors(r, g, b, a=None)
setRightClickOnGObject(pymodule, pyfunc)

Sets the python callback which should be called whenever given graphics object is right clicked.

Parameters
  • pymodule (str) – Python module

  • pyfunc (str) – Python function

show()

Display this object, if it was hidden

property xhead
property yhead
property zhead
property xtail
property ytail
property ztail
property radius