--- trunk/SHAPES/PDBReader.cpp 2004/07/20 17:07:01 1359 +++ trunk/SHAPES/PDBReader.cpp 2004/07/20 20:02:15 1360 @@ -4,18 +4,23 @@ PDBReader::~PDBReader(void) { } PDBReader::~PDBReader(void) { - gzclose(PDBfile); + fclose(PDBfile); } -void PDBReader::setPDBfile(const char *fname) { - PDBfile = gzopen(fname, "r"); - if (PDBfile == Z_NULL) { +void PDBReader::setPDBfileName(const char *fname) { + PDBfile = fopen(fname, "r"); + if (PDBfile == NULL) { printf("Could not open PDB file %s\n", fname); exit(-1); - } + } else + setPDBfile(PDBfile); } +void PDBReader::setPDBfile(FILE* myFile) { + PDBfile = myFile; +} + vector PDBReader::getAtomList() { char numstr[9]; @@ -31,10 +36,10 @@ vector PDBReader::getAtomList() { ta = getTotAtoms(); theAtoms.reserve(ta); - gzrewind(PDBfile); + rewind(PDBfile); - while (!gzeof(PDBfile)) { - gzgets(PDBfile, buf, 150); + while (!feof(PDBfile)) { + fgets( buf, 150, PDBfile); if (!strcmp(buf, "END") || !strncmp(buf, "END ", 4) || !strncmp(buf, "TER ", 4) || @@ -84,9 +89,9 @@ unsigned int PDBReader::getTotAtoms(void) { unsigned int PDBReader::getTotAtoms(void) { char buf[150]; unsigned int ta = 0; - gzrewind(PDBfile); - while (!gzeof(PDBfile)) { - gzgets(PDBfile,buf,150); + rewind(PDBfile); + while (!feof(PDBfile)) { + fgets(buf,150,PDBfile); if (!strcmp(buf, "END") || !strncmp(buf, "END ", 4) || !strncmp(buf, "TER ", 4) ||