ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/draw.c
(Generate patch)
# Line 26 | Line 26
26   EXTERN int mm3_mmx[], mmff_mmx[];
27  
28   int get_field(void);
29 + int get_hydrid(int);
30 + int is_bond(int,int);
31 +
32   // ===============================================
33   void set_atomdata(int ia, int mmxtype, int mm3type, int mmfftype)
34   {
# Line 307 | Line 310
310         i = mmfftype;
311      return(i);
312   }
313 + /* =============================================== */
314 + // get hybridization of atom - tetrahedral = 1, planar = 2, linear = 3
315 + //
316 + int get_hybrid(int ia)
317 + {
318 +    int itype;
319 +
320 +    itype = atom.mmx_type[ia];
321 +    if (itype == 2 || itype == 3 || itype == 7 || itype == 9 || itype == 25 ||
322 +        itype == 26 || itype == 29 || itype == 30 || itype == 37 || itype == 38 ||
323 +        itype == 40 || itype == 57 )
324 +        return 2;
325 +    else if (itype == 4 || itype == 10)
326 +        return 3;
327 +    else
328 +        return 1;
329 + }
330 + /* ------------------------------------*/    
331 + int is_bond(int ia, int ib)
332 + {
333 +    int i;
334 +    for (i=0; i < MAXIAT; i++)
335 +    {
336 +        if (atom.iat[ia][i] == ib)
337 +          return TRUE;
338 +    }
339 +    return FALSE;
340 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines