schrodinger.graphics3d.polyhedron module¶
The polyhedron module allows creation and drawing of polyhedra.The body of the polyhedron is composed of faces that are composed of vertices.
Drawing is done in the current OpenGL rendering context and current OpenGL window, so you must set those prior to drawing. If you are using this with Maestro’s drawing callback mechanism the context and window are handled automatically.
Control over the vertices, faces, color, and opacity of a box are provided. However, please note that the current implementation does not ensure the passed in vertices and faces will enclose to form a volume. This must be determined in the subclass.
To draw any number of polyhedra, create the Polyhedron instances, add them to a Group instance then invoke the Group’s draw() method.
Copyright Schrodinger, LLC. All rights reserved.
-
schrodinger.graphics3d.polyhedron.
origin_to_point
(vertices, center)¶ Takes a set of vertices that have been created around the origin and translates them to the be centered around the x, y, z coordinates supplied in
center
.Parameters: - vertices (list of lists (e.g. [[x1,y1,z1],[x2,y2,z2],..]) – The list of vertices around the origin
- center (list of floats) – The x, y, and z coordinates to center the
vertices
on
-
schrodinger.graphics3d.polyhedron.
scale_vertices
(vertices, scale)¶ Scale a set of vertices.
Parameters: - vertices (list of lists (e.g. [[x1,y1,z1],[x2,y2,z2],..]) – The list of vertices around the origin
- scale (float) – The scale to apply to the vertices
-
class
schrodinger.graphics3d.polyhedron.
Polyhedron
(vertices, faces, mode, color='red', opacity=1.0, style=1)¶ Bases:
schrodinger.graphics3d.common.Primitive
Class to draw a 3D polyhedron with OpenGL using the current context in whatever is the current drawable (which could be Maestro).
-
__init__
(vertices, faces, mode, color='red', opacity=1.0, style=1)¶ Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
- color (Mixed. Either 1) Color object, 2) Color name (string), or 3) a tuple of (R, G, B) (each 0.0-1.0)) – The color of the polyhedron
- opacity (float From 0.0 (invisible) to 1.0 (opaque) Default: 1.0 (opaque)) – The opacity of the polyhedron
- style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
See: graphics3d.common.Group
documentation
-
vertices
= None¶ A list of each vertex of the polyhedron. These are set during the Polyhedron.update method and taken from the constructor argument, vertices.
-
faces
= None¶ A list containing lists of vertices that define a face of the polyhedron. These are set during the Polyhedron.update method and taken from constructor argument, faces.
-
normals
= None¶ The normals for the faces passed in. These are calculated and set during the Polyhedron.update method.
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': '\n Class to draw a 3D polyhedron with OpenGL using the current context\n in whatever is the current drawable (which could be Maestro).\n\n ', '_blend': None, '_smooth_point': None, '_cull': None, '_lighting': None, '_lighting_model': None, '_shading_model': None, '_polygon_mode': None, '__init__': <function Polyhedron.__init__>, '_setNormals': <function Polyhedron._setNormals>, '_glSetup': <staticmethod object>, '_glReset': <staticmethod object>, '_draw': <function Polyhedron._draw>, '_calculateBoundingBox': <function Polyhedron._calculateBoundingBox>, 'update': <function Polyhedron.update>, 'setStyle': <function Polyhedron.setStyle>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
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
-
-
class
schrodinger.graphics3d.polyhedron.
MaestroPolyhedronCore
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Bases:
schrodinger.graphics3d.polyhedron.Polyhedron
-
__init__
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Create a polyhedron centered at
center
. Note that one of length, radius, or volume is needed to create the shape.Parameters: - center (list(float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
- color – One of - Color object, Color name (string), or Tuple of (R, G, B) (each 0.0-1.0)
- opacity (float) – 0.0 (invisible) through 1.0 (opaque). Defaults to 1.0
- style (int) – LINE or FILL. Default is FILL.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float. - NotImplementedError – If the initiating subclass does not have
a
getVertices
orgetFaces
method.
-
getVertices
()¶ Abstract method, defined by convention only
-
getIndices
()¶ Abstract method, defined by convention only
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__init__': <function MaestroPolyhedronCore.__init__>, '_checkSizeArgs': <function MaestroPolyhedronCore._checkSizeArgs>, 'getVertices': <function MaestroPolyhedronCore.getVertices>, 'getIndices': <function MaestroPolyhedronCore.getIndices>, 'getFaces': <function MaestroPolyhedronCore.getFaces>, 'updateVertices': <function MaestroPolyhedronCore.updateVertices>, '_handleOpenGLLevelChange': <function MaestroPolyhedronCore._handleOpenGLLevelChange>, '__doc__': None})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
-
class
schrodinger.graphics3d.polyhedron.
MaestroCube
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroPolyhedronCore
Class to draw a 3D cube in Maestro’s Workspace.
Cubes should be added to a graphics3d.common.Group, or CubeGroup, and drawing done via the Group. See the
graphics3d.common.Group
documentation.API Example:
import schrodinger.maestro.maestro as maestro import schrodinger.graphics3d.polyhedron as polyhedron cube_group = polyhedron.Group() st = maestro.workspace_get() # Here, st is methane. for atom in st.atom: if atom.element == 'C': center = atom.xyz cube = polyhedron.Cube( center = center, mode = polyhedron.MODE_MAESTRO, length = 1.828, # length between Hs color = 'goldenrod', opacity = 1.0, style = polyhedron.LINE ) # Add the primative to the container. cube_group.add(cube) # Show the markers cube.show() cube_group.show() # Hide the markers. cube_group.hide() # Remove the markers and the callback. cube_group.clear()
-
__init__
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ See: MaestroPolyhedronCore.__init__
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the sides of the
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - radius (float) – Circumsphere radius in Angstroms from center of
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
getIndices
()¶ :return The indices of the faces
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': "\n Class to draw a 3D cube in Maestro's Workspace.\n\n Cubes should be added to a graphics3d.common.Group, or CubeGroup, and\n drawing done via the Group. See the `graphics3d.common.Group`\n documentation.\n\n API Example::\n\n import schrodinger.maestro.maestro as maestro\n import schrodinger.graphics3d.polyhedron as polyhedron\n\n cube_group = polyhedron.Group()\n st = maestro.workspace_get() # Here, st is methane.\n for atom in st.atom:\n if atom.element == 'C':\n center = atom.xyz\n\n cube = polyhedron.Cube(\n center = center,\n mode = polyhedron.MODE_MAESTRO,\n length = 1.828, # length between Hs\n color = 'goldenrod',\n opacity = 1.0,\n style = polyhedron.LINE\n )\n # Add the primative to the container.\n cube_group.add(cube)\n\n # Show the markers\n cube.show()\n cube_group.show()\n\n # Hide the markers.\n cube_group.hide()\n\n # Remove the markers and the callback.\n cube_group.clear()\n\n ", '__init__': <function MaestroCube.__init__>, 'getVertices': <function MaestroCube.getVertices>, 'getIndices': <function MaestroCube.getIndices>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
Cube
(*args, **keywords)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroCube
This class is now deprecated. Please use MaestroCube.
-
__init__
(*args, **keywords)¶ See: MaestroPolyhedronCore.__init__
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': '\n This class is now deprecated. Please use MaestroCube.\n ', '__init__': <function Cube.__init__>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
getIndices
()¶ :return The indices of the faces
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the sides of the
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - radius (float) – Circumsphere radius in Angstroms from center of
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
MaestroTetrahedron
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroPolyhedronCore
Class to draw a 3D tetrahedron in Maestro’s Workspace.
Tetrahedrons should be added to a graphics3d.common.Group, or TetrahedronGroup, and drawing done via the Group. See the
graphics3d.common.Group
documentation.API Example:
import schrodinger.maestro.maestro as maestro import schrodinger.graphics3d.polyhedron as polyhedron tetrahedron_grp = polyhedron.Group() st = maestro.workspace_get() # Here, st is methane. for atom in st.atom: if atom.element == 'C': center = atoms.xyz tetra = polyhedron.Tetrahedron( center = center, length = 1.828, # length between Hs color = 'goldenrod', opacity = 1.0, style = tetrahedron.LINE ) # Add the primative to the container. tetrahedron_grp.add(tetra) # Add the draw callback. maestro.workspace_draw_function_add(tetrahedron_grp.draw) # Hide the markers. tetrahedron_grp.hide() # Remove the markers and the callback. tetrahedron_grp.clear() maestro.workspace_draw_function_remove(tetrahedron_grp.draw)
-
__init__
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ See: MaestroPolyhedronCore.__init__
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the sides of the
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - radius (float) – Circumsphere radius in Angstroms from center of
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
getIndices
()¶ :return The indices of the faces
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': "\n Class to draw a 3D tetrahedron in Maestro's Workspace.\n\n Tetrahedrons should be added to a graphics3d.common.Group, or\n TetrahedronGroup, and drawing done via the Group. See the\n `graphics3d.common.Group` documentation.\n\n API Example::\n\n import schrodinger.maestro.maestro as maestro\n import schrodinger.graphics3d.polyhedron as polyhedron\n\n tetrahedron_grp = polyhedron.Group()\n st = maestro.workspace_get() # Here, st is methane.\n for atom in st.atom:\n if atom.element == 'C':\n center = atoms.xyz\n\n tetra = polyhedron.Tetrahedron(\n center = center,\n length = 1.828, # length between Hs\n color = 'goldenrod',\n opacity = 1.0,\n style = tetrahedron.LINE\n )\n # Add the primative to the container.\n tetrahedron_grp.add(tetra)\n\n # Add the draw callback.\n maestro.workspace_draw_function_add(tetrahedron_grp.draw)\n\n # Hide the markers.\n tetrahedron_grp.hide()\n\n # Remove the markers and the callback.\n tetrahedron_grp.clear()\n maestro.workspace_draw_function_remove(tetrahedron_grp.draw)\n\n ", '__init__': <function MaestroTetrahedron.__init__>, 'getVertices': <function MaestroTetrahedron.getVertices>, 'getIndices': <function MaestroTetrahedron.getIndices>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
Tetrahedron
(*args, **keywords)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroTetrahedron
This class is now deprecated. Please use MaestroTetrahedron.
-
__init__
(*args, **keywords)¶ See: MaestroPolyhedronCore.__init__
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': '\n This class is now deprecated. Please use MaestroTetrahedron.\n ', '__init__': <function Tetrahedron.__init__>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
getIndices
()¶ :return The indices of the faces
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the sides of the
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - radius (float) – Circumsphere radius in Angstroms from center of
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
MaestroOctahedron
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroPolyhedronCore
Class to draw a 3D octahedron in Maestro’s Workspace.
See
Tetrahedron
doc string for more details.-
__init__
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ See: MaestroPolyhedronCore.__init__
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the sides of the
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - radius (float) – Circumsphere radius in Angstroms from center of
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
getIndices
()¶ :return The indices of the faces
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': "\n Class to draw a 3D octahedron in Maestro's Workspace.\n\n See `Tetrahedron` doc string for more details.\n ", '__init__': <function MaestroOctahedron.__init__>, 'getVertices': <function MaestroOctahedron.getVertices>, 'getIndices': <function MaestroOctahedron.getIndices>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
Octahedron
(*args, **keywords)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroOctahedron
This class is now deprecated. Please use MaestroOctahedron.
-
__init__
(*args, **keywords)¶ See: MaestroPolyhedronCore.__init__
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': '\n This class is now deprecated. Please use MaestroOctahedron.\n ', '__init__': <function Octahedron.__init__>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
getIndices
()¶ :return The indices of the faces
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the sides of the
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - radius (float) – Circumsphere radius in Angstroms from center of
tetrahedron. Note:
length
orradius
must be specified to create tetrahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
MaestroDodecahedron
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroPolyhedronCore
Class to draw a 3D dodecahedron in Maestro’s Workspace.
See
Tetrahedron
doc string for more details.-
__init__
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ See: MaestroPolyhedronCore.__init__
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the dodecahedron.
- length (float) – Length in Angstroms of each of the sides of the
dodecahedron. Note:
length
orradius
must be specified to create dodecahedron. - radius (float) – Circumsphere radius in Angstroms from center of
dodecahedron. Note:
length
orradius
must be specified to create dodecahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
getIndices
()¶ :return The indices of the faces
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': "\n Class to draw a 3D dodecahedron in Maestro's Workspace.\n\n See `Tetrahedron` doc string for more details.\n ", '__init__': <function MaestroDodecahedron.__init__>, 'getVertices': <function MaestroDodecahedron.getVertices>, 'getIndices': <function MaestroDodecahedron.getIndices>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
Dodecahedron
(*args, **keywords)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroDodecahedron
This class is now deprecated. Please use MaestroDodecahedron.
-
__init__
(*args, **keywords)¶ See: MaestroPolyhedronCore.__init__
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': '\n This class is now deprecated. Please use MaestroDodecahedron.\n ', '__init__': <function Dodecahedron.__init__>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
getIndices
()¶ :return The indices of the faces
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the dodecahedron.
- length (float) – Length in Angstroms of each of the sides of the
dodecahedron. Note:
length
orradius
must be specified to create dodecahedron. - radius (float) – Circumsphere radius in Angstroms from center of
dodecahedron. Note:
length
orradius
must be specified to create dodecahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
MaestroIcosahedron
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroPolyhedronCore
Class to draw a 3D icosahedron in Maestro’s Workspace.
See
Tetrahedron
doc string for more details.-
__init__
(center, mode, length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ See: MaestroPolyhedronCore.__init__
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the icosahedron.
- length (float) – Length in Angstroms of each of the sides of the
icosahedron. Note:
length
orradius
must be specified to create icosahedron. - radius (float) – Circumsphere radius in Angstroms from center of
icosahedron. Note:
length
orradius
must be specified to create icosahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
getIndices
()¶ :return The indices of the faces
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': "\n Class to draw a 3D icosahedron in Maestro's Workspace.\n\n See `Tetrahedron` doc string for more details.\n ", '__init__': <function MaestroIcosahedron.__init__>, 'getVertices': <function MaestroIcosahedron.getVertices>, 'getIndices': <function MaestroIcosahedron.getIndices>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
Icosahedron
(*args, **keywords)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroIcosahedron
This class is now deprecated. Please use MaestroIcosahedron.
-
__init__
(*args, **keywords)¶ See: MaestroPolyhedronCore.__init__
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': '\n This class is now deprecated. Please use MaestroIcosahedron.\n ', '__init__': <function Icosahedron.__init__>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
getIndices
()¶ :return The indices of the faces
-
getVertices
(center, length=None, radius=None, volume=None)¶ Get a list of vertices. If the center coordinates are considered the origin the vertices will have a base on the y-plane, a vertex on the x-axis and a vertex directly in the +z-axis from the
center
.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the icosahedron.
- length (float) – Length in Angstroms of each of the sides of the
icosahedron. Note:
length
orradius
must be specified to create icosahedron. - radius (float) – Circumsphere radius in Angstroms from center of
icosahedron. Note:
length
orradius
must be specified to create icosahedron. - volume (float) – Volume in cubed Angstroms of the object.
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
-
class
schrodinger.graphics3d.polyhedron.
MaestroHemisphere
(center, direction=(0.0, 0.0, 1.0), length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Bases:
schrodinger.graphics3d.polyhedron.MaestroPolyhedronCore
Class to draw a 3D hemisphere in Maestro’s Workspace.
-
__init__
(center, direction=(0.0, 0.0, 1.0), length=None, radius=None, volume=None, color='red', opacity=1.0, style=1)¶ Create a polyhedron centered at
center
. Note that one of length, radius, or volume is needed to create the shape.Parameters: - center (list(float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
- color – One of - Color object, Color name (string), or Tuple of (R, G, B) (each 0.0-1.0)
- opacity (float) – 0.0 (invisible) through 1.0 (opaque). Defaults to 1.0
- style (int) – LINE or FILL. Default is FILL.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float. - NotImplementedError – If the initiating subclass does not have
a
getVertices
orgetFaces
method.
-
__class__
¶ alias of
builtins.type
-
__del__
(_hasattr=<built-in function hasattr>, _maestro=<module 'schrodinger.maestro.maestro' from '/scr/buildbot/savedbuilds/2018-4/NB/build-145/internal/lib/python3.6/site-packages/schrodinger/maestro/maestro.py'>)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.graphics3d.polyhedron', '__doc__': "\n Class to draw a 3D hemisphere in Maestro's Workspace.\n ", '_hemi_vertices': None, '_hemi_faces': None, '__init__': <function MaestroHemisphere.__init__>, '_initHemisphereMatrices': <classmethod object>, '_makeHemisphere': <staticmethod object>, '_norm': <function MaestroHemisphere._norm>, '_rotationMatrix': <function MaestroHemisphere._rotationMatrix>, 'getVertices': <function MaestroHemisphere.getVertices>, 'getIndices': <function MaestroHemisphere.getIndices>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.graphics3d.polyhedron'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getFaces
(vertices)¶ Parameters: vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
-
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
-
setStyle
(style)¶ Sets the polyhedron’s drawing style.
Parameters: style (Choice, FILL or LINE) – Whether to fill the polyhedron in or to leave it as lines connecting vertices.
-
show
()¶ Display this object, if it was hidden
-
update
(vertices, faces)¶ Update the polyhedron’s shape.
Parameters: - vertices (list of lists) – List of vertices. Each member of list should be a list of 3 coords, [x,y,z]
- faces (list of lists) – List of faces comprising the polyhedron. Each face should be a list of at least 3 vertices.
See: Tetrahedron.updateVertices
for an example of usage
-
updateVertices
(center, length=None, radius=None, volume=None)¶ Update the vertices given a new
center
and size parameter. The changes will be seen the next time the object is drawn.Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the tetrahedron.
- length (float) – Length in Angstroms of each of the edges of the tetrahedron.
- radius (float) – Circumsphere radius in Angstroms from center of tetrahedron.
- volume (float) – Volume in cubed Angstroms of the object.
Raises: - RuntimeError – If a single option from
length
,radius
, andvolume
does not have a value. - ValueError – If the size parameter (
length
,radius
, orvolume
) is not a float.
-
getVertices
(center, length=None, radius=1.0, volume=None)¶ Parameters: - center (list(float, float, float)) – List of 3 Angstrom values indicating the center coordinate of the hemisphere.
- length – Unused but required by parent class
- radius (float) – Radius of the hemisphere
- volume – Unused but required by parent class
-
getIndices
()¶ Returns: The indices of the faces
-