schrodinger.graphics3d.tube module

Module for drawing a tube in the Workspace.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.graphics3d.tube.MaestroTube(point1, point2, color, radius, opacity=1.0)

Bases: schrodinger.graphics3d.common.Primitive

A graphical tube (bond) drawn in the Workspace

__init__(point1, point2, color, radius, opacity=1.0)

Create a Tube instance

Parameters:
  • point1 (list) – The [X, Y, Z] points of the first tube end
  • point2 (list) – The [X, Y, Z] points of the other tube end
  • color (tuple) – A tuple of (R, G, B) values between 0 and 1
  • radius (float) – The radius of the tube in ?Angstroms?
calculateXYZBox()

Pre-calculate some data used in the bounding box function

createObject()

Create a graphics object

setColor(color)

Set the color of the object

Parameters:color (tuple) – The (R, G, B) values in the range of 0-1
setRadius(radius)

Set the radius of the object

Parameters:radius (float) – The radius of the object
setPoints(point1, point2)

Set the coordinates of the tube ends

Parameters:
  • point1 (list) – The [X, Y, Z] points of the first tube end
  • point2 (list) – The [X, Y, Z] points of the other tube end
setEntryID(eid)

Set the entry id of the object. This is used for placing the workspace graphics when the workspace is tiled.

Parameters:eid (str) – The entry ID to associate the graphics with
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.

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.
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