00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00023 #ifndef MOL_FILE_PLUGIN_H
00024 #define MOL_FILE_PLUGIN_H
00025
00026 #include "vmdplugin.h"
00027
00031 #define MOLFILE_PLUGIN_TYPE "mol file reader"
00032
00037 #define MOLFILE_CONVERTER_PLUGIN_TYPE "mol file converter"
00038
00039
00040 #define MOLFILE_SUCCESS 0
00041 #define MOLFILE_EOF -1
00042 #define MOLFILE_ERROR -1
00043 #define MOLFILE_NOSTRUCTUREDATA -2
00045 #define MOLFILE_NUMATOMS_UNKNOWN -1
00046 #define MOLFILE_NUMATOMS_NONE 0
00051 #define MOLFILE_BUFSIZ 81
00057 typedef struct {
00058 char database[81];
00059 char accession[81];
00060 char date[81];
00061 char title[81];
00062 int remarklen;
00063 char *remarks;
00064 } molfile_metadata_t;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00082 typedef struct {
00083
00084 char name[16];
00085 char type[16];
00086 char resname[8];
00087 int resid;
00088 char segid[8];
00089 char chain[2];
00091
00092 char altloc[2];
00093 char insertion[2];
00094 float occupancy;
00095 float bfactor;
00096 float mass;
00097 float charge;
00098 float radius;
00099 int atomicnumber;
00100 } molfile_atom_t;
00101
00104 #define MOLFILE_NOOPTIONS 0x0000
00105 #define MOLFILE_INSERTION 0x0001
00106 #define MOLFILE_OCCUPANCY 0x0002
00107 #define MOLFILE_BFACTOR 0x0004
00108 #define MOLFILE_MASS 0x0008
00109 #define MOLFILE_CHARGE 0x0010
00110 #define MOLFILE_RADIUS 0x0020
00111 #define MOLFILE_ALTLOC 0x0040
00112 #define MOLFILE_ATOMICNUMBER 0x0080
00113 #define MOLFILE_BONDSSPECIAL 0x0100
00114 #define MOLFILE_BADOPTIONS 0xFFFFFFFF
00117
00118 #if vmdplugin_ABIVERSION > 10
00119 typedef struct molfile_timestep_metadata {
00120 unsigned count;
00121 unsigned avg_bytes_per_timestep;
00122 int has_velocities;
00124 } molfile_timestep_metadata_t;
00125 #endif
00126
00127
00128
00129
00130 typedef struct {
00131 float *coords;
00132 float *velocities;
00142 float A, B, C, alpha, beta, gamma;
00145 double physical_time;
00146 } molfile_timestep_t;
00147
00148
00153 typedef struct {
00154 char dataname[256];
00156 float origin[3];
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167 float xaxis[3];
00168 float yaxis[3];
00169 float zaxis[3];
00171
00172
00173
00174
00175
00176
00177 int xsize;
00178 int ysize;
00179 int zsize;
00181 int has_color;
00182 } molfile_volumetric_t;
00183
00184
00185
00186 #if vmdplugin_ABIVERSION > 9
00187
00192 typedef struct {
00193
00194 unsigned int nimag;
00195 unsigned int nintcoords;
00196 unsigned int ncart;
00197
00198
00199 unsigned int num_basis_funcs;
00200 unsigned int num_shells;
00201 unsigned int orbital_counter;
00202
00203
00204 unsigned int num_traj_points;
00205 unsigned int have_trajectory;
00206 } molfile_qm_metadata_t;
00207
00208
00213 typedef struct {
00214 double *carthessian;
00215 int *imag_modes;
00216 double *inthessian;
00217 double *wavenumbers;
00218 double *intensities;
00219 double *normalmodes;
00220 } molfile_qm_hessian_t;
00221
00222
00227 typedef struct {
00228 unsigned int *basis_counter;
00229 unsigned int *atomic_shells;
00230 unsigned int *shell_primitives;
00231 unsigned int homo_index;
00232
00233 float *basis;
00234 char *orbital_symmetry;
00235 } molfile_qm_orbital_t;
00236
00237
00241 typedef struct {
00242 unsigned int runtyp;
00243 unsigned int nproc;
00244 unsigned int num_gauss_basis_funcs;
00245 unsigned int num_electrons;
00246 unsigned int totalcharge;
00247 unsigned int multiplicity;
00248 unsigned int num_orbitals_A;
00249 unsigned int num_orbitals_B;
00250 unsigned int scftyp;
00251 unsigned int ngauss;
00252 unsigned int npfunc;
00253 unsigned int ndfunc;
00254 unsigned int nffunc;
00255 unsigned int diffs;
00256 unsigned int diffsp;
00257 double *nuc_charge;
00258
00259 char runtyp_string[MOLFILE_BUFSIZ];
00260 char scftyp_string[MOLFILE_BUFSIZ];
00261 char basis_string[MOLFILE_BUFSIZ];
00262
00263 char memory[MOLFILE_BUFSIZ];
00264 char gbasis[MOLFILE_BUFSIZ];
00265
00266 char runtitle[MOLFILE_BUFSIZ];
00267 char guess[MOLFILE_BUFSIZ];
00268 char geometry[MOLFILE_BUFSIZ];
00269
00270 char version_string[MOLFILE_BUFSIZ];
00271 } molfile_qm_sysinfo_t;
00272
00273
00277 typedef struct {
00278 float *wave_function;
00279 #if vmdplugin_ABIVERSION > 11
00280 int scfiter;
00281 #endif
00282 double *scfenergies;
00283 double *mulliken_charges;
00284 double *lowdin_charges;
00285 double *esp_charges;
00286 double *npa_charges;
00287 } molfile_qm_timestep_t;
00288
00289
00293 typedef struct {
00294 molfile_qm_hessian_t hess;
00295 molfile_qm_orbital_t orb;
00296 molfile_qm_sysinfo_t run;
00297 } molfile_qm_t;
00298
00299
00300 #endif
00301
00302
00307 enum molfile_graphics_type {
00308 MOLFILE_POINT, MOLFILE_TRIANGLE, MOLFILE_TRINORM, MOLFILE_NORMS,
00309 MOLFILE_LINE, MOLFILE_CYLINDER, MOLFILE_CAPCYL, MOLFILE_CONE,
00310 MOLFILE_SPHERE, MOLFILE_TEXT, MOLFILE_COLOR, MOLFILE_TRICOLOR
00311 };
00312
00316 typedef struct {
00317 int type;
00318 int style;
00319 float size;
00320 float data[9];
00321 } molfile_graphics_t;
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00353 typedef struct {
00357 vmdplugin_HEAD
00358
00369 const char *filename_extension;
00370
00379 void *(* open_file_read)(const char *filepath, const char *filetype,
00380 int *natoms);
00381
00389 int (*read_structure)(void *, int *optflags, molfile_atom_t *atoms);
00390
00410 int (*read_bonds)(void *, int *nbonds, int **from, int **to, float **bondorder);
00411
00426 int (* read_next_timestep)(void *, int natoms, molfile_timestep_t *);
00427
00431 void (* close_file_read)(void *);
00432
00439 void *(* open_file_write)(const char *filepath, const char *filetype,
00440 int natoms);
00441
00445 int (* write_structure)(void *, int optflags, const molfile_atom_t *atoms);
00446
00453 int (* write_timestep)(void *, const molfile_timestep_t *);
00454
00458 void (* close_file_write)(void *);
00459
00467 int (* read_volumetric_metadata)(void *, int *nsets,
00468 molfile_volumetric_t **metadata);
00469
00478 int (* read_volumetric_data)(void *, int set, float *datablock,
00479 float *colorblock);
00480
00487 int (* read_rawgraphics)(void *, int *nelem, const molfile_graphics_t **data);
00488
00495 int (* read_molecule_metadata)(void *, molfile_metadata_t **metadata);
00496
00508 int (* write_bonds)(void *, int nbonds, int *from, int *to, float *bondorder);
00509
00510
00511 #if vmdplugin_ABIVERSION > 9
00512
00519 int (* write_volumetric_data)(void *, molfile_volumetric_t *metadata,
00520 float *datablock, float *colorblock);
00521
00528 int (* read_angles)(void *,
00529 int *numangles, int *angles, double *angleforces,
00530 int *numdihedrals, int *dihedrals, double *dihedralforces,
00531 int *numimpropers, int *impropers, double *improperforces,
00532 int *numcterms, int *cterms,
00533 int *ctermcols, int *ctermrows, double *ctermforces);
00534
00541 int (* write_angles)(void *,
00542 int numangles, const int *angles, const double *angleforces,
00543 int numdihedrals, const int *dihedrals, const double *dihedralforces,
00544 int numimpropers, const int *impropers, const double *improperforces,
00545 int numcterms, const int *cterms,
00546 int ctermcols, int ctermrows, const double *ctermforces);
00547
00551 int (* read_qm_metadata)(void *, molfile_qm_metadata_t *metadata);
00552
00556 int (* read_qm_rundata)(void *, molfile_qm_t *qmdata);
00557
00575 int (* read_timestep)(void *, int natoms, molfile_timestep_t *,
00576 molfile_qm_metadata_t *, molfile_qm_timestep_t *);
00577 #endif
00578
00579 #if vmdplugin_ABIVERSION > 10
00580 int (* read_timestep_metadata)(void *, molfile_timestep_metadata_t *);
00581 #endif
00582
00583 } molfile_plugin_t;
00584
00585 #endif
00586