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 #include "molfile_plugin.h"
00028
00029 typedef PDBAtom *PDBAtomPtr ;
00030 typedef struct PAL {
00031 PDBAtom *data;
00032 struct PAL *next;
00033 } PDBAtomList;
00034
00035 class PDB {
00036 private:
00037 PDBAtomList *atomListHead, *atomListTail;
00038
00039 #ifdef MEM_OPT_VERSION
00040 PDBCoreData *atomArray;
00041 #else
00042 PDBAtom **atomArray;
00043 #endif
00044
00045 void add_atom_element(PDBAtom *newAtom);
00046 int atomCount;
00047
00048 ScaledPosition smin, smax;
00049
00050 void find_extremes_helper(
00051 SortableResizeArray<BigReal> &coor,
00052 BigReal &min, BigReal &max, Vector rec, BigReal frac
00053 );
00054
00055 public:
00056 PDB(const char *pdbfilename);
00057
00058 #ifdef MEM_OPT_VERSION
00059
00060 PDB(const char *pdbfilename, int expectedNumAtoms);
00061 #endif
00062
00063
00064 PDB(molfile_plugin_t *pIOHdl, void *pIOFileHdl, int numAtoms, const float *occupancy, const float *bfactor);
00065
00066 PDB(const char *, Ambertoppar *);
00067
00068
00069
00070
00071
00072 PDB(const char *filename, const GromacsTopFile *topology);
00073
00074 ~PDB(void);
00075 void write(const char *outfilename, const char *commentline=NULL);
00076
00077 int num_atoms( void);
00078
00079 #ifdef MEM_OPT_VERSION
00080 PDBCoreData *atom(int place);
00081
00082 void delPDBCoreData() { delete [] atomArray; atomArray=NULL; }
00083 #else
00084 PDBAtom *atom(int place);
00085 #endif
00086
00087 PDBAtomList *atoms(void ) { return atomListHead; }
00088
00089 #if 0
00090
00091 void find_extremes(BigReal *min, BigReal *max, Vector rec,
00092 BigReal frac=1.0) const;
00093 #else
00094
00095
00096 void find_extremes(const Lattice &, BigReal frac=1.0);
00097
00098
00099 void get_extremes(ScaledPosition &xmin, ScaledPosition &xmax) const {
00100 xmin = smin; xmax = smax;
00101 }
00102 #endif
00103
00104 void set_all_positions(Vector *);
00105
00106 void get_all_positions(Vector *);
00107
00108 void get_position_for_atom(Vector *, int);
00109 };
00110
00111 #endif // PDB_H
00112