Package schrodinger :: Package graphics3d :: Module torus :: Class MaestroTorus
[hide private]
[frames] | no frames]

Class MaestroTorus

      object --+        
               |        
common.Primitive --+    
                   |    
           TorusCore --+
                       |
                      MaestroTorus


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

See doc string for __init__ for details on instantiation.

Toruses 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.torus as torus

torus_grp = common.Group()
st = maestro.workspace_get()
for bond in st.bond:
    trs = torus.MaestroTorus(
        x0=bond.atom1.x,
        y0=bond.atom1.y,
        z0=bond.atom1.z,
        x1=bond.atom2.x,
        y1=bond.atom2.y,
        z1=bond.atom2.z,
        radius=0.1,
        tube_radius=0.5,
        resolution_u=7,
        resolution_v=5,
        opacity=0.8,
        color='red'
    )
    # Add the primative to the container.
    torus_grp.add(trs)

# MaestroTorus needs to be drawn.
# No special callback like there is for Toruses is needed.
torus_grp.show()

# Hide the markers.
torus_grp.hide()

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

Instance Methods [hide private]
 
__init__(self, x0=None, y0=None, z0=None, x1=None, y1=None, z1=None, color=None, r=None, g=None, b=None, radius=None, tube_radius=None, transparency=None, opacity=1.0, resolution_u=5, resolution_v=3)
Constructor requires:
 
_draw(self)
For this class, we don't need to do anything
 
setCoords(self)
 
setColors(self)
 
_getX0(self)
 
_setX0(self, value)
 
_getY0(self)
 
_setY0(self, value)
 
_getZ0(self)
 
_setZ0(self, value)
 
_getX1(self)
 
_setX1(self, value)
 
_getY1(self)
 
_setY1(self, value)
 
_getZ1(self)
 
_setZ1(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)
 
_getTubeRadius(self)
 
_setTubeRadius(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 TorusCore (private): _calculateBoundingBox

Inherited from common.Primitive: __del__, groupHidden, groupShown, hide, isGroupShown, isShown, setEntryID, setGlowColor, setIsGlowing, setRightClickOnGObject, 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]
  x0
X0 coordinate
  y0
Y0 coordinate
  z0
Z0 coordinate
  x1
X1 coordinate
  y1
Y1 coordinate
  z1
Z1 coordinate
  r
Red value in RGB triplet
  g
Green value in RGB triplet
  b
Blue value in RGB triplet
  radius
Torus's radius
  tube_radius
Torus's tube_radius
  opacity
Torus's opacity
  material
Torus's material
  pick_id
Torus object's pick ID
  pick_category
Torus's picking category

Inherited from object: __class__

Method Details [hide private]

__init__(self, x0=None, y0=None, z0=None, x1=None, y1=None, z1=None, color=None, r=None, g=None, b=None, radius=None, tube_radius=None, transparency=None, opacity=1.0, resolution_u=5, resolution_v=3)
(Constructor)

 

Constructor requires:

x0, y0, z0:  coordinate specifying center of torus in Angstroms.

x1, y1, z1:  coordinate specifying projected center of torus
        in Angstroms.

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

radius:   radius of the torus in Angstroms

tube_radius:  radius of the tube of the torus in Angstroms

Optional arguments:

opacity:  0.0 (transparent) through 1.0 (opaque)
               Defaults to 1.0

resolution_u:    2 to 30, resolution in the U direction of the surface
               Defaults to 5

resolution_v:    2 to 30, resolution in the V direction of the surface
               Defaults to 3

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]

x0

X0 coordinate

Get Method:
_getX0(self)
Set Method:
_setX0(self, value)

y0

Y0 coordinate

Get Method:
_getY0(self)
Set Method:
_setY0(self, value)

z0

Z0 coordinate

Get Method:
_getZ0(self)
Set Method:
_setZ0(self, value)

x1

X1 coordinate

Get Method:
_getX1(self)
Set Method:
_setX1(self, value)

y1

Y1 coordinate

Get Method:
_getY1(self)
Set Method:
_setY1(self, value)

z1

Z1 coordinate

Get Method:
_getZ1(self)
Set Method:
_setZ1(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

Torus's radius

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

tube_radius

Torus's tube_radius

Get Method:
_getTubeRadius(self)
Set Method:
_setTubeRadius(self, value)

opacity

Torus's opacity

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

material

Torus's material

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

pick_id

Torus object's pick ID

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

pick_category

Torus's picking category

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