Package schrodinger :: Package graphics3d :: Module arrow :: Class MaestroArrow
[hide private]
[frames] | no frames]

Class MaestroArrow

      object --+        
               |        
common.Primitive --+    
                   |    
           ArrowCore --+
                       |
                      MaestroArrow


Class for creating a 3D arrow in Maestro

See doc string for __init__ for details on instantiation

Arrows should be added to a Group and drawing done via the Group.
See the Group documentation.

API Example
-----------
import schrodinger.maestro.maestro as maestro
import schrodinger.graphics3d.common as common
import schrodinger.graphics3d.arrow as arrow

arrow_grp = common.Group()
st = maestro.workspace_get()
for bond in st.bond:
    ar = arrow.MaestroArrow(
        xhead=bond.atom2.x, yhead=bond.atom2.y, zhead=bond.atom2.z,
        xtail=bond.atom1.x, ytail=bond.atom1.y, ztail=bond.atom1.z,
        color='red',
        radius=0.15,
        opacity=0.8,
        resolution=50
    )
    # Add the primative to the container.
    arrow_grp.add(ar)

# Unlike Arrow MaestroArrow simply needs to be shown to be drawn.
# No special callback like there is for Arrows is needed.
arrow_grp.show()

# Hide the markers.
arrow_grp.hide()

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

Instance Methods [hide private]
 
__init__(self, xhead=None, yhead=None, zhead=None, xtail=None, ytail=None, ztail=None, color=None, r=0.0, g=1.0, b=0.0, radius=0.15, transparency=None, opacity=1.0, resolution=16, body_percentage=0.75, remove_endcaps=False)
Constructor requires:
 
calculateCoords(self, body_percentage=0.75)
Calculate the intermediate coordinate between head and body
 
_draw(self)
For this class, we don't need to do anything
 
_setCoords(self)
 
_setColors(self)
 
_getXHead(self)
 
_setXHead(self, value)
 
_getYHead(self)
 
_setYHead(self, value)
 
_getZHead(self)
 
_setZHead(self, value)
 
_getXTail(self)
 
_setXTail(self, value)
 
_getYTail(self)
 
_setYTail(self, value)
 
_getZTail(self)
 
_setZTail(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 ArrowCore (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]
  xhead
  yhead
  zhead
  xtail
  ytail
  ztail
  r
  g
  b
  radius
  opacity
  material
  pick_id
  pick_category

Inherited from object: __class__

Method Details [hide private]

__init__(self, xhead=None, yhead=None, zhead=None, xtail=None, ytail=None, ztail=None, color=None, r=0.0, g=1.0, b=0.0, radius=0.15, transparency=None, opacity=1.0, resolution=16, body_percentage=0.75, remove_endcaps=False)
(Constructor)

 

Constructor requires:

xhead, yhead, zhead: corrdinate of the head position
xtail, ytail, ztail: coordinate of the tail position

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:

radius:   radius of the arrow in Angstroms
          Default: .15
opacity:  0.0 (invisible) through 1.0 (opaque)
               Default: 0.0
resolution:    Ranges from ?? to ??.  Default: ??

remove_endcaps: Whether to remove cylinder endcaps on arrow body.

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]

xhead

Get Method:
_getXHead(self)
Set Method:
_setXHead(self, value)

yhead

Get Method:
_getYHead(self)
Set Method:
_setYHead(self, value)

zhead

Get Method:
_getZHead(self)
Set Method:
_setZHead(self, value)

xtail

Get Method:
_getXTail(self)
Set Method:
_setXTail(self, value)

ytail

Get Method:
_getYTail(self)
Set Method:
_setYTail(self, value)

ztail

Get Method:
_getZTail(self)
Set Method:
_setZTail(self, value)

r

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

g

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

b

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

radius

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

opacity

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

material

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

pick_id

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

pick_category

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