Changes between Version 6 and Version 7 of ChimeraAnimationTasks


Ignore:
Timestamp:
Dec 8, 2010, 5:15:48 PM (15 years ago)
Author:
Darren Weber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ChimeraAnimationTasks

    v6 v7  
    3232Some tips in the [http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/faq.html programming FAQ] are useful (esp, items 4, 5, 7-10). 
    3333
     34==== Attributes: To Copy or Not to Copy, that is the question! ====
     35
     36From the [http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/faq.html FAQ], item (7): Some attributes return a copy of an object.
     37{{{
     38>>> xf = model.openState.xform  # xf is a copy of the model's Xform matrix.
     39>>> xf.zRotate(45)              # This will not rotate the model.
     40
     41>>> c = model.atoms[0].color    # c is the MaterialColor object for the atom
     42>>> c.ambientDiffuse = (1,0,0)  # The Atom color changes immediately to red.
     43}}}
     44
     45Some Chimera objects returned as attributes are always copies, some are always references to the uncopied object. Objects that are always copied include Xform, Vector, Point, Sphere, Element, MolResId, Coord, .... Objects that are never copied include Atom, Bond, PseudoBond, CoordSet, Molecule, Residue, RibbonStyle, .... Object that can be copied have a __copy__ method. In order to know if an object type is passed by value is to look at the Chimera C++ header files. Classes without a WrapPy base class are always copied. This base class is part of the C++ to Python interface generation.
     46
     47
    3448==== openState attribute (from FAQ) ====
    3549