Molecule rotation

ChemAxon 587f88acea

24-10-2005 15:16:34

I'd like to be able to programmatically rotate a molecule about its center. This is the same behavior you get when you grab and drag a molecule in an MViewPane, this functionality just needs to be exposed in the public API. Is there already something in the API that would allow me to do this? I'm aware of the MolHandler.align(...) method, thats not what I need.





Optimally I'd like a method on MolHandler:


public void rotateAboutCenter(double degrees);





Or more generally (to take a page from java.awt.geom.AffineTransform):


public void rotate(double degrees, double anchorX, anchorY);

ChemAxon 7c2d26e5cf

24-10-2005 21:14:14

You can do a transformation on the Molecule object.


http://www.chemaxon.com/jchem/doc/api/chemaxon/struc/Molecule.html#transform(chemaxon.struc.CTransform3D,%20boolean)


Get the molecule from the viewer, transform it, and update the molecule in the viewer.


Is it not a good solution for you?