Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

MolFilePlugin Class Reference

VMD interface to 'molfile' plugins. Molfile plugins read coordinate files, structure files, volumetric data, and graphics data. The data is loaded into a new or potentially preexisting molecule in VMD. More...

#include <MolFilePlugin.h>

List of all members.

Public Methods

 MolFilePlugin (vmdplugin_t *p)
virtual ~MolFilePlugin ()
const char * name () const
const char * prettyname () const
const char * extension () const
int can_read_structure () const
int can_read_bonds () const
int can_read_pagealigned_timesteps () const
int can_read_timesteps () const
int can_read_graphics () const
int can_read_volumetric () const
int can_read_metadata () const
int can_read_qm () const
int can_read_qm_timestep ()
int can_read_angles ()
int can_read_timestep_metadata ()
int can_read_qm_timestep_metadata ()
int can_write_structure () const
int can_write_bonds () const
int can_write_timesteps () const
int can_write_angles ()
int can_write_volumetric () const
int init_read (const char *file)
 open file for reading; read natoms. Return 0 on success. More...

int natoms () const
 Number of atoms in each timestep -1 if unknown (not in file). More...

void set_natoms (int)
 override the number of atoms in each step; this is needed for CRD files :-(. More...

int read_structure (Molecule *m, int filebonds, int autobonds)
 init mol, file bond determination auto bond determination return 0 on success. More...

int read_optional_structure (Molecule *m, int filebonds)
 Read optional structure information into the molecule, but without initializing atoms. Sets all optional fields like radius and charge, as well as bonds, but only if the file explicitly contains it. If bonds are found then the molecular topology is recalculated as well. More...

int read_timestep_pagealign_size (void)
 Query the molfile plugin to determine whether or not memory allocations used for atomic coordinates and PBC unit cell information need to be aligned to a particular virtual memory or filesystem page size boundary to facilitate kernel-bypass unbuffered I/O, e.g., as used by jsplugin. This API should be called prior to the first call to read a timestep. The required page alignment size (in bytes) is returned to the caller. If this API has not been called, then the molfile plugin should revert to standard kernel-buffered I/O and suffer the associated performance loss. If a page-aligned allocation is not required for the file being read, the plugin will return an alignment size of 1. On error, a value of -1 will be returned. More...

Timestepnext (Molecule *m, int ts_pagealign_sz=1)
 next timestep. More...

int skip (Molecule *m)
 skip over a step; return 0 on success. More...

int read_rawgraphics (Molecule *, Scene *)
 Read raw graphics data into the given molecule. More...

int read_volumetric (Molecule *, int nsets, const int *setids)
 Read selected volumetric datasets into molecule. Return 0 on success. If nsets == -1 then all sets will be read. More...

int read_metadata (Molecule *)
 Read file metadata into molecule. Return 0 on success. More...

int read_qm_data (Molecule *)
 Read QM data into molecule. Return 0 on success. More...

int init_write (const char *file, int natoms)
int write_structure (Molecule *, const int *sel)
 if can_write_structure returns true, then write_structure must be called before the first invocation of write_timestep. If sel is non-NULL, it must point to an array of indices, one for each atom in Molecule or Timestep, indicating which atoms are to be written to the file. More...

int write_timestep (const Timestep *, const int *sel)
int write_volumetric (Molecule *, int set)
 Write volumetric data. More...


Detailed Description

VMD interface to 'molfile' plugins. Molfile plugins read coordinate files, structure files, volumetric data, and graphics data. The data is loaded into a new or potentially preexisting molecule in VMD.

Definition at line 42 of file MolFilePlugin.h.


Constructor & Destructor Documentation

MolFilePlugin::MolFilePlugin vmdplugin_t *    p
 

Definition at line 55 of file MolFilePlugin.C.

References NULL.

MolFilePlugin::~MolFilePlugin   [virtual]
 

Definition at line 68 of file MolFilePlugin.C.


Member Function Documentation

int MolFilePlugin::can_read_angles   [inline]
 

Definition at line 76 of file MolFilePlugin.h.

References NULL.

Referenced by read_optional_structure, and read_structure.

int MolFilePlugin::can_read_bonds   const [inline]
 

Definition at line 62 of file MolFilePlugin.h.

References NULL.

Referenced by read_optional_structure, and read_structure.

int MolFilePlugin::can_read_graphics   const [inline]
 

Definition at line 71 of file MolFilePlugin.h.

References NULL.

Referenced by init_read, VMDApp::molecule_load, and read_rawgraphics.

int MolFilePlugin::can_read_metadata   const [inline]
 

Definition at line 73 of file MolFilePlugin.h.

References NULL.

Referenced by init_read, and VMDApp::molecule_load.

int MolFilePlugin::can_read_pagealigned_timesteps   const [inline]
 

Definition at line 63 of file MolFilePlugin.h.

References NULL.

Referenced by CoorPluginData::CoorPluginData, VMDApp::molecule_load, and read_timestep_pagealign_size.

int MolFilePlugin::can_read_qm   const [inline]
 

Definition at line 74 of file MolFilePlugin.h.

References NULL.

Referenced by init_read, and VMDApp::molecule_load.

int MolFilePlugin::can_read_qm_timestep   [inline]
 

Definition at line 75 of file MolFilePlugin.h.

References NULL.

Referenced by VMDApp::molecule_load, and next.

int MolFilePlugin::can_read_qm_timestep_metadata   [inline]
 

Definition at line 78 of file MolFilePlugin.h.

References NULL.

Referenced by next.

int MolFilePlugin::can_read_structure   const [inline]
 

Definition at line 61 of file MolFilePlugin.h.

References NULL.

Referenced by init_read, VMDApp::molecule_load, read_optional_structure, and read_structure.

int MolFilePlugin::can_read_timestep_metadata   [inline]
 

Definition at line 77 of file MolFilePlugin.h.

References NULL.

Referenced by next.

int MolFilePlugin::can_read_timesteps   const [inline]
 

Definition at line 70 of file MolFilePlugin.h.

References NULL.

Referenced by init_read, VMDApp::molecule_load, next, and skip.

int MolFilePlugin::can_read_volumetric   const [inline]
 

Definition at line 72 of file MolFilePlugin.h.

References NULL.

Referenced by init_read, and VMDApp::molecule_load.

int MolFilePlugin::can_write_angles   [inline]
 

Definition at line 83 of file MolFilePlugin.h.

References NULL.

Referenced by write_structure.

int MolFilePlugin::can_write_bonds   const [inline]
 

Definition at line 81 of file MolFilePlugin.h.

References NULL.

Referenced by write_structure.

int MolFilePlugin::can_write_structure   const [inline]
 

Definition at line 80 of file MolFilePlugin.h.

References NULL.

Referenced by CoorPluginData::CoorPluginData, init_write, and write_structure.

int MolFilePlugin::can_write_timesteps   const [inline]
 

Definition at line 82 of file MolFilePlugin.h.

References NULL.

Referenced by SaveTrajectoryFltkMenu::act_on_command, init_write, and write_timestep.

int MolFilePlugin::can_write_volumetric   const [inline]
 

Definition at line 84 of file MolFilePlugin.h.

References NULL.

Referenced by init_write, and VMDApp::molecule_savetrajectory.

const char* MolFilePlugin::extension   const [inline]
 

Definition at line 59 of file MolFilePlugin.h.

Referenced by SaveTrajectoryFltkMenu::act_on_command, and VMDApp::guess_filetype.

int MolFilePlugin::init_read const char *    file
 

open file for reading; read natoms. Return 0 on success.

Definition at line 684 of file MolFilePlugin.C.

References can_read_graphics, can_read_metadata, can_read_qm, can_read_structure, can_read_timesteps, can_read_volumetric, NULL, and stringdup.

Referenced by VMDApp::molecule_load.

int MolFilePlugin::init_write const char *    file,
int    natoms
 

Definition at line 989 of file MolFilePlugin.C.

References can_write_structure, can_write_timesteps, can_write_volumetric, natoms, NULL, and stringdup.

Referenced by VMDApp::molecule_savetrajectory, and write_file.

const char* MolFilePlugin::name void    const [inline]
 

Definition at line 57 of file MolFilePlugin.h.

Referenced by SaveTrajectoryFltkMenu::act_on_command, VMDApp::guess_filetype, and write_structure.

int MolFilePlugin::natoms   const [inline]
 

Number of atoms in each timestep -1 if unknown (not in file).

Definition at line 90 of file MolFilePlugin.h.

Referenced by CoorPluginData::CoorPluginData, init_write, and VMDApp::molecule_load.

Timestep * MolFilePlugin::next Molecule   m,
int    ts_pagealign_sz = 1
 

next timestep.

Definition at line 735 of file MolFilePlugin.C.

References Timestep::a_length, QMTimestep::add_wavefunction, Timestep::alpha, Timestep::b_length, Timestep::beta, Timestep::c_length, can_read_qm_timestep, can_read_qm_timestep_metadata, can_read_timestep_metadata, can_read_timesteps, Timestep::gamma, DrawMolecule::get_frame, NULL, DrawMolecule::numframes, Timestep::physical_time, Timestep::pos, Timestep::qm_timestep, QMCHARGE_ESP, QMCHARGE_LOWDIN, QMCHARGE_MULLIKEN, QMCHARGE_NPA, QMCHARGE_UNKNOWN, QMTimestep::set_charges, QMTimestep::set_gradients, QMTimestep::set_scfenergies, QMTimestep::sort_orbitals, Timestep::vel, WAVE_BOYS, WAVE_CANON, WAVE_CINATUR, WAVE_GEMINAL, WAVE_MCSCFNAT, WAVE_MCSCFOPT, WAVE_PIPEK, WAVE_RUEDEN, and WAVE_UNKNOWN.

Referenced by CoorPluginData::next.

const char* MolFilePlugin::prettyname   const [inline]
 

Definition at line 58 of file MolFilePlugin.h.

int MolFilePlugin::read_metadata Molecule  
 

Read file metadata into molecule. Return 0 on success.

Definition at line 1651 of file MolFilePlugin.C.

References NULL, Molecule::record_database, and Molecule::record_remarks.

Referenced by VMDApp::molecule_load.

int MolFilePlugin::read_optional_structure Molecule   m,
int    filebonds
 

Read optional structure information into the molecule, but without initializing atoms. Sets all optional fields like radius and charge, as well as bonds, but only if the file explicitly contains it. If bonds are found then the molecular topology is recalculated as well.

Definition at line 395 of file MolFilePlugin.C.

References BaseMolecule::add_angle, BaseMolecule::add_bond, BaseMolecule::add_cterm, BaseMolecule::add_dihedral, BaseMolecule::add_improper, NameList< int >::add_name, BaseMolecule::analyze, BaseMolecule::ANGLES, BaseMolecule::angleTypeNames, BaseMolecule::ANGLETYPES, BaseMolecule::atom, MolAtom::atomicnumber, BaseMolecule::ATOMICNUMBER, atoms, BaseMolecule::beta, BaseMolecule::BFACTOR, BaseMolecule::BONDORDERS, BaseMolecule::BONDS, MolAtom::bonds, BaseMolecule::bondTypeNames, BaseMolecule::BONDTYPES, can_read_angles, can_read_bonds, can_read_structure, BaseMolecule::charge, BaseMolecule::CHARGE, BaseMolecule::clear_angles, BaseMolecule::clear_dihedrals, BaseMolecule::clear_impropers, DrawMolItem::COL_REGEN, BaseMolecule::CTERMS, BaseMolecule::dihedralTypeNames, DrawMolecule::force_recalc, BaseMolecule::improperTypeNames, DrawMolecule::invalidate_ss, BaseMolecule::mass, BaseMolecule::MASS, BaseMolecule::nAtoms, NULL, BaseMolecule::occupancy, BaseMolecule::OCCUPANCY, BaseMolecule::radius, BaseMolecule::RADIUS, DrawMolItem::SEL_REGEN, BaseMolecule::set_dataset_flag, BaseMolecule::set_radii_changed, and NameList< int >::typecode.

Referenced by VMDApp::molecule_load.

int MolFilePlugin::read_qm_data Molecule  
 

Read QM data into molecule. Return 0 on success.

Definition at line 1667 of file MolFilePlugin.C.

References QMData::geometry, QMData::init_basis, QMData::init_electrons, QMData::memory, BaseMolecule::nAtoms, QMData::nproc, BaseMolecule::qm_data, QMSTATUS_FILE_TRUNCATED, QMSTATUS_OPT_CONV, QMSTATUS_OPT_NOT_CONV, QMSTATUS_SCF_NOT_CONV, QMSTATUS_UNKNOWN, QMData::runtitle, QMData::runtype, RUNTYPE_DYNAMICS, RUNTYPE_ENERGY, RUNTYPE_GRADIENT, RUNTYPE_HESSIAN, RUNTYPE_MEX, RUNTYPE_OPTIMIZE, RUNTYPE_PROPERTIES, RUNTYPE_SADPOINT, RUNTYPE_SURFACE, RUNTYPE_UNKNOWN, SAFESTRNCPY, QMData::scftype, SCFTYPE_FF, SCFTYPE_GVB, SCFTYPE_MCSCF, SCFTYPE_NONE, SCFTYPE_RHF, SCFTYPE_ROHF, SCFTYPE_UHF, SCFTYPE_UNKNOWN, QMData::set_angular_momenta, QMData::set_carthessian, QMData::set_imagmodes, QMData::set_intensities, QMData::set_inthessian, QMData::set_normalmodes, QMData::set_wavenumbers, QMData::status, and QMData::version_string.

Referenced by VMDApp::molecule_load.

int MolFilePlugin::read_rawgraphics Molecule  ,
Scene  
 

Read raw graphics data into the given molecule.

Definition at line 1431 of file MolFilePlugin.C.

References MoleculeGraphics::add_cone, MoleculeGraphics::add_cylinder, MoleculeGraphics::add_line, MoleculeGraphics::add_point, MoleculeGraphics::add_sphere, MoleculeGraphics::add_text, MoleculeGraphics::add_triangle, MoleculeGraphics::add_tricolor, MoleculeGraphics::add_trinorm, can_read_graphics, data, DrawMolecule::moleculeGraphics, Scene::nearest_index, NULL, size, and MoleculeGraphics::use_color.

Referenced by VMDApp::molecule_load.

int MolFilePlugin::read_structure Molecule   m,
int    filebonds,
int    autobonds
 

init mol, file bond determination auto bond determination return 0 on success.

Definition at line 73 of file MolFilePlugin.C.

References BaseMolecule::add_angle, BaseMolecule::add_atoms, BaseMolecule::add_bond, BaseMolecule::add_bond_dupcheck, BaseMolecule::add_cterm, BaseMolecule::add_dihedral, BaseMolecule::add_improper, NameList< int >::add_name, BaseMolecule::ALTLOC, BaseMolecule::ANGLES, BaseMolecule::angleTypeNames, BaseMolecule::ANGLETYPES, BaseMolecule::ATOMICNUMBER, atoms, BaseMolecule::beta, BaseMolecule::BFACTOR, BaseMolecule::BONDORDERS, BaseMolecule::BONDS, BaseMolecule::bondTypeNames, BaseMolecule::BONDTYPES, can_read_angles, can_read_bonds, can_read_structure, BaseMolecule::CHARGE, BaseMolecule::charge, BaseMolecule::clear_angles, BaseMolecule::clear_dihedrals, BaseMolecule::clear_impropers, BaseMolecule::CTERMS, BaseMolecule::default_beta, BaseMolecule::default_charge, BaseMolecule::default_mass, BaseMolecule::default_occup, BaseMolecule::default_radius, BaseMolecule::dihedralTypeNames, BaseMolecule::find_bonds_from_timestep, BaseMolecule::find_unique_bonds_from_timestep, get_pte_mass, get_pte_vdw_radius, BaseMolecule::improperTypeNames, BaseMolecule::init_atoms, BaseMolecule::INSERTION, BaseMolecule::MASS, BaseMolecule::mass, NULL, BaseMolecule::OCCUPANCY, BaseMolecule::occupancy, BaseMolecule::RADIUS, BaseMolecule::radius, BaseMolecule::set_dataset_flag, BaseMolecule::set_radii_changed, and NameList< int >::typecode.

Referenced by VMDApp::molecule_load.

int MolFilePlugin::read_timestep_pagealign_size void   
 

Query the molfile plugin to determine whether or not memory allocations used for atomic coordinates and PBC unit cell information need to be aligned to a particular virtual memory or filesystem page size boundary to facilitate kernel-bypass unbuffered I/O, e.g., as used by jsplugin. This API should be called prior to the first call to read a timestep. The required page alignment size (in bytes) is returned to the caller. If this API has not been called, then the molfile plugin should revert to standard kernel-buffered I/O and suffer the associated performance loss. If a page-aligned allocation is not required for the file being read, the plugin will return an alignment size of 1. On error, a value of -1 will be returned.

Definition at line 697 of file MolFilePlugin.C.

References can_read_pagealigned_timesteps, and NULL.

Referenced by CoorPluginData::CoorPluginData, and VMDApp::molecule_load.

int MolFilePlugin::read_volumetric Molecule  ,
int    nsets,
const int *    setids
 

Read selected volumetric datasets into molecule. Return 0 on success. If nsets == -1 then all sets will be read.

Definition at line 1526 of file MolFilePlugin.C.

References BaseMolecule::add_volume_data, n, NULL, size, and stringdup.

Referenced by VMDApp::molecule_load.

void MolFilePlugin::set_natoms int   
 

override the number of atoms in each step; this is needed for CRD files :-(.

Definition at line 680 of file MolFilePlugin.C.

References n.

Referenced by CoorPluginData::CoorPluginData.

int MolFilePlugin::skip Molecule   m
 

skip over a step; return 0 on success.

Definition at line 969 of file MolFilePlugin.C.

References can_read_timesteps.

Referenced by CoorPluginData::next.

int MolFilePlugin::write_structure Molecule  ,
const int *    sel
 

if can_write_structure returns true, then write_structure must be called before the first invocation of write_timestep. If sel is non-NULL, it must point to an array of indices, one for each atom in Molecule or Timestep, indicating which atoms are to be written to the file.

Definition at line 1008 of file MolFilePlugin.C.

References BaseMolecule::ALTLOC, MolAtom::altlocindex, BaseMolecule::altlocNames, BaseMolecule::angles, BaseMolecule::ANGLES, BaseMolecule::angleTypeNames, BaseMolecule::ANGLETYPES, ResizeArray::append, ResizeArray::append3, ResizeArray::append4, BaseMolecule::atom, BaseMolecule::ATOMICNUMBER, MolAtom::atomicnumber, BaseMolecule::atomNames, atoms, BaseMolecule::atomTypes, BaseMolecule::beta, BaseMolecule::BFACTOR, BaseMolecule::BONDORDERS, MolAtom::bonds, BaseMolecule::BONDS, MolAtom::bondTo, BaseMolecule::bondTypeNames, BaseMolecule::BONDTYPES, can_write_angles, can_write_bonds, can_write_structure, MolAtom::chainindex, BaseMolecule::chainNames, BaseMolecule::CHARGE, BaseMolecule::charge, BaseMolecule::cterms, BaseMolecule::CTERMS, BaseMolecule::dihedrals, BaseMolecule::dihedralTypeNames, BaseMolecule::get_angletype, BaseMolecule::get_dihedraltype, BaseMolecule::get_impropertype, BaseMolecule::getbondorder, BaseMolecule::getbondtype, BaseMolecule::has_structure, BaseMolecule::impropers, BaseMolecule::improperTypeNames, BaseMolecule::INSERTION, MolAtom::insertionstr, BaseMolecule::MASS, BaseMolecule::mass, NameList< int >::name, name, MolAtom::nameindex, BaseMolecule::nAtoms, NULL, ResizeArray::num, NameList< int >::num, BaseMolecule::num_angles, BaseMolecule::num_cterms, BaseMolecule::num_dihedrals, BaseMolecule::num_impropers, BaseMolecule::OCCUPANCY, BaseMolecule::occupancy, BaseMolecule::RADIUS, BaseMolecule::radius, MolAtom::resid, MolAtom::resnameindex, BaseMolecule::resNames, MolAtom::segnameindex, BaseMolecule::segNames, BaseMolecule::test_dataset_flag, and MolAtom::typeindex.

Referenced by CoorPluginData::CoorPluginData.

int MolFilePlugin::write_timestep const Timestep  ,
const int *    sel
 

Definition at line 1367 of file MolFilePlugin.C.

References Timestep::a_length, Timestep::alpha, Timestep::b_length, Timestep::beta, Timestep::c_length, can_write_timesteps, Timestep::gamma, NULL, Timestep::num, Timestep::physical_time, Timestep::pos, and Timestep::vel.

Referenced by CoorPluginData::next.

int MolFilePlugin::write_volumetric Molecule  ,
int    set
 

Write volumetric data.

Definition at line 1895 of file MolFilePlugin.C.

References VolumetricData::data, BaseMolecule::get_volume_data, n, VolumetricData::name, NULL, BaseMolecule::num_volume_data, VolumetricData::origin, VolumetricData::xaxis, VolumetricData::xsize, VolumetricData::yaxis, VolumetricData::ysize, VolumetricData::zaxis, and VolumetricData::zsize.

Referenced by VMDApp::molecule_savetrajectory, and write_file.


The documentation for this class was generated from the following files:
Generated on Mon May 13 04:30:29 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002