From: Egon W. <e.w...@sc...> - 2005-02-10 11:27:46
|
Miguel, I was talking with Hens today about bond orders, and I wanted to add support for CML2 <bond order="partial12"/>... So I hacked up this code in JmolAdapter.java: public final static byte ORDER_PARTIAL01 = (byte)(1 << 2); public final static byte ORDER_PARTIAL12 = (byte)(1 << 6); public final static byte ORDER_AROMATIC = ORDER_PARTIAL12; public final static byte ORDER_HBOND = ORDER_PARTIAL01; public final static byte ORDER_STEREO_NEAR = (byte)((1 << 3) | 1); public final static byte ORDER_STEREO_FAR = (byte)((2 << 3) | 2); In words, I added partial01 and partial02 types, and HBOND defaults to partial01, because I thought those were represented by 'dotted' bonds, and AROMATIC likewise to 'solid + dotted'... Seemed logical. However, later I saw that apparently this has been replaced by JmolConstants.java: /** * Extended Bond Definition Types * */ public final static short BOND_COVALENT = 3; public final static short BOND_AROMATIC_MASK = (1 << 2); public final static short BOND_AROMATIC = (1 << 2) | 1; public final static short BOND_STEREO_MASK = (3 << 3); public final static short BOND_STEREO_NEAR = (1 << 3) | 1; public final static short BOND_STEREO_FAR = (2 << 3) | 2; public final static short BOND_SULFUR_MASK = (1 << 5); public final static short BOND_HBOND_SHIFT = 6; public final static short BOND_HYDROGEN_MASK = (0x0F << BOND_HBOND_SHIFT); public final static short BOND_H_REGULAR = (1 << BOND_HBOND_SHIFT); public final static short BOND_H_PLUS_2 = (2 << BOND_HBOND_SHIFT); public final static short BOND_H_PLUS_3 = (3 << BOND_HBOND_SHIFT); public final static short BOND_H_PLUS_4 = (4 << BOND_HBOND_SHIFT); public final static short BOND_H_PLUS_5 = (5 << BOND_HBOND_SHIFT); public final static short BOND_H_MINUS_3 = (6 << BOND_HBOND_SHIFT); public final static short BOND_H_MINUS_4 = (7 << BOND_HBOND_SHIFT); public final static short BOND_H_NUCLEOTIDE = (8 << BOND_HBOND_SHIFT); public final static short BOND_ALL_MASK = (short)0xFFFF; If that is correct, then there is some outdated/buggy code in several IO classes, including the CMLReader... (but PDB and MOL too!)... Advise needed. Egon |