Package schrodinger :: Package graphics3d :: Module sphere :: Class MaestroSphere
[hide private]
[frames] | no frames]

Class MaestroSphere

      object --+        
               |        
common.Primitive --+    
                   |    
          SphereCore --+
                       |
                      MaestroSphere


Class to create a 3D sphere in Maestro.  This sphere will be drawn
at the appropriate time in Maestro to interact properly with transparent
objects.

See doc string for __init__ for details on instantiation.

Spheres 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.sphere as sphere

sphere_grp = common.Group()
st = maestro.workspace_get()
for at in st.atom:
    sph = sphere.MaestroSphere(
        x=at.x,
        y=at.y,
        z=at.z,
        radius=1.0,
        resolution=20,
        opacity=0.8,
        color='red'
    )
    # Add the primative to the container.
    sphere_grp.add(sph)

# Unlike Sphere MaestroSphere simply needs to be shown to be drawn.
# No special callback like there is for Spheres is needed.
sphere_grp.show()


# Hide the markers.
sphere_grp.hide()

# Remove the markers and the callback.
sphere_grp.clear()
maestro.workspace_draw_function_remove(sphere_grp.draw)

Instance Methods [hide private]
 
__init__(self, x=None, y=None, z=None, color=None, r=None, g=None, b=None, radius=None, transparency=None, opacity=1.0, resolution=16)
Constructor requires:
 
_draw(self)
For this class, we don't need to do anything
 
setCoords(self)
 
setColors(self)
 
_getX(self)
 
_setX(self, value)
 
_getY(self)
 
_setY(self, value)
 
_getZ(self)
 
_setZ(self, value)
 
_getR(self)
 
_setR(self, value)
 
_getG(self)
 
_setG(self, value)
 
_getB(self)
 
_setB(self, value)
 
_getOpacity(self)
 
_setOpacity(self, value)
 
_getRadius(self)
 
_setRadius(self, value)
 
_getMaterial(self)
 
_setMaterial(self, value)
 
_getPickID(self)
 
_setPickID(self, id)
 
_getPickCategory(self)
 
_setPickCategory(self, pick_category)
 
_handleOpenGLLevelChange(self)
When the OpenGL version changes we need to rebuild the Maestro-based objects.

Inherited from SphereCore (private): _calculateBoundingBox

Inherited from common.Primitive: __del__, groupHidden, groupShown, hide, isGroupShown, isShown, show

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
_glSetup()
For this class, we don't need to do any setup
 
_glReset()
For this class, we don't need to do anything
Class Variables [hide private]
Properties [hide private]
  x
X coordinate
  y
Y coordinate
  z
Z coordinate
  r
Red value in RGB triplet
  g
Green value in RGB triplet
  b
Blue value in RGB triplet
  radius
Sphere's radius
  opacity
Sphere's opacity
  material
Sphere's material
  pick_id
Sphere object's pick ID
  pick_category
Sphere's picking category

Inherited from object: __class__

Method Details [hide private]

__init__(self, x=None, y=None, z=None, color=None, r=None, g=None, b=None, radius=None, transparency=None, opacity=1.0, resolution=16)
(Constructor)

 

Constructor requires:

x, y, z:  coordinate specifying center of sphere in Angstroms.

color:    One of:
            Color object
            Color name (string)
            Tuble of (R, G, B) (each 0.0-1.0)

radius:   radius of the sphere in Angstroms


Optional arguments:

opacity:  0.0 (transparent) through 1.0 (opaque)
               Defaults to 1.0
resolution:    4 to 50
               Defaults to 16
          

Overrides: object.__init__

_handleOpenGLLevelChange(self)

 

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


Property Details [hide private]

x

X coordinate

Get Method:
_getX(self)
Set Method:
_setX(self, value)

y

Y coordinate

Get Method:
_getY(self)
Set Method:
_setY(self, value)

z

Z coordinate

Get Method:
_getZ(self)
Set Method:
_setZ(self, value)

r

Red value in RGB triplet

Get Method:
_getR(self)
Set Method:
_setR(self, value)

g

Green value in RGB triplet

Get Method:
_getG(self)
Set Method:
_setG(self, value)

b

Blue value in RGB triplet

Get Method:
_getB(self)
Set Method:
_setB(self, value)

radius

Sphere's radius

Get Method:
_getRadius(self)
Set Method:
_setRadius(self, value)

opacity

Sphere's opacity

Get Method:
_getOpacity(self)
Set Method:
_setOpacity(self, value)

material

Sphere's material

Get Method:
_getMaterial(self)
Set Method:
_setMaterial(self, value)

pick_id

Sphere object's pick ID

Get Method:
_getPickID(self)
Set Method:
_setPickID(self, id)

pick_category

Sphere's picking category

Get Method:
_getPickCategory(self)
Set Method:
_setPickCategory(self, pick_category)