/****************************************/ /* v.c: Mar 22, 1999 */ /* viewer of Ju Li's configuration file */ /****************************************/ #include #include "W.h" #define MAX_STRLEN 128 #define TP_STRLEN 2 #define MAX_TP 5 #define GROUP_NAME "atoms" struct ATOMTYPE { char *name; /* type name */ double mass; /* atomic mass */ int occurrence; /* number of atoms of such type */ int color; double radius; /* interaction radius in A */ } at[MAX_TP+1] = {{"Ar", 39.948, 0, W_RED, 1.50}, {"Si", 28.086, 0, W_GREEN, 1.11}, {"C", 12.011, 0, W_WHITE, 0.77}, {"H", 1.0079, 0, W_WHITE, 0.37}, {"O", 16.000, 0, W_RED, 0.73}, {"Un", -1.000, 0, W_WHITE, 1.50}}; int main (int argc, char *argv[]) { int i, j, k, np, nc[3], *id; char buf[MAX_STRLEN], read[MAX_STRLEN], *r, *p, **tp; double H[3][3], HI[3][3], *mass, *s, *s1; FILE *in; WSPHERE *sphere; if ( argc == 1 ) { /* no input argument */ printf ("View config file of JL's format: "); for (r=read; r0) fprintf (stdout, " %7d %2s %.3f %6s %.3f\n", at[j].occurrence, at[j].name, at[j].mass, Wcolorname[at[j].color-1], at[j].radius); fprintf (stdout, "------------------------------------------------\n"); WLock(); sphere = (WSPHERE *) WCreateOG(GROUP_NAME, W_SPHERE, np); for (i=0; irw unit */ W_DEFAULT_PBC, /** PBC, no default key **/ W_DEFAULT, W_DEFAULT, /* viewport origin xy in rw */ W_DEFAULT, /* viewport origin z in rw */ W_DEFAULT, W_DEFAULT, W_DEFAULT, /* x-axes direction */ W_DEFAULT, W_DEFAULT, W_DEFAULT, /* y-axes direction */ W_DEFAULT, W_DEFAULT, /* screen size contains box */ W_DEFAULT, /* eye position */ W_DEFAULT, /* eye thickness factor */ W_DEFAULT, /* view-plate thickness */ W_DEFAULT, /* Z-buffer order (and lighting) scheme */ W_DEFAULT, W_DEFAULT, /* lighting parameters alpha and beta */ W_DEFAULT, /* factor of change */ W_DEFAULT_EYE_AID, /* draw the eye_aide or not */ W_DEFAULT /* animation frames/second */); sleep(10000000); return (0); } /* end main() */