#include "dist.h" void LoopOverNeighbors (atom_record *atom,neibour_descr *neibours,int neibour_count) {} void SaveAtomVertices(int n,atom_record * a, vertex *v1, vertex *v2) { double V[4]; char buf[BUFSIZ]; static atom_record * current_atom ; static const char * ObjName = "WritePoly" ; static bool Print = false ; static vector_count =0; static atom_count =0; switch (n) { case 0: /* 1=t for text 2=The number of non-comment lines following this header. Thus, for a 327 line file without any '!' lines, this number would be 326. 3=80 characters across . 1 2 3 */ printf("DRAW_OBJECT_%s t %s 80\n",ObjName,"ChangeThisToTotalLines"); printf("Begin_object %s\n",ObjName); break; case 1 : current_atom = a ; sprintfAtomShortForm (buf,a); printf("\n! Beginning Atom %20s\n",buf); break; case 2: case 3: case 4: vector_count ++ ; /* STDOUT("! 2: ->1->2"); */ V[1] = v1->x ; V[2] = v1->y ; V[3] = v1->z ; O_gdl_Vector(V,0); V[1] = v2->x ; V[2] = v2->y ; V[3] = v2->z ; O_gdl_Vector(V,1); break ; case 5: { double occ = a->occ ; double b = a->b ; atom_count ++ ; a->occ = a->volume ; a->b = a->surface ; printf("! volume= %12.4f MaxDistSq= %12.4f\n", a->volume,a->surface); sprintfAtomShortForm (buf,a); printf("\n! Ending Atom %4d : %20s\n",atom_count,buf); printf("! "); write_pdb_record (stdout, a,0); a->occ = occ ; a->b = b ; } break ; case 6: printf("End_object\n"); printf("! Total_Vectors = %6d\n",vector_count) ; printf("! Total_Lines = %6d\n",2*vector_count + 2) ; break; default: STDERR("You defaulted on your loan"); } } main(int argc,char **argv) { SAY_HI_FIRST ; CITATION ; default_initialization(); { file_records *f = open_and_read_pdb(STRG_AFTER_OPT_W_ENV("i","in.pdb"),0); char *outputfile = STRG_AFTER_OPT_W_ENV("o",NULL); FILE *ff = outputfile == NULL ? stdout : fopen(outputfile, "w") ; atom_record ** A = f->atoms ; int n = f->atomnum ; SaveAtomVertices(0,NULL,NULL,NULL); NN_Calculate_Volumes(f, (int) DoubleAfterOption(argc,argv,"method",2), 64.0, 6.0); SaveAtomVertices(6,NULL,NULL,NULL); } }