schrodinger.graphics3d.polygon module

Maestro 3D polygons.

The polygon module allows creation and drawing of polygons. Clients draw using Group instances not through Polygon instances.

Control over the vertices, color, and transparency of a polygon are provided. See the Polygon class for more info.

To draw any number of polygons create the Polygon instances and add them to a Group instance (PolygonGroup can be used and is a synonym). Then invoke the Group’s draw() method.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.graphics3d.polygon.MaestroPolygon(vertices, color=None, opacity=1.0, style=1)

Bases: schrodinger.graphics3d.common.Primitive

__init__(vertices, color=None, opacity=1.0, style=1)

Creates polygon object in Maestro.

Constructor requires:

vertices: List of vertex coordinates (x, y, z).

Specify at least 3 vertices in consecutive order. All vertices must be in the same plane.

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:

opacity: 0.0 (invisible) through 1.0 (opaque)

Defaults to 1.0

style: LINE or FILL. Default is FILL.

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.

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.

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