00001
00007
00008
00009
00010
00011
00012 #ifndef PDB_H
00013 #define PDB_H
00014
00015
00016
00017
00018
00019
00020 #include "parm.h"
00021 #include "ResizeArray.h"
00022 #include "GromacsTopFile.h"
00023
00024 #include "PDBData.h"
00025 #include "Vector.h"
00026 #include "Lattice.h"
00027
00028 typedef PDBAtom *PDBAtomPtr ;
00029 typedef struct PAL {
00030 PDBAtom *data;
00031 struct PAL *next;
00032 } PDBAtomList;
00033
00034 class PDB {
00035 private:
00036 PDBAtomList *atomListHead, *atomListTail;
00037
00038 #ifdef MEM_OPT_VERSION
00039 PDBCoreData *atomArray;
00040 #else
00041 PDBAtom **atomArray;
00042 #endif
00043
00044 void add_atom_element(PDBAtom *newAtom);
00045 int atomCount;
00046
00047 public:
00048 PDB(const char *pdbfilename);
00049
00050 #ifdef MEM_OPT_VERSION
00051
00052 PDB(const char *pdbfilename, int expectedNumAtoms);
00053 #endif
00054
00055 PDB(const char *, Ambertoppar *);
00056
00057
00058
00059
00060
00061 PDB(const char *filename, const GromacsTopFile *topology);
00062
00063 ~PDB(void);
00064 void write(const char *outfilename, const char *commentline=NULL);
00065
00066 int num_atoms( void);
00067
00068 #ifdef MEM_OPT_VERSION
00069 PDBCoreData *atom(int place);
00070
00071 void delPDBCoreData() { delete [] atomArray; atomArray=NULL; }
00072 #else
00073 PDBAtom *atom(int place);
00074 #endif
00075
00076 PDBAtomList *atoms(void ) { return atomListHead; }
00077
00078
00079 void find_extremes(BigReal *min, BigReal *max, Vector rec,
00080 BigReal frac=1.0) const;
00081
00082 void set_all_positions(Vector *);
00083
00084 void get_all_positions(Vector *);
00085
00086 void get_position_for_atom(Vector *, int);
00087 };
00088
00089 #endif // PDB_H
00090