whitespace cleanup in VMD plugin headers
This commit is contained in:
@ -15,10 +15,10 @@
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
* API for C extensions to define a way to load structure, coordinate,
|
* API for C extensions to define a way to load structure, coordinate,
|
||||||
* trajectory, and volumetric data files
|
* trajectory, and volumetric data files
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MOL_FILE_PLUGIN_H
|
#ifndef MOL_FILE_PLUGIN_H
|
||||||
#define MOL_FILE_PLUGIN_H
|
#define MOL_FILE_PLUGIN_H
|
||||||
@ -63,9 +63,9 @@ typedef ssize_t molfile_ssize_t; /**< for frame counts */
|
|||||||
/**
|
/**
|
||||||
* Hard-coded direct-I/O page size constants for use by both VMD
|
* Hard-coded direct-I/O page size constants for use by both VMD
|
||||||
* and the plugins that want to use direct, unbuffered I/O for high
|
* and the plugins that want to use direct, unbuffered I/O for high
|
||||||
* performance with SSDs etc. We use two constants to define the
|
* performance with SSDs etc. We use two constants to define the
|
||||||
* range of hardware page sizes that we can support, so that we can
|
* range of hardware page sizes that we can support, so that we can
|
||||||
* add support for larger 8KB or 16KB page sizes in the future
|
* add support for larger 8KB or 16KB page sizes in the future
|
||||||
* as they become more prevalent in high-end storage systems.
|
* as they become more prevalent in high-end storage systems.
|
||||||
*
|
*
|
||||||
* At present, VMD uses a hard-coded 4KB page size to reduce memory
|
* At present, VMD uses a hard-coded 4KB page size to reduce memory
|
||||||
@ -89,16 +89,16 @@ typedef struct {
|
|||||||
} molfile_metadata_t;
|
} molfile_metadata_t;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Struct for specifying atoms in a molecular structure. The first
|
* Struct for specifying atoms in a molecular structure. The first
|
||||||
* six components are required, the rest are optional and their presence is
|
* six components are required, the rest are optional and their presence is
|
||||||
* indicating by setting the corresponding bit in optsflag. When omitted,
|
* indicating by setting the corresponding bit in optsflag. When omitted,
|
||||||
* the application (for read_structure) or plugin (for write_structure)
|
* the application (for read_structure) or plugin (for write_structure)
|
||||||
* must be able to supply default values if the missing parameters are
|
* must be able to supply default values if the missing parameters are
|
||||||
* part of its internal data structure.
|
* part of its internal data structure.
|
||||||
* Note that it is not possible to specify coordinates with this structure.
|
* Note that it is not possible to specify coordinates with this structure.
|
||||||
* This is intentional; all coordinate I/O is done with the read_timestep and
|
* This is intentional; all coordinate I/O is done with the read_timestep and
|
||||||
* write_timestep functions.
|
* write_timestep functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -169,7 +169,7 @@ typedef struct {
|
|||||||
#define MOLFILE_CTNUMBER 0x0200 /**< ctnumber provided */
|
#define MOLFILE_CTNUMBER 0x0200 /**< ctnumber provided */
|
||||||
#endif
|
#endif
|
||||||
#define MOLFILE_BADOPTIONS 0xFFFFFFFF /**< Detect badly behaved plugins */
|
#define MOLFILE_BADOPTIONS 0xFFFFFFFF /**< Detect badly behaved plugins */
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/*@{*/
|
/*@{*/
|
||||||
@ -189,22 +189,22 @@ typedef struct molfile_timestep_metadata {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Per-timestep atom coordinates and periodic cell information
|
* Per-timestep atom coordinates and periodic cell information
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
float *coords; /**< coordinates of all atoms, arranged xyzxyzxyz */
|
float *coords; /**< coordinates of all atoms, arranged xyzxyzxyz */
|
||||||
float *velocities; /**< space for velocities of all atoms; same layout */
|
float *velocities; /**< space for velocities of all atoms; same layout */
|
||||||
/**< NULL unless has_velocities is set */
|
/**< NULL unless has_velocities is set */
|
||||||
|
|
||||||
/*@{*/
|
/*@{*/
|
||||||
/**
|
/**
|
||||||
* Unit cell specification of the form A, B, C, alpha, beta, gamma.
|
* Unit cell specification of the form A, B, C, alpha, beta, gamma.
|
||||||
* notes: A, B, C are side lengths of the unit cell
|
* notes: A, B, C are side lengths of the unit cell
|
||||||
* alpha = angle between b and c
|
* alpha = angle between b and c
|
||||||
* beta = angle between a and c
|
* beta = angle between a and c
|
||||||
* gamma = angle between a and b
|
* gamma = angle between a and b
|
||||||
*/
|
*/
|
||||||
float A, B, C, alpha, beta, gamma;
|
float A, B, C, alpha, beta, gamma;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
double physical_time; /**< physical time point associated with this frame */
|
double physical_time; /**< physical time point associated with this frame */
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ typedef struct {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata for volumetric datasets, read initially and used for subsequent
|
* Metadata for volumetric datasets, read initially and used for subsequent
|
||||||
* memory allocations and file loading.
|
* memory allocations and file loading.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char dataname[256]; /**< name of volumetric data set */
|
char dataname[256]; /**< name of volumetric data set */
|
||||||
@ -233,20 +233,20 @@ typedef struct {
|
|||||||
* x/y/z axis:
|
* x/y/z axis:
|
||||||
* These the three cell sides, providing both direction and length
|
* These the three cell sides, providing both direction and length
|
||||||
* (not unit vectors) for the x, y, and z axes. In the simplest
|
* (not unit vectors) for the x, y, and z axes. In the simplest
|
||||||
* case, these would be <size,0,0> <0,size,0> and <0,0,size) for
|
* case, these would be <size,0,0> <0,size,0> and <0,0,size) for
|
||||||
* an orthogonal cubic volume set. For other cell shapes these
|
* an orthogonal cubic volume set. For other cell shapes these
|
||||||
* axes can be oriented non-orthogonally, and the parallelpiped
|
* axes can be oriented non-orthogonally, and the parallelpiped
|
||||||
* may have different side lengths, not just a cube/rhombus.
|
* may have different side lengths, not just a cube/rhombus.
|
||||||
*/
|
*/
|
||||||
float xaxis[3]; /**< direction (and length) for X axis */
|
float xaxis[3]; /**< direction (and length) for X axis */
|
||||||
float yaxis[3]; /**< direction (and length) for Y axis */
|
float yaxis[3]; /**< direction (and length) for Y axis */
|
||||||
float zaxis[3]; /**< direction (and length) for Z axis */
|
float zaxis[3]; /**< direction (and length) for Z axis */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* x/y/z size:
|
* x/y/z size:
|
||||||
* Number of grid cells along each axis. This is _not_ the
|
* Number of grid cells along each axis. This is _not_ the
|
||||||
* physical size of the box, this is the number of voxels in each
|
* physical size of the box, this is the number of voxels in each
|
||||||
* direction, independent of the shape of the volume set.
|
* direction, independent of the shape of the volume set.
|
||||||
*/
|
*/
|
||||||
int xsize; /**< number of grid cells along the X axis */
|
int xsize; /**< number of grid cells along the X axis */
|
||||||
int ysize; /**< number of grid cells along the Y axis */
|
int ysize; /**< number of grid cells along the Y axis */
|
||||||
@ -348,10 +348,10 @@ typedef struct {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* QM run info. Parameters that stay unchanged during a single file.
|
* QM run info. Parameters that stay unchanged during a single file.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int nproc; /**< number of processors used. */
|
int nproc; /**< number of processors used. */
|
||||||
int memory; /**< amount of memory used in Mbyte. */
|
int memory; /**< amount of memory used in Mbyte. */
|
||||||
int runtype; /**< flag indicating the calculation method. */
|
int runtype; /**< flag indicating the calculation method. */
|
||||||
int scftype; /**< SCF type: RHF, UHF, ROHF, GVB or MCSCF wfn. */
|
int scftype; /**< SCF type: RHF, UHF, ROHF, GVB or MCSCF wfn. */
|
||||||
int status; /**< indicates wether SCF and geometry optimization
|
int status; /**< indicates wether SCF and geometry optimization
|
||||||
@ -384,9 +384,9 @@ typedef struct {
|
|||||||
* array size = 2*num_basis_funcs
|
* array size = 2*num_basis_funcs
|
||||||
* The basis must NOT be normalized. */
|
* The basis must NOT be normalized. */
|
||||||
int *atomic_number; /**< atomic numbers (chem. element) of atoms in basis set */
|
int *atomic_number; /**< atomic numbers (chem. element) of atoms in basis set */
|
||||||
int *angular_momentum; /**< 3 ints per wave function coefficient do describe the
|
int *angular_momentum; /**< 3 ints per wave function coefficient do describe the
|
||||||
* cartesian components of the angular momentum.
|
* cartesian components of the angular momentum.
|
||||||
* E.g. S={0 0 0}, Px={1 0 0}, Dxy={1 1 0}, or Fyyz={0 2 1}.
|
* E.g. S={0 0 0}, Px={1 0 0}, Dxy={1 1 0}, or Fyyz={0 2 1}.
|
||||||
*/
|
*/
|
||||||
int *shell_types; /**< type for each shell in basis */
|
int *shell_types; /**< type for each shell in basis */
|
||||||
} molfile_qm_basis_t;
|
} molfile_qm_basis_t;
|
||||||
@ -460,9 +460,9 @@ enum molfile_qm_wavefunc_type {
|
|||||||
MOLFILE_WAVE_MCSCFNAT, MOLFILE_WAVE_MCSCFOPT,
|
MOLFILE_WAVE_MCSCFNAT, MOLFILE_WAVE_MCSCFOPT,
|
||||||
MOLFILE_WAVE_CINATUR,
|
MOLFILE_WAVE_CINATUR,
|
||||||
MOLFILE_WAVE_PIPEK, MOLFILE_WAVE_BOYS, MOLFILE_WAVE_RUEDEN,
|
MOLFILE_WAVE_PIPEK, MOLFILE_WAVE_BOYS, MOLFILE_WAVE_RUEDEN,
|
||||||
MOLFILE_WAVE_NAO, MOLFILE_WAVE_PNAO, MOLFILE_WAVE_NHO,
|
MOLFILE_WAVE_NAO, MOLFILE_WAVE_PNAO, MOLFILE_WAVE_NHO,
|
||||||
MOLFILE_WAVE_PNHO, MOLFILE_WAVE_NBO, MOLFILE_WAVE_PNBO,
|
MOLFILE_WAVE_PNHO, MOLFILE_WAVE_NBO, MOLFILE_WAVE_PNBO,
|
||||||
MOLFILE_WAVE_PNLMO, MOLFILE_WAVE_NLMO, MOLFILE_WAVE_MOAO,
|
MOLFILE_WAVE_PNLMO, MOLFILE_WAVE_NLMO, MOLFILE_WAVE_MOAO,
|
||||||
MOLFILE_WAVE_NATO, MOLFILE_WAVE_UNKNOWN
|
MOLFILE_WAVE_NATO, MOLFILE_WAVE_UNKNOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ typedef struct molfile_qm_timestep_metadata {
|
|||||||
int has_orben_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< orbital energy flags */
|
int has_orben_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< orbital energy flags */
|
||||||
int has_occup_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< orbital occupancy flags */
|
int has_occup_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< orbital occupancy flags */
|
||||||
int num_wavef ; /**< # wavefunctions in this ts */
|
int num_wavef ; /**< # wavefunctions in this ts */
|
||||||
int wavef_size; /**< size of one wavefunction
|
int wavef_size; /**< size of one wavefunction
|
||||||
* (# of gaussian basis fctns) */
|
* (# of gaussian basis fctns) */
|
||||||
int num_charge_sets; /**< # of charge values per atom */
|
int num_charge_sets; /**< # of charge values per atom */
|
||||||
} molfile_qm_timestep_metadata_t;
|
} molfile_qm_timestep_metadata_t;
|
||||||
@ -547,14 +547,14 @@ typedef struct {
|
|||||||
* from graphics file reader plugins.
|
* from graphics file reader plugins.
|
||||||
*/
|
*/
|
||||||
enum molfile_graphics_type {
|
enum molfile_graphics_type {
|
||||||
MOLFILE_POINT, MOLFILE_TRIANGLE, MOLFILE_TRINORM, MOLFILE_NORMS,
|
MOLFILE_POINT, MOLFILE_TRIANGLE, MOLFILE_TRINORM, MOLFILE_NORMS,
|
||||||
MOLFILE_LINE, MOLFILE_CYLINDER, MOLFILE_CAPCYL, MOLFILE_CONE,
|
MOLFILE_LINE, MOLFILE_CYLINDER, MOLFILE_CAPCYL, MOLFILE_CONE,
|
||||||
MOLFILE_SPHERE, MOLFILE_TEXT, MOLFILE_COLOR, MOLFILE_TRICOLOR
|
MOLFILE_SPHERE, MOLFILE_TEXT, MOLFILE_COLOR, MOLFILE_TRICOLOR
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Individual graphics object/element data
|
* Individual graphics object/element data
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int type; /* One of molfile_graphics_type */
|
int type; /* One of molfile_graphics_type */
|
||||||
int style; /* A general style parameter */
|
int style; /* A general style parameter */
|
||||||
@ -570,13 +570,13 @@ typedef struct {
|
|||||||
type data style size
|
type data style size
|
||||||
---- ---- ----- ----
|
---- ---- ----- ----
|
||||||
point x, y, z pixel size
|
point x, y, z pixel size
|
||||||
triangle x1,y1,z1,x2,y2,z2,x3,y3,z3
|
triangle x1,y1,z1,x2,y2,z2,x3,y3,z3
|
||||||
trinorm x1,y1,z1,x2,y2,z2,x3,y3,z3
|
trinorm x1,y1,z1,x2,y2,z2,x3,y3,z3
|
||||||
the next array element must be NORMS
|
the next array element must be NORMS
|
||||||
tricolor x1,y1,z1,x2,y2,z2,x3,y3,z3
|
tricolor x1,y1,z1,x2,y2,z2,x3,y3,z3
|
||||||
the next array elements must be NORMS
|
the next array elements must be NORMS
|
||||||
the following element must be COLOR, with three RGB triples
|
the following element must be COLOR, with three RGB triples
|
||||||
norms x1,y1,z1,x2,y2,z2,x3,y3,z3
|
norms x1,y1,z1,x2,y2,z2,x3,y3,z3
|
||||||
line x1,y1,z1,x2,y2,z2 0=solid pixel width
|
line x1,y1,z1,x2,y2,z2 0=solid pixel width
|
||||||
1=stippled
|
1=stippled
|
||||||
cylinder x1,y1,z1,x2,y2,z2 resolution radius
|
cylinder x1,y1,z1,x2,y2,z2 resolution radius
|
||||||
@ -590,41 +590,41 @@ color r, g, b
|
|||||||
/**
|
/**
|
||||||
* Main file reader API. Any function in this struct may be NULL
|
* Main file reader API. Any function in this struct may be NULL
|
||||||
* if not implemented by the plugin; the application checks this to determine
|
* if not implemented by the plugin; the application checks this to determine
|
||||||
* what functionality is present in the plugin.
|
* what functionality is present in the plugin.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/**
|
/**
|
||||||
* Required header
|
* Required header
|
||||||
*/
|
*/
|
||||||
vmdplugin_HEAD
|
vmdplugin_HEAD
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filename extension for this file type. May be NULL if no filename
|
* Filename extension for this file type. May be NULL if no filename
|
||||||
* extension exists and/or is known. For file types that match several
|
* extension exists and/or is known. For file types that match several
|
||||||
* common extensions, list them in a comma separated list such as:
|
* common extensions, list them in a comma separated list such as:
|
||||||
* "pdb,ent,foo,bar,baz,ban"
|
* "pdb,ent,foo,bar,baz,ban"
|
||||||
* The comma separated list will be expanded when filename extension matching
|
* The comma separated list will be expanded when filename extension matching
|
||||||
* is performed. If multiple plugins solicit the same filename extensions,
|
* is performed. If multiple plugins solicit the same filename extensions,
|
||||||
* the one that lists the extension earliest in its list is selected. In the
|
* the one that lists the extension earliest in its list is selected. In the
|
||||||
* case of a "tie", the first one tried/checked "wins".
|
* case of a "tie", the first one tried/checked "wins".
|
||||||
*/
|
*/
|
||||||
const char *filename_extension;
|
const char *filename_extension;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to open the file for reading. Return an opaque handle, or NULL on
|
* Try to open the file for reading. Return an opaque handle, or NULL on
|
||||||
* failure. Set the number of atoms; if the number of atoms cannot be
|
* failure. Set the number of atoms; if the number of atoms cannot be
|
||||||
* determined, set natoms to MOLFILE_NUMATOMS_UNKNOWN.
|
* determined, set natoms to MOLFILE_NUMATOMS_UNKNOWN.
|
||||||
* Filetype should be the name under which this plugin was registered;
|
* Filetype should be the name under which this plugin was registered;
|
||||||
* this is provided so that plugins can provide the same function pointer
|
* this is provided so that plugins can provide the same function pointer
|
||||||
* to handle multiple file types.
|
* to handle multiple file types.
|
||||||
*/
|
*/
|
||||||
void *(* open_file_read)(const char *filepath, const char *filetype,
|
void *(* open_file_read)(const char *filepath, const char *filetype,
|
||||||
int *natoms);
|
int *natoms);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read molecular structure from the given file handle. atoms is allocated
|
* Read molecular structure from the given file handle. atoms is allocated
|
||||||
* by the caller and points to space for natoms.
|
* by the caller and points to space for natoms.
|
||||||
* On success, place atom information in the passed-in pointer.
|
* On success, place atom information in the passed-in pointer.
|
||||||
* optflags specifies which optional fields in the atoms will be set by
|
* optflags specifies which optional fields in the atoms will be set by
|
||||||
* the plugin.
|
* the plugin.
|
||||||
*/
|
*/
|
||||||
@ -636,15 +636,15 @@ typedef struct {
|
|||||||
* Each unique bond should be specified only once, so file formats that list
|
* Each unique bond should be specified only once, so file formats that list
|
||||||
* bonds twice will need post-processing before the results are returned to
|
* bonds twice will need post-processing before the results are returned to
|
||||||
* the caller.
|
* the caller.
|
||||||
* If the plugin provides bond information, but the file loaded doesn't
|
* If the plugin provides bond information, but the file loaded doesn't
|
||||||
* actually contain any bond info, the nbonds parameter should be
|
* actually contain any bond info, the nbonds parameter should be
|
||||||
* set to 0 and from/to should be set to NULL to indicate that no bond
|
* set to 0 and from/to should be set to NULL to indicate that no bond
|
||||||
* information was actually present, and automatic bond search should be
|
* information was actually present, and automatic bond search should be
|
||||||
* performed.
|
* performed.
|
||||||
*
|
*
|
||||||
* If the plugin provides bond order information, the bondorder array
|
* If the plugin provides bond order information, the bondorder array
|
||||||
* will contain the bond order for each from/to pair. If not, the bondorder
|
* will contain the bond order for each from/to pair. If not, the bondorder
|
||||||
* pointer should be set to NULL, in which case the caller will provide a
|
* pointer should be set to NULL, in which case the caller will provide a
|
||||||
* default bond order value of 1.0.
|
* default bond order value of 1.0.
|
||||||
*
|
*
|
||||||
* If the plugin provides bond type information, the bondtype array
|
* If the plugin provides bond type information, the bondtype array
|
||||||
@ -655,23 +655,23 @@ typedef struct {
|
|||||||
* and consistency checking.
|
* and consistency checking.
|
||||||
*
|
*
|
||||||
* These arrays must be freed by the plugin in the close_file_read function.
|
* These arrays must be freed by the plugin in the close_file_read function.
|
||||||
* This function can be called only after read_structure().
|
* This function can be called only after read_structure().
|
||||||
* Return MOLFILE_SUCCESS if no errors occur.
|
* Return MOLFILE_SUCCESS if no errors occur.
|
||||||
*/
|
*/
|
||||||
int (*read_bonds)(void *, int *nbonds, int **from, int **to, float **bondorder,
|
int (*read_bonds)(void *, int *nbonds, int **from, int **to, float **bondorder,
|
||||||
int **bondtype, int *nbondtypes, char ***bondtypename);
|
int **bondtype, int *nbondtypes, char ***bondtypename);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XXX this function will be augmented and possibly superceded by a
|
* XXX this function will be augmented and possibly superceded by a
|
||||||
* new QM-capable version named read_timestep(), when finished.
|
* new QM-capable version named read_timestep(), when finished.
|
||||||
*
|
*
|
||||||
* Read the next timestep from the file. Return MOLFILE_SUCCESS, or
|
* Read the next timestep from the file. Return MOLFILE_SUCCESS, or
|
||||||
* MOLFILE_EOF on EOF. If the molfile_timestep_t argument is NULL, then
|
* MOLFILE_EOF on EOF. If the molfile_timestep_t argument is NULL, then
|
||||||
* the frame should be skipped. Otherwise, the application must prepare
|
* the frame should be skipped. Otherwise, the application must prepare
|
||||||
* molfile_timestep_t by allocating space in coords for the corresponding
|
* molfile_timestep_t by allocating space in coords for the corresponding
|
||||||
* number of coordinates.
|
* number of coordinates.
|
||||||
* The natoms parameter exists because some coordinate file formats
|
* The natoms parameter exists because some coordinate file formats
|
||||||
* (like CRD) cannot determine for themselves how many atoms are in a
|
* (like CRD) cannot determine for themselves how many atoms are in a
|
||||||
* timestep; the app must therefore obtain this information elsewhere
|
* timestep; the app must therefore obtain this information elsewhere
|
||||||
* and provide it to the plugin.
|
* and provide it to the plugin.
|
||||||
*/
|
*/
|
||||||
@ -681,16 +681,16 @@ typedef struct {
|
|||||||
* Close the file and release all data. The handle cannot be reused.
|
* Close the file and release all data. The handle cannot be reused.
|
||||||
*/
|
*/
|
||||||
void (* close_file_read)(void *);
|
void (* close_file_read)(void *);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a coordinate file for writing using the given header information.
|
* Open a coordinate file for writing using the given header information.
|
||||||
* Return an opaque handle, or NULL on failure. The application must
|
* Return an opaque handle, or NULL on failure. The application must
|
||||||
* specify the number of atoms to be written.
|
* specify the number of atoms to be written.
|
||||||
* filetype should be the name under which this plugin was registered.
|
* filetype should be the name under which this plugin was registered.
|
||||||
*/
|
*/
|
||||||
void *(* open_file_write)(const char *filepath, const char *filetype,
|
void *(* open_file_write)(const char *filepath, const char *filetype,
|
||||||
int natoms);
|
int natoms);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write structure information. Return success.
|
* Write structure information. Return success.
|
||||||
*/
|
*/
|
||||||
@ -698,12 +698,12 @@ typedef struct {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Write a timestep to the coordinate file. Return MOLFILE_SUCCESS if no
|
* Write a timestep to the coordinate file. Return MOLFILE_SUCCESS if no
|
||||||
* errors occur. If the file contains structure information in each
|
* errors occur. If the file contains structure information in each
|
||||||
* timestep (like a multi-entry PDB), it will have to cache the information
|
* timestep (like a multi-entry PDB), it will have to cache the information
|
||||||
* from the initial calls from write_structure.
|
* from the initial calls from write_structure.
|
||||||
*/
|
*/
|
||||||
int (* write_timestep)(void *, const molfile_timestep_t *);
|
int (* write_timestep)(void *, const molfile_timestep_t *);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the file and release all data. The handle cannot be reused.
|
* Close the file and release all data. The handle cannot be reused.
|
||||||
*/
|
*/
|
||||||
@ -716,18 +716,18 @@ typedef struct {
|
|||||||
* the plugin and should be freed by close_file_read(). The application
|
* the plugin and should be freed by close_file_read(). The application
|
||||||
* may call this function any number of times.
|
* may call this function any number of times.
|
||||||
*/
|
*/
|
||||||
int (* read_volumetric_metadata)(void *, int *nsets,
|
int (* read_volumetric_metadata)(void *, int *nsets,
|
||||||
molfile_volumetric_t **metadata);
|
molfile_volumetric_t **metadata);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the specified volumetric data set into the space pointed to by
|
* Read the specified volumetric data set into the space pointed to by
|
||||||
* datablock. The set is specified with a zero-based index. The space
|
* datablock. The set is specified with a zero-based index. The space
|
||||||
* allocated for the datablock must be equal to
|
* allocated for the datablock must be equal to
|
||||||
* xsize * ysize * zsize. No space will be allocated for colorblock
|
* xsize * ysize * zsize. No space will be allocated for colorblock
|
||||||
* unless has_color is nonzero; in that case, colorblock should be
|
* unless has_color is nonzero; in that case, colorblock should be
|
||||||
* filled in with three RGB floats per datapoint.
|
* filled in with three RGB floats per datapoint.
|
||||||
*/
|
*/
|
||||||
int (* read_volumetric_data)(void *, int set, float *datablock,
|
int (* read_volumetric_data)(void *, int set, float *datablock,
|
||||||
float *colorblock);
|
float *colorblock);
|
||||||
#if vmdplugin_ABIVERSION > 16
|
#if vmdplugin_ABIVERSION > 16
|
||||||
int (* read_volumetric_data_ex)(void *, molfile_volumetric_readwrite_t *v);
|
int (* read_volumetric_data_ex)(void *, molfile_volumetric_readwrite_t *v);
|
||||||
@ -735,8 +735,8 @@ typedef struct {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Read raw graphics data stored in this file. Return the number of data
|
* Read raw graphics data stored in this file. Return the number of data
|
||||||
* elements and the data itself as an array of molfile_graphics_t in the
|
* elements and the data itself as an array of molfile_graphics_t in the
|
||||||
* pointer provided by the application. The plugin is responsible for
|
* pointer provided by the application. The plugin is responsible for
|
||||||
* freeing the data when the file is closed.
|
* freeing the data when the file is closed.
|
||||||
*/
|
*/
|
||||||
int (* read_rawgraphics)(void *, int *nelem, const molfile_graphics_t **data);
|
int (* read_rawgraphics)(void *, int *nelem, const molfile_graphics_t **data);
|
||||||
@ -746,19 +746,19 @@ typedef struct {
|
|||||||
* came from, what the accession code for the database is, textual remarks
|
* came from, what the accession code for the database is, textual remarks
|
||||||
* and other notes pertaining to the contained structure/trajectory/volume
|
* and other notes pertaining to the contained structure/trajectory/volume
|
||||||
* and anything else that's informative at the whole file level.
|
* and anything else that's informative at the whole file level.
|
||||||
*/
|
*/
|
||||||
int (* read_molecule_metadata)(void *, molfile_metadata_t **metadata);
|
int (* read_molecule_metadata)(void *, molfile_metadata_t **metadata);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write bond information for the molecule. The arrays from
|
* Write bond information for the molecule. The arrays from
|
||||||
* and to point to the (one-based) indices of bonded atoms.
|
* and to point to the (one-based) indices of bonded atoms.
|
||||||
* Each unique bond will be specified only once by the caller.
|
* Each unique bond will be specified only once by the caller.
|
||||||
* File formats that list bonds twice will need to emit both the
|
* File formats that list bonds twice will need to emit both the
|
||||||
* from/to and to/from versions of each.
|
* from/to and to/from versions of each.
|
||||||
* This function must be called before write_structure().
|
* This function must be called before write_structure().
|
||||||
*
|
*
|
||||||
* Like the read_bonds() routine, the bondorder pointer is set to NULL
|
* Like the read_bonds() routine, the bondorder pointer is set to NULL
|
||||||
* if the caller doesn't have such information, in which case the
|
* if the caller doesn't have such information, in which case the
|
||||||
* plugin should assume a bond order of 1.0 if the file format requires
|
* plugin should assume a bond order of 1.0 if the file format requires
|
||||||
* bond order information.
|
* bond order information.
|
||||||
*
|
*
|
||||||
@ -769,15 +769,15 @@ typedef struct {
|
|||||||
* scheme is different from the index numbers.
|
* scheme is different from the index numbers.
|
||||||
* if the pointers are set to NULL, then this information is not available.
|
* if the pointers are set to NULL, then this information is not available.
|
||||||
* bondtypenames can only be used of bondtypes is also given.
|
* bondtypenames can only be used of bondtypes is also given.
|
||||||
* Return MOLFILE_SUCCESS if no errors occur.
|
* Return MOLFILE_SUCCESS if no errors occur.
|
||||||
*/
|
*/
|
||||||
int (* write_bonds)(void *, int nbonds, int *from, int *to, float *bondorder,
|
int (* write_bonds)(void *, int nbonds, int *from, int *to, float *bondorder,
|
||||||
int *bondtype, int nbondtypes, char **bondtypename);
|
int *bondtype, int nbondtypes, char **bondtypename);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the specified volumetric data set into the space pointed to by
|
* Write the specified volumetric data set into the space pointed to by
|
||||||
* datablock. The * allocated for the datablock must be equal to
|
* datablock. The * allocated for the datablock must be equal to
|
||||||
* xsize * ysize * zsize. No space will be allocated for colorblock
|
* xsize * ysize * zsize. No space will be allocated for colorblock
|
||||||
* unless has_color is nonzero; in that case, colorblock should be
|
* unless has_color is nonzero; in that case, colorblock should be
|
||||||
* filled in with three RGB floats per datapoint.
|
* filled in with three RGB floats per datapoint.
|
||||||
*/
|
*/
|
||||||
@ -788,27 +788,27 @@ typedef struct {
|
|||||||
molfile_volumetric_readwrite_t *v);
|
molfile_volumetric_readwrite_t *v);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read in Angles, Dihedrals, Impropers, and Cross Terms and optionally types.
|
* Read in Angles, Dihedrals, Impropers, and Cross Terms and optionally types.
|
||||||
* (Cross terms pertain to the CHARMM/NAMD CMAP feature)
|
* (Cross terms pertain to the CHARMM/NAMD CMAP feature)
|
||||||
*/
|
*/
|
||||||
int (* read_angles)(void *handle, int *numangles, int **angles, int **angletypes,
|
int (* read_angles)(void *handle, int *numangles, int **angles, int **angletypes,
|
||||||
int *numangletypes, char ***angletypenames, int *numdihedrals,
|
int *numangletypes, char ***angletypenames, int *numdihedrals,
|
||||||
int **dihedrals, int **dihedraltypes, int *numdihedraltypes,
|
int **dihedrals, int **dihedraltypes, int *numdihedraltypes,
|
||||||
char ***dihedraltypenames, int *numimpropers, int **impropers,
|
char ***dihedraltypenames, int *numimpropers, int **impropers,
|
||||||
int **impropertypes, int *numimpropertypes, char ***impropertypenames,
|
int **impropertypes, int *numimpropertypes, char ***impropertypenames,
|
||||||
int *numcterms, int **cterms, int *ctermcols, int *ctermrows);
|
int *numcterms, int **cterms, int *ctermcols, int *ctermrows);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write out Angles, Dihedrals, Impropers, and Cross Terms
|
* Write out Angles, Dihedrals, Impropers, and Cross Terms
|
||||||
* (Cross terms pertain to the CHARMM/NAMD CMAP feature)
|
* (Cross terms pertain to the CHARMM/NAMD CMAP feature)
|
||||||
*/
|
*/
|
||||||
int (* write_angles)(void *handle, int numangles, const int *angles, const int *angletypes,
|
int (* write_angles)(void *handle, int numangles, const int *angles, const int *angletypes,
|
||||||
int numangletypes, const char **angletypenames, int numdihedrals,
|
int numangletypes, const char **angletypenames, int numdihedrals,
|
||||||
const int *dihedrals, const int *dihedraltypes, int numdihedraltypes,
|
const int *dihedrals, const int *dihedraltypes, int numdihedraltypes,
|
||||||
const char **dihedraltypenames, int numimpropers,
|
const char **dihedraltypenames, int numimpropers,
|
||||||
const int *impropers, const int *impropertypes, int numimpropertypes,
|
const int *impropers, const int *impropertypes, int numimpropertypes,
|
||||||
const char **impropertypenames, int numcterms, const int *cterms,
|
const char **impropertypenames, int numcterms, const int *cterms,
|
||||||
int ctermcols, int ctermrows);
|
int ctermcols, int ctermrows);
|
||||||
|
|
||||||
|
|
||||||
@ -817,7 +817,7 @@ typedef struct {
|
|||||||
* QM datasets in this file.
|
* QM datasets in this file.
|
||||||
*
|
*
|
||||||
* The metadata are the sizes of the QM related data structure
|
* The metadata are the sizes of the QM related data structure
|
||||||
* arrays that will be populated by the plugin when
|
* arrays that will be populated by the plugin when
|
||||||
* read_qm_rundata() is called. Since the allocation of these
|
* read_qm_rundata() is called. Since the allocation of these
|
||||||
* arrays is done by VMD rather than the plugin, VMD needs to
|
* arrays is done by VMD rather than the plugin, VMD needs to
|
||||||
* know the sizes beforehand. Consequently read_qm_metadata()
|
* know the sizes beforehand. Consequently read_qm_metadata()
|
||||||
@ -830,7 +830,7 @@ typedef struct {
|
|||||||
* Read timestep independent QM data.
|
* Read timestep independent QM data.
|
||||||
*
|
*
|
||||||
* Typical data that are defined only once per trajectory are
|
* Typical data that are defined only once per trajectory are
|
||||||
* general info about the calculation (such as the used method),
|
* general info about the calculation (such as the used method),
|
||||||
* the basis set and normal modes.
|
* the basis set and normal modes.
|
||||||
* The data structures to be populated must have been allocated
|
* The data structures to be populated must have been allocated
|
||||||
* before by VMD according to sizes obtained through
|
* before by VMD according to sizes obtained through
|
||||||
@ -840,19 +840,19 @@ typedef struct {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the next timestep from the file. Return MOLFILE_SUCCESS, or
|
* Read the next timestep from the file. Return MOLFILE_SUCCESS, or
|
||||||
* MOLFILE_EOF on EOF. If the molfile_timestep_t or molfile_qm_metadata_t
|
* MOLFILE_EOF on EOF. If the molfile_timestep_t or molfile_qm_metadata_t
|
||||||
* arguments are NULL, then the coordinate or qm data should be skipped.
|
* arguments are NULL, then the coordinate or qm data should be skipped.
|
||||||
* Otherwise, the application must prepare molfile_timestep_t and
|
* Otherwise, the application must prepare molfile_timestep_t and
|
||||||
* molfile_qm_timestep_t by allocating space for the corresponding
|
* molfile_qm_timestep_t by allocating space for the corresponding
|
||||||
* number of coordinates, orbital wavefunction coefficients, etc.
|
* number of coordinates, orbital wavefunction coefficients, etc.
|
||||||
* Since it is common for users to want to load only the final timestep
|
* Since it is common for users to want to load only the final timestep
|
||||||
* data from a QM run, the application may provide any combination of
|
* data from a QM run, the application may provide any combination of
|
||||||
* valid, or NULL pointers for the molfile_timestep_t and
|
* valid, or NULL pointers for the molfile_timestep_t and
|
||||||
* molfile_qm_timestep_t parameters, depending on what information the
|
* molfile_qm_timestep_t parameters, depending on what information the
|
||||||
* user is interested in.
|
* user is interested in.
|
||||||
* The natoms and qm metadata parameters exist because some file formats
|
* The natoms and qm metadata parameters exist because some file formats
|
||||||
* cannot determine for themselves how many atoms etc are in a
|
* cannot determine for themselves how many atoms etc are in a
|
||||||
* timestep; the app must therefore obtain this information elsewhere
|
* timestep; the app must therefore obtain this information elsewhere
|
||||||
* and provide it to the plugin.
|
* and provide it to the plugin.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -17,20 +17,20 @@
|
|||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
* This header must be included by every VMD plugin library. It defines the
|
* This header must be included by every VMD plugin library. It defines the
|
||||||
* API for every plugin so that VMD can organize the plugins it finds.
|
* API for every plugin so that VMD can organize the plugins it finds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef VMD_PLUGIN_H
|
#ifndef VMD_PLUGIN_H
|
||||||
#define VMD_PLUGIN_H
|
#define VMD_PLUGIN_H
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Preprocessor tricks to make it easier for us to redefine the names of
|
* Preprocessor tricks to make it easier for us to redefine the names of
|
||||||
* functions when building static plugins.
|
* functions when building static plugins.
|
||||||
*/
|
*/
|
||||||
#if !defined(VMDPLUGIN)
|
#if !defined(VMDPLUGIN)
|
||||||
/**
|
/**
|
||||||
* macro defining VMDPLUGIN if it hasn't already been set to the name of
|
* macro defining VMDPLUGIN if it hasn't already been set to the name of
|
||||||
* a static plugin that is being compiled. This is the catch-all case.
|
* a static plugin that is being compiled. This is the catch-all case.
|
||||||
*/
|
*/
|
||||||
#define VMDPLUGIN vmdplugin
|
#define VMDPLUGIN vmdplugin
|
||||||
@ -38,11 +38,11 @@
|
|||||||
/** concatenation macro, joins args x and y together as a single string */
|
/** concatenation macro, joins args x and y together as a single string */
|
||||||
#define xcat(x, y) cat(x, y)
|
#define xcat(x, y) cat(x, y)
|
||||||
/** concatenation macro, joins args x and y together as a single string */
|
/** concatenation macro, joins args x and y together as a single string */
|
||||||
#define cat(x, y) x ## y
|
#define cat(x, y) x ## y
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* macros to correctly define plugin function names depending on whether
|
* macros to correctly define plugin function names depending on whether
|
||||||
* the plugin is being compiled for static linkage or dynamic loading.
|
* the plugin is being compiled for static linkage or dynamic loading.
|
||||||
* When compiled for static linkage, each plugin needs to have unique
|
* When compiled for static linkage, each plugin needs to have unique
|
||||||
* function names for all of its entry points. When compiled for dynamic
|
* function names for all of its entry points. When compiled for dynamic
|
||||||
* loading, the plugins must name their entry points consistently so that
|
* loading, the plugins must name their entry points consistently so that
|
||||||
@ -59,13 +59,13 @@
|
|||||||
|
|
||||||
|
|
||||||
/** "WIN32" is defined on both WIN32 and WIN64 platforms... */
|
/** "WIN32" is defined on both WIN32 and WIN64 platforms... */
|
||||||
#if (defined(WIN32))
|
#if (defined(WIN32))
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#if !defined(STATIC_PLUGIN)
|
#if !defined(STATIC_PLUGIN)
|
||||||
#if defined(VMDPLUGIN_EXPORTS)
|
#if defined(VMDPLUGIN_EXPORTS)
|
||||||
/**
|
/**
|
||||||
* Only define DllMain for plugins, not in VMD or in statically linked plugins
|
* Only define DllMain for plugins, not in VMD or in statically linked plugins
|
||||||
* VMDPLUGIN_EXPORTS is only defined when compiling dynamically loaded plugins
|
* VMDPLUGIN_EXPORTS is only defined when compiling dynamically loaded plugins
|
||||||
*/
|
*/
|
||||||
@ -86,7 +86,7 @@ BOOL APIENTRY DllMain( HANDLE hModule,
|
|||||||
#endif /* ! STATIC_PLUGIN */
|
#endif /* ! STATIC_PLUGIN */
|
||||||
#else
|
#else
|
||||||
/** If we're not compiling on Windows, then this macro is defined empty */
|
/** If we're not compiling on Windows, then this macro is defined empty */
|
||||||
#define VMDPLUGIN_API
|
#define VMDPLUGIN_API
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** define plugin linkage correctly for both C and C++ based plugins */
|
/** define plugin linkage correctly for both C and C++ based plugins */
|
||||||
@ -96,13 +96,13 @@ BOOL APIENTRY DllMain( HANDLE hModule,
|
|||||||
#define VMDPLUGIN_EXTERN extern VMDPLUGIN_API
|
#define VMDPLUGIN_EXTERN extern VMDPLUGIN_API
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Plugin API functions start here
|
* Plugin API functions start here
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init routine: called the first time the library is loaded by the
|
* Init routine: called the first time the library is loaded by the
|
||||||
* application and before any other API functions are referenced.
|
* application and before any other API functions are referenced.
|
||||||
* Return 0 on success.
|
* Return 0 on success.
|
||||||
*/
|
*/
|
||||||
@ -110,15 +110,15 @@ VMDPLUGIN_EXTERN int VMDPLUGIN_init(void);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Macro for creating a struct header used in all plugin structures.
|
* Macro for creating a struct header used in all plugin structures.
|
||||||
*
|
*
|
||||||
* This header should be placed at the top of every plugin API definition
|
* This header should be placed at the top of every plugin API definition
|
||||||
* so that it can be treated as a subtype of the base plugin type.
|
* so that it can be treated as a subtype of the base plugin type.
|
||||||
*
|
*
|
||||||
* abiversion: Defines the ABI for the base plugin type (not for other plugins)
|
* abiversion: Defines the ABI for the base plugin type (not for other plugins)
|
||||||
* type: A string descriptor of the plugin type.
|
* type: A string descriptor of the plugin type.
|
||||||
* name: A name for the plugin.
|
* name: A name for the plugin.
|
||||||
* author: A string identifier, possibly including newlines.
|
* author: A string identifier, possibly including newlines.
|
||||||
* Major and minor version.
|
* Major and minor version.
|
||||||
* is_reentrant: Whether this library can be run concurrently with itself.
|
* is_reentrant: Whether this library can be run concurrently with itself.
|
||||||
*/
|
*/
|
||||||
#define vmdplugin_HEAD \
|
#define vmdplugin_HEAD \
|
||||||
@ -129,12 +129,12 @@ VMDPLUGIN_EXTERN int VMDPLUGIN_init(void);
|
|||||||
const char *author; \
|
const char *author; \
|
||||||
int majorv; \
|
int majorv; \
|
||||||
int minorv; \
|
int minorv; \
|
||||||
int is_reentrant;
|
int is_reentrant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Typedef for generic plugin header, individual plugins can
|
* Typedef for generic plugin header, individual plugins can
|
||||||
* make their own structures as long as the header info remains
|
* make their own structures as long as the header info remains
|
||||||
* the same as the generic plugin header, most easily done by
|
* the same as the generic plugin header, most easily done by
|
||||||
* using the vmdplugin_HEAD macro.
|
* using the vmdplugin_HEAD macro.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -158,7 +158,7 @@ typedef struct {
|
|||||||
#define VMDPLUGIN_ERROR -1
|
#define VMDPLUGIN_ERROR -1
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function pointer typedef for register callback functions
|
* Function pointer typedef for register callback functions
|
||||||
*/
|
*/
|
||||||
typedef int (*vmdplugin_register_cb)(void *, vmdplugin_t *);
|
typedef int (*vmdplugin_register_cb)(void *, vmdplugin_t *);
|
||||||
@ -175,16 +175,16 @@ typedef int (*vmdplugin_register_cb)(void *, vmdplugin_t *);
|
|||||||
VMDPLUGIN_EXTERN int VMDPLUGIN_register(void *, vmdplugin_register_cb);
|
VMDPLUGIN_EXTERN int VMDPLUGIN_register(void *, vmdplugin_register_cb);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow the library to register Tcl extensions.
|
* Allow the library to register Tcl extensions.
|
||||||
* This API is optional; if found by dlopen, it will be called after first
|
* This API is optional; if found by dlopen, it will be called after first
|
||||||
* calling init and register.
|
* calling init and register.
|
||||||
*/
|
*/
|
||||||
VMDPLUGIN_EXTERN int VMDPLUGIN_register_tcl(void *, void *tcl_interp,
|
VMDPLUGIN_EXTERN int VMDPLUGIN_register_tcl(void *, void *tcl_interp,
|
||||||
vmdplugin_register_cb);
|
vmdplugin_register_cb);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Fini method is called when the application will no longer use
|
* The Fini method is called when the application will no longer use
|
||||||
* any plugins in the library.
|
* any plugins in the library.
|
||||||
*/
|
*/
|
||||||
VMDPLUGIN_EXTERN int VMDPLUGIN_fini(void);
|
VMDPLUGIN_EXTERN int VMDPLUGIN_fini(void);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user