Thanks Egon,
Still there are problems:
The following code has the same coordinates of initial molecule (mol) and of 
the output molecule (layedOutMol)

 org.openscience.cdk.layout.StructureDiagramGenerator sdg = new 
org.openscience.cdk.layout.StructureDiagramGenerator();
 sdg.setMolecule(mol);
 sdg.generateCoordinates();
 org.openscience.cdk.interfaces.IMolecule layedOutMol = sdg.getMolecule();

Even when I explicitly set all coordinates to 0:

 javax.vecmath.Point3d point3d = new javax.vecmath.Point3d();
 Iterator<org.openscience.cdk.interfaces.IAtom> itatoms = mol.atoms();
 while (itatoms.hasNext())
  itatoms.next().setPoint3d(point3d);

basically it does not generate coordinates.
any thoughts?

On Friday 21 November 2008 08:15, Egon Willighagen wrote:
> Dear Adel,
>
> On Thu, Nov 13, 2008 at 3:13 PM, Adel Golovin <[EMAIL PROTECTED]> wrote:
> > org.openscience.cdk.io.MDLReader cdkMDL = new
> > org.openscience.cdk.io.MDLReader(mdl); org.openscience.cdk.Molecule mol =
> > new org.openscience.cdk.Molecule(); cdkMDL.read(mol);
> > org.openscience.cdk.renderer.SimpleRenderer2D renderer = new
> > org.openscience.cdk.renderer.SimpleRenderer2D(); Rectangle2D bounds = new
> > Rectangle2D.Double(0, 0, 180, 180);
> > BufferedImage bufferedImage = new BufferedImage( 180,
> > 180,BufferedImage.TYPE_INT_RGB ); Graphics2D graphics =
> > bufferedImage.createGraphics();
> > renderer.paintMolecule(mol, graphics, bounds);
> > javax.imageio.ImageIO.write(bufferedImage, "png", out);
>
> In this code you do not create 2D coordinates, and...
>
> <snip>
>
> >  the mdl file is as follows:
> >
> > 3D_NCI753
> >   3D_NCI
> >
> >   9 10  0  0  0  0  0  0  0  0  1 V2000
> >    -0.0170    1.4060    0.0100 C   0  0  0  0  0  0  0  0  0  0  0  0
> >     0.0020   -0.0040    0.0020 C   0  0  0  0  0  0  0  0  0  0  0  0
> >    -1.2560    2.0480    0.0300 C   0  0  0  0  0  0  0  0  0  0  0  0
> >     2.0610    0.7840   -0.0130 C   0  0  0  0  0  0  0  0  0  0  0  0
> >    -2.2920   -0.0100    0.0250 C   0  0  0  0  0  0  0  0  0  0  0  0
> >     1.2730    1.8200    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
> >     1.3260   -0.3630   -0.0130 N   0  0  0  0  0  0  0  0  0  0  0  0
> >    -1.1490   -0.6630    0.0100 N   0  0  0  0  0  0  0  0  0  0  0  0
> >    -2.3520    1.3100    0.0410 N   0  0  0  0  0  0  0  0  0  0  0  0
> >   1  2  4  0  0  0  0
> >   1  3  4  0  0  0  0
> >   1  6  4  0  0  0  0
> >   2  7  4  0  0  0  0
> >   2  8  4  0  0  0  0
> >   3  9  4  0  0  0  0
> >   4  6  4  0  0  0  0
> >   4  7  4  0  0  0  0
> >   5  8  4  0  0  0  0
> >   5  9  4  0  0  0  0
> > M  END
>
> This file only has 3D coordinates... I think you can solve your
> problem by using the StructureDiagramGenerator...
>
> Hope that helps,
>
> Egon

-- 
Adel Golovin EMBL-EBI/PDBe 44 1223 492531 [EMAIL PROTECTED]


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to