-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathautobondrot.h
114 lines (88 loc) · 4.05 KB
/
autobondrot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* name: autobondrot.h */
/* author: J. Michael Word */
/* date written: 7/ 9/99 */
/* purpose: manipulations of moving atoms */
/*****************************************************************/
/* NOTICE: This is free software and the source code is freely */
/* available. You are free to redistribute or modify under the */
/* conditions that (1) this notice is not removed or modified */
/* in any way and (2) any modified versions of the program are */
/* also available for free. */
/* ** Absolutely no Warranty ** */
/* Copyright (C) 1999 J. Michael Word */
/*****************************************************************/
#ifndef AUTOBONDROT_H
#define AUTOBONDROT_H 1
#include <stdio.h>
#include <math.h>
#include "abin.h"
#include "geom3d.h"
#define XFORMREC_DELIM ":"
#define MAX_XFORM_LEVELS 8
#define MAX_XFORM_STACK_DEPTH 8
#define NULLxform 0
#define ROTxform 1
#define TRANSxform 2
#define SAVExform 3
#define RESTORExform 4
#define CONSTbiasfunc 0
#define COSbiasfunc 1
#define POLYbiasfunc 2
typedef atomPtr (abrMkAtomProc)(char*, void*); /* make an atom from a record */
typedef void (abrAtomListProc)(atom*, void*); /* process a list of atoms */
typedef void (abrProbeProc)(char*, double, atom*, void*); /* process a list of atoms */
typedef struct xformAtomRecords_t {
struct xformAtomRecords_t *next; /* next record in list */
atom *a; /* atom being worked on */
point3d loc; /* original location (at "phase") */
} xformAtomRecords;
typedef struct goToRec_t {
struct goToRec_t *next; /* next record in list */
double level[MAX_XFORM_LEVELS]; /* value of each */
} goToRec;
typedef struct biasFunction_t {
struct biasFunction_t *next; /* next record in list */
int type; /* bias function type */
double v; /* scale */
double ph; /* phase angle or zeropoint */
double freq; /* cyclical frequency */
double shift; /* [shift - cos()] usually 1 */
} biasFunction;
typedef struct transformdata_t {
struct transformdata_t *next; /* list of transforms */
xformAtomRecords* recs; /* for which the current transformations apply */
xformAtomRecords* lastrec; /* last atom record in the list */
char *name; /* used to show the name */
int num; /* level number (helps when debugging) */
int type; /* ROTxform, etc. */
double phase; /* e.g. original angle in the starting structure */
double startVal; /* starting value */
double endVal; /* ending value */
double stepVal; /* change in value */
double currVal; /* working value (changes during processing) */
point3d a1, a2; /* axis vector end points */
matrix4 tmat; /* working transformation matrix (changes) */
biasFunction* funcs; /* list of bias functions */
} transformData;
typedef struct {
transformData *xforms; /* list of transformations */
transformData *last; /* last transformation in list */
int nlevs; /* number of adjustable levels */
transformData* level[MAX_XFORM_LEVELS]; /* index of each */
int nstack; /* how many CTMs on the stack */
matrix4* ctmstack[MAX_XFORM_STACK_DEPTH];
goToRec* golist; /* if non null, we do these instead of loop*/
goToRec* glast; /* last goTo record in list */
xformAtomRecords** sortedByRes; /* array of atom recs sorted by residue */
} xformDatabase;
xformDatabase* readTransformationDatabase(FILE *inf, FILE *outf,
abrMkAtomProc mkAtom, void *atomstuff,
abrAtomListProc inputListProc, void *liststuff,
char* cch);
void discardXformDB(xformDatabase* db,
abrAtomListProc delAtomProc, void *deletestuff);
void autobondrot(FILE *outf, xformDatabase* xdb,
abrProbeProc probeProc, void *probestuff,
abrAtomListProc delAtomProc, void *deletestuff,
int dumpGoToAtoms);
#endif