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
00052 typedef struct {
00053 char database[81];
00054 char accession[81];
00055 char date[81];
00056 char title[81];
00057 int remarklen;
00058 char *remarks;
00059 } molfile_metadata_t;
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00077 typedef struct {
00078
00079 char name[16];
00080 char type[16];
00081 char resname[8];
00082 int resid;
00083 char segid[8];
00084 char chain[2];
00086
00087 char altloc[2];
00088 char insertion[2];
00089 float occupancy;
00090 float bfactor;
00091 float mass;
00092 float charge;
00093 float radius;
00094 int atomicnumber;
00095 } molfile_atom_t;
00096
00099 #define MOLFILE_NOOPTIONS 0x0000
00100 #define MOLFILE_INSERTION 0x0001
00101 #define MOLFILE_OCCUPANCY 0x0002
00102 #define MOLFILE_BFACTOR 0x0004
00103 #define MOLFILE_MASS 0x0008
00104 #define MOLFILE_CHARGE 0x0010
00105 #define MOLFILE_RADIUS 0x0020
00106 #define MOLFILE_ALTLOC 0x0040
00107 #define MOLFILE_ATOMICNUMBER 0x0080
00108 #define MOLFILE_BONDSSPECIAL 0x0100
00110
00111
00112
00113
00114
00115 typedef struct {
00116 float *coords;
00126 float A, B, C, alpha, beta, gamma;
00128 } molfile_timestep_t;
00129
00130
00135 typedef struct {
00136 char dataname[256];
00138 float origin[3];
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149 float xaxis[3];
00150 float yaxis[3];
00151 float zaxis[3];
00153
00154
00155
00156
00157
00158
00159 int xsize;
00160 int ysize;
00161 int zsize;
00163 int has_color;
00164 } molfile_volumetric_t;
00165
00166
00171 enum molfile_graphics_type {
00172 MOLFILE_POINT, MOLFILE_TRIANGLE, MOLFILE_TRINORM, MOLFILE_NORMS,
00173 MOLFILE_LINE, MOLFILE_CYLINDER, MOLFILE_CAPCYL, MOLFILE_CONE,
00174 MOLFILE_SPHERE, MOLFILE_TEXT, MOLFILE_COLOR, MOLFILE_TRICOLOR
00175 };
00176
00180 typedef struct {
00181 int type;
00182 int style;
00183 float size;
00184 float data[9];
00185 } molfile_graphics_t;
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00217 typedef struct {
00221 vmdplugin_HEAD
00222
00232 const char *filename_extension;
00233
00242 void *(* open_file_read)(const char *filepath, const char *filetype,
00243 int *natoms);
00244
00252 int (*read_structure)(void *, int *optflags, molfile_atom_t *atoms);
00253
00273 int (*read_bonds)(void *, int *nbonds, int **from, int **to, float **bondorder);
00274
00286 int (* read_next_timestep)(void *, int natoms, molfile_timestep_t *);
00287
00291 void (* close_file_read)(void *);
00292
00299 void *(* open_file_write)(const char *filepath, const char *filetype,
00300 int natoms);
00301
00305 int (* write_structure)(void *, int optflags, const molfile_atom_t *atoms);
00306
00313 int (* write_timestep)(void *, const molfile_timestep_t *);
00314
00318 void (* close_file_write)(void *);
00319
00327 int (* read_volumetric_metadata)(void *, int *nsets,
00328 molfile_volumetric_t **metadata);
00329
00338 int (* read_volumetric_data)(void *, int set, float *datablock,
00339 float *colorblock);
00340
00347 int (* read_rawgraphics)(void *, int *nelem, const molfile_graphics_t **data);
00348
00355 int (* read_molecule_metadata)(void *, molfile_metadata_t **metadata);
00356
00368 int (* write_bonds)(void *, int nbonds, int *from, int *to, float *bondorder);
00369
00370 } molfile_plugin_t;
00371
00372 #endif
00373