Hi Gilleain,

Thanks, this works, and rendering is already better with regard to scaling.

http://apps.ideaconsult.net:8080/ambit2/depict?search=[O-]C1%3DCC%28[N%2B]%28[O-]%29%3DO%29%3DCC%3DC1OC.[Na%2B]

http://apps.ideaconsult.net:8080/ambit2/depict?search=[NH4%2B].CP%28%3DO%29%28O%29CCC%28N%29C%28%3DO%29[O-]

Nina


On 25 October 2010 14:07, gilleain torrance <gilleain.torrance@gmail.com> wrote:
Hi Nina,

Yes, the fastest approach is to just transform the model coordinates,
then render normally. The GeometryTools class has methods to move
containers around like this, but be warned that the translateTo method
has a problem that it uses the 'center of mass' (sum of coordinates /
number of atoms) rather than the center of the bounding box; see the
get2DCenter method.

I would recommend code like this:
a) find bounding box of each connected component (for single atoms,
padded with some margin)
b) layout these bounding boxes to get a list of points
c) move the atom containers to these points

steps b) and c) can be combined. To move the atom container, use
GeometryTools, but use the translate2D methods rather than the
translate2DCenterTo method.

gilleain

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Cdk-devel mailing list
Cdk-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-devel